I'm wishing to know why the MSS value in the TCP header is 1460 bytes. I know that the MTU for Ethernet networks is 1500 bytes, that the IP header is 20 bytes and the TCP header is 20 bytes...but still, why 1460 bytes? Couldn't it be lower or higher than that?
-
It's not. It's 536 for IPv4 and 1220 for IPv6. https://en.wikipedia.org/wiki/Maximum_segment_size – spikey_richie May 27 '21 at 20:50
-
@spikey_richie so what's does this image from clouflare means? it shows 1460 bytes as the maximum [link](https://www.cloudflare.com/resources/images/slt3lc6tev37/29tC841gKxTb6c2fUFJro6/9c49654618fe84f3c00700629f30a6e4/MSS_TCP_segment_packet_diagram.png) – Dacaramo May 27 '21 at 21:12
-
That's the maximum amount, not the default value. Your question is "why does ... 1460 bytes by default?" – spikey_richie May 27 '21 at 21:14
-
Sorry for that, I did not mean to ask that, I have already modify my question – Dacaramo May 27 '21 at 21:18
-
1your diagram shows the answer nicely. the Path MTU is 1500 bytes in this example, and the necessary L3 and L4 headers are are 40bytes, leaving you with a maximum of 1460 bytes (of 1500) of data that that segment can contain. these values will vary when the path MTU is not 1500. – Frank Thomas May 27 '21 at 22:01
1 Answers
1460 is not the maximum MSS. The MSS is calculated as the MTU minus the IP and TCP header sizes. On networks with higher path MTUs than 1500 (example: data center networks that use nonstandard 6k or 9k jumbo Ethernet frames), the MSS will be larger. On networks with lower path MTUs than 1500 (example: PPPoE, common on DSL, has 8 additional bytes of overhead for an MTU of 1492), the MSS will be lower. The point of the MSS is to optimize performance by maximizing the amount of data that can be sent in each packet, which minimizes the overhead of protocol headers and mandatory link-layer inter-packet gaps. Avoiding sending oversized segments also avoids making routers do fragmentation, and that's a good optimization as well, as fragmentation introduces delay and other overhead.
The value 1460 was only common in the late 20th century because Ethernet was common, Ethernet frames have a standard 1500 byte payload capacity (which becomes the IP MTU), and IP and TCP headers were both 20 bytes long in those days. However, around the turn of the 21st century, networks had gotten fast enough that TCP needed to add the 12-byte TCP Timestamp option to protect against wrapped TCP sequence numbers, so typical TCP headers are 32 bytes long now, resulting in a typical 1448 byte TCP MSS on a standard 1500 byte MTU Ethernet network. So here in the 21st century, 1448 is a much more common TCP MSS than 1460. That Cloudflare diagram you linked to from one of your followup comments is a bit misleading, because although it's still technically possible to disable TCP Timestamps in your TCP stack and put yourself at risk of TCP sequence number wrapping, it's just not something people commonly do.
IPv4's max datagram size (the largest MTU it can fill up) is 2^16 bytes (i.e. 64KiB or 65535 bytes). So the max TCP MSS by today's standards is 65,483 bytes with TCP timestamps on, or 65,495 with them disabled.
However, Ethernet and Ethernet-like networks with Ethernet-standard 1500 byte MTUs are so common, that it's rare to see a path MTU across the public Internet that's larger than 1500 bytes, so it's rare to see a TCP MSS larger than 1448 bytes.
- 101,729
- 17
- 175
- 229