3

Why is the MSS 1460 bytes max in a TCP data packet?

Data packet
Image source.

I know that:

  • The MTU for Ethernet networks is 1500 bytes max.
  • The IP header is 20 bytes.
  • The TCP header is 20 bytes.

But still, why 1460 bytes? Couldn't it be lower or higher than that?

Mateen Ulhaq
  • 3,728

1 Answers1

15

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.

Spiff
  • 110,156