Difference between message-oriented protocols and stream-oriented protocols [closed]

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


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.


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


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.