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:
| Name | What it is |
|---|---|
| laptop | gets its address from DHCP, and does most of the talking |
| printer, broken-pc | two more hosts at home. broken-pc causes trouble in chapter 3 |
| sw1 | the home network’s switch |
| r1 | router 1, the home gateway. It relays DHCP to the dns server |
| r2 | router 2, in front of the servers |
| web | a web server, with HTTP on port 80 and HTTPS on port 443 for two names |
| dns | the 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 capturerecords what crosses one or more ports into a file incaptures/. - The network is on the lab app’s Topology tab. Hover a cable to see the
make capturethat 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
- 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.
- 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.
- 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.1Same 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
- 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.
- 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.
- 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. - 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.