0003.d Network components and topologies
On this page
A network is a set of devices that can exchange data, and it can be described at several levels. At the largest level is its scope, whether it covers a building or spans continents. Within that scope are the components that move data, each working at a particular boundary: within one network, between networks, between wireless and wired, or between inside and outside. Those components can be connected in different shapes, called topologies, and the shape a designer chooses largely determines the two properties this section cares most about, how well a network grows (scalability) and how well it survives failures (reliability). Finally, at the level of the devices' roles, a network can be organized around dedicated servers or around peers that share with each other. The section takes these levels in turn.
Local and wide area networks#
The first distinction is by distance. A local area network (LAN) connects devices in a limited area, such as a school building, and a wide area network (WAN) connects networks across large distances, such as the long-distance links that join a set of clinics to a main hospital, or a leased line joining two school buildings. Distance, not ownership, decides the category, so a district that owns and administers all of its equipment can still have a LAN in each building joined by a WAN connection. The Internet is the largest WAN, because it interconnects networks around the world. Every other network you might name, a school's or a city's or a company's, is one smaller network among those the Internet joins.
The distinction is useful for diagnosis. Traffic within a building travels over the LAN without using the outside line, while traffic to the Internet has to cross the WAN link. So if a building's internal network keeps working during an outage, computers can still reach the printers and file server inside the building but not outside websites. In the same way, if local file transfers are fast but Internet access is slow, the switch, the network adapters, and the local server are performing well, and the WAN link, the one part used only by the slow transfers, is the likely bottleneck.
The components that move data#
Each kind of network equipment works at a particular boundary. A switch connects devices within a local network. It forwards data using hardware addresses (the MAC addresses described in 0003.e), keeping a table of which hardware address is reachable through which of its ports. A router forwards packets between networks using IP addresses, and packets crossing the Internet pass from router to router until they reach the destination network. In a school, a switch handles the traffic between a teacher's computer and the printer down the hall, while routers carry web traffic out to other networks. The difference matters when changing a network. Adding a second switch connected to the one already serving a floor extends the same local network and adds ports, while a router would place the new computers on a separate network. Conversely, joining several departments' separate networks calls for a router with one connection to each. A third kind of identifier, the port number, separates the applications running on a single host, and 0003.e returns to it.
A wireless access point connects Wi-Fi devices to a wired network, and adding more access points extends coverage. If students in a few classrooms far from the existing access point get a weak signal, the problem is coverage, not capacity, so the remedy is another access point near those rooms. A firewall sits at the boundary between inside and outside, allowing or blocking traffic according to a set of rules. It doesn't choose routes, encrypt data, or hand out addresses. Limiting incoming connections shrinks what outsiders can reach, which protects internal services that shouldn't be exposed. But a firewall can only check traffic against its rules, so it can't tell that a permitted login comes from someone using stolen credentials, and it doesn't stop phishing, insiders, or hardware faults. It is one layer of protection among several, as 0004 describes.
Topologies#
Components can be connected in different shapes, and a network's topology describes how its devices are connected and communicate. Topology is about the pattern of communication, not cabling, so a set of wireless devices that all communicate through one central device forms the same topology as a wired one. The common topologies differ mainly in two things: what a single failure takes down, and how many connections the design requires.
In a star topology, each device connects to a central switch. Adding a device is easy, since it needs only one cable to the center, and because each device has its own link, one cable's failure affects only one device. This is also a diagnostic clue: if one computer in a star loses its connection while the others work, the fault most likely lies on that computer's own cable or its connection at the switch, since a failed central switch would affect every computer. That central device is the star's weakness. All traffic depends on it, which makes it a single point of failure, and only redundancy, such as a second switch with links that traffic can fail over to, removes that dependence. A bigger switch or a firewall leaves the network relying on one device.
Two older topologies show why the star won. In a bus, all devices share one cable, and in a ring, each device connects to two neighbors, with data passing from device to device around the loop. In their simple forms, neither offers an alternative path, so a single break in the shared cable, or a single failed device or link in the ring, can disrupt much of the network. This is why switched stars replaced them: a dedicated link for each device contains a cable failure to one device and makes adding devices simpler, at the cost of more cable and of the dependence on the central switch.
A mesh goes the other way, connecting each device to several others. This provides multiple paths, so messages can travel around a failed device or link, which gives fault tolerance. The cost is the number of connections to establish and maintain. In a full mesh, where every device connects to every other, n devices need n(n-1)/2 links, so six devices need 6 * 5 / 2, or 15. That number grows roughly with the square of the number of devices, which makes a full mesh impractical for many computers. Meshes suit settings where individual links are unreliable and paths matter more than cost, such as wireless sensors, and the Internet's core has a mesh-like structure so that traffic can route around failed links and routers.
A tree combines stars into a hierarchy. Each building or department is a star around its own switch, and those switches connect upward to switches at higher levels. A district whose schools are each a star, with each school's switch connected to a central one, forms a tree. Trees suit organizations that grow by adding whole groups, because a new branch attaches at one point, and they can be managed centrally. Their weakness follows from the hierarchy: a failure near the top affects all of the branches below it. If the central switch fails, traffic between schools stops, although computers within one school may still reach each other, since their own switch can still forward local traffic. Adding a redundant core switch with duplicate uplinks to it removes that single point of failure, while faster or additional switches lower down leave the dependence in place. Where links are unreliable, as with wireless links between buildings, a mesh's ability to route around a dropped link can outweigh a tree's tidiness.
Scalability and reliability#
Those trade-offs lead to the two properties that network design aims for. Scalability is a network or system's ability to handle growth, to keep performing as demand grows. A slow service where nothing has failed has a scalability problem, not a fault-tolerance one. There are several approaches. Hierarchical design, grouping devices by building and floor, keeps a growing network manageable. Adding capacity helps where the existing equipment is saturated. A load balancer distributes incoming requests across several servers, so a popular website can handle more demand as requests grow, and when those servers are themselves saturated, adding more servers behind the load balancer adds capacity directly. Spreading a service across many servers has a second benefit, since it can keep running if one server fails, though it adds complexity. A service on one machine has a single point of failure, and that machine's growth has limits.
Reliability is the ability to keep working when components fail. Redundancy, such as extra paths or servers, improves it by removing single points of failure, components whose failure stops the whole system. That is a different problem from a bottleneck, which limits speed without stopping service. A standby server that takes over when the main one fails is redundancy, and because it sits idle in normal operation, it doesn't share the load or add capacity. Redundancy has costs: money, plus more equipment to configure and manage. It also helps only when the copies don't share a risk. Two servers in one room, or two cables in one trench, can fail together from a single flood or a single cut, so redundant parts should be separated.
Client-server and peer-to-peer#
The last level concerns the roles devices play. In a client-server network, clients request services from dedicated servers.12 A web browser is a client, requesting pages from a server that holds a library catalog and answers those requests. Dedicated servers make data and policies easy to manage centrally, which is why a school keeps shared documents on servers where access and backups are managed in one place, instead of leaving them on each person's device. The cost is dependence: clients rely on the server, so its failure affects all of them. In a peer-to-peer network, devices share resources directly with each other, as a family's laptops might share files at home. Each peer contributes resources as well as using them, so total capacity, such as the upload capacity for distributing a large file, can grow as more participants join, whereas a single server must carry all of the load itself. The loss of one peer removes only that peer's own resources. Whatever its topology and roles, a network needs shared rules for how data actually travels across it, and those rules, the Internet's protocols, are the subject of the next section.
- local area network (LAN): a network connecting devices in a limited area, such as a school
- wide area network (WAN): a network connecting networks over large distances; the Internet is the largest
- switch: a device that forwards data within a local network using hardware addresses
- router: a device that forwards packets between networks using IP addresses
- wireless access point: a device that connects Wi-Fi devices to a wired network
- firewall: a device or program that filters traffic according to a set of rules
- topology: the pattern in which a network's devices are connected and communicate
- star: a topology in which each device connects to a central switch
- bus: a topology in which devices share one cable
- ring: a topology in which each device connects to two neighbors
- mesh: a topology in which devices connect to several others; a full mesh of
ndevices hasn(n-1)/2links - tree: star networks connected in a hierarchy
- single point of failure: a component whose failure stops the whole system
- fault tolerance: the ability to keep working despite a failed component
- scalability: the ability to handle growth
- load balancer: a device that distributes requests across servers
- reliability: the ability to keep working when components fail
- redundancy: extra components, such as paths or servers, that remove single points of failure
- client-server: an arrangement in which clients request services from dedicated servers
- peer-to-peer: an arrangement in which devices share resources directly
Practice: practice questions for 0003.d
-
MWC2, Riddles: HTTP requests, responses, verbs, and status codes. ↩
-
MWC2, Riddle Server: views, models, fields, subclasses, and an API specification. ↩