Capture & explain real traffic
Annotate captures of DHCP, ARP, DNS, TCP and TLS from your network.
By Invicly Tech, , in Computer Networking. About 11 minutes to read.
In short
Capturing your own network's traffic connects every protocol you studied to real packets. Record a client joining the network and loading a web page, then annotate each exchange: DHCP DORA, ARP for the gateway, DNS lookup, TCP handshake, TLS handshake and HTTP. Writing it up proves you understand each step.
Explained simply
You have studied DHCP, ARP, DNS, TCP and TLS one by one. In this project you see them all working together in your own network. You capture the packets while a laptop joins the network and opens a web page, then explain each step in plain words.
The order is always the same, because each step needs the one before it. The laptop first gets an address with DHCP, then finds its gateway's MAC address with ARP, then looks up the website's IP with DNS, then opens a TCP connection, then secures it with TLS, and only then sends the web request.
Your job is to annotate: next to each important packet, write what it does and why. For example: "Packet 4: DHCP ACK. The server confirms 10.20.10.57 for 8 hours, gateway 10.20.10.1, DNS 10.20.40.10." Good annotations prove you understand what you see.
At the end you write a short traffic report: what happened, how long each stage took, and anything unusual. This is exactly what network engineers write when they investigate real problems.
Press Play on a diagram to walk through it one step at a time.
- Client to Router / DHCP: DHCP DORA: get IP, gateway, DNS1DHCP DORA: get IP, gateway, DNS
- Client to Router / DHCP: ARP: who has the gateway?2ARP: who has the gateway?
- Client to DNS server: DNS query for the site3DNS query for the site
- DNS server to Client: DNS answer with the IP4DNS answer with the IP
- Client to Web server: TCP handshake, then TLS handshake5TCP handshake, then TLS handshake
- Client to Web server: HTTP GET over TLS6HTTP GET over TLS
- Web server to Client: HTTP 200 response7HTTP 200 response
- 1TLS
Server name (SNI), ALPN, version; content encrypted
- 2TCP
Ports, handshake timing, retransmissions
- 3DNS
Names looked up and the IPs returned
- 4IP
Source and destination, TTL hints at hop count
- 5ARP and DHCP
MACs, leased address, gateway, DNS server
In depth
Capturing a client joining the network
To see DHCP you must capture before the client asks for an address. In GNS3, right-click the link between the client and the switch and choose Start capture; Wireshark opens and records that link. On a real Linux client, start tcpdump, then release and renew the lease (dhclient -r and dhclient, or nmcli connection down and up on NetworkManager systems). On Windows, ipconfig /release and ipconfig /renew. In Packet Tracer there is no pcap capture; use Simulation mode with the event filter set to DHCP, ARP and DNS, and step through the events, opening each packet's OSI view.
In the capture, filter with dhcp (the filter is called bootp in Wireshark versions before 3.0). You should see the four DORA messages, from 0.0.0.0 port 68 to 255.255.255.255 port 67 for Discover. Many clients then send ARP probes for the offered address (sender IP 0.0.0.0) to check nobody else uses it, followed by ARP for the gateway.
- GNS3: right-click a link, Start capture
- Linux: dhclient -r then dhclient, or nmcli down and up
- Windows: ipconfig /release then /renew
- Packet Tracer: Simulation mode with event filters
Reading DHCP and ARP
Open the DHCP ACK and expand the options. Option 53 is the message type (1 Discover, 2 Offer, 3 Request, 5 ACK). Option 1 is the subnet mask, option 3 the router (default gateway), option 6 the DNS servers, option 51 the lease time and option 54 the server identifier. Write these values in your annotation and compare them with your addressing plan; a wrong gateway or DNS here explains many later failures.
Next comes ARP. The client broadcasts "Who has 10.20.10.1? Tell 10.20.10.57" to ff:ff:ff:ff:ff:ff, and the router answers with its MAC directly to the client. Wireshark's arp filter shows both. Note that the gateway's MAC is the router's subinterface MAC, which is the same for every VLAN on a router-on-a-stick. If you see a duplicate address warning (Wireshark flags it as arp.duplicate-address-detected), two devices claim the same IP, a classic static-address mistake.
- Client to Router (DHCP): Discover: broadcast, 0.0.0.0:68 to 255.255.255.255:671Discover: broadcast, 0.0.0.0:68 to 255.255.255.255:67
- Router (DHCP) to Client: Offer: 10.20.10.57, gateway, DNS, lease2Offer: 10.20.10.57, gateway, DNS, lease
- Client to Router (DHCP): Request: I accept 10.20.10.573Request: I accept 10.20.10.57
- Router (DHCP) to Client: ACK: confirmed for 8 hours4ACK: confirmed for 8 hours
- Client to Router (DHCP): ARP: who has 10.20.10.1?5ARP: who has 10.20.10.1?
- Router (DHCP) to Client: ARP reply: 10.20.10.1 is at router MAC6ARP reply: 10.20.10.1 is at router MAC
Capturing and annotating a web page load
With the client online, capture while you open one site, ideally from a fresh browser session so nothing is cached. Modern browsers send DNS queries for both A and AAAA records, often in parallel. Some resolvers or browsers use DNS over HTTPS, which hides DNS inside TLS on port 443; for a clear lab capture, use a browser setting or curl that uses the system resolver.
After DNS, find the TCP handshake (tcp.flags.syn == 1) and the TLS ClientHello (tls.handshake.type == 1). In the ClientHello, note the server_name (SNI) extension, which reveals the site name even though everything else is encrypted, and the ALPN extension listing h2 and http/1.1. In TLS 1.3 the ServerHello is followed only by encrypted records; the certificate is encrypted too. Watch out: Chrome and Firefox may use HTTP/3 over QUIC on UDP 443 instead of TCP. If you see no TCP to the site, filter with quic, or capture with curl --http1.1 or curl --http2 to force TCP.
- 1DNS
A and AAAA queries, answer time from dns.time
- 2TCP handshake
SYN, SYN-ACK, ACK: one round trip
- 3TLS handshake
ClientHello with SNI and ALPN, ServerHello
- 4HTTP request
Encrypted unless you have a key log
- 5Response and close
Data, then FIN or the connection is kept alive
Writing the traffic report
A good report is short and factual. Start with the setup: where you captured (capture point), which client, which time, and which tools. Then list each stage with its key packets, the main values, and the time it took. Measure with Wireshark: dns.time gives DNS latency; the time between SYN and SYN-ACK gives the network round trip; the time from ClientHello to the first application data gives the TLS cost; http.time (if decrypted) gives server time.
Add overview statistics: Statistics, Protocol Hierarchy for the mix of traffic, and Conversations for who talked to whom. tshark can print the same in text with tshark -r file -qz io,phs and tshark -r file -qz conv,tcp, which is handy for pasting into the report. End with observations: anything unexpected, such as retransmissions, a slow DNS server, a wrong DNS server from DHCP, or background traffic you did not expect. Before sharing a capture, remove or trim private data.
- Setup: capture point, client, time, tools
- Each stage: key packets, values, duration
- Statistics: protocol hierarchy and conversations
- Observations and anything unusual
Learn it in 4 short steps
About 45m each. Track them with a timer in your plan.
- 1Capture a client joining the network~45m
- 2Capture a web page load~45m
- 3Annotate each protocol exchange~45m
- 4Write a short traffic report~45m
Key points
- Start the capture before connecting the client to catch DHCP.
- Use display filters per protocol: dhcp, arp, dns, tcp.flags.syn == 1, tls.handshake.
- Note timings: DNS time, connect time and server response time.
- Remove sensitive data before sharing captures.
Key terms
Tap a card to flip it. 0/3 known
Examples
sudo tcpdump -i eth0 -nn -w join.pcap &
sudo dhclient -r eth0 && sudo dhclient eth0
curl -s https://example.com > /dev/null
sudo kill %1
tshark -r join.pcap -Y 'dhcp || arp || dns || tls.handshake.type == 1'Annotated sample of a client join
Captured on the link between PC-Staff-1 and the access switch in GNS3. Step 1: filter dhcp || arp. Step 2: read and annotate each packet as below. Step 3: check the values against the addressing plan: the lease, gateway and DNS all match, and the ARP reply MAC belongs to the router's g0/0 interface. This block goes straight into the report.
No. Time Summary Annotation
1 0.000 DHCP Discover 0.0.0.0 -> 255.255.255.255 Client asks for any address
2 0.004 DHCP Offer 10.20.10.1 -> 10.20.10.57 Router offers .57, 8 h lease
3 0.005 DHCP Request 0.0.0.0 -> 255.255.255.255 Client accepts .57 (broadcast)
4 0.008 DHCP ACK 10.20.10.1 -> 10.20.10.57 Opt 3 gw .1, opt 6 DNS 10.20.40.10
5 0.010 ARP Who has 10.20.10.57? Tell 0.0.0.0 Probe: is .57 already used?
9 1.120 ARP Who has 10.20.10.1? Tell 10.20.10.57 Find the gateway MAC
10 1.123 ARP 10.20.10.1 is at 0c:1a:2b:3c:4d:00 Router replies directlyTiming a page load from the command line
To put real numbers in the report, capture a single HTTPS request made with curl, forcing HTTP/2 over TCP so QUIC does not hide the handshake. Step 1: start tcpdump. Step 2: run curl with timing output. Step 3: stop the capture. Step 4: use tshark to list DNS, handshake and TLS packets with relative times. Compare curl's numbers with the packet times; they should agree within a millisecond or two.
sudo tcpdump -i eth0 -nn -w load.pcap 'port 53 or tcp port 443' &
curl -s -o /dev/null --http2 -w 'dns %{time_namelookup} tcp %{time_connect} tls %{time_appconnect} ttfb %{time_starttransfer}\n' https://example.com
sudo kill -INT %1
tshark -r load.pcap -Y 'dns || tcp.flags.syn == 1 || tls.handshake' \
-T fields -e frame.time_relative -e _ws.col.Info
tshark -r load.pcap -qz io,phsQuick reference
- Start capturing before the client joins, or DHCP is missed
- Filters: dhcp (bootp before Wireshark 3.0), arp, dns, tcp.flags.syn == 1, tls.handshake
- DHCP options: 53 type, 1 mask, 3 gateway, 6 DNS, 51 lease time, 54 server ID
- ClientHello SNI shows the site name even though TLS hides the content
- Browsers may use QUIC on UDP 443; filter quic or force TCP with curl --http2
- dns.time and SYN to SYN-ACK gap give DNS latency and network RTT
- tshark -qz io,phs and -qz conv,tcp print stats for the report
- Packet Tracer: use Simulation mode; GNS3: right-click a link, Start capture
Quick quiz
Pick an answer to see if you're right and why.
Practice exercises
Try each one yourself first. Use the hint if you get stuck, then compare with the solution.
- Exercise 1easy
Capture a DHCP renewal on your own Linux or Windows machine and write down the leased IP, gateway, DNS servers and lease time from the ACK.
- Exercise 2medium
Capture one HTTPS page load and produce a table with the time of the first DNS query, DNS answer, SYN, SYN-ACK, ClientHello and ServerHello.
- Exercise 3hard
Write a one-page traffic report for your capture, with setup, a stage-by-stage table, statistics and observations.
Check yourself
Answer in your head, reveal, then be honest with yourself.
Feel confident about this topic?
Frequently asked questions
- Can I capture packets in Cisco Packet Tracer?
- Packet Tracer does not produce pcap files, but Simulation mode lets you step through each event and inspect every packet layer by layer. For real pcap files, use GNS3 or a physical lab.
- Why is the DHCP filter called bootp in some guides?
- DHCP is built on the older BOOTP protocol. Wireshark used the filter name bootp until version 3.0, when it was renamed to dhcp.
- Is it safe to share my capture file?
- Only after checking it. Captures can hold passwords, cookies, internal IPs and names, so filter to what you need and save a trimmed copy with File, Export Specified Packets.