Highlights

Contents

Back matter

Interview question bank

Explain what the mechanism protects, how it works, and where it can fail. Use the running example rather than reciting a definition.

Q1. Why use packet switching?

It shares links among independent exchanges rather than reserving one complete circuit for each. Sharing enables utilization but introduces queues, loss, and variable delay.

Q2. What changes at each network boundary?

A link frame describes the local hop, an IP packet describes routed delivery, transport identifies endpoint communication, and application protocols give bytes meaning. A successful lower layer does not establish success above it.

Q3. Why does the college client ARP for its gateway?

The remote server is outside the client’s subnet. ARP resolves the local next-hop interface; it does not find the remote server’s Ethernet address across routers.

Q4. How does a switch differ from a router?

A switch learns and forwards link-layer addresses within a bridged domain. A router chooses a next hop using an IP route and places the packet in a new local-hop frame.

Q5. What does longest-prefix matching choose?

The most specific matching destination route. It does not choose the row that looks closest numerically, and a default route applies only when no more specific match wins.

Q6. Why is NAT not a firewall?

Translation rewrites addressing and keeps return mappings. Filtering decides which traffic may pass. Neither operation establishes application authorization.

Q7. What does TCP deliver?

An ordered reliable byte stream, not message boundaries. Receivers can get part of a request or several requests in one read; the application must frame its messages.

Q8. Why are flow control and congestion control different?

Flow control protects the receiving endpoint’s buffer. Congestion control responds to the path’s carrying capacity. A large receive window does not authorize sending beyond the congestion allowance.

Q9. What does DNS supply?

Typed name records through cached and hierarchical resolution. An address answer is neither a verified TLS identity nor a guarantee that the application is healthy.

Q10. What does HTTPS authenticate?

TLS checks the expected peer identity and protects the exchange according to its configuration. Reaching a routed address alone does not establish that identity, and encryption does not make application input trustworthy.

Q11. Why can curl work while browser JavaScript fails?

The browser enforces same-origin access and CORS response rules that curl does not enforce. A blocked script read is different from failed network delivery or rejected authentication.

Q12. Why use readiness-based I/O?

One event loop can wait for useful work across many idle sockets. Readiness does not guarantee a complete message or make CPU-heavy callbacks parallel.

Back matter

Exercises

One filled dot is a short explanation, two require diagnosis, and three require a complete design. Draw the mechanism before checking the solution.

E1 ●○○ A Bengaluru college lab reaches a remote admissions page. Explain why the destination IP stays remote while the first frame goes to the gateway.

E2 ●○○ A socket read returns half an HTTP request. Has TCP lost the rest?

E3 ●●○ Small network probes succeed but a large tunneled response stalls. What boundary would you inspect?

E4 ●●○ A login API works from curl but its response is unavailable to browser script. Plan a diagnosis.

E5 ●●● Trace an uncached HTTPS request from the campus browser to the server.

E6 ●●● Design a network diagnosis for a slow admissions page.

Back matter

Worked solutions

Check the reasoning and its assumptions, not only the conclusion.

E1. The route identifies a local next hop for the remote IP destination. The client resolves the gateway’s link address and frames the packet for that hop. Each router repeats local-hop delivery while forwarding toward the IP destination.

E2. Not necessarily. TCP exposes bytes as they become available and does not preserve application write boundaries. Retain the partial data and continue until the HTTP framing says the request is complete, handling EOF and errors explicitly.

E3. Encapsulation adds headers, reducing the payload that fits the path MTU. Check packet-too-big feedback, fragmentation policy, and the effective inner MTU. A small successful probe does not establish that a larger packet can cross the same path.

E4. Separate network reachability and HTTP status from the browser’s access policy. Inspect the requested origin, preflight where needed, and CORS response headers. Keep authentication and CSRF protection separate; broadening CORS is not a substitute for either.

E5. Resolve the hostname, choose a route, resolve the local gateway, and frame the packet. The gateway translates the configured tuple and routers forward it. TCP establishes transport, TLS verifies the intended hostname, and HTTP carries the request. The return path uses its own forwarding and NAT state; the application frames received bytes into a response.

E6. Measure name resolution, connection establishment, TLS, server processing, and transfer separately. Check cache hits, connection reuse, loss, queueing, receiver limits, and application waits. State measurement boundaries and compare repeated observations before blaming bandwidth or adding a proxy.