I
Intaek Lim
I'm writing a simple path MTU discovery utility by modifying
'traceroute' source code in Win32 with MSVC7.
I set DF bit in IP header and send packets filled with N bytes of
data. When MTU size of some intermediate router is less than the size
of packet I sent, then that router returns 'Packet needs to be
fragmented but DF set' error. So I try again with packets those are
smaller than previous packets, again and again.
Okay, I can find path MTU in this way, but there is a problem.
After I receive DF error from router, in next try, sendto() don't
work. WSAGetLastError() returns 10040(message too long).
Does windows socket library remember information like 'Host - Path MTU
to the HOST'? If not, why sendto fails? I cleaned up socket resources
right before exit point of my program.
'traceroute' source code in Win32 with MSVC7.
I set DF bit in IP header and send packets filled with N bytes of
data. When MTU size of some intermediate router is less than the size
of packet I sent, then that router returns 'Packet needs to be
fragmented but DF set' error. So I try again with packets those are
smaller than previous packets, again and again.
Okay, I can find path MTU in this way, but there is a problem.
After I receive DF error from router, in next try, sendto() don't
work. WSAGetLastError() returns 10040(message too long).
Does windows socket library remember information like 'Host - Path MTU
to the HOST'? If not, why sendto fails? I cleaned up socket resources
right before exit point of my program.