Difference between message-oriented protocols versus stream-oriented protocols [closed]
Asked Answered
H

4

44

I am trying to understand the difference between message-oriented and stream-oriented protocols. I've searched around and haven't found a clear explanation or distinction between the two. Could anybody please explain me or give a link to a page that explains if there are differences?

Thank you

Hockenberry answered 10/6, 2010 at 19:11 Comment(2)
Are you referring to a specific level in the network stack?Taal
I'm voting to close this question as off-topic because this is not about programming — instead it’s about network protocols without relation to any specific problem at all, let alone a programming problem.Bethesde
E
81

Message Oriented protocols send data in distinct chunks or groups. The receiver of data can determine where one message ends and another begins. Stream protocols send a continuous flow of data.

Here is an example with mobile phones. Text messages would be a message oriented protocol as each text message is distinct from the other messages. A phone call is stream oriented as there is a continuous flow of audio throughout the call.

Common protocols used on the internet are UDP (message oriented) and TCP (stream oriented). Wikipedia these terms for more information.

Hope this helps

Eldwun answered 10/6, 2010 at 19:20 Comment(0)
J
33

Stream protocols send data byte-by-byte. You can view it as pipe where all going in on one side gets transfered on other side. It is task of other side to determine when it has enough data to make any sense of it.

TCP is classic example of it. Once you send "Hello World" through pipe, there are no guaranties that it will come as such. It may come as each letter by itself, as two words or in one piece. Only thing that you know is that letters will be in same order.

Message protocols are usually built over streams but there is one layer in between which takes care to separate each logical part from another. It parses input stream for you and gives you result only when whole dataset arrives and not all states in between. In previous example, you would only expect whole "Hello World" message or nothing.

This is quite simplified view, but I think it explains biggest difference.

Jackelinejackelyn answered 10/6, 2010 at 19:20 Comment(0)
M
5

It is a little bit more complicated.

Generally, there are two different types of low-level (OSI:Physical) types:

  • package-oriented transport
  • channel-oriented transport

both transport types can be send by Frequency-Modulation, Amplitude-Modulation, Phase-Modulation ...

Those Frequency/Amplitude/... (also called Analog-Modulation) can be enhanced by digitalisation. Or used for digital signals. This is called Digital-Modulation.

see: https://en.wikipedia.org/wiki/Modulation

Package-Oriented Transports use one line for several packages. Channel-Oriented Transports use different lines for different packages. The advantage of Channel-Oriented Transports (as used in radios) is, that the signal comes without instantly. The disadvantage is, that this channel is sparse used. So, the total bandwidth is low. Therefore, we use Package-Oriented-Transport for the Internet. But, this transport can be based on the channel-oriented frequency modulation (as Cable-Modems) or on single line package-oriented amplitude modulation (as Telefone-Lines).

In the end, UDP and TCP are package-oriented in OSI level 5 (Transport). So, the question about what is the difference between Streaming and Message-Oriented TCP is a good question.

Also streams from shoutcast.com using TCP are partitionated into packages. (Streaming-Packages/Messages are divided into TCP-Packages.) It is possible, that one TCP-Package get lost. Mere, because TCP is address-oriented and enumerates its packages, the package can be requested again. That makes TCP reliable.

On the top of TCP are now streams. They use the possiblity to order the packages of TCP according to the package-number. The point is, that they send data, which is more likely to switch into the stream on every moment.

Perhaps, that clarifies the question.

Regards

Marquita answered 6/4, 2016 at 8:18 Comment(0)
N
4

the main difference between message stream and byte stream is the message boundary. Also the message stream will keep track of the message boundaries but the byte stream dos not.

consider in network the 1024 bytes of data are transmitted to the host, then after a min another 1024 bytes has transmitted to the same host then the receiver will receive totally 2048 bytes of data.

in this transmission the message stream will send two different 1024 bytes of messages while in byte stream will transfer the full 2048to the receiver as a single unit.

Ex. Of message stream is sequence of pages. Ex. of the byte stream downloading a song or a movie.

Nikolas answered 1/12, 2017 at 14:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.