Wraparound Concept and TCP Sequence Number



What is TCP?

The Transmission Control Protocol (TCP) is a network communication protocol that allows data packets to be sent across the Internet.

  • TCP is an OSI transport layer protocol used to connect remote computers by conveying and ensuring message delivery through supporting networks and the Internet.

  • Transmission Control Protocol is a member of the Internet protocol suite, sometimes known as the TCP/IP suite, and is one of the most widely used protocols in digital network communications.

  • TCP is primarily used to assure end-to-end data delivery between different nodes.

  • TCP operates in tandem with Internet Protocol, which determines the logical location of the remote node, while TCP transports and ensures that the data reaches its intended destination.

  • TCP establishes a connection between the source and destination nodes before transmitting data and keeps it alive until the conversation is complete.

  • TCP decomposes massive data into smaller packets and ensures that the data integrity is preserved once it reaches the target node.

What are Sequence Numbers?

The 32-bit sequence number field specifies the number allocated to the segment's first byte of data. TCP is a protocol for transporting data in streams. Each byte to be transmitted is numbered to assure connectivity. Each party generates an initial sequence number (ISN) during connection establishment using a random number generator, which is usually different in each direction. A TCP sequence number is 32 bits long, as we know.

As a result, it has a finite amount of sequence numbers (ranging from 0 to (232-1) = 4 Giga), implying that we will communicate no more than 4GB of data with a unique sequence number.

It aids in assigning a sequence number that is compatible with the other data bytes sent via a TCP connection. Each connection has its own ISN, which is separated by the device.

Wraparound Concept

When there is a considerable volume of traffic, all of the sequence numbers may be used up. Every packet's sequence number must be unique; however, because it is finite (4 Giga), the Sequence Number will be exhausted at some point. When accessible, the sequence numbers that were previously utilized can be reused as needed, and this reusing of sequence numbers is known as the Wrap around an idea.

Wrap around is defined as "using the sequence numbers over and again once all of them have been used up, in order to maintain the continuity of data transport."

This allows you to transfer more and more data without having to worry about how much data you're sending. Because the sequence numbers can be reused, there is no limit to the amount of data that can be stored.

When and how will the Wraparound be used?

For example, if I download a 4GB+ 2 byte software, but the sequence number accessible is only 4GB, the remaining two-byte will not receive a sequence number. In these circumstances, the sequence numbers are wrapped, which means they are utilized repeatedly as needed. The random initial sequence number has an impact on this wrapping. We may receive a lower number of sequence numbers at first, but once all sequence numbers have been spent, the sequence number will reset to 0.

We will obtain 232 sequence numbers from wherever we start utilizing sequence numbers. As a result, we can argue that the wrap idea of the TCP sequence number involves recycling a sequence number as needed.

Wraparound Time

Wraparound time is the amount of time it takes to wrap around. It indicates that if we start with sequence number 0 (or any other number), we will utilize the same sequence number again after how long. The time it takes to start reusing the same sequence number, or the time it takes to repeat the sequence number as needed, is referred to as the "Wrap around time."

The number of sequences and Bandwidth available define the wraparound time. The rate at which bits (sequence number) are utilized is known as the Bandwidth. The faster the rate of consumption, the faster the sequence number is consumed.

$$ \mathrm{Wraparound\:Time =\frac{Total\:Sequence\: Number}{Bandwidth}=\frac{232}{Bandwidth}}$$

How to Reduce the Wraparound Time?

Wrap around time is inversely related to Bandwidth and directly proportional to the number of Sequences (Rate at which data will flow).

  • The more Sequence numbers available, the longer the Wrap around time will be.

  • The longer the wraparound time, the lower the Bandwidth.

As a result, to lower the wraparound time, we must −

  • Reduce the sequence numbers or

  • Increase the available Bandwidth (possible)


Advertisements