does path MTU discovery have to be implemented separately for each transport-layer protocol?
I can see that for example for ICMP this is never necessary since all valid packets are below or at minimum PMTU.
for TCP it's easy, since whenever I receive a "packet too big" or "fragmentation needed" message, all I have to do is make the TCP segment smaller and retransmit.
but what about UDP? am i supposed keep outbound UDP packets in a "possible retransmit list" for a bit and wait for "packet too big" messages to potentially arrive? or do i just not keep track of outbound packets and simply decrease the PMTU when i get such a message, and simply tolerate the loss of the larger packets?
or is there a specific protocol to detect the PMTU before beginning communication with a socket?
how to properly implment path MTU discovery?
Re: how to properly implment path MTU discovery?
Hi,
I think the basic idea is reasonably well covered by the corresponding wikipiedia article.....
Cheers,
Brendan
I think the basic idea is reasonably well covered by the corresponding wikipiedia article.....
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: how to properly implment path MTU discovery?
I have read the article but what I don't understand is whether, for example, for UDP i'm supposed to retransmit the packets in fragments after I already sent them and discovered the size was too large; or do I simply accept that the packet was dropped (which would in theory work since UDP tolerates loss).
-
- Member
- Posts: 1146
- Joined: Sat Mar 01, 2014 2:59 pm
Re: how to properly implment path MTU discovery?
Don't retransmit UDP packets, the other machine has no way to know that they have been retransmitted. If you get a "too large" response, reduce the packet size and continue with the next packet.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Re: how to properly implment path MTU discovery?
You can do either. The packet will have been dropped at some point, so it's as if it was never transmitted. As far as the client listening on the remote computer is concerned the first time that you send it, suitably fragmented, using the correct MTU is the first time it has been sent.mariuszp wrote:I have read the article but what I don't understand is whether, for example, for UDP i'm supposed to retransmit the packets in fragments after I already sent them and discovered the size was too large; or do I simply accept that the packet was dropped (which would in theory work since UDP tolerates loss).
Re: how to properly implment path MTU discovery?
Hi,
Also note that it's probably better to consider it "continuous MTU adjustment" (and not "once only MTU discovery"). There can be many different paths between 2 computers (each with a different MTU), and no guarantee that all packets will travel the same path.
Basically; whenever you're told "packet too big" reduce your packet size to suit; and then maybe for long running connections consider sending an occasional/rare "deliberately slightly over-sized" packet to determine if MTU could be increased.
Cheers,
Brendan
Also note that it's probably better to consider it "continuous MTU adjustment" (and not "once only MTU discovery"). There can be many different paths between 2 computers (each with a different MTU), and no guarantee that all packets will travel the same path.
Basically; whenever you're told "packet too big" reduce your packet size to suit; and then maybe for long running connections consider sending an occasional/rare "deliberately slightly over-sized" packet to determine if MTU could be increased.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Re: how to properly implment path MTU discovery?
that makes sense thanks
Re: how to properly implment path MTU discovery?
Unlike TCP, for UDP the OS cannot choose the packet size, it must deliver the UDP packet as requested by the application. Only if your OS would offer a higher-level interface ( like "streamvideo" ) you could consider to implement dynamic tuning of the packet size based on PMTU discovery ( i.e. setting the DF flag ). Normally, the Internet will fragment UDP packets that are too large ( and they might arrive, or might not, depending on firewalls and the likes )
See https://lists.opensuse.org/opensuse-bug ... 02451.html
See https://lists.opensuse.org/opensuse-bug ... 02451.html