cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
597
Views
0
Helpful
10
Replies

Why Fragmentation if segmentation happens?

When transport layer take care of segmentation, keeping the segment size equal MTU size, Why fragmentation happen at layer 3?

 

S

10 Replies 10

Joseph W. Doherty
Hall of Fame
Hall of Fame

@carloseduardodapare wrote:

When transport layer take care of segmentation, keeping the segment size equal MTU size, Why fragmentation happen at layer 3?


Actually, if L3 segment size is the same size as L2 MTU, it would require fragmentation due to L2 overhead.  L3 segment size cannot exceed L2 payload size without requiring fragmentation.

As to why fragmentation happens at L3, it's because L3 supports its own maximum segment size (for IP, 64K) which is often larger than most, if not all, L2 medium's MTUs.  So, if L3 segment size is to not be dependent on L2 MTU which do not support maximum segment size, L3 needs a way to "span" its larger segment across such L2 frames, i.e. it needs to fragment its larger segment across multiple L2 frames.

Hi.

@Joseph W. Doherty Considering segmatation 1460 bytes. So if segmatation is 1460 at layer 4, still layer 3 fragmentation is required?

tcp mss 1460+  tcp header + IP header > L2 mtu there is frag
tcp mss 1460 + tcp header + IP header < L2 mtu there is no frag 

it that simple 
MHM

It depends on frame MTU, L3 and L4 header sizes, all possibly variable.

@MHM Cisco World 's recent reply is an example of fragmentation being unnecessary presuming TCP and IP headers each their minimum sizes of 20 octets and a MTU that provides 1500 octets payload (like standard Ethernet), then a MSS of 1460 would not need fragmentation.

L4 see mtu of L3 and forward packet fit to L3 mtu value 

L3 see mtu of l2 mtu of it fit to it mtu + header then no frag if large the  L3 frag the packet

Why L3 frag not other layer because it have capability to add flag in IP header about fragment. 

So if you config device you have three value set from small to large 

Tcp mss (L4)

Ip mtu (L3)

Mtu (L2)

MHM


@MHM Cisco World wrote:

L4 see mtu of L3 and forward packet fit to L3 mtu value 

L3 see mtu of l2 mtu of it fit to it mtu + header then no frag if large the  L3 frag the packet

Why L3 frag not other layer because it have capability to add flag in IP header about fragment. 

So if you config device you have three value set from small to large 

Tcp mss (L4)

Ip mtu (L3)

Mtu (L2)

MHM


Oh my, @MHM Cisco World had to mention TCP!  (Laugh)

Well, OP didn't actually name what transport layer protocol he was wondering about, although certainly TCP is a L4 transport protocol and likely the one in most common usage.

If we really want to get technical, TCP does has rules on how to set its MSS, which are pretty much basically as @MHM Cisco World describes.  For the nitty gritty of TCP, you might start with RFC 9293.

Other L4 IP protocols, may have different rules for loading up L3, which in IP, may differ a bit between IPv4 and IPv6.

Possibly important things to remember, L2 frame's maximum size is limited by media hardware.

L3 packet sizes have a maximum logical size of 64K (2 bytes length field), but what's counted against that size differs between IPv4 and IPv6.  Both IP versions support fragmentation but such can only be done at the source for IPv6.

TCP also has a logical (2 byte length field) MSS of 64K (although IPv6 max value supports infinity! - PMTUD is used for actual value - IPv6 jumbograms can be up to 4GB [4 byte length field]), but refer to the RFC reference, above, for all the rules that apply.

Anyway, again, for the question "Why fragmentation happen at layer 3?"

L2 is physically limited.

L3 is logically limited, but runs over L2 and often its logical limit exceeds what many L2 MTU can support.  So, IP's L3 provides a method, fragmentation, to split larger logical packets across smaller physical frames.

The transport layer, L4, provides features beyond what L3 provides, so it can have its own rules for how it loads up L3.  Just as an IP packet's size is limited by L2 MTU, a L4 protocol doesn't have to be limited by L3's maximum packet size.  However, for efficiency, L4 can "inquire" and/or somehow already know what the L2 and/or L3 limitations are, and take them into account.

If a L4 protocol does exceed the maximum size of L3, it, like L3 over L2, it would need some way to fragment its L4 segments across L3 packets.

Friend there are two protocol in transport layer 
tcp which is connection 
udp which is connection less 
the tcp since it connection oriented can detect l3 mtu, udp can not detect that, that why I mention tcp not udp.
I think you need to read more about this point 

MHM 

OP never explicitly mentioned IP, just mentioned "transport layer", "segmentation/segment" and L3, so likely the OSI model is in OP's mind, agree?  Otherwise, do you think OP is referencing the 4 layer IP/TCP model?

Something like IPX/SPX, as a protocol, maps into OSI model's L3 and L4, agree?  If so, there are other protocols that operate at L4 other than UDP and TCP.

However, even within IP, what about, for examples, SCTP, RDP, RUDP, IL, MPTCP and UDP-Lite?  All are also considered transport layer protocols that run on IP.

The forging protocols would be very, very little used compared to TCP and UDP, but your implication that only those two are the only transport protocols is incorrect.

As a side comment, I never object to being corrected nor being asked for references, and when I'm unsure about something I'll usually note that, but remarks like "I think you need to read more about this point" can be embarrassing when they appear to more apply to the one making them.

BTW, I skimmed that reference and although not factually incorrect I don't believe it explains well, especially for a beginner.  (Just my opinion.)

Review Cisco Networking for a $25 gift card