|
|
|
|
||||||
| comp.protocols.tcp-ip TCP and IP network protocols. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
tcp dummy's question;
udp has "message length" in it's header but tcp doesn't. how tcp knows length? thanks, |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
This is because there is no concept of a message in a TCP connection.
TCP is a stream oriented protocol, so if you need to correlate input/output streams into a data structure, for instance, you will need to develop a protocol to exchange your structures over the TCP stream. UDP, on the other hand, relies on discrete datagrams to pass data back and forth, so you are able to nicely encapsulate one 'message' per recv. jim wrote: > tcp dummy's question; > udp has "message length" in it's header but tcp doesn't. > how tcp knows length? > thanks, |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
In article <1161301279.190162.54570@h48g2000cwc.googlegroups. com>,
"baringforge@gmail.com" <baringforge@gmail.com> wrote: > jim wrote: > > tcp dummy's question; > > udp has "message length" in it's header but tcp doesn't. > > how tcp knows length? > > thanks, > This is because there is no concept of a message in a TCP connection. > TCP is a stream oriented protocol, so if you need to correlate > input/output streams into a data structure, for instance, you will need > to develop a protocol to exchange your structures over the TCP stream. > UDP, on the other hand, relies on discrete datagrams to pass data back > and forth, so you are able to nicely encapsulate one 'message' per > recv. I don't think you're answering the question he asked. I think he wants to know how TCP knows the *segment* length, since there's no length field in the header. It does this by knowing the length of the IP payload that the segment is contained in, and the length of the TCP header. It subtracts the header length from the payload length, and that's the length of the TCP segment's payload. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
![]() |
| Outils de la discussion | |
|
|