1

just to be clear.. if a sender wants to send a data of 1800bytes ( assuming MTU be 1500bytes

so MSS = 1500-40 (taking min ip and tcp header) = 1460bytes)

Then there will be three segments 750 + 750 + 300 (3 tcp segments).

Not taking 1500 + 300 because MSS is 1460bytes and thus will be discarded.

Am I correct here??

6
  • How about 1460 + 340? That's only two segments.
    – Ron Trunk
    Commented Sep 15, 2020 at 11:54
  • Packets would only be fragmented by MTU, but you must remember that the packet payload must be on an eight octet boundary, and neither 750 nor 300 are divisible by eight. Also, the MSS option is the maximum segment size a host can receive. Each host of the connection can have a different MSS, which can be much smaller than the MTU.
    – Ron Maupin
    Commented Sep 15, 2020 at 12:51
  • "Maximum Segment Size Option Data: 16 bits If this option is present, then it communicates the maximum receive segment size at the TCP which sends this segment. This field must only be sent in the initial connection request (i.e., in segments with the SYN control bit set). If this option is not used, any segment size is allowed."
    – Ron Maupin
    Commented Sep 15, 2020 at 13:07
  • You also need to understand that IP fragmentation and TCP segmentation really have nothing to do with each other. People often confuse the two, but they are completely different things.
    – Ron Maupin
    Commented Sep 15, 2020 at 13:09
  • hey @RonMaupin thanks :) but i have one more doubt, like you said "any segment size is allowed if MSS option data is not set to 16bits" what does that actually mean? I mean Is 1460 + 340 is correct? or only multiples of 8 as you said earlier like 1800 = 1352 + 448, if both host's MTU is 1500bytes
    – AxDu
    Commented Sep 15, 2020 at 19:32

1 Answer 1

1

I really think you are confusing IP fragmentation with TCP segmentation. Those are two very different things.

Assuming you mean that TCP is given 1800 octets of data from the application, then you will not have any fragmentation at all. TCP will segment the data into two TCP segments that fit into the 1500 octet MTU with no fragmentation. One segment will have 1460 octets of application data (20 octets of TCP header, and 20 octets of IPv4 header, for a total of 1500 octets to meet the MTU), and another segment with 340 octets of application data.

Fragmentation happens when the MTU in the path shrinks and an IP packet is larger than the MTU. In the above scenario, if the MTU on one hop is 1400 octets, then the first IPv4 packet must be fragmented or dropped. The 1500 octet packet will be fragmented into two packets, one of 1396 octets with a payload of 1376 octets (20 octets of TCP header plus 1356 octets of application data), and one of 124 octets with a payload of 104 octets of application data. The other original IP packet fits the new MTU, so it is not fragmented.

When the fragments are received at the destination, the packet fragments are reassembled before IPv4 passes the segment up to TCP, so TCP has no idea that the packet was fragmented. TCP deals with the data segmentation.


IPv6 has eliminated in-path fragmentation because it is resource intensive, and it slows packet delivery. Also, smart businesses will drop IPv4 packet fragments at the firewall to prevent fragmentation attacks. Today, we have PMTUD (Path MTU Discovery) that is used to determine the smallest MTU in the path so that packets can be properly sized to prevent the need for fragmentation in the path.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.