MTU mismatch between GetIfEntry and netsh
- by ChrisJ
I'm working on pseudo-transport layer software that runs over UDP, providing reliable connection-oriented transmission, as an alternative to TCP. In order to maximize network efficiency, we query the MTU of the "best" network adapter upon initialization.
MIB_IFROW row = {0};
row.dwIndex = dwBestIfIndex;
dwRes = GetIfEntry(&row);
Searching online I found that you can use the following netsh commands to query for this same value, from a command prompt (not a C++ API)
netsh interface ipv4 show interfaces
netsh interface ipv4 show subinterfaces
The troubling issue is that while row.dwMtu may be set to 1500, snooping the network traffic on the sending laptop shows that our packets are fragmented into 1300 byte packets.
netsh also reports that the MTU is 1300.
Clearly the value reported by netsh command is the actual used values. Anyone know what API I can call to get the same values as netsh?