[e2e] TCP fragmentation and reassembly

Joe Touch touch at ISI.EDU
Mon Dec 5 16:30:25 PST 2005

Hash: SHA1


It's useful to keep in mind that TCP is a byte-stream protocol; there
are no segment boundaries preserved between application and transport layer:

Erwin Davis wrote:
> Helllo,
> Packet from application layer may be framed in TCP layer based on MSS
> (maximum segment size, not MTU in IP layer) negotiated between two TCP
> layers of the end parties. 

Apps using TCP don't write in packets; they write bytes. The application
can write in whatever units it wants; TCP is allowed to send packets
based on that data however it sees fit. While an application can tune to
the behavior of a specific TCP implementation, it cannot rely on all
TCPs acting the same way.

> My question is if the TCP layer in receiving
> side will reassemble the TCP fragments before it forward the packet to
> the application layer.

TCP reorders, but doesn't maintain application layer boundaries. So long
as data is received in order, once it is received and ACK'd it is
presented to the receive-side application layer.

> If yes, then how the TCP layer in receiving side
> knows how many TCP fragments are made up for this one application
> packet. If not, will it require the intelligence from the application
> layer for the application packet reassembly. Thanks for your help,

Applications cannot strictly know what TCP does with data that is sent
absent monitoring the traffic directly.

Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the end2end-interest mailing list