Network Bytes · Episode 74 · CCNA 1.5
"Packet capture basics (Wireshark)"
A packet capture records every packet that crosses your network interface, like a security camera for your network. With the free tool Wireshark you pick an interface, press start, read one row per packet, open any packet layer by layer and use a filter such as dns to keep only what you need, always on networks you own or have permission to test.
A security camera for your network
Commands like ping or traceroute answer one question and give you a summary: it works, or it doesn't. A packet capture is different. It records a copy of every packet that crosses a network interface, with a timestamp, so you can go back and see exactly what was sent and received. When a summary says "something is wrong", a capture shows you what is wrong.
Wireshark is the best-known free, open-source packet analyzer. Its command-line cousin, tcpdump, does the same job in a terminal and is common on servers.
Start a capture
- Pick an interface. Your computer may have several: Wi-Fi, Ethernet, a VPN adapter. Choose the one the traffic actually uses.
- Press start. Packets begin to scroll past, one row each.
- Read the columns. Every row shows the time (seconds since the capture started), the source and destination addresses, and the protocol (DNS, TCP, TLS and so on), plus a short info line.
Capturing usually needs administrator rights, and on Windows a capture driver (Npcap) that the installer offers. On a switched network you normally see only your own traffic plus broadcasts and multicasts; to watch other devices, network engineers use a SPAN (mirror) port or a network tap.
Open a packet layer by layer
Click any row and the details pane opens it up like envelopes inside envelopes:
- Ethernet (layer 2): source and destination MAC addresses.
- IP (layer 3): source and destination IP addresses, TTL.
- TCP or UDP (layer 4): port numbers, and for TCP the flags such as SYN and ACK.
- Data: whatever the application sent.
This is the OSI and TCP/IP model made visible: each layer wraps the one inside it. Most web traffic today is encrypted with TLS, so you will see the headers and the handshake, but not the page contents.
Filters and permission
A busy network produces thousands of packets a minute. Type a display filter such as dns, tcp or ip.addr == 10.0.0.5 and only matching packets stay on screen; the others are hidden, not deleted, and you can change the filter at any time. Capture filters are different: they are set before you start, use another syntax (BPF, for example port 53), and decide what is recorded at all.
And the rule that matters most: only capture on networks you own, or have written permission to test. Recording other people's traffic without permission can break the law and workplace policy.
Try it yourself
On your own computer and home network, install Wireshark, pick your Wi-Fi or Ethernet interface and press start. Open a website, then stop the capture. Type the display filter dns and find the query for the site's name: which IP address did the answer give? Then try the filter arp and see which devices on your home network asked "who has this IP address?"
Good to know
- Wireshark is free and open source (GPL); tcpdump is the command-line alternative.
- Capturing usually needs admin rights, or the Npcap driver on Windows.
- On a switched network you normally see only your own traffic plus broadcasts and multicasts, unless you use a SPAN (mirror) port or a tap.
- Display filters such as
dns,tcporip.addr == 10.0.0.5hide packets after capture; capture filters use a different (BPF) syntax and are set before the capture starts. - Most web traffic is encrypted with TLS: you see headers and the handshake, not page contents.
- Capturing other people's traffic without permission can break law and workplace policy.
- The capture window in the video is our own simplified drawing, not the real program's screen; the addresses are private or documentation examples.
For CCNA learners
The CCNA 200-301 blueprint has no Wireshark topic, but captures are a lab skill that supports topic 1.5 Compare TCP to UDP: in a capture you can watch TCP's three-way handshake, sequence numbers and acknowledgments, and compare them with UDP traffic such as DNS, which simply sends and replies.
Answer to the comment question
ACK. A TCP connection opens with a three-way handshake: the client sends SYN, the server answers SYN-ACK, and the client finishes with an ACK (EP14). After that third packet the connection is open and data, for a website usually the TLS handshake, can flow. In Wireshark, try the display filter tcp.flags.syn == 1 to find the first two packets of each connection.
Test your knowledge
Quick quiz: "Packet capture basics (Wireshark)"
4 multiple-choice questions. Pick one answer for each, then check how you did.
Sources
- Wireshark, "Wireshark User's Guide": capturing live traffic, the packet list and details panes, privileges needed to capture
- Wireshark Wiki, "Display Filters": display filters such as dns or ip.addr==192.168.0.10, changeable during a capture
- Wireshark Wiki, "Capture Filters": capture filters use libpcap/BPF syntax and are set before capture
- IETF, "RFC 9293, Transmission Control Protocol": the three-way handshake, SYN, SYN-ACK, ACK
Video transcript
How do you see what's really traveling on the wire?
Other tools give you a summary. A packet capture records every single packet, like a security camera for your network.
A free tool called Wireshark does this. Pick your network interface, press start, and packets scroll past, one row each: time, source, destination and protocol.
Click any row to open it up, layer by layer: Ethernet, then IP, then TCP, then the data inside.
Type a filter, like DNS, and only those packets stay on screen. And only capture on networks you own, or have permission to test.
You capture a website loading and see a SYN, then a SYN-ACK. Which packet comes next? Comment your answer below!
That's your byte.
More from Network Bytes
- EP72"nslookup and DNS troubleshooting"
- EP73"show ip interface brief: up/down states"
- EP75"Network Bytes recap: what's next"
- EP76"Stateful firewalls: who gets in"