<aside>
🔢
L2.2 — Subnetting, Routing & NAT covers two lectures of material by Graeme Bragg. It builds on L2.1's introduction to subnets and netmasks with a chalk-and-talk binary tree method for working out IPv4 subnet ranges, available addresses (reserved/broadcast/router), a worked subnetting example (152.78.70.0/23 → /24 + 2× /25), routing fundamentals (host view, routing tables, longest prefix match, metric tiebreaker), prefix aggregation, the default free zone, Autonomous Systems (multihomed/transit/stub, ASN, IXPs), routing protocols (RIP distance-vector, link-state IS-IS/OSPF with Dijkstra's, BGP exterior), BGP operation and downsides (trust, flapping, table size ~1M IPv4 / ~128k IPv6), traceroute mechanics, routing gotchas (asymmetric routes, latency ≠RTT/2), and NAT (NAPT, CGNAT RFC 6598, NAT64 with DNS64).
</aside>
📋 At a Glance
- [ ] Use the binary tree method to determine IPv4 subnet ranges from a netmask
- [ ] Know that the first address (network), last address (broadcast), and one for the router are reserved in every IPv4 subnet
- [ ] Subnet an allocation like 152.78.70.0/23 into a /24 + 2× /25
- [ ] Explain how a host decides: send locally or forward to default router (compare destination to netmask)
- [ ] Read a routing table — identify interface routes, default route, gateway
- [ ] Apply longest prefix match to select the correct route; use metric as tiebreaker
- [ ] Explain prefix aggregation and why IPv4 exhaustion makes it harder
- [ ] Define the default free zone and why it has no default route
- [ ] Describe Autonomous Systems: multihomed, transit, stub; ASN (32-bit); IXPs
- [ ] Compare IGP vs EGP — RIP (distance vector) vs IS-IS/OSPF (link state) vs BGP (exterior)
- [ ] Explain RIP: hop count metric, 30 s updates, max 15 hops, count-to-infinity, broken MD5 auth
- [ ] Explain link-state routing: discover neighbours, flood LSPs, Dijkstra's shortest path, fast convergence
- [ ] Explain BGP: AS paths, TCP port 179, initial full table then incremental UPDATEs, filtering, loop detection
- [ ] Know BGP downsides: trust issues, slow (60 s KEEPALIVE / 180 s HOLDDOWN), flapping, table size limits
- [ ] Use traceroute (increasing TTL → ICMP Time Exceeded): UDP on Linux, ICMP on Windows ("tracert")
- [ ] Know routing gotchas: routes change packet-to-packet, asymmetric routing, latency ≠RTT/2
- [ ] Explain NAT: rewriting IP headers, breaks end-to-end principle