[e2e] TCP fragmentation and reassembly

Detlef Bosau detlef.bosau at web.de
Tue Dec 6 04:59:40 PST 2005


Erwin Davis wrote:
> 
> Hi, All,
> 
> Thanks for your info. RFC 879 clearly explains the TCP fragmentation
> in the sending side but it
> says nothing about reassembly in the receiving side.
> 

Hang on here!

TCP fills in portions of a strem into "letters". These are received by a
sender.

The "MSS" is nothing else than the slot size of a letter box. Or other
restrictions
given by the underlying transportation system.

So TCP breaks down its flow into portions the lower layer can carry. And
that´s it.

Of course, the receiver must resequence these portions. Particularly as
IP packets may arrive at the receiver out of order or even get lost and
thus my be retransmitted after some time.

This is different from what IP does. IP delivers a packet. ("letter".)
Wether this letter is fragmented into a million of pieces and
reassembled at the receiver ("Scotty, beam me up!") or sent in a whole
("I prefer a shuttle") does not matter - you will not even know it.

In TCP we talk about a continous byte flow which is sent using packets.
And of course, a receiver must resequnce these packets, more correctly:
A receiver must reconstruct the byte stream from TCP datagrams which are
sent as payloads of IP packets.

Please make yourself clear _why_ fragementation is done at the IP layer. 

The reason is that you may not be aware of the maximum packet size which
can be conveyed on the whole path. The path may start
with an Ethernet segment where 1500 byte packes can be carried and there
may be a SLIP line in between, were 536 byte packts can
be carried. So, an IP packet traveling this path needs to be split up
into pieces to be conveyed.

>From TCP´s point of view, there is a transpartent transportation system
for packtes. Period. You´re given an MSS for 
the whole path and you don´t care, would even have no idea of, what
happens underneath the IP API (or behind the
slot of the letterbox).
 
> 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
>

What you talk about now is how TCP splits up a byte stream into peaces.
With all the issues that come up with that.
And this is not only the MSS. There is a rate control issue, there is a
flow control issue, there is a congestion
control issue, a loss detection issue, a retransmission issue etc. etc.
And of course this is done by the TCP
endpoints.

However, once again, I strongly advise that you have a look at a
textbook on TCP/IP here to get a first understanding.
If there are difficulties, please feel free to ask. However, I would
recommend to do this off list, because this 
might be quite boaring for the list. But please start with some good
introdution to TCP. Again: Tanenbaum, Computer Networks,
could be a good starting point. It is by far not that detailed for TCP
as the books by W. Rich Stevens or Doug Comer are.
But for the first steps, I think it is quite helpful.

Detlef

-- 
Detlef Bosau
Galileistrasse 30
70565 Stuttgart
Mail: detlef.bosau at web.de
Web: http://www.detlef-bosau.de
Mobile: +49 172 681 9937


More information about the end2end-interest mailing list