Premium Chapter

Routing, switching & protocols

Computer Science & Applications (Paper 2) (Code 87) · Unit 9 · ~26 min read · Original chapter

Free previewPremium full chapter

Free preview

Switching moves data inside a network; routing moves it between networks. Circuit switching reserves a whole path before communication, as in old telephone calls: guaranteed bandwidth, but wasted capacity when silent. Packet switching splits data into packets that travel independently and share links: efficient and robust, but with variable delay. Message switching stores whole messages at each hop before forwarding, which is simple but slow. Modern data networks use packet switching, and virtual circuits (as in MPLS) combine packet switching with a pre-established path.

Routing protocols compute the paths routers use. Distance-vector protocols (RIP) have routers exchange their whole routing tables with neighbours and choose the smallest hop count; they are simple but slow to converge and suffer the count-to-infinity problem when a link fails. Link-state protocols (OSPF) have every router learn the full topology and compute shortest paths itself with Dijkstra's algorithm; they converge faster but need more memory and processing. BGP is different again: it routes between autonomous systems using policies, not just shortest paths, which is why internet routing follows business relationships as well as topology.

Worked example — subnetting arithmetic. Take the network 10.0.0.0/8 and subnet it to /16. The prefix grows by 8 bits, so the number of subnets is 2^8 = 256. Each subnet keeps 32 − 16 = 16 host bits, giving 2^16 = 65,536 addresses, or 65,534 usable hosts after removing the network and broadcast addresses. The rule is always the same: borrowed bits count subnets, remaining bits count hosts, and two addresses per subnet are reserved.

Checking premium access…