# Q4(a) · Alternating-bit data and ACK sequence

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/papers/paper-2023-jan-ai-reexam/q4a

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/papers/paper-2023-jan-ai-reexam--q4a/

Exact historical variant. Current-syllabus questions solved; excluded topics and source limitations stated.

### Q4(a). Use the printed rdt3.0 alternating-bit sender/receiver: S0 sends data0; S3 accepts ACK0; S5 sends data1; S8 accepts ACK1; S2/S7 are timeout retransmissions; S1/S6 ignore corrupt or wrong ACKs. Receiver R0 accepts new data0 and sends ACK0; R2 accepts new data1 and sends ACK1; R3/R1 handle corrupt or duplicate data while waiting for 0/1 respectively. Timeline: data at t=0 arrives correctly at t=1; ACK arrives at sender t=2. New data sent t=2 arrives t=3, but its ACK is lost. Timeout just after t=4 resends that data, received at t=5; ACK reaches sender t=6. Data sent at t=6 is corrupted on arrival t=7, and its ACK reaches sender t=8. Give the interleaved numbers for data at t=2, ACK at t=3, timeout data after t=4, ACK at t=5, data at t=6, ACK at t=7. Justify. [10 marks]

### Answer

### Given

The complete timeline in the question, starting with data0 at t=0.

### To find

Six interleaved DATA/ACK numbers.

### Formula and why

Advance DATA sequence only after a correct matching ACK. On timeout resend the same sequence; on duplicate or corrupt data repeat the last successful ACK.

This keeps lost ACKs from causing duplicate application delivery.

### Solution

The sequence bit labels the outstanding DATA packet. ACK0 confirms data0 and ACK1 confirms data1 in this printed FSM; these are not TCP cumulative byte numbers. An ACK loss does not advance the sender. A duplicate data packet is acknowledged again but not delivered twice.

| Event | Number | Reason |
| --- | --- | --- |
| t2 data | 1 | ACK0 has arrived; next DATA is1 |
| t3 ACK | 1 | Receiver accepted data1 |
| after t4 timeout data | 1 | ACK1 lost; sender resends1 |
| t5 ACK | 1 | Duplicate data1: re-ACK1, do not redeliver |
| t6 data | 0 | ACK1 now arrives; wrap to0 |
| t7 ACK | 1 | Data0 corrupt: receiver still expects0 and repeatsACK1 |

**Answer: 1, 1, 1, 1, 0, 1.** At t8 ACK1 is wrong for outstanding data0, so S1 ignores it; the next timeout retransmits0.
