简体   繁体   中英

How frequently IP packets are fragmented at the source host?

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 ie 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 (ie 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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM