online posts 16
labs

Wireshark 101

Capture real traffic on a small network and read it in Wireshark: ARP, DHCP through a relay, DNS, a TCP connection from SYN to FIN, what TLS shows without decrypting it, then three broken paths to find from the packets alone. Wireshark runs in your browser, nothing to install.

First lab here? Meet the lab shows how every lab works, once.

Networking 101 explained how a laptop gets an address, finds its neighbors and looks up a name. Here you watch it happen, one packet at a time. You capture the traffic, open it in Wireshark, the tool network engineers reach for when the diagrams and the show commands disagree, and read what each protocol actually puts on the wire.

The network

The same home network as Networking 101, set up so there’s something to watch:

NameWhat it is
laptopgets its address from DHCP, and does most of the talking
printer, broken-pctwo more hosts at home. broken-pc causes trouble in chapter 3
sw1the home network’s switch
r1router 1, the home gateway. It relays DHCP to the dns server
r2router 2, in front of the servers
weba web server, with HTTP on port 80 and HTTPS on port 443 for two names
dnsthe DNS server and, in this lab, the DHCP server too

Where Wireshark runs

A codespace has no screen, so Wireshark can’t open a window inside it. Two things make up for that:

  • Capturing is done from outside the nodes, like a tap on a cable: make capture records what crosses one or more ports into a file in captures/.
  • The network is on the lab app’s Topology tab. Hover a cable to see the make capture that records it, and click a device for a terminal on it, in a tab of its own.
  • Reading happens in Wireshark served to your browser, in the lab app’s Wireshark tab: click Start Wireshark there (or run make wireshark). It’s the full desktop Wireshark, version 4.6. If you have Wireshark on your own computer, you can right-click any capture in the Explorer, Download it, and open it there instead.

tshark, Wireshark’s command-line twin, works in every terminal too, and the guide shows it next to the Wireshark steps.

How each task works

The same five parts as Networking 101: explain, show, follow along, challenge, then check. Most tasks start with a capture and end with a few answers you read out of it. make check opens your capture with the same dissectors as Wireshark and works out the right answers for that file, so they match what you see even though your timestamps and port numbers differ from the guide’s.

No lab running? make skip T=<task> copies a reference capture, taken from this same lab, into captures/.

Quick start

  1. Open the lab and sign in with GitHub. The lab is your own copy, in a codespace on your GitHub account's free allowance (what that means). The first start takes a few minutes; coming back takes about one.
  2. The lab opens in your browser: this guide on the left, VS Code on the right, and the network's state at the top. Wait for it to say network up.
  3. Follow task 1.1. Check task, under the guide, tells you when you've got it right.

Finished? Finish lab, top right, deletes the codespace. Left it open? It stops itself after 20 minutes without activity, and Open the lab picks up where you were.

Advanced: run it on your laptop Docker, Git and VS Code
$ git clone https://gitlab.com/networkdoodles-labs/wireshark-101.git
$ cd wireshark-101
$ code .            # then: Reopen in Container
$ make check T=1.1

Same dev container, on your own Docker (4 GB of memory is plenty), and your own Wireshark can open captures/ directly. No dev container? Linux with Docker, containerlab 0.83 or later, Python 3 and make.

8 chapters · 17 tasks

ch 1 What a capture showsYour first capture: a ping, in Wireshark’s three panes. Then the same traffic seen from two switch ports, and why one of them sees almost nothing. 40 min lesson 1
  1. 1.1 Your first captureCapture the laptop pinging the printer, open the file in Wireshark, and read the three panes: the packet list, the details and the bytes. Find out what the laptop sent before its first ping. 20 min
  2. 1.2 Where you captureCapture two switch ports at once, r1’s and the printer’s, while the laptop pings web. See why one port carries the whole conversation and the other only a single broadcast. 20 min
ch 2 FiltersDisplay filters, which hide frames you already have, and capture filters, which decide what gets saved at all. One small operator that behaves differently from what most guides say. 40 min lesson 2
  1. 2.1 Display filtersWrite display filters that pick exactly the right frames out of a busy capture, and learn the one operator, !=, that doesn’t mean what most guides say. 25 min
  2. 2.2 Capture filtersCapture with a capture filter, so only DNS is ever saved, and write two capture filters of your own in BPF, the language capture filters use. 20 min
ch 3 ARPWho has 192.168.1.20? The question, the answer, and the time two hosts answered at once. 30 min lesson 3
  1. 3.1 Who has?Read ARP’s question and answer field by field, and see which address the laptop asks about when the destination is on another network. 15 min
  2. 3.2 Two answersWatch broken-pc claim the printer’s IP address, see two different hosts answer the same ARP question, and let Wireshark’s expert info point it out. 15 min
ch 4 DHCPThe four messages that give the laptop its address, and the router in the middle that carries them to a server two hops away. 35 min lesson 4
  1. 4.1 DORACapture the laptop giving back its address and asking for a new one, find DHCP’s four messages, and read the options in the Offer: the address, the lease, the gateway and the DNS server. 20 min
  2. 4.2 The relayCapture both sides of r1 at once and watch it relay DHCP: a broadcast on the home network becomes an ordinary packet to a server two hops away, with r1’s address written inside. 15 min
ch 5 DNSQuestions and answers, aliases, a name that doesn’t exist, and the extra lookups the resolver makes when you type a short name. 30 min lesson 5
  1. 5.1 Names and answersCapture three lookups, match each question to its answer by transaction ID, and read an address, a TTL, an alias (CNAME) and a name that doesn’t exist. 15 min
  2. 5.2 The search domainType one short name and count the lookups it really causes: the search domain, A and AAAA side by side, a server that refuses, and a retry. 15 min
ch 6 TCPA whole connection, from the handshake to the last FIN, and what a refused one looks like. 35 min lesson 6
  1. 6.1 A whole connectionFollow one web page from the TCP handshake through the request and the answer to the FINs that close it, reading the sequence and acknowledgement numbers that tie it together. 20 min
  2. 6.2 RefusedTell a refused connection from a normal one: a SYN answered by a RST. Find it among three connections by its stream index. 15 min
ch 7 TLSWhat an encrypted connection still shows (the name you asked for, the versions, the cipher), and how to decrypt one of your own. 40 min lesson 7
  1. 7.1 What TLS showsCapture two HTTPS connections and read what encryption leaves in plain sight: the server name (SNI), the versions offered and chosen, the cipher suite and the application protocols. 20 min
  2. 7.2 Decrypt your ownCapture a TLS 1.2 connection, read the server’s certificate in the clear, then give Wireshark the session keys the laptop saved and read the page that was sent encrypted. 20 min
ch 8 A broken pathPacket loss, a fault the lab picks at random, and a black hole that lets ping through but not HTTPS. Capture at two points and find each one. 60 min lesson 8
  1. 8.1 LossMake 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. 20 min
  2. 8.2 The mystery faultThe lab breaks the path to web one of three ways, at random. Capture at three points along the path and find out where the packets stop and why, from the packets alone. 25 min
  3. 8.3 The black holeSomeone turned on jumbo frames on the laptop and on web, but not on the network between them. Ping works and HTTPS hangs. Find the frame that never gets through, and where it disappears. 20 min