Sunday, 15 November 2026

Windows Performance Analyzer graphing of TCP/IP events

When a trace file being analyzed by Windows Performance Analyzer (WPA) contains events from the Microsoft-Windows-TCPIP provider, the “Communications” category in the WPA Graph Explorer contains a “Tcpip Events” group consisting of six graphs. There seems to be very little on-line information about these graphs (I found none), but there are both subtleties of interpretation that it might be useful to understand and errors in the parsing of some events.

What follows is a discussion of each graph.

Throughput over Time

The “Throughput over Time” graph uses just 4 of the over 600 event types defined by the Microsoft-Windows-TCPIP provider: TcpDataTransferSend, TcpDataTransferReceive, UdpEndpointSendMessages and UdpEndpointReceiveMessages.

The default Graph Configuration (show as per second value) seems to exaggerate variability in the throughput, but this is partly just an artefact of the calculation of “per second” values:


Changing the Graph Configuration to “Cumulative over time” gives a graph that looks more like a TCP “Stevens” graph:


However, the graph just “sums” the number of bytes mentioned in each event without regard to whether the bytes are being retransmitted. This graph appears to show 8111 bytes transferred over a TCP connection:

This “Stevens” style graph of the same connection show that just 4430 bytes were successfully transferred and that retransmissions occurred:

If one can bear in mind how the graph might have been affected by retransmissions, it can give an impression of throughput obtained.

Ack Delays per connection

The “Ack Delays per connection” graph uses the TcpDataTransferSend and TcpDataTransferCumAck events to calculate the delays (the time between a TcpDataTransferSend event (when data is passed to a lower level to be sent) and the TcpDataTransferCumAck that acknowledges the data in that send). It would be possible to gather this information (RTT (Round-Trip Time)) using just one type of event, namely TcpDataTransferRttSample (which also includes SRTT (Smoothed Round-Trip Time) and RTTVar (Round Trip Time Variation) values).

RFC 6298 (Computing TCP's Retransmission Timer) says:

TCP MUST use Karn's algorithm for taking RTT samples.  That is, RTT samples MUST NOT be made using segments that were retransmitted (and thus for which it is ambiguous whether the reply was for the first instance of the packet or a later instance).

Similar to the “Throughput over Time” graph, the “Ack Delays per connection” graph ignores issues of retransmission; the equivalent “Round Trip Time” TCP Stream graph in Wireshark can be configured to choose which “data sends” (segments) are used when plotting the graph.

Events by Count

WPA only understands the format of a small number of the total set of Microsoft-Windows-TCPIP events; the “Events by Count” graph shows the “per second” count of these events. This graph can be used to identify time spans where particular types of events (such as error events) are prevalent.

Send IO Completion time per connection

The “Send IO Completion time per connection” graph uses the TcpSendPosted and TcpDataTransferCumAck events to calculate the time between an application requesting data to be sent (TcpDataTransferSend event) and the time of the TcpDataTransferCumAck that acknowledges that data.

The difference between this graph and the “Ack Delays per connection” graph is that this graph uses the moment that data to be sent enters the TCPIP driver (from a higher layer) as the starting point and “Ack Delays per connection” uses the moment that data leaves the TCPIP driver (to a lower layer).

Tcp Send State over Time

The “Tcp Send State over Time” graph categorizes the send state of a connection as one of “No Send Activity”, “AppSendBound”, “TcpSendBound” or “RemoteBound”.

  • “No Send Activity” → there is no data waiting to be sent and all sent data has been acknowledged.
  • “AppSendBound” → the amount of data waiting to be sent or acknowledged is less than the minimum of the send window and the congestion window (implying that the application is not generating data fast enough to “fill” the connection).
  • “TcpSendBound” → the amount of data waiting to be sent or acknowledged is greater or equal to the congestion window (implying that the local TCP implementation is throttling the sending of data).
  • “RemoteBound” → the amount of data waiting to be sent or acknowledged is greater or equal to the send window and the send window is less than or equal to the congestion window (implying that the send window, controlled by the remote host, is too small to obtain the maximum send rate).

Knowledge of the congestion window size is needed to perform this categorization; since the congestion window size is never transmitted “over the wire”, it is not present in PCAP(NG) captures and is therefore not available to tools like Wireshark.

The table used by this graph includes several event types, but the events TcpDataTransferCumAck, TcpDataTransferReceive, TcpDataTransferSend, TcpDeliveryIndicated and TcpSendPosted are particularly important for the graph.

Unfortunately, a parsing error in the TcpSendPosted event makes the calculation of the Tcp Send State unreliable/incorrect. The TcpSendPosted is defined in the instrumentation manifest as:

<template tid="tid_TCP_SEND">
  <data name="Tcb" inType="win:Pointer" outType="win:HexInt64" />
  <data name="Injected" inType="win:UnicodeString" outType="xs:string" />
  <data name="NumBytes" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="SndNxt" inType="win:UInt32" outType="xs:unsignedInt" />
  <!-- version 0 ends -->
  <data name="SendAvailable" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="ActivityID" inType="win:Pointer" outType="win:HexInt64" />
  <!-- version 1 ends -->
  <data name="SndLimBytesSnd" inType="win:UInt64" outType="xs:unsignedLong" />
  <data name="SndLimBytesRwin" inType="win:UInt64" outType="xs:unsignedLong" />
  <data name="SndLimBytesCwnd" inType="win:UInt64" outType="xs:unsignedLong" />
  <data name="CWnd" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="SRtt" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="LossRecoveryEpisodes" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="RtoEpisodes" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="PtoEpisodes" inType="win:UInt32" outType="xs:unsignedInt" />
  <!-- version 2 ends -->
</template>

The parsing of the data by the routine perf_tcpip!XPerfAddIn::CTcpipSend::Parse suggests the data is interpreted as:

<template tid="tid_TCP_SEND">
  <data name="Tcb" inType="win:Pointer" outType="win:HexInt64" />
  <data name="Injected" inType="win:UnicodeString" outType="xs:string" />
  <data name="NumBytes" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="SndNxt" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="CWnd" inType="win:UInt32" outType="xs:unsignedInt" />
  <data name="SndWnd" inType="win:UInt32" outType="xs:unsignedInt" />
</template>

The SndAvailable value is interpreted by the graph as a CWnd value, and the lower four bytes of the ActivityID value are interpreted as a SndWnd value.

Some events (such as TcpSendAcked, TcpSendAdvance, TcpSendComplete, TcpSendPosted, TcpConnectionSummary) carry data direct from the TCP/IP driver for values such as SndLimBytesSnd, SndLimBytesRwin and SndLimBytesCwnd (see TCP_ESTATS_SND_CONG_ROD_v0 (tcpestats.h) - Win32 apps | Microsoft Learn for value descriptions), which could be an alternative basis for a “Tcp Send State over Time” graph.

Window values over Time

The default “Window values over Time” graph configuration plots the values of three variables over time: BytesTransferredNotAcked, CWnd and SndWnd. It shares many characteristics with the “Tcp Send State over Time” graph, including the event types used, showing information (CWnd) not available in tools like Wireshark and suffering from the incorrect parsing of the TcpSendPosted event.

The ActivityID in the TcpSendPosted event appears to be derived from a kernel address; given the layout of kernel memory, it is likely that the low four bytes of its value (when interpreted as an unsigned integer representing SndWnd) will be a large number. The large (and incorrect) value of SndWnd, coupled with the automatic scaling of the graph normally means that the graph lines for CWnd and BytesTransferredNotAcked are not visible (too small to be seen).

One can try removing the TcpSendPosted events from the trace and then viewing the graph; this might mean that some changes in the window values are missed but one can get an impression of the development of the window values over time.

Summary

The “Tcpip Events” group graphs either display information that is not as accurate as similar graphs in Wireshark (ignoring the impact of retransmissions) or display misleading information (by incorrectly parsing event data).

When examining network trace information, it is normally wise to be aware that artefacts of the network trace recording process may influence what one sees; such artefacts include packets sent/received but not recorded or protocol operations offloaded to outside of visibility to the recording process. If one is aware of and allows for the issues of the “Tcpip Events” group graphs then they can still be useful.

No comments:

Post a Comment