Why networks exist: hosts, roles and peers
Follow a request across links and routers, see client and server as jobs, watch peers share a file, and cut an uplink to tell a network from the Internet. Network foundations and switching models · Computer networks.
Mira's laptop holds nothing about next week's lecture. The notes are stored on Atlas, a server in a data centre far from her desk. To fetch those remote notes, her laptop must communicate with the machine that holds them. That is what a network is for: reaching a service or data that lives somewhere else, or sharing what you have. So what happens between Mira pressing Enter and the page appearing, and which device does which job on the way?
One request, four devices
Mira's browser sends a request for the notes. Three links carry it: laptop to home router, home router to the ISP's router, and ISP router to Atlas. A real path to a distant server crosses more routers than this, but two are enough to show their job.
- The laptop and Atlas are hosts, the end systems where applications run. The request starts in the browser on one and is taken off the network by the application on the other.
- A link joins two neighbouring devices. This path has 3 links, and the request crosses them one at a time.
- The home router and the ISP router are routers. A router receives a packet on one link, reads its destination address and sends it on along another link. Neither router runs the notes service or is the destination, so each only forwards. The home router is also the laptop's default gateway: it receives traffic when no more specific route applies.
In this simplified example, one packet carries the request and one carries the answer along the same 3 links, with no retransmissions: 6 link crossings. Real return paths can differ, and a message can require multiple packets. The box on Mira's shelf is really a switch, a Wi-Fi access point and a router in one case, usually with an address translator as well; here only its router job matters.
One request across two routers
Read the steps as text
- Nothing has been sent yet. Laptop will ask Atlas for the notes page, with two routers on the path between them.
- The application on Laptop creates the request for notes. Because it starts the interaction, it is the client.
- Home router receives the request for notes from Laptop. It is not the destination, so it forwards the request for notes toward Atlas, choosing the next link from the destination address.
- ISP router receives the request for notes from Home router and forwards it toward Atlas.
- Atlas receives the request for notes from ISP router. This is the last link of the path.
- The application on Atlas takes the request for notes off the network. It waits for requests and answers them, so Atlas is the server in this interaction.
- Atlas answers with the notes page. Sending the answer is the server's side of the interaction.
- ISP router receives the notes page from Atlas and forwards it toward Laptop, the host that asked.
- Home router receives the notes page from ISP router and forwards it toward Laptop, the host that asked.
- Laptop receives the notes page from Home router. This is the last link of the path back.
- The application on Laptop gets the notes page, which finishes the interaction. Every device on the path had a job in this interaction.
Client and server are jobs
In that exchange the laptop is the client because its application requests the notes, and Atlas is the server because its application provides them. The words name an application role in one exchange, not a kind of machine.
Another day Mira opens her grades on the campus network. Her laptop asks a report server through one router, and the report server answers. Afterwards, for a separate update, the report server asks a database host for the day's grade rows, a request of its own. In the first interaction the report server is the server. In the second it is the client, and the database is the server. Nothing about the hardware changed between them.
One host in two roles
Read the steps as text
- Nothing has been sent yet. Two interactions will run in turn. First, Laptop will ask Report server for the grades page, with one router on the path between them.
- The application on Laptop creates the request for grades. Because it starts the interaction, it is the client.
- Campus router receives the request for grades from Laptop. It is not the destination, so it forwards the request for grades toward Report server, choosing the next link from the destination address.
- Report server receives the request for grades from Campus router. This is the last link of the path.
- The application on Report server takes the request for grades off the network. It waits for requests and answers them, so Report server is the server in this interaction.
- Report server answers with the grades page. Sending the answer is the server's side of the interaction.
- Campus router receives the grades page from Report server and forwards it toward Laptop, the host that asked.
- Laptop receives the grades page from Campus router. This is the last link of the path back.
- The application on Laptop gets the grades page, which finishes the interaction. Database had no job in this interaction.
- Now Report server starts a new interaction and creates the request for rows. A moment ago Report server was the server; a role belongs to an interaction, not to a machine.
- Database receives the request for rows from Report server over the last link.
- The application on Database takes the request for rows off the network. Database is the server in this interaction.
- Database answers with the grade rows.
- Report server receives the grade rows from Database over the last link.
- The application on Report server gets the grade rows, which finishes the interaction. Laptop and Campus router had no job in this interaction.
Peers request and provide
Some services let ordinary machines share the serving. Ana, Ben and Cy share an office network and want a song file of 192 KB, split into 3 pieces of 64 KB. Ana holds pieces 1 and 2, Ben holds piece 3, and Cy holds none. Cy asks a directory host, which answers with the holders, Ana and Ben. It sends Cy no part of the file.
The pieces then move between the peers themselves. Ana sends piece 1 to Cy and Ben sends piece 3 to Cy. Ana sends piece 2 to Ben, Cy passes piece 1 on to Ben, and Ben passes piece 2 on to Cy. Last, Cy passes piece 3 on to Ana. Six transfers move 6 x 64 = 384 KB, and the directory carries 0 KB of it. Here every peer has both sent and received pieces. In peer-to-peer systems, peers can both request and provide resources, though not every peer must do both.
Peers and a directory
Read the steps as text
- Nothing has been shared yet. Directory holds none of the file; it only keeps a list of who does. Cy wants the song file: 3 pieces, 64 KB each, 3 x 64 = 192 KB in all.
- Cy asks Directory who holds the song file. The question is small and carries no part of the file.
- Directory answers with the holders it knows: Ana and Ben. It only points Cy to them; it holds no piece itself.
- Ana sends piece 1 (64 KB) to Cy. It goes peer to peer; Directory is not on the path, so Directory still carries 0 KB of the file.
- Ben sends piece 3 (64 KB) to Cy. Cy has now received 128 KB, and Ben has sent 64 KB.
- Ana sends piece 2 (64 KB) to Ben. Ben has now received 64 KB, and Ana has sent 128 KB.
- Cy received piece 1 earlier and now passes it on to Ben: this peer has both received and sent pieces.
- Ben now holds all 3 pieces, 192 KB in all, so Ben's copy of the song file is complete.
- Ben received piece 2 earlier and now passes it on to Cy.
- Cy now holds all 3 pieces, 192 KB in all, so Cy's copy of the song file is complete.
- Cy received piece 3 earlier and now passes it on to Ana.
- Ana now holds all 3 pieces, 192 KB in all, so Ana's copy of the song file is complete.
Peer-to-peer does not mean a cable between every pair. Every piece still crosses the office router, and the directory is a helper for finding holders, not a relay.
A network is not the Internet
An office has a laptop, a printer and a switch, which passes traffic between the devices that plug into it. An office router joins the switch to the ISP, and beyond it sits a web server. The laptop prints through 2 links, laptop to switch and switch to printer, and it fetches a page from the web server through 4 links: switch, office router, ISP router, web server.
Now the cable between the office router and the ISP router is cut. The print job never used that link, so it still arrives. The web request goes as far as the office router and stops, because the only path to the web server continues over the broken link.
An office with its uplink cut
Read the steps as text
- Nothing has gone wrong yet. Each flow uses the destination's address directly, so no name server is needed.
- Laptop sends the print job to Printer through Switch, and it arrives. Every link works.
- Laptop sends the web request to Web server through Switch, Office router and ISP router, and it arrives.
- Office router and ISP router lose the link between them. Nothing crosses it in either direction from now on.
- Laptop sends the print job again. The path to Printer never uses the failed link, so it still arrives.
- Laptop sends the web request again, but Office router is as far as it can go, because the only path continues over the failed link. It stops there.
So the office is a network: hosts joined by links and by devices that pass traffic along. It is one network, not the entire Internet. The Internet is a network of such networks, run by many operators and joined by routers. One caution: the laptop addresses the printer directly. An uncached lookup that required an outside name server would fail too.
Recap
- In the example, a request crosses 3 links, routers forward it, and its answer returns along those links: 6 crossings.
- Client and server are jobs in one interaction, and a host can hold both in turn. Peers can request and provide; a directory may only say who holds what.
- In the office example, the intact local links still work after the only uplink fails. The Internet joins networks run by many operators.
Peers without a directory
Some peer-to-peer systems have no directory host at all. They keep the list of holders in a distributed table spread over the peers themselves, so there is no single central directory, and a peer can find holders by asking other peers in turn.
Continue to From network edge to shared core to place these roles inside access networks and the shared Internet core.