Username:
Password:
TCP/IP Packet Analysis Tutorials

Basics of TCP & UDP Protocols / TCP Sequence Numbers

Subtitles of the Movie

Another component of TCP that we'll talk about is the sequence number. Now, TCP uses sequence numbers to track each segment that it sent or is received in the TCP conversation; a TCP session. All sequence numbers are are one-up numbers that are serially assigned to each segment that the host computer, the sending computer sends. Now, the sending computer and the receiving computer use these sequence numbers to keep track of each segment. They use them to determine if what has been sent has actually been received. Now, one thing you should probably know is different TCP/IP Stack implementations on the various OSs, such as Windows and Linux and so forth, use different methods to come up with these sequence numbers. But regardless of the OS, the sequence number is a 32-bit number, usually a random number, and it's incremented by one for each segment sent. So the first segment sent could be number 50, the second could be 52, 53 and so forth. So it's in order. Now, the sender sequence numbers are sent to the receiver and the receiver will send back a reply and in that reply the receiver will include the sender's sequence number and it'll add one on to that so it'll be the sequence number plus one to indicate which segment number is expected next. Now, if when that gets sent back to the sender, if that sequence number's not what it expects to send out next, then it will resend what the receiver thinks it needs to get. That tells the sender that hey, I didn't get that last sequence. So it will resend it. So in that way, the TCP sequence numbers help the sender and receiver keep track of all the segments that are sent and received and make sure that in the end, all the segments that got sent by the sender got received by the receiver. Now, additionally the receiver also uses these sequence numbers to order the packets back in the correct sequence for higher-layer application protocols. So it sends the packets up the OSI Stack in the correct sequence for the proper application to use. Now, this may seem a little bit fuzzy, but in a moment we're going to do a demonstration that will show you exactly how sequence numbers work.

Tutorial Information

Course: TCP/IP Packet Analysis
Author: Bobby Rogers
SKU: 33909
ISBN: 1-934743-95-X
Release Date: 2008-09-11
Duration: 5 hrs / 60 lessons
Work Files: Yes
Captions: Available on CD and Online University
Compatibility: Vista/XP/2000, OS X, Linux
QuickTime 7, Flash 8

VTC Sign up & Benefits

  • Unlimited Access
  • 81,350 Video Tutorials (20,800 free)
  • Video Available as Flash or QuickTime
  • Over 782 Courses
  • $30 for One Month Access
  • Multi-User Discounts Available