[e2e] TCP fragmentation and reassembly

Erwin Davis erwin.davis at gmail.com
Mon Dec 5 17:10:22 PST 2005


Hi, All,

Thanks for your info. RFC
879<http://www.networksorcery.com/enp/rfc/rfc879.txt>clearly explains
the TCP fragmentation in the sending side but it
says nothing about reassembly in the receiving side.

Joe, see an example below. Assume an application writes down a packet with
10 Kbyte to TCP layer whose negotiated MMS is 5 Kbytes. Then the TCP layer
will fragment the application packet into two TCP segments with 5 Kbytes
each. Assume that the first TCP packet arrives at the receiving side. Then
the TCP layer in the receiving side wakes up the application listening to
this TCP port. The application processes the half packet and fails. The app
has no way to know if it receive a complete message or not but the TCP layer
in the sending side knows.  To me,  such TCP operation is not transparent to
the application. It requires the intelligent part in the application to
determine if the arriving TCP packet is a complete packet from the sending
application or not.
let me know if I misunderstood some points.  Thanks again,

Erwin

On 12/5/05, Joe Touch <touch at isi.edu> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Erwin,
>
> 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.
>
> Joe
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>
> iD8DBQFDlNuhE5f5cImnZrsRAgK/AKCD9IoKKeQncJDfvSfBXCQ0cvVZNQCg5c5r
> vJQkSrgnXaDPX3WQsug1PSc=
> =U7lI
> -----END PGP SIGNATURE-----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.postel.org/pipermail/end2end-interest/attachments/20051205/4b552ff0/attachment.html


More information about the end2end-interest mailing list