ExerciseDifficulty: Advanced1 min

Practice: Tracing Sequence and Acknowledgement Numbers

A handshake, two data segments of 100 and 200 bytes, and one loss; give every number.

Tracing the numbers on each segment is how TCP's behaviour is read in a packet capture. A client opens a connection with initial sequence number 3000, and the server chooses 8000. The client then sends two segments of data, A with 100 bytes and B with 200 bytes. Segment A is lost; B arrives. The client resends A, and it arrives.

Fill in the blanks, in order:

  1. The client's SYN: seq ____.
  2. The server's SYN-ACK: seq ____, ack ____.
  3. The client's ACK: seq ____, ack ____.
  4. Segment A: seq ____. Segment B: seq ____.
  5. The server's acknowledgement after B arrives: ack ____.
  6. The server's acknowledgement after A is resent: ack ____.
Show the answers
  1. SYN seq 3000, the client's initial sequence number.
  2. SYN-ACK seq 8000, ack 3001. The SYN uses one sequence number, so the next byte expected is 3001.
  3. ACK seq 3001, ack 8001, by the same rule for the server's SYN.
  4. A seq 3001, B seq 3101. A holds bytes 3001 to 3100, so B starts at 3101.
  5. ack 3001. B arrived, but byte 3001 is still missing, so the server repeats the acknowledgement for the first byte it wants.
  6. ack 3301. With A in place, every byte up to 3300 has arrived: B's 200 bytes end at 3300.