task 8.1 · chapter 8 of 8: a broken path · 20 min
Loss
objective
Make the link between the routers lose 3% of its packets, capture a download, and read how TCP notices and repairs the gaps: duplicate ACKs, retransmissions, and Wireshark’s expert info.
answers/8.1.ymlopen a file in VS Code: Ctrl+P (Cmd+P on a Mac), type its name, Enter
| The fault | make break X=loss: r2 drops 3% of what it sends towards r1 |
|---|---|
| Capture | make capture AT=laptop:eth1 NAME=8.1 X=big: the laptop downloads 2 MB from web |
| Afterwards | make fix |
| Your answers | answers/8.1.yml |
new to this? step by stepbeginner
make break X=loss, thenmake capture AT=laptop:eth1 NAME=8.1 X=big, thenmake fix.- Filter
tcp.analysis.retransmission: count them, and see who sent them. - Challenge: filter
tcp.analysis.duplicate_ackand count. Open Analyze › Expert Information. - Fill in answers/8.1.yml, then
make check T=8.1.
more in meet the lab
How TCP repairs a gap
A lossy link still works
A link that loses a few percent of its packets doesn’t look broken. Pages load, downloads finish, ping mostly answers. Everything is just slower, and nobody can say why. It’s one of the most common network complaints, and one of the hardest to see from a show command. A capture shows it plainly, because TCP has to do something about every lost packet, and that something is on the wire.
What TCP does about it
web sends the download as a stream of numbered segments (chapter 6). Say one goes missing:
- The laptop receives the segments after it, but not the missing one. It can only acknowledge everything up to the gap, so it sends the same ACK again, and again, for every segment that arrives after it: duplicate ACKs.
- After three duplicate ACKs, web concludes the segment was lost (not just late) and sends it again at once, without waiting for a timeout: a fast retransmission.
- The laptop fills the gap and acknowledges everything it has: the ACK number jumps forward.
Modern TCP also uses SACK (selective acknowledgement): each duplicate ACK lists the blocks the laptop did receive past the gap, so web only resends what’s really missing.
in one sentence Loss shows up as a burst of duplicate ACKs from the receiver, then a retransmission from the sender.
Wireshark keeps score
Wireshark tracks every TCP stream and flags what it notices, under tcp.analysis:
| Flag | Meaning |
|---|---|
tcp.analysis.lost_segment | Previous segment not captured: a gap in the sequence numbers |
tcp.analysis.duplicate_ack | an ACK the receiver already sent |
tcp.analysis.retransmission | data sent again (fast retransmissions included) |
tcp.analysis.fast_retransmission | resent after duplicate ACKs, not a timeout |
tcp.analysis.out_of_order | data that arrived after data with higher numbers |
tcp.analysis.flags matches all of them at once. They’re also summed up in Analyze › Expert Information.
One lost segment
From the reference capture, one gap and its repair:
35 192.168.2.10 [TCP Previous segment not captured] 80 → 56336 [ACK] Seq=17623 Ack=79 Win=65152 Len=1448
36 192.168.1.175 [TCP Dup ACK 34#1] 56336 → 80 [ACK] Seq=79 Ack=16175 ... SLE=17623 SRE=19071
38 192.168.1.175 [TCP Dup ACK 34#2] 56336 → 80 [ACK] Seq=79 Ack=16175 ... SLE=17623 SRE=20519
40 192.168.1.175 [TCP Dup ACK 34#3] 56336 → 80 [ACK] Seq=79 Ack=16175 ... SLE=17623 SRE=21967
...
58 192.168.2.10 [TCP Fast Retransmission] 80 → 56336 [ACK] Seq=16175 Ack=79 Win=65152 Len=1448
Read it: frame 35 jumps from 16,175 to 17,623, so 1,448 bytes are missing. The laptop keeps saying Ack=16175: I
still need byte 16,175, and its SACK block (SLE to SRE) grows as later segments arrive. Then web resends
Seq=16175.
Break it, capture, count
Turn the loss on:
run in the terminalmake break X=lossIt uses containerlab’s link impairments (
containerlab tools netem) on r2’s port towards r1.Capture the laptop downloading a 2 MB file from web:
run in the terminalmake capture AT=laptop:eth1 NAME=8.1 X=bigIt still works: curl prints how many bytes it got, and how long it took.
Turn the loss off again:
run in the terminalmake fixOpen
/captures/8.1.pcapng, filtertcp.analysis.retransmission, and read the Displayed count and the source address.Fill in the follow-along lines:
editanswers/8.1.ymlCtrl+P → 8.1.ymlretransmissions: 26 # count yours: the loss is random retransmitted_by: 192.168.2.10
The receiver’s side
dup_acks: how many duplicate ACKs the laptop sent.
Then open Analyze › Expert Information and compare its counts with your filters. And one question to think about: you captured on the laptop’s cable, but the loss was between r2 and r1. How could you prove where the packets went missing?
hint
Filter tcp.analysis.duplicate_ack.
show the solutionanswers/8.1.yml
or pull it into your lab: make solve T=8.1, then git diff --staged shows what changed
dup_acks: 142 # count yours
About five duplicate ACKs for every retransmission in the reference capture. The receiver is noisy about loss; the sender is quiet and efficient.
To find where: capture on both sides of each link at once, the way you did with r1 in task 4.2. A segment
that’s on r2:eth2 but not on r1:eth2 went missing in between. That’s task 8.2.
5 check: run it, then prove it
$ make check T=8.1when it's right, you'll see
╭─ task 8.1 · loss
│ ✓ captures/8.1.pcapng: taken on laptop:eth1, ... frames
│ ✓ the capture has retransmissions: the loss was on
│ ✓ how many retransmissions (follow along): ...
│ ✓ who had to send again (follow along): 192.168.2.10
│ ✓ how many duplicate ACKs (challenge): ...
╰─ 5/5 checks passed verified