Featured image of post Reliable Transmission

Reliable Transmission

In this article I explore how reliable transmission can be implemented in protocols such as TCP.

Reliable Transmission: Briefly

Reliable Transmission is a service usually provided by the transport layer, although occasionally available at the link-layer; it concerns itself with the reliable delivery of data from one host to another, either over a direct link or over an internetwork (like the Internet).

Reliable Transmission is a vital for applications that need to delivery all data as accurately as possible over an unreliable network, with little or no requirements for speed, examples include: File Transfer, Messaging applications or Email.

In the following sections we will explore the fundamental building blocks for any protocol implementing reliable transmission, how reliable transmission is implemented in the real world and where reliable transmission is heading in modern protocols such as QUIC, which do not follow the traditional ideas of a reliable delivery service.

The Building Blocks for Reliable Transmission

Before we establish the building blocks for Reliable Transmission we need to understand why we even need reliable transmission, To explore this consider the following scenario:

📌 Scenario

A sender is transmitting some data to the receiver, the sender is sequentially data over the network, there is neither re-transmission of packets, nor sequencing information attached to the packets. Since the packets may take different routes over the network to arrive to the host the packets are more likely to arrive out of order than in order, as the receiver receives the information, it has no way of knowing how to order the packets or if it has all the data that was transmitted, this will obviously confuse the receiver and possibly the application it is serving, leading to poor formation of data and degraded user experience.

This is where Reliable Transmission comes in, to solve this exact problem

Reliable Transmission is implemented using the following concepts:

  • Acknowledgements: Sent by the receiver to the sender acknowledging the information has arrived
  • Sequencing: Information added to the packet that denotes how the data should be sequenced.
  • Re-transmission: Re-sending data that the receiver has not acknowledged, Usually after a timer has expired
  • Timers: Used to time how long the receiver takes to send an acknowledgement

The 2 Ways to implement Reliable Transmission

In this section, We’ll explore two different reliable transmission algorithms which have been historically significant or are being used in modern implementations of such protocols

Stop and Wait Algorithm

Stop and Wait is quite a simple algorithm, the sender sends a single data segment to the receiver and waits for the receiver to send an acknowledgement, If the user does not send an acknowledgement to the sender then after a certain amount of time the sender re-transmits the segment, this process continues until the receiver receives all segments.

Stop and Wait Algorithm

As seen in the diagram, stop and wait ensures that the data arrives at the receiver, however, the algorithm has a major drawback, it acts as a bottleneck for the entire transmission, halting the transmission of further segments until an acknowledgement is received is just not viable for any network, therefore, as a solution the Sliding Window Algorithm was developed which we study next.

Sliding Window Algorithm

The sliding window algorithm is more sophisticated approach to reliable transmission, it features a sliding window on both the sender and receiver, the sliding windows maintain 3 different variables: Last Byte Written / Read, Last Byte Sent / Received and Window Size.

Sliding Window The Sliding Window; Bytes can be buffered until they are read so the sender can send as many bytes as the window permits

The sender can transmit as many bytes (as a collective, inside a segment to maintain efficiency) as the receiver’s window size permits, the receiver acknowledges all the segments it receives, usually as a cumulative to avoid sending multiple acknowledgements.

If any of the bytes do not arrive then the receiver does not send an acknowledgement for those bytes and after a certain amount of time the sender re-transmits those bytes, additionally, if the receiver receives successive bytes before receiving bytes for an earlier sequence number then they can choose to selectively acknowledge certain bytes to let the sender know that they do not need to re-transmit all the byte collections sequenced after the missing byte collection.

Sliding Window over Time graph

One of the heaviest points of debate among computer networking scientists is whether reliable transmission should be implemented at the link layer or the transport layer, I will briefly explore both sides of the argument.

Reliable Delivery at the link-layer will be a violation to the end-to-end principle, which states that several functions such as validating correctness, security and reliability should happen at the end hosts to ensure the spanning layer stays as simple and scaleable as possible, additionally, if the link-layer implements reliable transmission than it may unnecessarily harm the performance of applications that do not require reliable transmissions such as real time time video calling applications.

However, ensuring reliability can ensure that issues involving transmission failures get addressed as early as possible, this can maximise the efficiency of the network.

Conclusion

In this article we examined why we need reliable transmission, how reliable transmission can be implemented, two prominent algorithms in reliable transmission and whether reliable transmission should be implemented at the link layer.

Not-By-AI Not-By-AI