Quarry School

Use acknowledgments in a paper protocol

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 teacher who gets no answer says a name again.

    Rule

    In the card protocol, which carries one message at a time, the receiver sends ACK n for each usable piece n, and the sender keeps a list of pieces not yet acknowledged, removes a piece when its acknowledgment arrives, and sends a piece again when its time runs out. The sender knows every piece has arrived when every piece has been sent and its list is empty; the receiver may hold them all sooner.

    Step

    1. Write each piece on the sender's list of pieces sent and not yet acknowledged, then send it and start its wait.

    2. On the receiver's side, check each card against the protocol, place it in its slot as in the last lesson (a slot already filled keeps its first card, as the next lesson shows), and send ACK n for each usable card.

    3. For each acknowledgment that reaches the sender, cross its piece off the list.

    4. When a piece's wait runs out and the piece is still on the list, send it again and start its wait again.

    5. Stop when every piece has been sent and the sender's list is empty.

    Trap

    Waiting forever for an answer stalls the whole message. Without a timeout, a lost piece is never sent again.

    Acknowledging a card before checking it defeats the purpose. An acknowledgment says the piece arrived and is usable; a card that fails the format checks is not acknowledged. The checks cannot catch every change: NOON turned into SOON on the way still passes them.

    1 In plain words

    A teacher who gets no answer says a name again. TCP does the same with a packet that got no answer.

    In the Field Guide's description, TCP uses acknowledgments: messages sent back to tell the sender that a packet arrived and is usable. If no answer comes back within a set time, a timeout, the sender sends the packet again. The card protocol uses only acknowledgments, so a piece with no ACK in time is sent again. Its ACK n for each piece is a simplified rule of this unit's own.

    The card protocol adds one rule for each side. The receiver answers every usable card with an acknowledgment card, ACK n, for its piece number. The sender keeps a list of the pieces not yet acknowledged and sends each of them again when its time runs out. Two people send one message at a time, so every ACK card belongs to the message being sent.

    Remember one sentence: no acknowledgment in time means send it 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

    EventAna's listKai holdssends 1, 2, 31, 2, 3—ACK 1 and ACK 321, 3resend 221, 3ACK 2none1, 2, 3

    A table of Ana sending three pieces to Kai. Ana sends pieces 1, 2 and 3, and her list of pieces not yet acknowledged holds all three. Piece 2 is lost; ACK 1 and ACK 3 come back, leaving 2 on her list while Kai holds 1 and 3. Her time runs out and she sends piece 2 again. ACK 2 comes back, her list is empty and Kai holds all three. The timeout row is marked.

    Piece 2 is lost and sent again

    3 Why

    The sender cannot see the far end. In the card protocol an acknowledgment is the only news that a piece arrived usable, so a piece without one is treated as lost.

    Acknowledgments travel in the opposite direction from the data, which gives the receiver a way to report back. The sender's list shrinks with the first acknowledgment of each piece; a later ACK for a piece already crossed off changes nothing. Once every piece has been sent, the list is empty only when every piece is known to have arrived.

    The timeout is the last defense: it covers a lost piece and a lost acknowledgment alike, because in both cases the sender hears nothing.

    4 The rule

    In the card protocol, which carries one message at a time, the receiver sends ACK n for each usable piece n, and the sender keeps a list of pieces not yet acknowledged, removes a piece when its acknowledgment arrives, and sends a piece again when its time runs out.

    The sender knows every piece has arrived when every piece has been sent and its list is empty; the receiver may hold them all sooner.

    5 How

    1. Write each piece on the sender's list of pieces sent and not yet acknowledged, then send it and start its wait.
    2. On the receiver's side, check each card against the protocol, place it in its slot as in the last lesson (a slot already filled keeps its first card, as the next lesson shows), and send ACK n for each usable card.
    3. For each acknowledgment that reaches the sender, cross its piece off the list.
    4. When a piece's wait runs out and the piece is still on the list, send it again and start its wait again.
    5. Stop when every piece has been sent and the sender's list is empty.

    6 Trace

    Trace Ana sending MEET-AT-NOON to Kai when piece 2 is lost
    EventAna's listKai's slotsExplanation
    Ana sends pieces 1, 2, 31, 2, 3_, _, _Every piece starts on the list.
    piece 2 is lost1, 2, 3_, _, _Nothing tells Ana yet.
    pieces 1 and 3 arrive; ACK 1 and ACK 3 reach Ana2MEET, _, NOONKai sends ACK 1 and ACK 3, and Ana crosses off 1 and 3 as they arrive.
    timeout for piece 2: Ana sends it again2MEET, _, NOONPiece 2 is still on the list when its time runs out.
    piece 2 arrives; ACK 2 reaches AnanoneMEET, -AT-, NOONThe list is empty and the message is complete.

    7 The trap

    Waiting forever for an answer stalls the whole message. Without a timeout, a lost piece is never sent again.

    Acknowledging a card before checking it defeats the purpose. An acknowledgment says the piece arrived and is usable; a card that fails the format checks is not acknowledged. The checks cannot catch every change: NOON turned into SOON on the way still passes them.

    Quick checks

    Quick check 1 of 2

    Ana sends pieces 1 to 4. She receives ACK 1, ACK 2 and ACK 4. Which piece does she send again when its time runs out?

    Show the steps and the answer
    Answer

    Piece 3.

    Why: Pieces 1, 2 and 4 are crossed off her list. Only piece 3 is still waiting for an acknowledgment.

    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

    Ana sends a 3-piece message and piece 2 is lost once, as in the trace. How many data cards does she send in all, and how many acknowledgment cards does Kai send?

    Show the steps and the answer
    Answer

    Ana sends 4 data cards, and Kai sends 3 acknowledgment cards.

    Why: Pieces 1, 2 and 3 plus the second copy of piece 2 make 4. Kai acknowledges each of the 3 pieces once, when it arrives.

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

    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.