Sunday, January 31, 2016

MTU, fragmentation and reassembly

Recently, I got the opportunity to work in a freshly built LTE/4G core and backhaul network. We observe a strange problem of the network where video traffic (RTSP/UDP) from UE devices in an APN were not reaching the video management servers. Although http or ftp traffic was passing through.
After hours of search, finally the problem was discovered in a one of the EPC component where it had a smaller MTU. Http traffic might have passed due to PMTUD.
Realizing the importance of MTU, let’s review this old school topic of networking.
MTU
The Maximum Transmission Unit (MTU) is the largest number of bytes in a single datagram can have on a particular data communications link.
Usually, in most Ethernet access networks it is 1500 bytes for IP packet.
At Layer 2, standard fame size is 1518 bytes, which includes additional header of 14 bytes and FCS of 4 bytes.
Other communication media types have different MTU size. Example: SONET/SDH has MTU of 4470 bytes.
https://habrastorage.org/getpro/habr/post_images/6c1/6da/135/6c16da13526de3dfd0368d31a5f1b6d9.jpg
Different type of encapsulation adds overhead.
  • GRE (IP Protocol 47) adds 24 bytes (20 byte IPv4 header, 4 byte GRE header)
  • MPLS adds 4 bytes for each label in the stack
  • IEEE 802.1Q tag adds 4 bytes (Q-in-Q would add 8 bytes)
  • VXLAN adds 50 bytes
  • OTV adds 42 bytes
  • IPsec encryption can add 52-76 bytes of overhead depending on transport or tunnel mode and the encryption/authentication algorithm
http://www.cisco.com/c/dam/en/us/td/i/000001-100000/80001-85000/81001-82000/81608.ps/_jcr_content/renditions/81608.jpg

Fragmentation
IP fragmentation involves breaking a datagram into a number of pieces that can be reassembled later.
Routers can fragment IPv4 packets unless the Do-Not-Fragment (DF) bit is set to 1 in the IPv4 header.
Identification, total length, fragment offset, “more fragments" and "don't fragment" flags in the IP header, are used for IP fragmentation and reassembly.
Fragmentation and reassembly of packets increase CPU and memory overhead.
pmtud_ipfrag_02.gif

MSS
Maximum segment size (MSS) is 40 bytes smaller than the MTU.
MSS = MTU – (IP Header + TCP header)
To assist in avoiding fragmentation between endpoints of TCP connection, MSS value is exchanged and lowest is set.
PMTUD
Path MTU Discovery (PMTUD) is used to avoid fragmentation in the path between the endpoints.
It is used to dynamically determine the lowest MTU of routers along the path from a packet's source to its destination.
PMTUD is only supported by TCP.

References

3 comments:

  1. It's like you read my mind! You seem to know a lot about this, like you wrote the book in it or something. I think that you can do with some pics to drive the message home a little bit, but instead of that, this is fantastic blog. A great read. I will definitely be back.
    GRE Training in Chennai
    GRE Coaching in Chennai
    GRE Training institutes in Chennai

    ReplyDelete
  2. Enthusiastic beginning is very common in every sector when anyone enters into a new world. But it is very hard to keep such enthusiasm for a long time after huddles come out from invited sources. Read this blog and know more about this topic.
    Lenovo ThinkSystem SR850

    ReplyDelete