The smallest MTU between the source and destination is 600. What I don't understand is how TCP knows to only include a max of 548 bytes, so that it doesn't go over 600 with TCP and IP overhead. MTU path discovery is enabled, and I understand how it works but I don't understand how TCP is using it because there is no network activity prior to the initial handshake. Is it possible my source has cached this information somehow based on previous activity? How does TCP know how big to make the datagram?


In simple terms, yes, systems cache that information. [route-cache, FIB, etc.]

If you understand how PMTUd works, you know how the maximum segment size is determined once traffic is flowing. Almost every modern network stack implements a route cache. It's a faster way to lookup a path than a full route table lookup per packet. Within the cache are parameters that normally don't exist in the main route table. The maximum segment size between a pair of hosts is but one.

For example:

debian1:~/[11:29 PM]:ip route show table cache [A]
[A] from [B] via [B gw] dev eth0 
    cache  expires 543sec mtu 1444 rtt 615ms rttvar 610ms cwnd 35 advmss 1460 hoplimit 64

Across an IPSec tunnel, the MTU had to be reduced. Until I ask for something bigger than a "1500" packet, the cache entry remains mtu 1500.

| improve this answer | |
  • usually pmtud isn't required if the end station is directly connected to the 600b segment... the TCP MSS value in the SYN packet prevents exceeding local MTU of that segment – Mike Pennington Jun 6 '16 at 13:24

TCP doesn't know. The router(s) in between will fragment IPv4 packets as necessary. The TCP segments are the payload of the IPv4 packets.

RFC 791, INTERNET PROTOCOL details the fragmentation process, and what the end-device needs to do to defragment the packets upon receipt. The IPv4 header has fields to facilitate the fragmentation/defragmentation process.

1.1. Motivation

The Internet Protocol is designed for use in interconnected systems of packet-switched computer communication networks. Such a system has been called a "catenet" [1]. The internet protocol provides for transmitting blocks of data called datagrams from sources to destinations, where sources and destinations are hosts identified by fixed length addresses. The internet protocol also provides for fragmentation and reassembly of long datagrams, if necessary, for transmission through "small packet" networks.


1.4. Operation

The internet protocol implements two basic functions: addressing and fragmentation.

| improve this answer | |
  • 1
    That's how things originally worked but it's not how they typically work today. – Peter Green Jun 6 '16 at 11:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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