Skip to main content
AP CSP course

F22 · Topic 4.1

Packet journey

Deliver packets out of order, detect missing sequence numbers and explain the difference between a routing model and a reliable transport protocol.

1. Predict first

Packets 1…4 contain Meet/by/the/gate. Deliver 4,1,3. Which positions are held, what is missing, and can the whole message be reconstructed?

Change it · step through · explain

Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.

Ready · Make a prediction

Ready to experiment
  1. Input 14,1,3Waiting

Ready to experiment

Why: Predict the first change, then advance one step.

Try this: Compare 1,1,1,1 with 4,2,1,3. Both have four deliveries; only one has every position.

2. Build your procedure

Describe a receiver that records unique sequence numbers, ignores duplicate deliveries and reassembles only when all four positions exist. Propose a real-protocol response to a missing packet.

Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.

3. Check boundaries

Public worked tests for the fixed model
InputExpectedWhy this case
4,1,3Missing 2; incompleteAn out-of-order partial delivery.
4,1,3,2Meet by the gateSequence metadata supports reassembly.
1,1,2,3Missing 4; duplicate 1 does not completeCount unique positions, not deliveries.

4. Explain and reflect

Why might packets from the same message arrive in a different order, and why is the Web not the name for the whole Internet?

Model limits: Four fixed packets and supplied delivery order; no actual network traffic, encryption, congestion, timing or retransmission is simulated.

Teacher guidance and scoring