TCP Header-Sequence Number-Acknowledgement Number
Duration: 13 min
This video lesson is available to enrolled students.
AI Summary
An AI-generated summary of this video lecture.
This educational video provides a comprehensive lecture on TCP sequence numbers and byte numbering mechanisms. The instructor begins by defining the sequence number as a 32-bit field used to number every byte transmitted in a TCP stream. He explains that numbering is independent in each direction and starts with a random Initial Sequence Number (ISN) to prevent duplication. The lecture then transitions to a practical example involving a 5000-byte file transfer, demonstrating how to calculate sequence numbers for multiple segments. Finally, the concept of sequence number wrap-around is introduced to explain how TCP handles data transmission exceeding the 4GB limit of a 32-bit field.
Chapters
0:00 – 2:00 00:00-02:00
The session opens with a slide titled 'Sequence number,' where the instructor defines TCP as a stream transport protocol. He points out that to ensure connectivity, each byte to be transmitted is numbered. The slide explicitly states that the 'Sequence number is 32-bit field defines the number assigned to the first byte of data contained in this segment.' The instructor highlights that the maximum number of possible sequence numbers is 2^32, lying in the range [0, 2^32 - 1]. He contrasts this with IP, where packets are counted, and DLL, where bits are counted with HDLC. A key point made is that during connection establishment, a random number generator creates an Initial Sequence Number (ISN), which is usually different in each direction to remove duplication problems. The instructor also notes that the sequence number of any other segment is the sequence number of the previous segment plus the number of bytes carried by the previous segment. A diagram of the TCP segment structure is visible, showing the 'Sequence number 32 bits' field.
2:00 – 5:00 02:00-05:00
The lecture moves to a slide titled 'Byte Number.' The instructor underlines the text 'Numbering is independent in each direction,' emphasizing that sender and receiver have separate numbering spaces. He explains that when TCP receives bytes of data from a process, it stores them in the sending buffer and numbers them. The slide notes that 'The numbering does not necessarily start from 0.' Instead, 'TCP chooses an arbitrary number between 0 and 2^32 - 1 for the number of the first byte.' The instructor elaborates that this arbitrary start is crucial for security and preventing old duplicate segments from being accepted. He gestures towards the text to reinforce that the numbering is per connection and independent, meaning the sequence numbers for data sent from A to B are distinct from those sent from B to A.
5:00 – 10:00 05:00-10:00
The instructor presents a specific problem on a digital whiteboard: 'Example: Suppose a TCP connection is transferring a file of 5000 bytes. The first byte is numbered 10001. What are the sequence numbers for each segment if data are sent in five segments, each carrying 1000 bytes?' He draws five boxes to represent the segments. He writes 'S' for Sender and 'R' for Receiver. He calculates the sequence numbers for each segment sequentially. For the first segment, the sequence number is 10,001, covering bytes 10,001 to 11,000. For the second segment, it is 11,001, covering 11,001 to 12,000. He continues this pattern, writing 12,001, 13,001, and 14,001 for the subsequent segments. He writes the byte ranges next to each segment box, such as '10,001 - 11,000' and '14,001 - 15,000'. He circles the starting number 10001 and the final byte number 15,000 to show the total span. This visual demonstration clarifies how the sequence number increments by the number of bytes carried in the previous segment.
10:00 – 12:50 10:00-12:50
The final section addresses the limitation of the 32-bit sequence number. A slide states, 'This does not imply that only 2^32 bytes = 4 GB data can be sent using TCP. The concept of wrap around allows to send unlimited data using TCP.' The instructor draws a large circle to represent the sequence number space, labeling it with '2^32 - 1' and '4 GB'. He explains that 'After all the 2^32 sequence numbers are used up and more data is to be sent, the sequence numbers can be wrapped around and used again from the starting.' He connects this back to the previous example, showing how the sequence numbers increment. He emphasizes that while the field is 32 bits, the wrap-around mechanism allows for continuous data transmission without running out of numbers, effectively treating the sequence space as a circular buffer.
The video effectively bridges theoretical definitions with practical application. It starts by establishing the 32-bit nature of TCP sequence numbers and the importance of random ISNs. It then solidifies understanding through a step-by-step calculation of sequence numbers for a multi-segment transfer. Finally, it resolves the apparent 4GB limitation by introducing the wrap-around concept, ensuring students understand that TCP can handle large file transfers despite the finite size of the sequence number field.