Start with the packet path. For a failure, name the first boundary you cannot prove works, then choose one observation that separates the likely causes. Commands assume Linux; some need iproute2, DNS utilities, or packet-capture privileges.
Packet flow and protocols
Describe connection setup in TCP.
Client sends SYN with sequence number x; server replies SYN-ACK with sequence y and acknowledgment x+1; client acknowledges y+1. This synchronizes sequence spaces. TCP then delivers an ordered byte stream with retransmission and flow/congestion control. See the TCP specification.
ping www.google.com: what happens?
Resolve the name through the host's configured resolution mechanism, select a route/source address, resolve the local next hop's link address if needed, then send ICMP Echo Requests and measure replies. Ping uses neither a TCP handshake nor HTTP. Blocked ICMP can coexist with working HTTPS.
What are the different OSI layers?
Physical, data link, network, transport, session, presentation, application. For debugging: link errors belong near layers 1/2, IP routing near 3, TCP/UDP near 4, and HTTP near 7. Real protocols do not fit every OSI boundary exactly.
How do TCP, IP, HTTP, and Ethernet relate?
HTTP is an application protocol; TCP transports a reliable byte stream; IP addresses and routes packets; Ethernet carries frames over a local link. HTTP/1.1 or HTTP/2 over TLS commonly uses TCP/IP; HTTP/3 uses QUIC over UDP/IP.
How does the OS determine which process gets a packet?
It matches protocol, addresses, ports, namespace, and socket state to a socket; established TCP connections use the endpoint tuple. The application reads that socket. Listening sockets, wildcard binds, and port reuse affect matching; the kernel does not select the process by HTTP URL.
How would you create a protocol similar to memcached?
Define commands, key/value encoding, explicit lengths or delimiters, responses, and error handling. TCP supplies bytes, so handle partial reads/writes and multiple messages in one read. Add maximum frame sizes, deadlines, expiry semantics, concurrent access rules, and backpressure. For example, a length-prefixed PUT frame must state both key and value lengths.
Routing, addressing, and boot
Given a destination IP, how does the OS determine the next-hop router?
Routing policy selects the relevant table; the most specific matching prefix normally wins within it. Metrics, multipath, and route attributes resolve other choices. ip route get 192.0.2.80 shows a lookup's interface, source, and next hop when applicable; use ip rule show for policy. See iproute2.
What is the purpose of a netmask in LAN routing?
It identifies the network prefix used to compare addresses and define route ranges. A connected route often makes destinations in that subnet directly reachable, while other destinations use another route or gateway. Routing-table and policy decisions are the actual forwarding authority; equal-looking prefixes do not establish working connectivity.
How does ARP work?
On an IPv4 link such as Ethernet, a host broadcasts a request for a neighbor's IPv4 address and learns its link address from a reply/cache. For remote destinations it resolves the local gateway, not the remote server. IPv6 uses Neighbor Discovery. See ARP.
How does a DHCP lease work?
Initial DHCPv4 allocation commonly uses Discover, Offer, Request, ACK. The lease has an expiry; at T1 the client normally tries renewal, and at T2 rebinding. Server-supplied timers can override the default 50%/87.5% lease fractions. After expiry the client must stop using the lease. See DHCPv4.
How does network boot work?
Firmware obtains network configuration and boot information, downloads a loader through its supported mechanism, and starts the kernel/early userspace. PXE commonly uses DHCP plus TFTP; UEFI HTTP Boot can use HTTP. Separate address allocation, loader download, kernel startup, and remote-root access failures.
A host boots without network connectivity. How do you troubleshoot it?
Check link, address/lease, route and source, neighbor resolution, DNS, then the actual application port. Use ip -br link, ip -br addr, ip route, ip route get DESTINATION, and ip neigh. If direct IP access works but names fail, focus on resolution; no address points earlier toward link, VLAN, or DHCP.
DNS and traceroute
How can DNS increase service uptime and resilience?
Run authoritative servers across failure domains and use health-aware endpoint answers or controlled failover where appropriate. Existing cached answers can remain until their TTLs expire, and existing connections are separate. Round-robin records alone do not detect failed backends; DNS updates are not instantaneous failover.
DNS records, primary/secondary servers, replication: how do these work?
A maps IPv4, AAAA IPv6, CNAME aliases, MX mail routing, NS authority, SOA zone administration, TXT text, PTR reverse names. A primary holds the writable zone; secondaries can obtain it through zone transfers. Both can answer authoritatively. Recursive resolvers cache answers; independently placed authorities improve DNS availability. See DNS concepts.
In IPv6, what is the equivalent of an A record?
AAAA. A holds an IPv4 address; AAAA holds an IPv6 address. PTR remains the reverse-lookup record type, under a different reverse namespace for IPv6.
How do you interpret traceroute output?
Each row represents probes with a particular hop limit, with responding router addresses and round-trip times. An asterisk means no reply within the timeout, which can result from rate limiting or filtering. A slow intermediate response alone does not prove forwarded traffic is slow. See traceroute.
Will application traffic follow the same traceroute path?
It may differ because of protocol/port hashing, multipath routing, route changes, and asymmetric return paths. TCP probes to the application's port can make the test more representative, but the displayed route is still a sample rather than a guarantee.
What part of the TCP header does traceroute modify?
Its hop-limiting mechanism changes the IP header's TTL, or IPv6 Hop Limit. TTL is not in the TCP header. Traceroute can use UDP, ICMP, or TCP probes; those choices affect how devices treat them.
Firewalls and slow networks
Describe a SYN flood and how to mitigate it.
An attacker sends enough connection-opening SYNs to exhaust handling capacity for incomplete handshakes. Discuss SYN cookies, connection/rate limits, filtering, and upstream protection for link saturation. Enlarging queues alone cannot absorb unlimited traffic. See SYN flood mitigations.
How do you determine whether traffic is blocked by a firewall?
Check the listener, route, policy counters/logs, and packet captures at relevant boundaries. Repeated unanswered SYNs alone cannot distinguish filtering from routing, host failure, or a broken return path. A RST often indicates refusal or active rejection; a completed handshake moves investigation above TCP.
How do you manage firewall configuration across thousands of hosts?
Generate versioned policy from inventory, validate it, canary it, and roll it out in bounded batches. Preserve management access, log drops, detect drift, and keep rollback available. Cover IPv4 and IPv6; connection-tracking and rule capacity are part of rollout planning.
What is the use of dedicated firewalls?
They centralize enforcement and inspection at network boundaries. Host firewalls add local workload context. Plan appliance capacity, redundant paths, routing symmetry, and state synchronization so the security boundary does not become a single failure point.
TCP versus UDP: which is easier to firewall at scale, and why?
TCP's handshake/state gives stateful firewalls useful connection information. UDP has no handshake, so implementations often track temporary flows with timeouts. Either can be expensive at high volume; rule design, connection tracking, protocol behavior, and throughput determine the practical answer.
How do you diagnose slow office traffic?
Compare one client with others, wired with wireless, local with external destinations, and DNS with direct-IP tests. Measure loss/latency, interface errors, Wi-Fi conditions, resolver time, and gateway/uplink saturation. A single slow traceroute hop is insufficient; find the first boundary where end-to-end behavior changes.
Metrics questions from the networking list
If you can monitor only three server metrics, which and why?
For a general serving host, choose CPU saturation, memory pressure, and filesystem free capacity: they expose inability to run, reclaim/OOM risk, and inability to allocate storage. Explain that a storage server or network appliance changes the choice. The monitoring guide gives the command-level answer.
What metrics would you add for a newly built service?
Request rate, errors, latency percentiles, and saturation; add completion/correctness for asynchronous work and the customer operation. Split by endpoint/version and compare to expected demand. Counts must distinguish fewer failures from fewer requests reaching the service. Worked monitoring answer.
Five-minute drill
A client times out connecting to a documented test endpoint. Explain what each observation would establish:
getent ahosts example.com
ip route get 192.0.2.80
nc -vz -w 3 example.com 443
sudo tcpdump -ni any -c 30 'host 192.0.2.80 and tcp port 443'
The IP is a placeholder, not the address of example.com; substitute the actual resolved destination for a live test. Expected: distinguish name resolution, route selection, a TCP attempt, and packet evidence. Next: troubleshooting and monitoring.