online posts 16
wireshark 101

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.

you edit, in the labanswers/8.1.yml

open a file in VS Code: Ctrl+P (Cmd+P on a Mac), type its name, Enter

given
The faultmake break X=loss: r2 drops 3% of what it sends towards r1
Capturemake capture AT=laptop:eth1 NAME=8.1 X=big: the laptop downloads 2 MB from web
Afterwardsmake fix
Your answersanswers/8.1.yml
new to this? step by stepbeginner
  1. make break X=loss, then make capture AT=laptop:eth1 NAME=8.1 X=big, then make fix.
  2. Filter tcp.analysis.retransmission: count them, and see who sent them.
  3. Challenge: filter tcp.analysis.duplicate_ack and count. Open Analyze › Expert Information.
  4. Fill in answers/8.1.yml, then make check T=8.1.

more in meet the lab

1 explain

How TCP repairs a gap

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:

  1. 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.
  2. 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.
  3. 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:

FlagMeaning
tcp.analysis.lost_segmentPrevious segment not captured: a gap in the sequence numbers
tcp.analysis.duplicate_ackan ACK the receiver already sent
tcp.analysis.retransmissiondata sent again (fast retransmissions included)
tcp.analysis.fast_retransmissionresent after duplicate ACKs, not a timeout
tcp.analysis.out_of_orderdata 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.

2 show

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.

3 follow along

Break it, capture, count

  1. Turn the loss on:

    run in the terminal
    make break X=loss
    

    It uses containerlab’s link impairments (containerlab tools netem) on r2’s port towards r1.

  2. Capture the laptop downloading a 2 MB file from web:

    run in the terminal
    make capture AT=laptop:eth1 NAME=8.1 X=big
    

    It still works: curl prints how many bytes it got, and how long it took.

  3. Turn the loss off again:

    run in the terminal
    make fix
    
  4. Open /captures/8.1.pcapng, filter tcp.analysis.retransmission, and read the Displayed count and the source address.

  5. Fill in the follow-along lines:

    editanswers/8.1.ymlCtrl+P → 8.1.yml
    retransmissions: 26      # count yours: the loss is random
    retransmitted_by: 192.168.2.10
    
4 challenge

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

when 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