Chapter 7

Routing Basics

Default gateway, traceroute, asymmetric paths.

Learning objectives

  • Explain how a host chooses where to send packets
  • Read a basic routing table
  • Interpret traceroute output

Local vs remote

When Workshop Co.’s PC (192.168.10.50) sends to another device on 192.168.10.0/26, it ARPs for the MAC address directly. For 203.0.113.10 (Swift Host VPS), the PC sends to the default gateway 192.168.10.1 — the router forwards onward.

Routing table (simplified)

Destination        Gateway         Interface
192.168.10.0/26    0.0.0.0         eth0      (local)
192.168.20.0/24    192.168.10.1    eth0      (via router VLAN)
0.0.0.0/0          192.168.10.1    eth0      (default route)

0.0.0.0/0 is “everything else” — the internet.

Traceroute

Traceroute (or mtr) shows hops between you and a destination. Useful when Workshop Co.’s site is slow — is it LAN, ISP, or the hoster?

traceroute www.workshopco.ca
 1  192.168.10.1    (shop gateway)
 2  10.x.isp.net    (ISP)
 3  ...
 N  203.0.113.10    (Swift Host)
Asymmetric routing

Return path may differ from outbound path. Usually invisible until firewalls expect symmetric flows — advanced topic; note if one direction hits a black hole.

Worked example — can’t reach camera NVR

Office PC on VLAN 10 cannot view NVR on VLAN 30. Ping fails. Routing exists but firewall blocks inter-VLAN. Fix: add rule allowing 192.168.10.0/26192.168.10.128/27 TCP port 443 to NVR only — not entire camera VLAN to internet.

  1. Same subnet? → Layer 2 direct
  2. Different subnet, same site? → Gateway + firewall rules
  3. Public IP? → NAT + ISP routing

Try it yourself — path sketch

Draw the hop list from a student phone on guest Wi‑Fi to www.workshopco.ca (cloud VPS). At which hop does traffic leave Workshop Co.’s private address space?

Answer

Phone (192.168.20.x) → guest AP → router (NAT to 198.51.100.44) → ISP → … → 203.0.113.10. Traffic leaves private space at the router NAT step (hop 2–3).

Quick quiz

  1. What is the default route?
  2. When does a host ARP vs send to gateway?
  3. What tool shows per-hop latency?
Answers
  1. 0.0.0.0/0 — catch-all toward internet gateway.
  2. ARP for same subnet; gateway for remote subnets.
  3. traceroute or mtr.