A-Level · Networks

Networks: How Data Actually Gets There

From the moment you press Enter on a URL to the page appearing on screen, dozens of layered protocols, addressing schemes and routing decisions run in sequence. Every one of them is verified and stepped through here, not just named.

Section 2

The TCP/IP stack and encapsulation

Click a layer to see what it does. Then watch a real message pick up a header at every layer going down, and lose them again coming back up, on the other end.

Encapsulation, step by step

Exam tips

  • Each layer's PDU (protocol data unit) has its own name, worth learning exactly: Message (Application), Segment/Datagram (Transport), Packet (Internet), Frame (Network Access). Getting this precise vocabulary right is often its own mark.
  • Encapsulation only ever adds a header at each layer going down, it never removes or rewrites the layers already added, that's exactly why de-encapsulation on the receiving end can strip them back off in the reverse order.
Section 3

Subnetting, and dividing one network into several (VLSM)

First, the standard calculation: one IP and one mask, the network address, broadcast address and usable host range, with the actual binary AND shown. Then the harder, genuinely useful version: splitting a single network among several departments of different sizes.

IP address

Subnet mask

Binary AND, octet by octet

VLSM: divide 192.168.1.0/24 among four departments

Exam tips

  • Usable hosts = 2^(host bits) − 2, the network address and broadcast address are never assignable to a device, that subtraction is not optional.
  • VLSM's standard method: allocate the largest requirement first, into the smallest subnet that fits it, then continue immediately after that block for the next requirement. Allocating smallest-first can leave gaps too small for a later, larger requirement.
Section 4

Packet switching vs circuit switching

Two fundamentally different ways to move data across a network. Step through a real message being packet-switched, including a dropped packet and its retransmission, then compare directly against how circuit switching would handle the same job.

Message: "NETWORKS ARE FUN" split into 4 packets

Reassembly buffer (arrives out of order)

PropertyCircuit switchingPacket switching
PathOne dedicated path, reserved for the whole sessionNo reserved path, each packet routed independently
Idle bandwidthWasted, reserved whether used or notShared with other users between packets
Order of arrivalGuaranteed in order (same path throughout)Not guaranteed, packets may take different routes
Resilience to a broken linkWhole call fails if the dedicated path breaksPackets can be rerouted around the failure
Typical useTraditional telephone callsThe internet

Exam tips

  • Packet switching's ability to reroute around a problem is precisely why packets can also arrive out of order, sequence numbers exist specifically to fix this at the receiving end, exactly what the reassembly buffer above is doing.
  • Circuit switching's guaranteed order and dedicated bandwidth come at a real cost: that capacity sits unusable by anyone else even during silent pauses in a call, which is why the internet, with its bursty, unpredictable traffic, uses packet switching instead.
Section 5

DNS resolution

Translating www.codebash.co.uk into an IP address a router can actually use. Step through the full chain, using the exact exam terminology.

Exam tips

  • A root nameserver never returns the final IP address, it returns a referral to the correct TLD nameserver. Only the authoritative nameserver actually holds the real answer, that hierarchy is the entire point of the design.
  • If a cached result exists and its TTL hasn't expired, every step from the recursive resolver onward is skipped entirely, this is why repeat visits to the same site resolve almost instantly.
Section 6

The TCP three-way handshake, then HTTP

HTTP runs on top of TCP, so a reliable connection must exist first. Step through the exact sequence of messages, a common 6-mark exam question written out in full.

💻
Client
🖥
Server

Exam tips

  • Each side's ACK number is always the other side's sequence number plus one, that's how each end confirms exactly what it received, not just that something arrived.
  • The handshake establishes the connection, it does not itself carry any HTTP data, the actual GET request only happens after all three handshake messages are complete.
Section 7

NAT: Network Address Translation

Every device on a home network shares one public IP address. NAT is the reason return traffic still finds its way back to the correct device, watch two devices browsing the same site simultaneously.

Exam tips

  • Notice both devices used the exact same private port (51000), NAT had to allocate them different public ports (40000, 40001) specifically so return traffic could be told apart, this table is precisely how.
  • Without this translation table, the router would have no way to know which of several internal devices a reply was actually meant for, NAT genuinely depends on remembering every open connection, not just rewriting addresses blindly.
Section 8

Client-server vs peer-to-peer

Two fundamentally different network models. Click any node to simulate it failing, and watch what actually happens to the rest of the network, not just read a claim about it.

Client-Server

Peer-to-Peer

Client-Server: pros / cons / use cases

  • Centralised control, security and backup, all managed in one place
  • Consistent performance for every client
  • Server is a single point of failure, and expensive to set up and maintain
  • Used for: web browsing, email, online banking, school network logins

Peer-to-Peer: pros / cons / use cases

  • No single point of failure, cheap and easy to set up, scales as peers join
  • Each peer can share resources directly with any other
  • No centralised security, backup, or way to manage/audit devices
  • Used for: BitTorrent file sharing, blockchain networks, early Skype calls

Exam tips

  • The core trade-off is centralisation itself: a client-server model concentrates control and security in one place, which is exactly why it's also a single point of failure, verified directly above, disable the server and every single client is cut off, since all of them depended on that one node.
  • P2P removes that single point of failure by removing the central authority entirely. Verified directly above too, disable any one peer and the rest stay fully connected to each other, at the direct cost of having no central authority left to enforce security or backups.
Section 9

Check your understanding