We’re all familiar with TCP, the three handshakes, reliable transmission, and all that jazz, but there are a few other things that are interesting, such as do you know what the size limit is for a TCP send?


Let’s review the TCP send process. First, the application layer calls a send to put the data from the user state to the kernel state, which is a complicated process, but can be left off the table, and then the kernel state is handed over to the hardware-network card and then sent out again. We actually know very well that each layer in between has the concept of segmentation, for example, TCP will segment and IP will slice.

So suppose I connect two PCs directly with a network cable, will a large TCP packet also be segmented? If not, what is the maximum TCP packet size that can be sent?

The MTU is generally not more than 1500, so the IP layer and above will be separated here; suppose we ignore this, then the IP layer, the maximum size of the IP layer is 65535, remove the 20 byte header, that is 65515 bytes, here can not be divided, then TCP is Then there is TCP, the shortest 20, then there is 65515-20, that is 65495 bytes, this is the maximum message data segment can be carried.