On Tue, 2006-04-04 at 07:40 -0400, Bob Penfield wrote: > > 2) can single TCP packet have more than one SIP messages? > > Since TCP is a streaming protocol, it is possible for a single IP Packet to > contain one or more messages, or even portions of one or more messages. It > is also possible that a single message will be split between multiple IP > Packets. You must use CRLF at the end of the headers and the value or > Content-Length header to locate the end of each message.
A better way to look at it is that TCP is a stream protocol, the abstraction it presents to its application is a stream of bytes. It provides no demarcations that correspond to the packet boundaries on the wire, or how bytes were grouped when they were given to the sending TCP by its application. So Content-Length is needed for the receiver to find the beginnings of the messages. Conversely, UDP is a message protocol, and its abstraction maintains the boundaries between messages. A clarifying example is SCTP, which is implemented much like TCP, but also provides message boundaries in its abstraction. SIP messages sent via SCTP do not need Content-Length. Dale --- interop.pingtel.com -- the public SIP phone interoperability test server _______________________________________________ Sip-implementors mailing list [email protected] https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors
