0

I got basic question. Trying to understand the mechanism how network layer identify when it receive packet larger than its interface MTU configured and has to fragment it.

For example. If the data to be transmitted by application is 2000byte where as the NIC on the server is having MTU 1500. Network layer has to do fragmentation now but how it knows it has to do it. Does the Transport layer give the full 2000byte data to network layer and than network layer compares it with the interface MTU configured and decide accordingly

Shekhar
  • 3
  • 1
  • Does this answer your question? [When will a TCP network packet be fragmented at the application layer?](https://stackoverflow.com/questions/756765/when-will-a-tcp-network-packet-be-fragmented-at-the-application-layer) – Zac67 Aug 09 '21 at 15:57
  • If there's a small gap in understanding: when the network layer binds a network interface (from data link layer) the MTU is passed upward, so the network layer always knows. – Zac67 Aug 09 '21 at 15:59
  • @Zac67 Thanks for the response. So does it mean that for the above example Network layer will get packet with 2000byte and then it store in in some buffer and meanwhile send the packet(1500bye) to below layer according to the MTU set. – Shekhar Aug 10 '21 at 08:52
  • Yes, pretty much so. When the network layer gets a datagram from the transport layer (L4) that is too large for the underlying data link layer (L2), the packet is fragmented (unless L4 forbids fragmentation). – Zac67 Aug 10 '21 at 10:07

1 Answers1

0

If the data to be transmitted by application is 2000byte

There are transport-layer (L4) protocols (most prominently TCP) that do all the chunking for an application. TCP is MTU-aware and segments its data automatically into the optimal chunks.

Other L4 protocols don't do any chunking of their own (e.g. UDP). Any application data is simply encapsulated into a datagram and passed to the network layer. If necessary, the network layer then fragments the encapsulating IP packet across several data-link-layer frames.

Zac67
  • 2,761
  • 1
  • 10
  • 21