Number of retransmitted Wifi packets in C++ under Windows

231 views Asked by At

I need to get the number (and size in bytes) of retransmitted Wifi packets with C++ under Windows. The Information I need is very low-level, encapsulated in the Frame Control of Wifi-Frame.

  • Is there an interface to get the information I need directly from Windows/WinApi?

I got two attempts to achieve the information I want, but there are also questions:

  1. Native WiFi API: has a struct called WLAN_STATISTICS which contains an array of structs WLAN_PHY_FRAME_STATISTICS with the field ullRetryCount.

    • Why is the WLAN_PHY_FRAME_STATISTICS an array? What does the elements represent?
    • Is the ullRetryCount the information I need? I get values here, but I can't be certain it's correct...
  2. IP Helper API: with the the struct MIB_IF_ROW2 there is the field OutDiscards, where I don't get any values. Maybe my connection is to good and no frames are discarded?

Thanks in advance!

1

There are 1 answers

4
ddbug On

Probably you won't get this information, unless you have a specialized driver. Or, set up a sniffer, capture all communication from this device and find retransmissions.

WLAN_STATISTICS is an array because it can have several instances on devices with multiple PHYs. One WLAN_PHY_FRAME_STATISTICS table per PHY.

Discards on IP level are usually caused by "Quality of service" shaping, it is much higher layer than wifi phy.