Introduction to TCP and UDP

Hello Irfan

In your three steps that you shared, in step 2, you said that H2 sent an ACK of 1. This ACK states that it is expecting the next segment to start with sequence number 1.

When H1 sends an ACK back in step 3, it must thus send a SEQ equal to 1. That’s what H2 is expecting, that’s what H2 asked for with its ACK=1. So this is why the third part of the three way handshake has SEQ=1.

SEQ of 1 was not sent in 1. SEQ was equal to 0 in step 1.

That’s correct. In fact we have two different and independent sequence numbers that are incremented. We have the SEQ sent by H1 and the SEQ sent by H2. These are not the same. So the SEQ value of 1 that H2 sends in the next reply (not shown) is incremented from H2’s initial SYN ACK. Does that make sense?

Yes, this is indeed the case. The ACK number sent back to the sender tells the sender which byte it is expecting. This is important to keep the segments in order and to ensure error checking and TCP windowing.

I hope this has been helpful!

Laz

1 Like