Quarry School

Explain a duplicate request

Subject: Computing
Level 1 · FoundationsAbout 5 min read2 new terms
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    A reply can be lost on the way, as a request can.

    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.

    Step

    1. When a card arrives, check it against the protocol; a card that breaks it is put aside without an acknowledgment.

    2. For a usable card, look at the slot of its number.

    3. If the slot is empty, place the card there and send ACK n.

    4. If the slot is filled, the card is a duplicate: leave the slot as it is and send ACK n again.

    5. On the sender's side, cross the piece off at the first ACK n and ignore any later one.

    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.

    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

    EventKai's slot 2Kai sendspiece 2 arrives-AT-ACK 2ACK 2 is lost-AT-—piece 2 again-AT- (kept)ACK 2

    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.

    A lost acknowledgment makes a duplicate

    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

    1. When a card arrives, check it against the protocol; a card that breaks it is put aside without an acknowledgment.
    2. For a usable card, look at the slot of its number.
    3. If the slot is empty, place the card there and send ACK n.
    4. If the slot is filled, the card is a duplicate: leave the slot as it is and send ACK n again.
    5. On the sender's side, cross the piece off at the first ACK n and ignore any later one.

    6 Trace

    Trace a lost acknowledgment for piece 2
    EventAna's listKai's slotsExplanation
    Ana sends 1, 2, 3; all arrive1, 2, 3MEET, -AT-, NOONKai fills all three slots and sends ACK 1, ACK 2, ACK 3.
    ACK 2 is lost; ACK 1 and ACK 3 reach Ana2MEET, -AT-, NOONAna crosses off 1 and 3 only.
    timeout: Ana sends piece 2 again2MEET, -AT-, NOONAna cannot tell that piece 2 arrived.
    the duplicate arrives; the new ACK 2 reaches AnanoneMEET, -AT-, NOONSlot 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
    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.

    Source: University of Canterbury Computer Science Education Research Group, Computer Science Field Guide: Network Communication Protocols, 16.3 Transport layer protocols - TCP, UDP

    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
    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

    1. 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.
    2. AP Computer Science Principles Course and Exam Description. College Board. All rights reserved. Read 2 Dec 2026.