Network Troubleshooting and Diagnostics Questions
Systematically diagnosing network problems: a layered troubleshooting methodology, diagnostic tools and commands (ping, traceroute, tcpdump, packet capture), root-cause analysis, and connectivity and user-access issues. Covers isolating faults across the stack, reading packet-level evidence, and driving from symptom to root cause. The diagnostic discipline that spans all networking layers.
Describe the minimum steps and capture settings you would use to perform a packet capture that is useful for troubleshooting a connectivity issue. Cover capture location (host vs tap vs SPAN), interface selection, capture filters, snaplen, buffering, and legal/privacy considerations when capturing production traffic.
Sample Answer
Direct answer
A packet capture that's actually useful for troubleshooting a connectivity issue needs deliberate choices made before you start, not just running tcpdump with no arguments: where you capture, what you filter for, how much of each packet you keep, and what legal/privacy constraints apply, all affect whether the capture actually answers your question later.
Structured elaboration
- Capture location: decide whether you need to capture on the host itself, at a switch SPAN/mirror port, at a network TAP, or (in cloud environments) via VPC traffic mirroring; a host-based capture sees only what that host sends/receives (and may miss packets dropped before reaching the NIC), while a SPAN or TAP sees the wire itself, which matters when you suspect a problem BETWEEN two points rather than at either endpoint.
- Interface selection: capturing on the wrong interface (a management interface instead of the data interface, or the wrong VLAN sub-interface) is a common, entirely avoidable mistake that produces an empty or irrelevant capture.
- Capture filters, applied at capture time: a BPF filter (host, port, protocol) applied while capturing reduces the volume you need to store and analyze, at the cost of not being able to go back and look at anything outside that filter later; decide this trade-off deliberately rather than by default.
- Snaplen (how much of each packet to keep): capturing only headers (a small snaplen) is enough for most connectivity troubleshooting and keeps files small; capturing full payload is needed only if you specifically need to inspect application-layer content, and comes with real privacy implications.
- Buffering and rotation: for anything beyond a quick, short capture, set file-size-based rotation (so a long-running capture doesn't fill the disk) and consider ring-buffer behavior, so an unattended capture degrades gracefully rather than crashing the host.
- Legal and privacy considerations: capturing production traffic can capture sensitive data (credentials, personal data) depending on snaplen and what's being captured; know your organization's policy on this before capturing broadly, and prefer the smallest scope (narrowest filter, smallest snaplen) that still answers your question.
Worked example
Troubleshooting an intermittent connectivity failure between a client and a specific backend: capture at the host closest to where the symptom is reported (not several hops away), filtered to the specific host/port pair involved (host <client-ip> and port 443), with a modest snaplen (enough to see full TCP/TLS headers, not necessarily full payload), rotating to 100MB files so an extended capture window doesn't fill the disk while you wait for the intermittent failure to recur.
Trade-offs & pitfalls
Capturing everything with no filter "just in case" produces a file that's expensive to store, slow to analyze, and more likely to contain sensitive data you didn't need; conversely, filtering too narrowly before you fully understand the failure risks missing the very packet that would have explained it. Start with a reasonably scoped filter based on what you already know, and widen it only if the first capture doesn't answer the question.
Your packet capture contains many IPv6 Neighbor Discovery issues. Explain how ND differs from ARP, which ICMPv6 messages are important for ND troubleshooting, and how you would use 'ip -6 neigh', tcpdump, and router advertisements to diagnose IPv6 neighbor reachability and autoconfiguration problems.
Sample Answer
Direct answer
IPv6 Neighbor Discovery (ND) does the same fundamental job as ARP, mapping a Layer 3 address to a Layer 2 (MAC) address, but it's built on ICMPv6 messages rather than a separate Layer 2 broadcast protocol, and it additionally handles router discovery and address autoconfiguration, tasks ARP itself never covered at all.
Structured elaboration
- Core mechanism difference: ARP uses its own dedicated Layer 2 broadcast protocol (ARP Request/Reply) with no relationship to ICMP; ND is built entirely on ICMPv6 message types, meaning the same general protocol family used for IPv6 error reporting and diagnostics also carries neighbor-resolution and router-discovery functions.
- Key ICMPv6 messages for ND specifically: Neighbor Solicitation (the ND equivalent of an ARP Request, asking "who has this address") and Neighbor Advertisement (the equivalent of an ARP Reply); additionally, Router Solicitation and Router Advertisement, which have NO ARP equivalent at all, since ARP never handled router or prefix discovery; Redirect messages exist in ND too, analogous to ICMPv4 Redirect.
- What ND additionally provides that ARP never did: Router Advertisements carry prefix information that hosts use for STATELESS address autoconfiguration (SLAAC), letting a host construct its own IPv6 address from an advertised prefix without needing DHCP at all; ARP has no equivalent concept, since IPv4 address assignment is handled entirely separately (statically or via DHCP), with ARP purely doing address-to-MAC resolution afterward.
- Diagnosing ND issues with tooling:
ip -6 neigh(the IPv6 analog ofip neigh/arp -n) shows the neighbor cache directly, with states analogous to ARP's (REACHABLE, STALE, FAILED, INCOMPLETE);tcpdump/Wireshark filtered foricmp6isolates the relevant ND traffic for capture-based analysis; watching Router Advertisements specifically confirms whether autoconfiguration information is being correctly and consistently advertised. - A specific ND-related failure mode worth checking for: inconsistent or conflicting Router Advertisements from MULTIPLE sources on the same segment (perhaps an unintended, unauthorized router or a misconfigured device also sending RAs) can cause hosts to receive conflicting prefix or default-router information, producing intermittent or inconsistent reachability that has no direct ARP-world analog, since ARP never involved anything resembling "which router should I use" in the first place.
Worked example
ip -6 neigh on an affected host shows an entry for the expected default gateway's link-local address in state FAILED, directly analogous to how an ARP entry in FAILED state would indicate the equivalent IPv4 problem. A capture filtered for icmp6 reveals TWO different devices on the segment sending Router Advertisements with conflicting prefix information, one legitimate, one from a misconfigured device that shouldn't be advertising at all; hosts intermittently picking up the illegitimate RA experience autoconfiguration and default-router inconsistency that manifests as exactly the kind of neighbor-reachability problem being investigated, even though the ROOT cause is upstream of neighbor discovery itself, in router advertisement, a category of problem ARP-based IPv4 networks simply don't have.
Trade-offs & pitfalls
Approaching an ND problem purely with ARP-troubleshooting habits (checking only the neighbor cache, as you would for ARP) can miss failure modes specific to ND's ADDITIONAL responsibilities, like conflicting Router Advertisements, since ARP never had anything analogous to diagnose in the first place; explicitly check Router Advertisement consistency as part of any thorough ND investigation, not just the neighbor cache entries themselves.
Explain how to use iperf (or iperf3) to distinguish between client-side, server-side, and network path bottlenecks. Provide test plans for both TCP and UDP tests, single-direction and bidirectional tests, and how to interpret results like retransmits, jitter, and achievable bandwidth.
Sample Answer
Direct answer
iperf (or iperf3) measures achievable throughput between a client and a server you control at both ends, which lets you localize a bottleneck by systematically varying WHERE the test runs from and to, rather than relying only on passive observation of real application traffic.
Structured elaboration
- Basic client/server test plan: run
iperf3 -son one end andiperf3 -c <server>on the other; comparing the achieved throughput against the theoretical capacity of the link (its advertised bandwidth) tells you whether you're anywhere near expected performance at all. - Isolating client-side versus server-side versus path bottlenecks: run the test between the two original endpoints first, then run it again with the SERVER role temporarily moved closer to (or onto) an intermediate point in the path, and again with the CLIENT role moved; if throughput improves dramatically when either endpoint is swapped for a point further along the path, the segment you just removed from the test is where the bottleneck lives.
- TCP versus UDP test plans: a TCP test reflects real achievable throughput INCLUDING the effects of congestion control and any loss on the path (loss causes TCP to back off, so a lossy path shows up as reduced TCP throughput even if raw bandwidth is fine); a UDP test (
iperf3 -u) sends at a specified rate REGARDLESS of loss, and directly reports the actual loss percentage and jitter, which isolates raw path loss/jitter from TCP's own congestion-driven throughput reduction. - Single-direction versus bidirectional tests: run the test in each direction separately (
-Rreverses the direction in iperf3) since asymmetric paths or asymmetric last-mile connections (common in many access networks) can show very different throughput in each direction; a bidirectional test (--bidir) additionally reveals whether simultaneous traffic in both directions interferes with either direction's throughput, relevant for links that aren't cleanly full-duplex in practice. - Interpreting key results: retransmits reported by a TCP test indicate loss occurred somewhere on the path during the test; jitter (reported by UDP tests) indicates variability in inter-packet arrival timing, relevant for real-time traffic; achievable bandwidth well below the link's rated capacity, combined with retransmits, points at loss-driven congestion-control throttling rather than a pure bandwidth ceiling.
Worked example
A TCP test between two data centers achieves only 200 Mbps on a link rated for 1 Gbps, with a nontrivial retransmit count reported. A UDP test at a controlled rate of 900 Mbps between the same two points shows 3% loss. This combination (TCP well under capacity, with retransmits, and UDP confirming real loss at a rate close to the link's capacity) points at actual packet loss on the path being the bottleneck, not a TCP window-tuning or latency issue; the TCP result alone couldn't distinguish "genuinely lossy path" from "TCP just needs window tuning for this RTT," but the UDP test's direct loss measurement resolves that ambiguity.
Trade-offs & pitfalls
A TCP-only test conflates two different possible causes of low throughput (real path loss versus TCP settings simply not being tuned for the path's bandwidth-delay product); running both TCP and UDP tests, and comparing, is what actually separates them. Also remember iperf tests generate real synthetic load; running a large-bandwidth test on a production path during business hours can itself cause the very congestion you're trying to diagnose, so schedule tests thoughtfully or use rate-limited tests when testing shared infrastructure.
In a production incident, when would you choose tcpdump over Wireshark, and what are the main trade-offs between live capture, saving a pcap, and analyzing offline after the fact?
Sample Answer
Direct answer
Choose tcpdump for anything live, fast, and command-line-driven, especially on a remote production host over SSH where you can't run a GUI; choose Wireshark (or tshark for the same engine without the GUI) when you need deep protocol decoding, statistical views, or to interactively explore a capture you've already saved.
Structured elaboration
- Live capture on the production host itself: tcpdump is lightweight, has no GUI dependency, and is almost always already installed; this makes it the default choice for capturing directly on a server during an incident, especially over a remote SSH session where a GUI isn't an option.
- Saving a pcap for later, deeper analysis: even when tcpdump does the actual capturing (because it has to run on the production host), the resulting file is typically pulled to a workstation and opened in Wireshark, which offers protocol dissectors, "Follow TCP Stream," and statistical views (IO graphs, conversation lists) that are far faster to use interactively than reading raw tcpdump output.
- Live capture with rich analysis needed simultaneously:
tshark(Wireshark's command-line sibling, using the same dissection engine) can display Wireshark-quality protocol decoding live in a terminal, which is useful when you need more than tcpdump's raw output but still can't or don't want to run a GUI. - Analyzing offline after the fact: once you have a saved pcap, Wireshark's interactivity (clicking through a stream, filtering and re-filtering without recapturing) is far more efficient for exploratory analysis than repeatedly reading raw tcpdump text output.
Worked example
During a live production incident over SSH: start with tcpdump -w incident.pcap <filter> to capture with minimal overhead on the host itself, since a GUI isn't available there and every unnecessary process running on an already-stressed production host has a cost. Once the capture is complete, scp the file to a workstation and open it in Wireshark to use "Follow TCP Stream" and the TCP time-sequence graph to visually spot patterns (like periodic retransmissions) that would take much longer to notice reading raw tcpdump text line by line.
Trade-offs & pitfalls
Running Wireshark directly against a live, high-traffic production interface (rather than tcpdump) risks more resource overhead exactly when the host is already under stress; and analyzing a saved capture purely with tcpdump's raw text output when Wireshark's visual tools are available wastes significant analyst time. Match the tool to the constraint you're actually under (remote/no-GUI/low-overhead versus deep interactive analysis), rather than defaulting to one tool for everything.
A client complains of sporadic high latency to your service. Demonstrate how to use 'ping' with different packet sizes and the DF bit (e.g., 'ping -M do -s') to detect MTU black hole issues and explain how Path MTU Discovery works. Include how to interpret 'Frag needed' ICMP messages and how PMTUD failures manifest in TCP connections.
Sample Answer
Direct answer
Use ping with a specific payload size and the "don't fragment" (DF) bit set to test whether a specific size threshold triggers a failure; a request that succeeds at one size and fails at a slightly larger one, with an ICMP message reporting a smaller MTU than expected, directly confirms an MTU black hole is the cause of sporadic high latency (via retransmission and retry delay) rather than general congestion.
Structured elaboration
- Establish the local link's expected MTU first: for standard Ethernet, 1500 bytes total, meaning 1472 bytes of ICMP payload plus 28 bytes of IP/ICMP header equals exactly 1500.
- Test at and just above the expected threshold with DF set:
ping -M do -s 1472 <host>(Linux syntax; macOS uses-D -s) should succeed if the path truly supports a 1500-byte MTU end to end;ping -M do -s 1473(crossing the 1500-byte boundary) failing specifically with a "Frag needed and DF set" message, rather than a generic timeout, is the direct signature of an MTU constraint somewhere on the path. - Read the MTU value reported in the ICMP message itself: this tells you the actual constraining link's MTU directly, rather than needing to guess or binary-search for it.
- Connect this to the reported "sporadic high latency" symptom: if application traffic occasionally sends packets exceeding this threshold (larger requests, or TCP segments that haven't yet been clamped to a smaller size), those specific packets get dropped and retransmitted, and the RETRANSMISSION delay (not the network's baseline latency) is what the client actually experiences as "sporadic high latency," specifically correlated with whichever requests happen to be large enough to hit the constraint.
- Confirm PMTUD (Path MTU Discovery) itself is working, or diagnose why it isn't: if the ICMP "fragmentation needed" message reliably returns from this direct ping test, PMTUD's underlying mechanism works for THIS test; if application traffic still exhibits the black-hole symptom despite this, some intermediate device may be filtering the ICMP specifically for the application's real traffic path while allowing it for this simpler ping test (different path, different device in between, or different treatment based on protocol).
Worked example
ping -M do -s 1472 10.20.30.40 succeeds cleanly. ping -M do -s 1473 10.20.30.40 fails immediately with ping: local error: Message too long, mtu=1400. This confirms a link along the path has an effective MTU of 1400 bytes, 100 bytes smaller than the standard 1500; any TCP segment the client sends larger than that (a very ordinary size for typical application data) will be dropped with DF set, forcing a retransmission cycle that shows up to the user as intermittent, sporadic slowness specifically for larger requests, while small requests remain unaffected and fast.
Trade-offs & pitfalls
It's tempting to treat "sporadic high latency" purely as a congestion or capacity question and reach straight for bandwidth-related tools; a quick, cheap DF-bit ping test at increasing sizes can rule in or out an MTU-related cause in seconds, before investing time in more elaborate congestion analysis. Also remember this direct ping test confirms PMTUD's MECHANISM works for ICMP specifically; if the real application traffic still hangs despite this test succeeding in reporting the correct MTU, suspect the ICMP is being filtered specifically on the application's actual path, not this simpler test path.
Unlock Full Question Bank
Get access to all 26 Network Troubleshooting and Diagnostics interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.