What is a protocol?
The exchange of information is an essential part of computing. Suppose computer A sends a message to computer B about the names of all the users and how long they have been working. To do this it sends a stream of bits across a network.
When computer B receives a stream of bits, it doesn't automatically know what they mean. It must decide if the bits represent numbers or characters, integers or floating point numbers, or a mixture of all of them. These different types of data are all stored as binary information - the only difference between them is the way one chooses to interpret them.
This problem is solved by defining a protocol. The protocol acts as an agreement between the operating systems of two machines regarding the contents of the messages and how to interpret them.
Lets take an example:
The agreement may say that the first thirty-two bits are four integers which give the address of the machine which sent the message. The next thirty-two bits are a special number telling the OS which protocol to use in order to interpret the data. The OS can then look up this protocol and discover that the rest of the data are arranged according to a pattern of it important to understand that all computers have to agree on the way in which the data are sent in advance.
To give you a general idea, a protocol is an agreed sequence of behavior which must be followed.
For example, when passing parameters to functions in a computer program, there are rules about how the parameter should be declared and in which order they are sent.