Explain a duplicate request
Quick review (2 minutes)
A reply can be lost on the way, as a request can.
When a lost acknowledgment leaves a piece on the sender's list as its wait runs out, the sender sends it again; if that copy arrives, the receiver gets a duplicate. In the card protocol the receiver recognizes a duplicate because the slot of its number is already filled, keeps the copy it has, and sends the acknowledgment again.
When a card arrives, check it against the protocol; a card that breaks it is put aside without an acknowledgment.
For a usable card, look at the slot of its number.
If the slot is empty, place the card there and send
ACK n.If the slot is filled, the card is a duplicate: leave the slot as it is and send
ACK nagain.On the sender's side, cross the piece off at the first
ACK nand ignore any later one.
Treating a duplicate as a new piece breaks the message. Appending the second -AT- would give MEET-AT-NOON-AT-. Place by number, and a filled slot stays as it is.
Ignoring a duplicate without acknowledging it again can leave the sender waiting: if no acknowledgment reaches it, its time runs out again and it keeps resending. Answer every usable copy.
1 In plain words
A reply can be lost on the way, as a request can. When a reply is lost and no other reply reaches the sender before its wait runs out, the sender repeats a message the receiver already has.
If an acknowledgment is lost and no other acknowledgment for that piece arrives, the sender's wait runs out and it sends the piece again, and if that copy arrives, the receiver gets a duplicate. TCP recognizes duplicates and ignores them.
The card protocol adds the receiver's last rule: a usable card whose slot is already filled is a duplicate. The receiver keeps the copy it has, puts the new one aside, and sends ACK n again, so the sender can cross the piece off.
Remember one sentence: same number, same piece, so keep one and acknowledge again. To look it up, see section 16.3.1 of the Computer Science Field Guide's chapter on network communication protocols.
2 Picture it
A table of piece 2 arriving twice. Piece 2 arrives and fills slot 2 with -AT-, and Kai sends ACK 2. ACK 2 is lost. Ana's time runs out and piece 2 arrives again; slot 2 keeps the -AT- it holds, and Kai sends ACK 2 again. The last row is marked.
3 Why
From the sender's side, a lost piece and a lost acknowledgment look the same: no answer. So the timeout sends the piece again in both cases, and some resends are duplicates.
The piece number shows a duplicate: the slot of that number is already filled. Keeping the first copy and ignoring the second leaves the message unchanged. Acknowledging the duplicate again matters when the sender is still waiting for an answer to that piece, as it is when the first acknowledgment was lost.
Resending is one way a network tolerates faults. Another is redundancy, such as more than one path between two devices, so that a failed path does not cut them off.
4 The rule
When a lost acknowledgment leaves a piece on the sender's list as its wait runs out, the sender sends it again; if that copy arrives, the receiver gets a duplicate.
In the card protocol the receiver recognizes a duplicate because the slot of its number is already filled, keeps the copy it has, and sends the acknowledgment again.
5 How
- When a card arrives, check it against the protocol; a card that breaks it is put aside without an acknowledgment.
- For a usable card, look at the slot of its number.
- If the slot is empty, place the card there and send
ACK n. - If the slot is filled, the card is a duplicate: leave the slot as it is and send
ACK nagain. - On the sender's side, cross the piece off at the first
ACK nand ignore any later one.
6 Trace
| Event | Ana's list | Kai's slots | Explanation |
|---|---|---|---|
| Ana sends 1, 2, 3; all arrive | 1, 2, 3 | MEET, -AT-, NOON | Kai fills all three slots and sends ACK 1, ACK 2, ACK 3. |
| ACK 2 is lost; ACK 1 and ACK 3 reach Ana | 2 | MEET, -AT-, NOON | Ana crosses off 1 and 3 only. |
| timeout: Ana sends piece 2 again | 2 | MEET, -AT-, NOON | Ana cannot tell that piece 2 arrived. |
| the duplicate arrives; the new ACK 2 reaches Ana | none | MEET, -AT-, NOON | Slot 2 is filled, so the copy is ignored. The new ACK 2 empties Ana's list. |
7 The trap
Treating a duplicate as a new piece breaks the message. Appending the second -AT- would give MEET-AT-NOON-AT-. Place by number, and a filled slot stays as it is.
Ignoring a duplicate without acknowledging it again can leave the sender waiting: if no acknowledgment reaches it, its time runs out again and it keeps resending. Answer every usable copy.
Quick checks
Quick check 1 of 2
Kai's slots for a 3-piece message hold MEET, -AT- and NOON. A card To Kai, From Ana, Piece 3 of 3, Data NOON arrives. What should Kai do?
Show the steps and the answer
Keep the NOON already in slot 3, put the new card aside as a duplicate, and send ACK 3 again.
Why: The card follows the protocol, but slot 3 is already filled, so under the card protocol it is a duplicate: the same piece has arrived twice.
Quick check 2 of 2
Two offices are joined by a single cable. Why does adding a second, separate path between them make the connection more fault-tolerant?
Show the steps and the answer
If one path fails, data can still travel by the other, so the offices stay connected.
Why: Redundancy, extra components such as a second path, lets a system keep working when one component fails.
Source: College Board, AP Computer Science Principles Course and Exam Description
Sources
- Computer Science Field Guide: Network Communication Protocols, 16.3 Transport layer protocols - TCP, UDP. University of Canterbury Computer Science Education Research Group. CC BY-SA 4.0. Read 2 Dec 2026.
- AP Computer Science Principles Course and Exam Description. College Board. All rights reserved. Read 2 Dec 2026.