Unit 3

Lesson 1 - Protocols

   Computer Protocols

The human protocols just described were developed to make human communication smoother. Of course, two people with wildly different protocols can still manage to communicate, because they can eventually learn to adapt their protocols to each other's needs. This process can even be fun, which is why international travel is a stimulating experience.

However, computers do not have creative, problem-solving brains. They are not intelligent, only fast. Thus, their communication protocols must be very specific and unambiguous.

For example, assume the telegraph company has replaced its human operators with machines. These machines convert messages to Morse Code, transmit the code over the wire, receive messages that come from the wire, and convert Morse Code back to text again. They can do everything the human operators did except for one thing: they do not know when one message ends and another begins.

The human operators knew when a message was done, because they could understand the words represented by the dots and dashes. However, the machine can only understand the dots and dashes themselves; to the machine, there is no meaning beyond the signal itself.

Simple Machine Protocol

To solve this problem, the machine programmers developed the very simple machine protocol illustrated on the Simple Machine Protocol Diagram. The protocol specifies that the first three characters of each message represent a decimal number that gives the length of the message that follows. Furthermore, the message length does not include the numbers themselves.

Simple Machine Protocol

Simple Machine Protocol

Thus, to send the message "HELLO STUDENTS," which contains 14 characters (including the space), the sending program would first transmit the characters "O14" followed by "HELLO STUDENTS." The receiving program would interpret the first three characters as the length of the message, and then expect 14 more characters. When 14 characters have been received, the receiving program will expect three more numbers, to begin a new message.

This protocol works well, as long as the two computers follow the protocol exactly. If the receiving computer uses a different protocol (expecting the first two characters to represent the length of the message, instead of the first three), it would expect a message only one character long. When that one character is not followed by numbers to start the next message, the receiving computer would interpret the transmission as an error. Or, if the sending program transmits fewer characters than promised, that would also be an error.

Protocol Headers

When nonmessage data, such as message length, is added to the beginning of a message, we call that additional data a "protocol header." Headers function just like envelopes or packing labels to describe the content of a message, its length, the identity of its sender or recipient, the time of day it was sent, and any other information the communicating processes need to know about the message itself.

   Activities

See the Activities and Extended Activities section in Unit 3 Lesson 1 in your textbook Introduction to Networking to test what you have learned so far.

[ Previous Section ] [ Unit Contents ] [ Next Lesson ]