Categories
Welcome Center
Education & Development
Discussions
Certification Preparation
Recent Posts
Groups
Free Resources
Ebooks
Free Workshops
Trending Certifications Infographic
Infosec Training
IT & Security Training
Live Boot Camps
Security Awareness Training
About Infosec Institute
Home
Certification Preparation
Cisco
CCST & CCNA (Entry-level & Associate)
Calculating Seq & Ack number
fluk3d
I'm having a brain fart when trying to figure out how to calculate the seq & ack number after the 3-way handshake has been established. I started looking @
Understanding TCP Sequence and Acknowledgment Numbers - Packet Life
however; it lost me. Does anyone have a simple explanation with an example preferably
thank you
Find more posts tagged with
Save $250 on 2025 certification boot camps from Infosec!
Book now with code EOY2025
Button
Comments
fluk3d
Essentially after starring at my book if someone can confirm
the next ack is calculated by
sequence number + length = confirmation of ack
Roguetadhg
I think you're talking about Sliding windows?
The Acknowledgement will say "Thank you I got the packet of X, go ahead and send me X and Y more."
It bounces around though.
It's like like how copying a file on windows will say "5 Hours" but then it'll cut down to "15 minutes", or may go back up to "2 Hours" depending on what the resources are available to send the information.
If memory serves me right that is. I don't have my ICND1 book with me.
Edit 1:
SYN
: The active open is performed by the client sending a SYN to the server. It sets the segment's sequence number to a random value A.
SYN-ACK
: In response, the server replies with a SYN-ACK. The acknowledgment number is set to one more than the received sequence number (A + 1), and the sequence number that the server chooses for the packet is another
random number, B
.
ACK
: Finally, the client sends an ACK back to the server. The sequence number is set to the received acknowledgement value i.e. A + 1, and the acknowledgement number is set to one more than the received sequence number i.e. B + 1.
From different sources, including wiki (take it as it is), the server doesn't know what number will be next.
Edit 2:
Im seeing from here that your original answer is correct:
http://www.rhyshaden.com/tcp.htm
Host 2 receives the
SYN
with the Sequence number
A
and sends a
SYN
segment with its own totally independent ISS number
B
in the Sequence number field. In addition, it sends an increment on the Sequence number of the last received segment (i.e.
A+x
where
x
is the number of octets that make up the data in this segment) in its Acknowledgment field. This
Acknowledgment
number informs the recipient that its data was received at the other end and it expects the next segment of data bytes to be sent, to start at sequence number
A+x
. This stage is aften called the
SYN-ACK
. It is here that the
MSS
is agreed.
Host 1 receives this
SYN-ACK
segment and sends an
ACK
segment containing the next sequence number (
B+y
where
y
is the number of octets in this particular segment), this is called
Forward Acknowledgement
and is received by Host 2. The
ACK
segment is identified by the fact that the
ACK
field is set. Segments that are not acknowledged within a certain time span, are retransmitted.
So yeah... I would assume you're correct. I've quickly skimmed different websites to find a correct answer for you. So yep, you're right. After the initial connect [Random, sometimes obscenely high, number high generated?], it's incremented upwards.
Sources:
http://support.novell.com/techcenter/articles/nc2001_05e.html
http://stackoverflow.com/questions/692880/tcp-how-are-the-seq-ack-numbers-generated
http://support.microsoft.com/kb/169292
http://ask.wireshark.org/questions/2145/how-do-tcp-sequence-and-acknowledgement-numbers-work
http://ssfnet.org/Exchange/tcp/tcpTutorialNotes.html
I hope these help you some. There's a lot of information to read through if you're interested more. Although, like everything on the internet - it may not be true.
fluk3d
Thanks for looking into that !
Quick Links
All Categories
Recent Posts
Activity
Unanswered
Groups
Best Of
INFOSEC Boot Camps
$250
OFF
Use code
EOY2025
to receive $250 off your 2025 certification boot camp!
BROWSE BOOT CAMPS