Home

Decryption IP Fragmentation and Reassembly: Mylinking™ Network Packet Broker Identifies IP Fragmented Packets

Introduction

We all know the principle of classification and non-classification principle of IP and its application in network communication. IP fragmentation and reassembling is a key mechanism in the process of packet transmission. When the size of a packet exceeds the maximum transmission Unit (MTU) limit of a network link, IP fragmentation splits the packet into multiple smaller fragments for transmission. These fragments are transmitted independently in the network and, upon arrival at the destination, they are reassembled into complete packets by the IP reassemble mechanism. This process of fragmentation and reassembly ensures that large size packets can be transmitted in the network while ensuring the integrity and reliability of the data. In this section, we'll take a deeper look at how IP fragmentation and reassembly work.

IP Fragmentation and Reassembly

Different data links have different maximum transmission units (MTU); for example, the FDDI data link has an MTU of 4352 bytes and the Ethernet MTU of 1500 bytes. MTU stands for Maximum Transmission Unit and refers to the maximum packet size that can be transmitted over the network.

FDDI (Fiber Distributed Data Interface) is a high-speed local area network (LAN) standard that uses optical fiber as the transmission medium. The Maximum Transmission Unit (MTU) is the maximum packet size that can be transmitted by a data link layer protocol. In FDDI networks, the size of the MTU is 4352 bytes. This means that the maximum packet size that can be transmitted by the data link layer protocol in FDDI network is 4352 bytes. If the packet to be transmitted exceeds this size, it needs to be fragmented to split the packet into multiple fragments suitable for MTU size for transmission and reassembly at the receiver.

For Ethernet, the MTU is typically 1500 bytes in size. This means that Ethernet can transmit packets up to 1500 bytes in size. If the packet size exceeds the MTU limit, then the packet is fragmented into smaller fragments for transmission and reassembled at the destination. Reassembly the fragmented IP datagram can only be carried out by the destination host, and the router will not perform reassembly operation.

We also talked about TCP segments earlier, but MSS stands for Maximum Segment Size, and it plays an important role in the TCP protocol. MSS refers to the size of the maximum data segment allowed to be sent in a TCP connection. Similar to MTU, MSS is used to limit the size of packets, but it does so at the transport layer, the TCP protocol layer. The TCP protocol transmits the data of the application layer by dividing the data into multiple data segments, and the size of each data segment is limited by the MSS.

The MTU of each data link is different because each different type of data link is used for different purposes. Depending on the purpose of use, different MTUs can be hosted.

Suppose the sender wants to send a large 4000 byte datagram for transmission over an Ethernet link, so the datagram needs to be split into three smaller datagrams for transmission. This is because the size of each small datagram cannot exceed the MTU limit, which is 1500 bytes. After receiving the three small datagrams, the receiver reassembles them into the original 4000 byte large datagram based on the sequence number and offset of each datagram.

IP Fragmentation and Reassembly

In fragmented transmission, the loss of a fragment will invalidate the entire IP datagram. To avoid this, TCP introduced MSS, where fragmentation is done at the TCP layer instead of by the IP layer. The advantage of this approach is that TCP has more precise control over the size of each segment, which avoids the problems associated with fragmentation at the IP layer.

For UDP, we try not to send a data packet larger than the MTU. This is because UDP is a connectionless oriented transport protocol, which does not provide reliability and retransmission mechanisms like TCP. If we send a UDP data packet larger than MTU, it will be fragmented by the IP layer for transmission. Once one of the fragments is lost, the UDP protocol cannot retransmit, resulting in the loss of data. Therefore, in order to ensure reliable data transmission, we should try to control the size of UDP data packets within the MTU and avoid fragmented transmission.

Mylinking ™ Network Packet Broker can automatically identify various kinds of tunnel protocol VxLAN/NVGRE/IPoverIP/MPLS/GRE, etc., can be determined according to the user profile according to the tunnel flow output of inner or outer characteristics.

○ It can recognize VLAN, QinQ, and MPLS label packets

○ Can identify the inner and outer VLAN

○ IPv4/IPv6 packets can be identified

○ Can identify VxLAN, NVGRE, GRE, IPoverIP, GENEVE, MPLS tunnel packets

○ IP Fragmented Packets can be Identified (Supported IP fragmentation identification and supports reassembly of IP fragmentation so as to implement L4 feature filtering on all IP fragmentation packets. Implement traffic output policy.)

Why is IP fragmented and TCP fragmented?

Since in the network transmission, the IP layer will automatically fragment the data packet, even if the TCP layer does not segment the data, the data packet will be automatically fragmented by the IP layer and transmitted normally. So why does TCP need fragmentation? Isn't that overkill?

Suppose there is a large packet that is not segmented at the TCP layer and is lost in transit; TCP will retransmit it, but only in the whole large packet (although the IP layer splits the data into smaller packets, each of which has MTU length). This is because the IP layer does not care about the reliable transmission of data.

In other words, on a machine's transport to network link, if the transport layer fragments the data, the IP layer does not fragment it. If fragmentation is not performed at the transport layer, fragmentation is possible at the IP layer.

In simple terms, TCP segments data so that the IP layer is no longer fragmented, and when retransmissions occur, only small portions of the data that have been fragmented are retransmitted. In this way, the transmission efficiency and reliability can be improved.

If TCP is fragmented, is the IP layer not fragmented?

In the above discussion, we mentioned that after TCP fragmentation at the sender, there is no fragmentation at the IP layer. However, there may be other network layer devices throughout the transport link that may have a maximum transmission unit (MTU) smaller than the MTU at the sender. Therefore, even though the packet has been fragmented at the sender, it is fragmented again as it passes through the IP layer of these devices. Eventually, all the shards will be assembled at the receiver.

If we can determine the minimum MTU over the entire link and send data at that length, no fragmentation will occur no matter which node the data is transmitted to. This minimum MTU over the entire link is called the path MTU (PMTU). When an IP packet arrives at a router, if the MTU of the router is less than the packet length and the DF (Do not Fragment) flag is set to 1, the router will not be able to fragment the packet and can only drop it. In this case, the router generates an ICMP (Internet Control Message Protocol) error message called "Fragmentation Needed But DF Set." This ICMP error message will be sent back to the source address with the MTU value of the router. When the sender receives the ICMP error message, it can adjust the packet size based on the MTU value in order to avoid the forbidden fragmentation situation again.

IP fragmentation is a necessity and should be avoided at the IP layer, especially on intermediate devices in the link. Therefore, in IPv6, fragmentation of IP packets by intermediate devices has been forbidden, and fragmentation can only be carried out at the start and end of the link.

Basic Understanding of IPv6

IPv6 is version 6 of the Internet Protocol, which is the successor to IPv4. IPv6 uses 128-bit address length, which can provide more IP addresses than the 32-bit address length of IPv4. This is because the IPv4 address space is gradually exhausted, while the IPv6 address space is very large and can meet the needs of the future Internet.

When talking about IPv6, in addition to more address space, it also brings better security and scalability, which means that IPv6 can provide a better network experience compared to IPv4.

Although IPv6 has been around for a long time, its global deployment is still relatively slow. This is mainly because IPv6 needs to be compatible with the existing IPv4 network, which requires transition and migration. However, with the exhaustion of IPv4 addresses and the increasing demand for IPv6, more and more Internet service providers and organizations are gradually adopting IPv6, and gradually realizing the dual-stack operation of IPv6 and IPv4.

Summary

In this chapter, we took a deeper look at how IP fragmentation and reassembling work. Different data links have different Maximum Transmission Unit (MTU). When the size of a packet exceeds the MTU limit, IP fragmentation divides the packet into multiple smaller fragments for transmission, and reassemble them into a complete packet by IP reassemble mechanism after arriving at the destination. The purpose of TCP fragmentation is to make the IP layer no longer fragment, and retransmit only the small data that has been fragmented when retransmission occurs, so as to improve transmission efficiency and reliability. However, there may be other network layer devices throughout the transport link whose MTU may be smaller than that of the sender, so the packet will still be fragmented again at the IP layer of these devices. Fragmentation at the IP layer should be avoided as much as possible, especially on intermediate devices in the link.

Media Contact
Company Name: Transworld (Hong Kong) Co., Limited.
Contact Person: Transworld
Email: Send Email
Country: China
Website: https://www.mylinking.com/