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.
Site-to-site IPsec tunnel reports fragmentation and throughput problems. Explain the steps to determine whether ESP or encapsulation overhead causes MTU issues, how to measure overhead and adjust PMTUD, and the pros/cons of applying MSS clamping on remote clients versus reducing tunnel MTU on endpoints.
Sample Answer
Direct answer
For a site-to-site IPsec tunnel showing fragmentation and throughput problems, the diagnostic question is whether the ESP (Encapsulating Security Payload) encapsulation overhead is pushing packets past the path's actual MTU; measure the overhead precisely, compare it against the available MTU budget, and choose between MSS clamping and adjusting the tunnel's own MTU based on where you can most safely make the change.
Structured elaboration
- Measure the actual ESP overhead for this specific configuration: ESP adds a header, an initialization vector (if the cipher requires one), padding (to align to the cipher's block size), and an authentication trailer; the exact byte overhead depends on the specific cipher suite and authentication algorithm negotiated, so calculate or look up the SPECIFIC overhead for what's actually negotiated on this tunnel, rather than assuming a generic estimate.
- Compare that overhead against the available MTU budget on the underlying path: if the underlying path supports a standard 1500-byte MTU, and ESP overhead for this specific configuration is, say, 50-60 bytes, then any original packet larger than roughly 1440-1450 bytes will be pushed over 1500 bytes once encapsulated, triggering fragmentation (or an outright drop if DF is set and fragmentation isn't permitted).
- Adjust and measure PMTUD (Path MTU Discovery) behavior specifically for the tunnel: confirm whether ICMP "fragmentation needed" messages generated for oversized ENCAPSULATED packets are correctly reaching back to the ORIGINAL sender (not just the tunnel endpoint), since a common failure mode is the ICMP message getting lost or misattributed somewhere in the encapsulation/decapsulation process, leaving the true original sender unaware it needs to shrink its segments.
- Choose between MSS clamping on remote clients versus reducing tunnel MTU on endpoints, with their real trade-offs: MSS clamping (adjusting the TCP MSS value in the SYN packet as it passes through the tunnel endpoint, forcing clients to negotiate a smaller segment size from the start) is transparent to clients and doesn't require touching every device's MTU setting individually, but only affects TCP (not UDP or other protocols using the tunnel), and adds a small amount of processing overhead at the tunnel endpoint for every new connection; reducing the tunnel interface's own MTU (having the tunnel endpoint advertise and enforce a smaller MTU to whatever's sending into it) is protocol-agnostic (affects all traffic, not just TCP) but requires the sending devices' own PMTUD to work correctly to benefit from it, and changes a setting that could have broader effects if not scoped carefully to just the tunnel interface.
- Verify the change resolves the SPECIFIC symptom without introducing a new one: after applying either fix, confirm both connectivity (packets are no longer being dropped/fragmented) and throughput (the fix didn't overcorrect to an unnecessarily small MSS/MTU that leaves usable bandwidth on the table).
Worked example
Calculating the specific ESP overhead for the negotiated cipher suite (AES with a specific mode plus HMAC authentication) yields roughly 56-60 bytes of overhead depending on padding. Against a 1500-byte underlying path MTU, this means any original TCP segment above roughly 1440 bytes triggers fragmentation once encapsulated. Applying MSS clamping at the tunnel endpoints to cap TCP MSS at a value accounting for this overhead (rather than relying on PMTUD, which testing shows isn't reliably working through this specific tunnel configuration) resolves the fragmentation without needing to modify the underlying tunnel interface's MTU setting, since the fix is scoped specifically to TCP's own segment-size negotiation.
Trade-offs & pitfalls
Choosing MSS clamping without checking whether significant UDP or other non-TCP traffic also traverses this tunnel risks leaving that traffic still exposed to the same fragmentation problem, since clamping only affects TCP's own MSS negotiation; if meaningful non-TCP traffic is present, tunnel-MTU adjustment (or a combination of both) may be needed instead. Also be precise about the ESP overhead calculation rather than using a rough estimate; getting this number wrong in either direction either leaves the problem partially unresolved or unnecessarily shrinks throughput more than needed.
Design a systematic approach to determine whether an observed packet loss is caused by a faulty network interface, a misconfigured switch port (e.g., rate limiting), or a downstream application server. Describe tests at the NIC, switch, and server levels including interface counters, ethtool statistics, port-speed/duplex, queue drops, and server application logging.
Sample Answer
Direct answer
Distinguishing a faulty NIC, a misconfigured switch port, and a downstream server as the cause of packet loss means checking evidence at each of the three levels independently, since each has its own distinct counters and symptoms that don't overlap much, which lets you localize the cause by process of elimination rather than guessing.
Structured elaboration
- NIC-level checks:
ethtool -Son the host shows detailed hardware statistics (errors, dropped packets, ring buffer overflows) specific to that interface; a NIC-side problem typically shows rising error/drop counters AT THE HOST, correlated with the loss. - Switch-port-level checks:
show interface(or equivalent) on the connected switch port shows its own independent counters (input errors, output drops, rate-limiting/policing hits); a misconfigured rate limit or a duplex mismatch shows up here specifically, and importantly, may show DIFFERENT (or no) errors compared to the host's own NIC counters, since a rate-limiting policy applied at the switch can drop traffic the host's NIC never even sees as an error (from the host's perspective, the packet simply never arrived, with no local error to explain why). - Server-side application-level checks: application logging and server-level resource metrics (CPU, memory, whether the receiving process is even keeping up with incoming data) can reveal a downstream server issue (like a receive buffer filling because the application isn't reading fast enough) that produces packet loss with NEITHER the NIC NOR the switch showing any error at all, since the loss in this case happens at a layer above what either of those devices' counters track.
- Cross-reference all three simultaneously, not sequentially in isolation: since a rate-limiting switch port and a slow application can BOTH produce "no NIC errors, but real loss," checking NIC counters alone and finding them clean does not rule out either of the other two; check all three levels' relevant evidence together to see which one actually correlates with the timing of reported loss.
- Use a process of elimination test where feasible: temporarily bypassing or isolating one segment (a direct host-to-host test bypassing the switch, if feasible) can conclusively rule a specific segment in or out, when counter evidence alone is ambiguous or contradictory.
Worked example
Host NIC counters show zero errors or drops. The connected switch port's counters show a nonzero, growing count of output drops due to a rate-limiting policy applied to that port. This directly localizes the cause to the switch port's configuration, not the NIC (which correctly shows nothing wrong, since the NIC never even sees packets the switch decided to drop before forwarding them) and not the server (which is never even reached by the dropped traffic in the first place).
Trade-offs & pitfalls
Checking only the host's own NIC counters and concluding "no errors, so it's not the network" is a common and incomplete conclusion, since a switch-side rate limit or policy drop can occur entirely upstream of what the host's NIC counters would ever reflect. Similarly, a server-side application bottleneck (like a slow-reading process) can produce real, measurable loss with NEITHER the NIC NOR the switch showing anything unusual, since the loss happens above the layer either device's counters track; always check all three levels together rather than stopping at the first clean-looking counter.
You find a fiber/copper link between two switches reporting 'down' in a datacenter. Describe the step-by-step physical layer troubleshooting you would perform (LEDs, cable type and pinout, SFP/optic compatibility and transceiver diagnostics, polarity on duplex fiber, ethtool/ifconfig output on hosts, vendor 'show' commands on switches, and simple loopback tests). Include what a VFL or OTDR would show and when to escalate to cabling team.
Sample Answer
Direct answer
A physical link reporting "down" between two switches is troubleshot bottom-up, literally: confirm the cable and connector first, then the optic/transceiver, then the port configuration, escalating to specialized tools only once the simple checks are exhausted.
Structured elaboration
- Check the physical indicators first: link LEDs on both ends (a dark or amber LED where a solid or blinking green is expected is often diagnostic on its own), and confirm the cable is actually seated and undamaged; the cheapest checks come first.
- Confirm cable type and pinout match the link's expectations: a straight-through cable used where crossover is needed (on older equipment without auto-MDI/MDX), or a cable rated for a lower category than the link speed requires, can produce exactly this symptom.
- Check SFP/optic compatibility and diagnostics: many switches expose transceiver diagnostics (DOM/DDM, Digital Diagnostics Monitoring) reporting the optic's actual transmit/receive power levels; a receive power reading far below the optic's rated sensitivity threshold points at a dirty or degraded fiber connection, or a mismatched optic (wrong wavelength, wrong distance rating) for the fiber type in use.
- Check host-side and switch-side software state:
ethtoolorifconfigon a host, and vendor "show interface" commands on switches, to confirm the port isn't administratively disabled and to check reported speed/duplex; a duplex mismatch specifically can cause a link to come up but perform terribly, which is a related but distinct symptom from a link that won't come up at all. - Check polarity on duplex fiber: swapped transmit/receive fibers on a duplex connection is a classic, easy-to-overlook installation mistake that produces exactly a "link down" or "link flapping" symptom despite every other check looking fine.
- Use specialized tools when simple checks don't resolve it: a Visual Fault Locator (VFL, a visible laser) can reveal a physical break or bad connector in fiber by eye; an OTDR (Optical Time-Domain Reflectometer) can precisely locate a break, excessive bend, or connector loss along a longer fiber run that a simple loopback test can't pinpoint. A basic loopback test (looping a link's transmit back to its own receive, where supported) confirms whether the local port's transceiver and circuitry are functioning at all, independent of anything downstream.
- Escalate to the cabling team once you've confirmed the fault is genuinely physical (not port configuration) and beyond what DOM/DDM readings and a loopback test can resolve from the network side.
Worked example
Both switches show the port LED dark. DOM/DDM readings on one switch show the local optic transmitting at expected power, but receiving essentially nothing. A loopback test on that same port (transmit looped to receive) shows the local transceiver and switch circuitry functioning correctly, isolating the fault to the fiber path itself, not the equipment on either end. An OTDR run against that fiber run pinpoints a break at a specific distance, consistent with recent construction work reported near that cable path, and the finding is escalated to the cabling team with a precise location rather than "the fiber seems bad somewhere."
Trade-offs & pitfalls
Jumping straight to an OTDR or escalating to the cabling team before confirming the simple things (cable seated, correct optic, port not admin-down) wastes the cabling team's time on problems that were actually configuration; conversely, spending too long on network-side checks when DOM/DDM and loopback tests have already isolated a physical fault delays a fix that's outside your control anyway. Work bottom-up, but escalate promptly once you've genuinely isolated the fault to the physical layer.
A set of firewall or security-group rules is intermittently blocking legitimate traffic, and you don't yet know which rule or which layer (stateful firewall, ACL, NAT) is responsible. Describe a systematic, minimally invasive way to narrow this down using captures and logs, and how your approach differs between an on-prem stateful firewall and a cloud model where security groups and network ACLs behave differently.
Sample Answer
Direct answer
When you suspect a firewall or security-group rule set is intermittently blocking legitimate traffic but do not know which specific rule, a controlled bisection, splitting the rule set in half and testing each half's effect, finds the offending rule in a bounded number of steps without needing to understand every rule up front. The mechanics of that bisection differ meaningfully between an on-prem stateful firewall and a cloud model split across security groups and network ACLs.
Structured elaboration
- Reproduce the failure reliably first: confirm you can trigger the block on demand (a specific request, from a specific source, at a specific time) before starting bisection; bisecting against a failure you cannot reliably reproduce will produce misleading results.
- Split the rule set and test each half: apply the first half of the current rule set in a test/staging path (or, if testing in production is unavoidable, during a low-traffic window with a fast rollback plan) and check whether the failure still occurs; whichever half reproduces the failure contains the offending rule, and you discard the other half from consideration.
- Repeat on the implicated half: continue splitting the remaining candidate rules in half each time; this converges to a single rule in roughly log2(N) test cycles rather than testing N rules one at a time.
- Use packet captures alongside bisection, not instead of it: a capture at each side of the firewall during a test cycle can confirm which packets are actually being dropped at that stage, corroborating (or correcting) what the bisection result implies.
- Adapt the mechanics to the platform: on an on-prem stateful firewall, the rule set is usually one ordered list evaluated top to bottom with implicit session/connection tracking, so bisecting means temporarily disabling or reordering blocks of rules on the same device, and a rollback is a single configuration revert on that device; because the firewall is stateful, return traffic is handled automatically once the forward direction is allowed. In a cloud model, you are usually bisecting across at least two independently evaluated layers, security groups (stateful, return traffic implicit) and network ACLs (stateless, every direction must be explicitly allowed), often owned by different teams; bisection needs to identify not just which rule but which layer first, since a security group change and a NACL change can look identical from the traffic's perspective but require editing entirely different resources. Cloud rule changes are frequently safer to test than on-prem ones because you can often clone a security group or duplicate a NACL and attach it to a single test instance or subnet without touching the shared, in-place resource that live traffic depends on.
- Roll back safely: keep every intermediate rule-set version so you can restore the last known-good state immediately if a test step causes unexpected impact, and always have an explicit, tested rollback path, not just a plan to revert if needed.
Worked example
A rule set of 32 rules is suspected on an on-prem firewall. Applying rules 1 through 16 only: failure still occurs. Applying rules 1 through 8: failure occurs. Applying rules 1 through 4: failure does not occur. Applying rules 5 through 8: failure occurs. Applying rule 5 alone: failure occurs. Five test cycles isolated the single offending rule out of 32, versus up to 32 cycles testing them one at a time, and because it is one on-prem device, each test cycle is a single config push and revert. Contrast this with the equivalent cloud case: the same intermittent block could be caused by either the instance's security group or the subnet's NACL. Here the first bisection step is not 'which rule' but 'which layer': temporarily attach a maximally permissive NACL to a cloned test subnet while leaving the security group untouched; if the failure disappears, the NACL (a stateless, easy-to-misconfigure return-path rule) is implicated, and only then do you bisect within that specific NACL's rule list, without ever needing to touch the security group or risk the shared production subnet.
Trade-offs & pitfalls
Bisection assumes the failure is caused by exactly one rule (or a small, testable subset); if two rules interact (each individually harmless, together causing the block), naive bisection can miss it, since removing either half individually may appear to fix the symptom while the real interaction goes undetected. This risk is higher in the cloud case specifically, because a security group rule and a NACL rule can interact (one allows the connection out, the other silently drops the stateless return), so a bisection that only ever tests one layer at a time can converge on a wrong or incomplete answer; test across both layers, not just within one. State this assumption explicitly, and if bisection does not converge cleanly, consider that you may be looking at an interaction rather than a single rule. Testing rule-set changes in production carries real risk on-prem, where there is often only one shared device; the cloud model's ability to clone a security group or NACL onto a single test resource lowers that risk considerably and should be preferred over testing directly against the shared production resource whenever it is available.
You need to process a set of packet captures (or a live traffic feed) to answer a concrete question, e.g. which flows are retransmitting the most, or what the handshake latency looks like per flow, without opening each one by hand. Describe how you'd script this (naming the library or tool you'd reach for), what fields you'd extract, and what you'd have to be careful of, like out-of-order packets or multiple capture points, for the numbers to be trustworthy.
Sample Answer
Direct answer
For a concrete question like "which flows are retransmitting the most" or "what's the per-flow handshake latency," script it with a pcap-parsing library (Python's scapy, or shelling out to tshark's field-extraction mode) rather than opening captures by hand; the key engineering concerns are correctness (handling out-of-order and duplicate packets) and scale (not loading an entire large capture into memory at once).
Structured elaboration
- Choose the extraction path:
tshark -r file.pcap -T fields -e ip.src -e ip.dst -e frame.lenstreams field values without building Python objects for every packet, and scales best for very large captures; scapy'sPcapReader(as opposed tordpcap) reads packets one at a time, which is the right choice when you need custom logic per packet in Python. - Aggregate incrementally: keep running totals in a dictionary keyed by the flow tuple (source IP, destination IP, and for TCP also ports), rather than storing every packet, so memory use stays flat regardless of capture size.
- Handle multiple capture points and out-of-order packets explicitly: if flows are captured at more than one point in the path, do not assume packet order in the file matches wall-clock order; sort by timestamp within each flow before computing anything that depends on ordering (like handshake latency, which needs to match a SYN to its SYN-ACK, not just the Nth and N+1th packet).
- Validate against a known-answer capture before trusting the script's output on real production data.
Worked example
Here is a minimal top-talkers-by-bytes script, executed against a synthetic 60-packet capture (3 flows) built with scapy for this validation:
from collections import defaultdict
from scapy.all import PcapReader, IP
def top_talkers(path, n=10):
counts = defaultdict(int)
byte_totals = defaultdict(int)
with PcapReader(path) as reader:
for pkt in reader:
if IP in pkt:
key = (pkt[IP].src, pkt[IP].dst)
counts[key] += 1
byte_totals[key] += len(pkt)
return sorted(byte_totals.items(), key=lambda kv: kv[1], reverse=True)[:n]
Run against the test capture, this correctly reported two flows: 10.1.1.10 -> 10.2.2.20 with 40 packets totaling 28,700 bytes, and 10.1.1.11 -> 10.2.2.21 with 20 packets totaling 11,700 bytes, matching the known composition of the synthetic file exactly. For handshake-latency specifically, the same pattern applies but keyed by the full 4-tuple, matching each SYN to the SYN-ACK sharing its source/destination ports and computing the timestamp delta.
Trade-offs & pitfalls
Loading an entire multi-gigabyte capture with rdpcap (which reads the whole file into memory as a list) is a common and expensive mistake; use a streaming reader instead. When captures come from multiple points, do not assume a packet appearing in one capture but not another means it was dropped; capture loss at the tap/collection point itself is a real, separate failure mode from network packet loss, and conflating the two produces wrong conclusions.
Unlock Full Question Bank
Get access to all Network Troubleshooting and Diagnostics interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.