Transport Layer protocols control and manage the delivery of a message from a process running on the source host to a corresponding process running on the destination host. Well, transport layer protocols can be connectionless where each segment of a message is considered as an independent entity. Or a transport layer protocol can also be connection-oriented where first a connection is established between the source and destination and all segments of a message have to follow this connection to get delivered to the destination host. Once all the segments of the message are delivered the connection is terminated.
Transport Layer Protocols
In this section, we will only discuss the common transport layer protocols. Here we are not discussing the TCP/IP transport layer protocols. Though the TCP/IP transport layer protocols are either modifications of these general protocols or are the combination of some of these protocols.
1. Simple Transport Layer Protocol
Simple protocol, as the name suggests is quite simple as the transport layer at the source host receives the message from its application layer. The received message is divided into manageable segments and is encapsulated into packets. These packets are delivered to the transport layer of the destination host. The transport layer protocol at the destination decapsulates the received packets and deliver them to the destination application layer.
The simple protocol is a connectionless protocol. In simple protocol, it is assumed that the packets sent by the source host can be immediately handled by the receiver host so this protocol does not provide flow and error control.
2. Stop-and-wait Protocol
Stop-and wait protocol is a connection-oriented protocol that uses a sliding window protocol with window size 1. As window size is 1 the source host sends only one packet at a time and waits for the acknowledgement. The moment the source host sends the packet it starts a timer. If the acknowledgement is received before the timer expires the source host sends the next packet.
If the acknowledge is not received before the timer expires the source host considers that either the packet is lost or is corrupted. So the source again sends the packet. The source keeps the packet until it is acknowledged. In this way, this protocol manages flow control.
To manage error control, a checksum is added to each data packet. The checksum is checked at the destination host. If the checksum is found incorrect the packet is discarded and no acknowledgement is sent for that corrupted packet. If no acknowledgement is sent for a packet and the timer for that corresponding packet is expired, the packet is resent. In this way, the protocol manages error control.
3. Go-Back N Protocol
Before understanding the go-back N protocol let us understand pipelining in networking. In general, pipelining specifies the beginning of the next task before the completion of the previous task. That is sending the next data packet before receiving the acknowledgement for the previously sent data packet.
The stop-and-wait protocol above does not implement pipelining as the sender waits for an acknowledgement before sending the next data packet. The go-back N protocol implements pipelining and is also based on sliding window protocol where the size of the window is N.
In go-back N protocol the sending host sends a series of the data packets which are sequentially numbered modulo to some maximum value. The window size N determines the number of data packets that are not acknowledged yet. let us understand the go-back-n protocol.
The window size in the example above is 4. So the sender sends four packets 0, 1, 2, and 3 without waiting for an acknowledgement. After sending four packets the sender waits for acknowledgement. After receiving the ack 0 the sliding window shifts by one frame and now frame or packet 4 is sent. Then acknowledgement for frame 1 is received which lets the sliding window shift ahead by one frame and frame 5 is sent.
But when the acknowledgement for frame 2 is not received by the sender (ack may be lost or damaged) in this case all the frames in the current sliding window are retransmitted i.e. frames 2, 3, 4, and 5. So in go-back-n, if the sender does not receive the acknowledgement for some sent data packet before the timer expires then all frames in the current sliding window are retransmitted.
4. Selective-Repeat Protocol
The selective-repeat is more efficient than the go-back N protocol. As in go-back-n protocol, all the frames in the current sliding window are retransmitted if an acknowledgement is not received.
But in the selective-repeat protocol, only that frame is retransmitted whose acknowledgement is lost or damaged. This reduces the number of retransmission making the protocol more efficient. As in the figure above you can see that the sender retransmit only packet 2 which was not properly acknowledged.
5. Bidirectional Protocol
The four protocols that we have discussed above only narrates the unidirectional flow of data packets from source to destination. But in real-world the data flows in both the direction that means from source to destination and from destination to source. Following this, the acknowledgement must also flow in both the direction from source to destination and from destination to host.
When the data and acknowledgement will flow in both the direction, there will be traffic on the network making it slow and inefficient. To reduce the network traffic and make it more efficient a piggybacking technique can be used.
To understand the technique of piggybacking let us understand the scenario where we have two communicating hosts A and B. Now suppose host A has sent a data packet to host B. Host B will not send the acknowledgement for the received packet from A immediately. Instead, host B delays the acknowledgement and hook up the acknowledgement on the outgoing data packet from B to A.
If host B sends the acknowledgement frame separately it would have required a separate header, acknowledgement and checksum which would have increased the load on the network.
But if host B hookups the acknowledgement for a packet received from host A on the data packet from B to A it will require only a few bits on the outgoing data packet.
So these are the general transport layer protocols. The transport layer of the TCP/IP model implements protocols either by modifying the above-discussed protocol or by combining some of these protocols.
Leave a Reply