Tools of the Trade: ip, ss, ping, dig, tcpdump and Reading a Packet Capture
The command-line tools used throughout this course and in real troubleshooting: ip, ss, ping, traceroute, tracepath, mtr, dig, curl, nc, tcpdump and tshark, how to read their output, capture versus display filters, and the macOS and Windows equivalents.
kvi5hnuCode Sprout team member21 min readOn this page
Networking is much easier to learn when you can see it. Every later article in this course shows real output from a handful of standard tools, and the same tools are what engineers reach for when something breaks. This article is a guided tour: what each tool is for, how to read its output, and what to use instead on macOS and Windows.
All the output here comes from the course lab, which runs Linux. The lab's hosts are client (192.0.2.10 and 2001:db8:1::10), a router r1 (192.0.2.1 on the client's network, 198.51.100.1 on the server's), a web server server (198.51.100.10, named www.example.com) and a DNS server dns (198.51.100.53). The path from client to server has about 20 ms of round-trip delay added, so timings look like a real network.
The diagram sorts the tools by the layer from article 3 that they look at: link, internet (IP), transport (TCP and UDP) and application, with the macOS and Windows equivalents in each row.

Addresses and routes: ip
On Linux, the ip command (from the iproute2 package) shows and changes interfaces, addresses, routes and neighbor tables. It replaced the older ifconfig, route and arp, which are still found on macOS and BSD.
The brief form, ip -br addr, gives one line per interface:
eth0@if11 UP 192.0.2.10/24 2001:db8:1::10/64 fe80::ff:fe00:110/64
The interface is eth0 (the @if11 part only shows which interface it's paired with in the lab), it's up, and it has three addresses: an IPv4 address with a 24-bit prefix, a global IPv6 address, and an automatically created IPv6 link-local address starting with fe80::. The full form shows more:
12: eth0@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 02:00:00:00:01:10 brd ff:ff:ff:ff:ff:ff link-netns r1
inet 192.0.2.10/24 scope global eth0
valid_lft forever preferred_lft forever
inet6 2001:db8:1::10/64 scope global nodad
valid_lft forever preferred_lft forever
inet6 fe80::ff:fe00:110/64 scope link proto kernel_ll
valid_lft forever preferred_lft forever
From this you can read the MTU (1500 bytes, the largest packet the link carries, article 20), the link-layer (MAC) address after link/ether, and each address's scope: global addresses work anywhere, while link addresses only work on this link. Articles 7 to 13 explain the addresses themselves.
The rest you can mostly skim. 12: is the interface's index number. The words in angle brackets are flags: UP means the interface is switched on and LOWER_UP means the link under it (the cable, here a virtual one) is working. brd is the broadcast MAC address, qdisc names the queue the kernel uses for outgoing packets, and valid_lft forever means the address never expires, because it was set by hand rather than handed out for a limited time. nodad means the lab skipped IPv6's duplicate-address check, and link-netns r1 is a lab detail: the other end of this virtual cable is in the router's namespace.
The routing table says where packets go:
default via 192.0.2.1 dev eth0
192.0.2.0/24 dev eth0 proto kernel scope link src 192.0.2.10
2001:db8:1::/64 dev eth0 proto kernel metric 256 pref medium
default via 2001:db8:1::1 dev eth0 metric 1024 pref medium
Read each line as "to reach this destination, use this next hop and interface". 192.0.2.0/24 dev eth0 means the local network is directly attached. proto kernel means the kernel added the route by itself when the address was configured, scope link that the destinations are on the link itself, and src the source address to use. metric is a preference (lower wins when two routes match), and pref medium is an IPv6 router preference you can ignore for now. default via 192.0.2.1 means everything else goes to the router at 192.0.2.1, the default gateway. IPv6 has its own table with the same structure. To ask which route the kernel would actually use for one address, use ip route get:
198.51.100.10 via 192.0.2.1 dev eth0 src 192.0.2.10 uid 0
cache
The answer says which next hop, interface and source address the host would use. (uid 0 is the user who asked, and cache just marks this as the result of a lookup rather than a line of the table.) This is the quickest way to check routing decisions, as article 27 shows.
ip neigh shows the neighbor table: which link-layer address belongs to which IP address on the local link (filled in by ARP, the Address Resolution Protocol, for IPv4 and by Neighbor Discovery for IPv6). lladdr is the link-layer address, and REACHABLE means the entry was confirmed recently. Other states, such as STALE, come up in article 21:
192.0.2.1 dev eth0 lladdr 02:00:00:00:01:01 REACHABLE
| Linux | macOS | Windows (PowerShell) |
|---|---|---|
ip addr | ifconfig | Get-NetIPAddress or ipconfig /all |
ip route | netstat -rn | Get-NetRoute or route print |
ip neigh | arp -a, ndp -a | Get-NetNeighbor or arp -a |
ip link, ethtool | ifconfig | Get-NetAdapter |
Reachability and delay: ping
ping sends ICMP (Internet Control Message Protocol, IP's error and diagnostic messages) Echo Request messages and measures how long each Echo Reply takes to come back, the round-trip time (RTT):
PING 198.51.100.10 (198.51.100.10) 56(84) bytes of data.
64 bytes from 198.51.100.10: icmp_seq=1 ttl=63 time=50.7 ms
64 bytes from 198.51.100.10: icmp_seq=2 ttl=63 time=24.6 ms
64 bytes from 198.51.100.10: icmp_seq=3 ttl=63 time=24.5 ms
64 bytes from 198.51.100.10: icmp_seq=4 ttl=63 time=26.3 ms
--- 198.51.100.10 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 917ms
rtt min/avg/max/mdev = 24.487/31.523/50.715/11.101 ms
How to read it:
56(84) bytes: 56 bytes of ICMP data, which makes an 84-byte IP packet (20 bytes of IP header and 8 of ICMP header). Each reply line says64 bytes: the 56 bytes of data plus the 8-byte ICMP header.icmp_seq: the probe's number, counting from 1, so a gap shows which probe got no reply.ttl=63: the reply's remaining time to live. The server sent it with 64, and the router decremented it once, so you can tell the server is one router away. Article 23 explains TTL.time=: the RTT for each probe. The first one is slower here (about 50 ms instead of 25) because the client first had to find the router's MAC address with ARP, and the router had to find the server's. Later probes find the answers cached in the neighbor tables.- The summary gives loss and the minimum, average, maximum and mean deviation of the RTT. The minimum is usually the best estimate of the real path delay, because queues only ever add to it.
A failed ping doesn't prove a host is down: many networks block ICMP. Article 41 covers ping in depth, including IPv6 and the options that matter for MTU testing.
The path: traceroute, tracepath and mtr
These tools show the routers between you and a destination, by sending probes with TTL 1, 2, 3 and so on, and listening for the "time exceeded" messages that routers send back when a TTL runs out (article 41 explains the trick in detail).
traceroute to 198.51.100.10 (198.51.100.10), 30 hops max, 60 byte packets
1 192.0.2.1 8.085 ms 8.029 ms
2 198.51.100.10 24.596 ms 24.588 ms
There are two hops: the router, then the server itself. Each hop shows the probes' round-trip times. The header line says traceroute will give up after 30 hops and sends 60-byte probe packets. (The lab ran traceroute -n -q 2: -n skips reverse DNS lookups and -q 2 sends two probes per hop instead of the default three.) Linux traceroute sends UDP probes by default, while Windows tracert uses ICMP Echo, so they can give different results through firewalls.
tracepath does the same without root, and also reports the path's MTU (pmtu 1500), useful when large packets mysteriously fail. The 1?: [LOCALHOST] line is the starting point, the router appears twice because tracepath sent it two probes, and in the last line back 2 is its estimate of the hop count on the return path:
1?: [LOCALHOST] pmtu 1500
1: 192.0.2.1 7.748ms
1: 192.0.2.1 6.944ms
2: 198.51.100.10 24.568ms reached
Resume: pmtu 1500 hops 2 back 2
mtr combines ping and traceroute, probing every hop repeatedly. The -r option prints a report after a fixed number of probes. The columns are loss, probes sent (Snt), and the last, average, best and worst RTT in milliseconds, plus the standard deviation (StDev), which shows how much the RTT varies:
Start: 2026-11-20T20:03:01+0000
HOST: client Loss% Snt Last Avg Best Wrst StDev
1.|-- 192.0.2.1 0.0% 5 8.1 6.8 5.5 8.1 1.1
2.|-- 198.51.100.10 0.0% 5 23.5 25.3 22.6 28.9 2.7
Loss% per hop is the most misread number in networking. Routers often rate-limit the messages traceroute and mtr depend on, so a router can show loss while forwarding your real traffic perfectly. Only loss that continues to every later hop points to a real problem. Windows' closest equivalent is pathping.
Sockets: ss
ss lists sockets. You met it in article 4 for listening ports. With -t (TCP), -i (internal TCP information) and -n (numbers), it shows each connection's live TCP state: round-trip time, congestion window, retransmissions and more. Article 2 used it to watch a connection during an outage. Useful forms:
ss -tlnandss -uln: listening TCP and UDP sockets.ss -tnp: established TCP connections with their processes.ss -tin dst 198.51.100.10: detailed TCP information for connections to one host.ss -s: summary counts.
On macOS use netstat -an or lsof -i. On Windows, netstat -ano or Get-NetTCPConnection.
Names: dig
dig sends DNS (Domain Name System) queries and prints the full answer. It talks to DNS directly, so unlike ping or a browser it doesn't consult the hosts file. Asking the lab's DNS server for the IPv4 address of www.example.com (+nocmd drops the banner and +norecurse asks the server to answer only from its own data):
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 57815
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.example.com. IN A
;; ANSWER SECTION:
www.example.com. 600 IN A 198.51.100.10
;; AUTHORITY SECTION:
example.com. 600 IN NS ns1.example.com.
;; Query time: 1 msec
;; SERVER: 198.51.100.53#53(198.51.100.53) (UDP)
;; WHEN: Fri Nov 20 20:05:22 UTC 2026
;; MSG SIZE rcvd: 100
The sections to look at:
- The header:
status: NOERRORmeans the query succeeded (NXDOMAINwould mean the name doesn't exist). The flags sayqr(this is a response) andaa(an authoritative answer, straight from the server responsible for the name). Without+norecurse, you'd also seerd(recursion desired) and a warning, because this server only answers for its own zone (the names it's responsible for) and doesn't look names up on others' behalf. - The question and answer sections: one A record (an IPv4 address record;
INmeans the Internet class, which is all you'll see), with a TTL of 600 seconds, meaning resolvers (the DNS servers that look names up for clients) may cache it for 10 minutes. - The authority section names the zone's name server (an
NSrecord), and theOPT PSEUDOSECTIONshows EDNS, an extension that lets DNS messages over UDP be larger than the original 512-byte limit (here the server says it accepts up to 1232 bytes). Part 9 explains both. - At the bottom, which server answered, over which transport, and how long it took.
For scripts, +short prints only the answer. Here it's dig +short @198.51.100.53 www.example.com AAAA, asking for the IPv6 address instead:
2001:db8:2::10
Current versions of dig (from BIND, the DNS software it ships with, 9.18 and later) can also send the query over encrypted DNS, with +tls for DNS over TLS and +https for DNS over HTTPS, which helps when your system's resolver uses those. On Windows, use Resolve-DnsName in PowerShell (or the older nslookup). Part 9 (articles 49 to 56) covers DNS, and article 56 is a full troubleshooting guide using dig.
Applications: curl and nc
curl -v shows each step of an HTTP request: name resolution, the connection (curl's own notes start with *), the request headers it sent (>) and the response headers it received (<):
* Host www.example.com:80 was resolved.
* IPv6: 2001:db8:2::10
* IPv4: 198.51.100.10
* Trying [2001:db8:2::10]:80...
* Connected to www.example.com (2001:db8:2::10) port 80
* using HTTP/1.x
> GET / HTTP/1.1
> Host: www.example.com
> User-Agent: curl/8.14.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Server: nginx
< Content-Type: text/html
< Content-Length: 13
< Last-Modified: Fri, 20 Nov 2026 20:03:00 GMT
< Connection: keep-alive
< ETag: "6b00a774-d"
< Accept-Ranges: bytes
<
* Connection #0 to host www.example.com left intact
Notice that curl got both addresses for the name and connected over IPv6 first, as article 4 explained. Add -4 or -6 to force one family, and --resolve to test a server without changing DNS. For HTTPS (HTTP encrypted with TLS, Transport Layer Security), curl -v also shows the TLS handshake, and openssl s_client -connect host:443 gives a lower-level view of it.
nc (netcat) opens a raw TCP or UDP connection, which is handy to check whether a port is reachable or to send test data. Here the server ran nc -l -p 7000 and the client sent one line:
server received: hello over TCP
There are several versions of nc with slightly different options. The lab uses the OpenBSD version, the default on Debian and Ubuntu. On Windows, PowerShell's Test-NetConnection host -Port 443 answers the most common question, "is this port open?".
Capturing packets: tcpdump
Every tool so far shows what one layer thinks is happening. A packet capture shows what actually went over the wire. tcpdump is the standard command-line capture tool on Linux, macOS and BSD. A typical command:
sudo tcpdump -i eth0 -nn -w web.pcap 'tcp port 80'
-i eth0chooses the interface (-i anycaptures on all of them on Linux).-nnshows addresses and ports as numbers instead of looking up names, which is faster and avoids generating extra DNS traffic.-w web.pcapwrites packets to a file instead of printing them. Read the file later withtcpdump -r web.pcap, or open it in Wireshark.'tcp port 80'is a capture filter, explained below.-ssets how many bytes of each packet to keep. The default keeps whole packets, and-s 96keeps just the headers, which saves space and avoids storing private data.
Here are the first six packets of a capture of curl -4 http://www.example.com/:
20:03:14.756144 IP 192.0.2.10.56284 > 198.51.100.10.80: Flags [S], seq 1657936235, win 64240, options [mss 1460,sackOK,TS val 3371790378 ecr 0,nop,wscale 7], length 0
20:03:14.777639 IP 198.51.100.10.80 > 192.0.2.10.56284: Flags [S.], seq 1628628386, ack 1657936236, win 65160, options [mss 1460,sackOK,TS val 1056443546 ecr 3371790378,nop,wscale 7], length 0
20:03:14.777729 IP 192.0.2.10.56284 > 198.51.100.10.80: Flags [.], ack 1, win 502, options [nop,nop,TS val 3371790400 ecr 1056443546], length 0
20:03:14.778032 IP 192.0.2.10.56284 > 198.51.100.10.80: Flags [P.], seq 1:80, ack 1, win 502, options [nop,nop,TS val 3371790400 ecr 1056443546], length 79: HTTP: GET / HTTP/1.1
20:03:14.799610 IP 198.51.100.10.80 > 192.0.2.10.56284: Flags [.], ack 80, win 509, options [nop,nop,TS val 1056443568 ecr 3371790400], length 0
20:03:14.799644 IP 198.51.100.10.80 > 192.0.2.10.56284: Flags [P.], seq 1:242, ack 80, win 509, options [nop,nop,TS val 1056443568 ecr 3371790400], length 241: HTTP: HTTP/1.1 200 OK
![Diagram of one tcpdump line split into labeled parts: the timestamp; IP for IPv4; the source address and port 192.0.2.10.56284; the destination 198.51.100.10.80; Flags [P.] meaning PSH and ACK; seq 1 meaning bytes 1 to 79; ack 1, the next byte wanted from the other side; win 502, the receive window; options; and length 79, the number of payload bytes. A note explains the flag letters S for SYN, F for FIN, R for RST, P for PSH and a dot for ACK, and that seq and ack are relative unless you add -S](https://code-sprout-content.laxmi.solutions/asset/2026/11/tcpip-tcpdump-line-3frozotrcgquh2i3.png)
The diagram labels each part of one line. In the Flags field, S is SYN (open a connection), P is PSH (push this data to the application), F is FIN (close), R is RST (reset), and a dot means the ACK flag is set. The six packets are the three-way handshake ([S], [S.], [.]), the request ([P.], 79 bytes), the server's acknowledgment and the response. After the handshake, tcpdump shows relative sequence numbers, counting from 1 at the start of the connection, so they're easy to read. The real numbers are random 32-bit values, visible in the SYN lines (and with -S everywhere). win 502 looks tiny, but the handshake agreed a window scale of 7 (wscale 7), so the real window is 502 × 2⁷ = 64,256 bytes. Article 60 explains the options.
-X adds a hex and text dump of each packet, which is how you check exactly what's inside. This shows only the first packet with the PSH flag set:
20:03:14.778032 IP 192.0.2.10.56284 > 198.51.100.10.80: Flags [P.], seq 1657936236:1657936315, ack 1628628387, win 502, options [nop,nop,TS val 3371790400 ecr 1056443546], length 79: HTTP: GET / HTTP/1.1
0x0000: 4500 0083 ffcf 4000 4006 4e5d c000 020a E.....@.@.N]....
0x0010: c633 640a dbdc 0050 62d2 196c 6112 e5a3 .3d....Pb..la...
0x0020: 8018 01f6 ecbd 0000 0101 080a c8f9 7040 ..............p@
0x0030: 3ef8 0c9a 4745 5420 2f20 4854 5450 2f31 >...GET./.HTTP/1
0x0040: 2e31 0d0a 486f 7374 3a20 7777 772e 6578 .1..Host:.www.ex
0x0050: 616d 706c 652e 636f 6d0d 0a55 7365 722d ample.com..User-
0x0060: 4167 656e 743a 2063 7572 6c2f 382e 3134 Agent:.curl/8.14
0x0070: 2e31 0d0a 4163 6365 7074 3a20 2a2f 2a0d .1..Accept:.*/*.
0x0080: 0a0d 0a ...
The dump starts at the IP header (4500... is IPv4 with a 20-byte header). Article 3 decodes these bytes field by field. The output was read back from the file with the filter tcp[tcpflags] & tcp-push != 0, so tcpdump never saw the SYN, had no starting point and printed the full sequence numbers here.
Capture filters
The filter at the end of a tcpdump command uses the BPF (Berkeley Packet Filter) syntax. It's applied in the kernel as packets are captured, so anything it rejects is never saved. Common forms:
| Filter | Captures |
|---|---|
host 198.51.100.10 | packets to or from that address |
net 192.0.2.0/24 | packets to or from that network |
tcp port 443 | TCP to or from port 443 |
udp port 53 or tcp port 53 | DNS over UDP and TCP |
icmp or icmp6 | ICMP for IPv4 or IPv6 |
arp | ARP packets |
tcp[tcpflags] & tcp-syn != 0 | TCP packets with SYN set (IPv4 only) |
not port 22 | everything except SSH, useful when you're logged in over SSH |
Analyzing captures: tshark and Wireshark
Wireshark is the graphical packet analyzer, and tshark is its command-line twin. They decode hundreds of protocols, follow TCP streams, spot retransmissions and calculate statistics. Both read and write the same capture files as tcpdump.
Wireshark uses a different, much richer language for display filters, which are applied after capture to choose what to show. They can test any decoded field. Showing just the SYNs and HTTP requests from a capture of two requests:
1 0.000000 192.0.2.10 → 198.51.100.10 TCP 74 56284 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=3371790378 TSecr=0 WS=128
2 0.021495 198.51.100.10 → 192.0.2.10 TCP 74 80 → 56284 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=1056443546 TSecr=3371790378 WS=128
4 0.021888 192.0.2.10 → 198.51.100.10 HTTP 145 GET / HTTP/1.1
11 0.067456 192.0.2.10 → 198.51.100.10 TCP 74 56298 → 80 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM TSval=3371790446 TSecr=0 WS=128
12 0.088852 198.51.100.10 → 192.0.2.10 TCP 74 80 → 56298 [SYN, ACK] Seq=0 Ack=1 Win=65160 Len=0 MSS=1460 SACK_PERM TSval=1056443614 TSecr=3371790446 WS=128
14 0.089103 192.0.2.10 → 198.51.100.10 HTTP 152 GET /big.txt HTTP/1.1
The numbers on the left are frame numbers in the file, so you can see that other frames were filtered out. Some useful display filters:
| Display filter | Shows |
|---|---|
ip.addr == 198.51.100.10 | packets to or from that address |
tcp.port == 443 | TCP port 443 in either direction |
tcp.flags.syn == 1 && tcp.flags.ack == 0 | connection attempts only |
tcp.analysis.retransmission | segments Wireshark thinks were retransmitted |
dns.flags.rcode != 0 | DNS errors |
http.response.code >= 400 | HTTP errors |
tls.handshake.type == 1 | TLS ClientHello messages |
Capture filters and display filters look similar but are different languages: tcp port 80 is a capture filter, tcp.port == 80 is a display filter. Use a capture filter to keep files small, and display filters to explore.
tshark -T fields prints chosen fields as columns, ready for a spreadsheet or a script:
0.043500000 198.51.100.10 80 200 13
0.207593000 198.51.100.10 80 200 300000
Each line is one HTTP response: the time since the capture started, the server's address and port, the status code and the body length. tshark's statistics mode summarizes whole conversations. Each row is one TCP connection. The <- columns count frames and bytes sent toward the first (left) address, here the client, and -> those sent from it, so the second connection's 304 kB is the download. The last two columns are when the connection started, relative to the capture, and how long it lasted in seconds:
================================================================================
TCP Conversations
Filter:<No Filter>
| <- | | -> | | Total | Relative | Duration |
| Frames Bytes | | Frames Bytes | | Frames Bytes | Start | |
192.0.2.10:56298 <-> 198.51.100.10:80 59 304 kB 56 3790 bytes 115 307 kB 0.067456000 0.1637
192.0.2.10:56284 <-> 198.51.100.10:80 4 513 bytes 6 483 bytes 10 996 bytes 0.000000000 0.0656
================================================================================
From a capture to a graph
Exporting fields makes it easy to draw your own graphs. Wireshark has built-in versions under Statistics → TCP Stream Graphs. A time-sequence graph plots each data segment's sequence number against time. This one was drawn from a capture of a 300 kB download, taken at the server:
data segments sent in each burst (one burst per round trip): 10, 20, 40, 80, 58

The graph shows TCP's slow start directly. The server sends 10 segments, waits one round trip for acknowledgments, then sends 20, then 40, then 80: the sending window doubles every round trip until the transfer ends. You'll see this graph again in article 72, which explains slow start, and in Part 12 for congestion control in general.
Capturing on macOS and Windows
- macOS includes
tcpdump. Wireshark is available as a download. Use-i en0(usually Wi-Fi) andsudo. - Windows has the built-in pktmon (
pktmon start --captureandpktmon etl2pcapto convert the file for Wireshark). Wireshark for Windows installs the Npcap driver to capture directly. - Phones need a capture on a computer acting as their router or hotspot, or remote-capture tools.
Captures can contain passwords, cookies, private messages and personal data. Capture only on networks you're allowed to, keep files private, and prefer header-only captures (-s 96) when you don't need the content.
Common questions
Why does tcpdump say "permission denied"?
Capturing needs raw access to the network interface, which normally requires root. Use sudo, or on Linux give the capture program the CAP_NET_RAW and CAP_NET_ADMIN capabilities (Wireshark's installer can set this up for a wireshark group).
Why does my capture show packets bigger than 1500 bytes?
Segmentation offload. The operating system hands the network card large segments, and the card splits them into MTU-sized packets after the point where tcpdump captures. On receive, the card or driver may merge packets before capture (GRO). The wire only ever carries normal-sized packets.
Should I trust mtr when it shows 50% loss at a middle hop?
Only if the loss continues at every hop after it. Routers often limit how many ICMP "time exceeded" replies they send, so a middle hop can show loss while forwarding everything. Loss that starts at one hop and continues to the destination is real.
Why is the first ping slower than the rest?
The first packet usually waits for address resolution: ARP or Neighbor Discovery for the next hop's MAC address, and sometimes DNS for the name. Later packets find those answers cached.
What's the difference between a capture filter and a display filter?
A capture filter (BPF syntax, as in tcp port 80) decides what gets captured at all, and discarded packets are gone. A display filter (Wireshark syntax, as in tcp.port == 80) only hides packets in a file you've already captured, and can test any decoded field.
Where should I capture: at the client, the server, or in between?
Wherever you need to see the truth. A capture at the sender shows when data left and when acknowledgments came back, which is ideal for TCP performance, as in the time-sequence graph. A capture at the receiver shows what really arrived. When something in the middle, such as a firewall, may be dropping packets, capture at both ends and compare.
Is ifconfig deprecated?
On Linux, yes in practice: net-tools (which provides ifconfig, route, arp and netstat) hasn't kept up with features such as multiple addresses per interface, and many distributions no longer install it by default. Use ip and ss. On macOS and BSD, ifconfig is still the standard tool.
Summary
ip addr,ip route(andip route get) andip neighshow a Linux host's addresses, routes and neighbor table. macOS usesifconfig,netstat -rnandarp/ndp, and Windows usesGet-NetIPAddress,Get-NetRouteandGet-NetNeighbor.pingmeasures reachability and round-trip time. In the lab the first probe was slower because of address resolution, and the minimum RTT is the best estimate of path delay.traceroute,tracepathandmtrshow the path. Loss at a middle hop that doesn't continue onward isn't real loss.ssshows sockets and live TCP state.digqueries DNS directly.curl -vandnctest applications and ports.tcpdumpcaptures packets using BPF capture filters, and writes files with-w. tshark and Wireshark decode them with a richer display-filter language, export fields with-T fieldsand compute statistics.- Captures are the ground truth. In the lab, a time-sequence graph built from exported fields showed TCP slow start doubling its bursts every round trip: 10, 20, 40, 80 segments.
- Segmentation offload can make captures show giant packets, and captures can contain private data, so handle them carefully.
Practice questions
1. ip route shows default via 10.0.0.1 dev wlan0 and 10.0.0.0/24 dev wlan0. Which next hop is used for 10.0.0.25, and which for 198.51.100.7?
Answer
10.0.0.25 is on the directly attached 10.0.0.0/24 network, so it's sent straight to that host on wlan0, with no router. 198.51.100.7 matches only the default route, so it goes to the router 10.0.0.1. ip route get <address> would confirm each.
2. A ping reply shows ttl=55. The sender probably started at 64. Roughly how many routers are on the return path?
Answer
About 64 − 55 = 9 routers decremented the TTL on the way back. The return path can differ from the forward path, and some systems start at 128 or 255, so this is an estimate.
3. Write a tcpdump command that saves only DNS traffic (UDP and TCP port 53) on interface eth0 to dns.pcap, without name lookups.
Answer
sudo tcpdump -i eth0 -nn -w dns.pcap 'port 53'. Since port 53 matches both TCP and UDP, the shorter filter works. 'udp port 53 or tcp port 53' is the explicit version.
4. Is tcp.port == 443 a capture filter or a display filter? What's the equivalent in the other syntax?
Answer
It's a Wireshark display filter. The capture-filter (BPF) equivalent is tcp port 443.
5. mtr shows 0% loss at hops 1–3, 60% at hop 4, and 0% at hops 5–8, the destination. Is there a problem at hop 4?
Answer
Almost certainly not. If hop 4 were really dropping 60% of packets, the hops after it would show loss too. Hop 4 is just rate-limiting the ICMP replies it sends to probes.
6. In the lab's tcpdump output, the client's ACK says win 502 and the SYN said wscale 7. How many bytes may the server send before waiting for more acknowledgments?
Answer
The window field is scaled by 2⁷ = 128, so 502 × 128 = 64,256 bytes.
Review quiz
You've finished Part 1. Test yourself on packets and datagrams, the end-to-end principle, layering and encapsulation, ports and names, standards and the tools:
Previous: Who Defines the Internet: RFCs, the IETF, IEEE and Real Implementations
Next: IPv4 Addresses: Dotted Quads, Binary and the Old Address Classes

More in TCP/IP Course
Quiz: TCP/IP Delicate Details
Twenty-five questions on the details that catch out experienced engineers: sequence numbers for SYN and FIN, TIME_WAIT versus tcp_fin_timeout, Karn's algorithm, socket buffer doubling, even and odd ephemeral ports, IPv6 checksums and fragmentation, negative DNS caching, and capture filter traps.
Quiz: TCP/IP Interview Questions
Thirty-three networking questions of the kind asked in developer, SRE and network engineering interviews: what happens when you load a URL, TCP versus UDP, handshakes, closing and TIME_WAIT, subnetting, NAT, DNS, MTU problems, congestion, TLS and QUIC, and debugging slow or failing connections.
Quiz: TCP/IP Course Final Exam (All Parts)
The final exam for the TCP/IP course: thirty questions across all fourteen parts, from packets and addressing through Ethernet, ARP, IP, DHCP, NAT, ICMP, UDP, DNS, TCP connections, reliability, congestion control, security, QUIC and troubleshooting.
Quiz: Modern Transports and Troubleshooting (TCP/IP Part 14)
Review modern transports and troubleshooting: QUIC packets, handshakes, 0-RTT, streams and connection migration, HTTP/3, Multipath TCP, SCTP multihoming, and a layered method for diagnosing real network faults.
Discussion
Sign in to ask a question or share what you learned.