Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a message boundary?

What is "message bonudaries" in the following context?

One difference between TCP and UDP is that UDP preserves message boundaries.

I understand the difference between TCP and UDP, but unsure about the definition of "message boundaries". Since UDP includes the destination and port information in each individual packet, could it be this that gives message a "boundary"?

like image 305
KMC Avatar asked Mar 05 '12 08:03

KMC


People also ask

Does TCP observe message boundary?

The most important point to remember about using TCP for network communication is that TCP does not respect message boundaries.

Does UDP preserve application layer message boundaries?

And then on the receiving side, UDP will deliver a segment's payload into the appropriate socket, preserving the application-defined message boundary. That's Correct!

Why UDP is message-oriented?

so the each data-gram has boundary and message are self contained that can have meaning. that's why UDP is also called as message-oriented protocol.

Is UDP byte oriented?

The TCP is a byte-oriented transport protocol. In the case of TCP, a stream of TCP packets is transported and each TCP packet contains a sequence of data bytes. The UDP is a message-oriented transport protocol. UDP transports a stream of UDP datagrams.


1 Answers

No, message boundaries have nothing to do with destinations or ports. A "message boundary" is the separation between two messages being sent over a protocol. UDP preserves message boundaries. If you send "FOO" and then "BAR" over UDP, the other end will receive two datagrams, one containing "FOO" and the other containing "BAR".

If you send "FOO" and then "BAR" over TCP, no message boundary is preserved. The other end might get "FOO" and then "BAR". Or it might get "FOOBAR". Or it might get "F" and then "OOB" and then "AR". TCP does not make any attempt to preserve application message boundaries -- it's just a stream of bytes in each direction.

like image 76
David Schwartz Avatar answered Sep 17 '22 20:09

David Schwartz