Read a sample: 1. A Connection Worth Following
A web page can appear so quickly that the network seems almost invisible. You enter an address, press Enter, and a page arrives. When it does not arrive, the message in the browser may offer little more than “This site can’t be reached.”
Between those two moments, several different jobs must succeed. The client needs usable network settings. It may need to translate a name into an IP address. It must decide where to send traffic, use a transport protocol to communicate with a service, and move information across a local network and potentially many remote networks. The destination must receive and process the request, and the response must make its own journey back.
None of this requires you to picture every electrical signal or memorize every field in every header before you can begin. A useful first step is to follow one request and ask a small set of questions at each stage:
- What information is being sent?
- What address or identifier is relevant here?
- Which device or software component handles it?
- What evidence would suggest that this stage worked?
- What could still go wrong afterward?
Those questions turn “the internet is down” into a problem you can investigate.
Imagine a technician named Maya sitting at a laptop on a small office network. She opens a browser and visits:
https://www.example.com/
For the walkthroughs in this book, assume Maya’s laptop has the following IPv4 configuration:
Also assume that, for this example, resolving www.example.com returns 203.0.113.20. That address stands in for a remote web service in our illustrations; it is not a promise about where the real name resolves. The addresses and network are hypothetical, chosen so that we can focus on how the pieces relate.
Maya’s laptop is the client: it initiates the interaction by requesting a resource. The remote system providing the web service is the server. These terms describe roles in this exchange, not necessarily special types of hardware. A single computer can act as a client in one interaction and a server in another.
The laptop connects to a local network, also called a local area network or LAN. It might connect through an Ethernet cable or through a wireless access point. Other devices on the LAN may include switches, printers, and servers. A router connects the local network to other networks and can serve as the laptop’s default gateway: the next-hop device used when the laptop needs to reach a destination outside its local subnet and has no more specific route.
The web server is on a remote network. Traffic between Maya and that server may pass through several routers and service-provider networks. Maya does not need to know the name of every router along the way. Her laptop needs enough information to send the traffic to an appropriate next hop, and each router makes its own forwarding decision.
A simplified view looks like this:
Maya’s laptop → local network → default gateway → other networks → web server
The response travels back to Maya, although it need not follow precisely the same route in reverse. We will return to that detail later; for now, remember that a working exchange needs communication in both directions.
The URL Maya enters contains more than one kind of information. In https://www.example.com/, https identifies the scheme the browser uses for the resource, www.example.com is the hostname, and the final slash represents the root path. A URL can also contain other components, such as a different port, a longer path, or a query.
The hostname is convenient for people and applications, but IP forwarding relies on IP addresses. The Domain Name System, or DNS, helps translate names into addresses. In our example, Maya’s client obtains 203.0.113.20 as an address for the hostname. The DNS server that answers the query is not necessarily the web server Maya wants to reach; it supplies information the client can use to find a destination.
The IP address answers a different question from the hostname: it identifies a network-layer destination for the traffic. A port number adds another distinction, helping direct transport traffic to an appropriate service on a host. HTTPS commonly uses TCP destination port 443 in the particular TCP-based example we will follow. Maya’s client also uses a source port to identify its side of the conversation.
Local delivery introduces still another kind of address. On an Ethernet network, a MAC address identifies an interface for delivery on the local link. When the destination is remote, Maya’s laptop normally sends the initial frame toward the gateway’s local interface, not directly to the remote server’s MAC address.
These identifiers cooperate rather than compete:
- The hostname names the resource’s host in a form the browser can use.
- The destination IP address identifies the remote network-layer destination.
- The destination port identifies the target transport service on that destination.
- The local next-hop MAC address helps deliver a frame across the current link.
A common beginner mistake is to treat all of these as different versions of the same address. Instead, think of them as answers to different questions. Knowing a hostname does not automatically mean DNS is working. Knowing an IP address does not prove that a web service is listening. Knowing the gateway’s MAC address does not mean the remote server can be reached.
Before examining the details chapter by chapter, let’s follow the request at a comfortable…