When you check a Galway train time, how does your request find the right server?
You tap to check when the next train leaves Galway. Your browser knows the website's name, yet your request has to cross several networks. What tells each router where to send it next?
Your browser is the client. It asks for a timetable by sending an HTTP request over TCP. TCP delivers data in order and can resend missing data. The server responds with the timetable. To see how data gets there, follow one packet carrying request data.
Look inside the Internet Protocol header of this outgoing packet. The source IP address, ending in ten, identifies where the packet came from. Here that's the client. The destination IP address, ending in twenty, identifies where the packet is meant to go. Here that's the server.
Look at the same outgoing packet. The laptop at the first address sends it to the timetable server at the second address. Which address goes in the destination field? Pick one.
Go back to what happens before the request is sent. The web address for this made-up site contains the host name rail dot example. A lookup through the Domain Name System, or D N S, returns the server's I P address. That becomes the destination for the request packet.
The packet goes from laptop A to router B. The lines show that B has links to routers C and D, and C has a link to server E. At each router, the destination address and that router's own routing table determine where the packet goes next.
At B, start with the packet's destination address. Slash twenty-four means the first twenty-four bits must match. In IPv4, that's the first three numbers. They match this entry, so B forwards to C. C checks its own table and finds that the destination network is directly connected. C forwards to E.
B's table shows two slash twenty-four routes. The first goes via D and the second via C. Compare the first three numbers of the destination address in the question with the first three numbers of each prefix. Which next hop should B choose? Pick one.
Watch for two mistakes: treating the destination address as a list of directions and thinking the right address guarantees arrival. Each router chooses the next hop from its own routing table. Even with the right address, a router can drop the packet if it has no matching route.
If the exam asks how a client sends a packet to a server when it knows only the host name, start with DNS. It looks up the server's IP address. The packet carries the client's source address and the server's destination address. Each router uses that destination to choose its next hop.