A protocol is a set of rules used by two devices to communicate. These sets of rules are usually decided by headers (fixed headers determined by the protocol). These headers specify the content of the message and the way this message is processed. To detect the error, the header must be the address of the destination, the address of the source, the checksum of the message.
Categorization of Protocol
Protocols are divided into two main categories based on the type of communication channel they are designed for:
1. Protocols for Noiseless (Error-Free) Channels
Designed assuming no errors occur during transmission (no lost, corrupted, or duplicated frames).
Mainly used for theoretical purposes or as a foundation for more complex protocols.
Not practical for real-world communication since channels usually have noise.
2. Protocols for Noisy (Error-Causing) Channels
Designed to handle errors such as lost, corrupted, or duplicated frames.
Used in real-life applications where communication channels are not perfect.
Include mechanisms for error detection and correction.
An idealistic channel where no frames are lost, corrupted, or duplicated. Protocols designed for this type of channeldo not implement error control because the channel is assumed perfect.
Protocols for Noiseless Channel
There are two main protocols designed for noiseless channels.
1. Simplest Protocol
Assumption: The receiver can handle every frame immediately without any delay or backlog.
Receiver Operation: The receiverβs data link layer quickly removes the header from each incoming frame and passes the data packet to the network layer, which is also capable of immediate processing. This means the receiver never gets overwhelmed by incoming frames.
Design of Simplest Protocol
Sender side:
The data link layer receives data from its network layer.
It creates a frame using this data.
It sends the frame over the physical layer.
Receiver side:
The data link layer receives the frame from the physical layer.
It extracts the data from the frame.
It passes the data to the network layer.
Communication Services:
The data link layers on both sender and receiver provide communication and transmission services for their respective network layers.
The data link layers use the physical layers to transmit bits physically.
π Image Design of Simplest Protocol with no error control or flow
Algorithm
Sender-Side Algorithm
Receiver-Side Algorithm
while(true) //Repeat forever
{
waitForEvent(); //sleep until an event occur
if (Event(RequestToSend)) //there is a packet to send
{
GetData();
MakeFrame();
SendFrame(); //send the frame
}
}
while(true) //Repeat forever
{
waitForEvent(); //sleep until an event occur
if (Event(ArrivalNotification)) //data frame arrived