MTU mismatch between GetIfEntry and netsh

Posted by ChrisJ on Stack Overflow See other posts from Stack Overflow or by ChrisJ
Published on 2010-05-07T17:48:32Z Indexed on 2010/05/08 0:18 UTC
Read the original article Hit count: 504

Filed under:
|
|
|

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?

© Stack Overflow or respective owner

Related posts about windows-vista

Related posts about mtu