A communications protocol is a set of rules for controlling communication. It may define a particular, ordered sequence of messages to be used in a communication. The order is agreed by convention between the communicating entities to satisfy their requirements. A simple example, taken from a different context, is:
|message:||'Hi beta, this is alpha, are you receiving me? OVER'|
|reply:||'Yes alpha, this is beta, I'm receiving you. OVER'|
The above two messages implement a connection establishment protocol.
An example of an application protocol (see Figure 3.16) is a client's interaction with a file server, for example:
|file-id =||open (filename, write-mode)|
|data-bytes =||read (file-id, byte-range)|