Re: seq in tcp protocol

Kristof Provost <[email protected]>
Newsgroups org.kernel.vger.linux-newbie
Message-ID <[email protected]>
On 2013-03-22 21:30:08 (+0800), ishare <[email protected]> wrote:
>   If I send a  buffer with tcp protocol , the data is separated to serveral packets ,
>   each packet will have a seq number with it ,which ensures the recipient read this buffer
>   in right orfer .
> 
>   my question is : how the recipient know which is the end packet of this queue ? Is there 
>   data indicate the total quantity of packets composing this buffer ?
> 
TCP is a stream protocol. There is no concept (at the application level
anyway) of packets in TCP. The receiving TCP/IP stack is free to offer
the data to the application whenever it decides to, in however many
lumps as it decides to. Similarly, the sending TCP/IP stack may decide
to wait to send data until it's received more from the sending
application before packaging it and sending it to the receiver.

You may find http://en.wikipedia.org/wiki/Nagle%27s_algorithm
interesting.

Regards,
Kristof

--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.