views:

648

answers:

2

I know that if IP payload > MTU then routers usually fragment the IP packet. Finally all the fragmented packets are assembled at the destination using the fields IP-ID, IP fragment offsets and fragmentation flags. Max length of IP payload is 64K. Thus its very plausible for L4 to hand over payload which is 64K. If the L2 protocol is Ethernet, which often is the case, then the MTU will be about 1600 bytes. Hence IP packet will be fragmented at the source host itself. However, a quick search about IP implementation in Linux tells me that in recent kernels, L4 protocols are fragment friendly i.e. they try to save the fragmentation work for IP by handing over buffers of size which is close to MTU.

Considering these two facts, I am wondering about how frequently does the IP packet gets fragmented at the source host itself. Does it occur sometimes/rarely/never? Does anyone know if there are exceptions to the rule of fragmentation in linux kernel (i.e. are there situations where L4 protocols are not fragment friendly)? How is this handled in other common OSes like windows? In general how frequently IP packets are fragmented?

+3  A: 

Though technically there shouldn't be any protocols that don't handle IP fragmentation correctly, there's a couple (such as NFS) that benefit greatly from lack of fragmentation.

How often you see fragmented packets is largely a function of your network environment. Packet encapsulation for VPNs, poorly-designed or implemented UDP protocols, and L1/L2 protocols that drop the end-to-end MTU below endpoint values can all cause IP fragmentation.

Most modern hosts implement PTMUD, which will automatically detect the MTU size unless non-compliant devices or over-paranoid firewalls are involved. In these days of Ethernet Everywhere, I don't expect them to be particularly common on the internet at large.

HUAGHAGUAH
NFS over UDP fragments quite a bit for me, but the fragmentation seems limited to reads and writes.
jdizzle
Even with TCP, fragmentation is highly undesirable since one lost fragment forces the destination to drop the entire packet. As you said, however, path MTU discovery usually avoids fragmentation at the source.+1.
nimrodm
Good point on TCP, I was getting my wires crossed w/ MTU sizes and sliding windows. Edited.
HUAGHAGUAH
Thanks for the answer. To clarify, my question is about fragment friendliness of L4. I think what you said is the job of L3 i.e. MTU discovery and chopping the buffer into MTU sized packets. I am asking if L4 itself takes care of handing over buffers that are <= MTU so that L3 does not have to invest more cycles in fragmentation.
Methos
A: 

how frequently ??

I dont get this.. its a necessity right ??

abt protocols not supporting fragmentation RFC 1948.