Principles of Reliable Data Transfer
Network Layer Imperfections
The transport layer must deal with the imperfections of the network layer service. There are three types of imperfections that must be considered by the transport layer:
- Segments can be corrupted by transmission errors
- Segments can be lost
- Segments can be reordered or duplicated
Let’s look at some workarounds for these problems that the transport layer employs.
Checksums
The first imperfection of the network layer is that segments may be corrupted by transmission errors. The simplest error detection scheme is the checksum.
A checksum can be based on a number of schemes. One possible scheme is an arithmetic sum of all the bytes of a segment. Checksums are computed by the sender and attached with the segment. The receiver verifies it upon reception and can choose what to do in case it is not valid. Quite often, the segments received with an invalid checksum are discarded.
Retransmission Timers
The second imperfection of the network layer is that segments may be lost. Since the receiver sends an acknowledgment segment after having received each data segment, the simplest solution to deal with losses is to use a retransmission timer.
A retransmission timer starts when the sender sends a segment. The value of this retransmission timer should be greater than the round-trip-time, for example, the delay between the transmission of a data segment and the reception of the corresponding acknowledgment. Note that TCP sends an acknowledgment for almost every segment! We’ll look at this in more detail in later lessons. When the retransmission timer expires, the sender assumes that the data segment has been lost and retransmits it.
This is illustrated in the figure below:
Limitations of Retransmission Timers
Unfortunately, retransmission timers alone are not sufficient to recover from segment losses. Let us consider the situation depicted below where an acknowledgment is lost. In this case, the sender retransmits a data segment that has been received correctly, but not properly acknowledged.
Unfortunately, as illustrated in the figure below, the receiver considers the retransmission as a new segment effectively and the segment is duplicated.
Sequence Numbers
To identify duplicates, transport protocols associate an identification number with each segment called the sequence number. This sequence number is prepended to the segments and sent. This way, the end entity can identify duplicates.
Quick Quiz!
Checksums address which imperfection of the network layer?
Packet drops
Packet errors
Packet reordering
Get hands-on with 1400+ tech skills courses.