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.
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.
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.
The Internet Protocol is designed for use in interconnected systems of packet-switched computer communication networks. Such a system has been called a "catenet" . 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.
The internet protocol implements two basic functions: addressing and fragmentation.