Across the internet
Each router looks up the destination in *its own* table and passes the packet on. A mistake can create a routing loop — two routers bouncing a packet forever. That's why IP has a TTL (time to live): each hop subtracts one, and at zero the packet is dropped. traceroute uses exactly that to map the path.
The network
const ROUTERS = {
home: [{ prefix: "0.0.0.0/0", via: "isp" }],
isp: [{ prefix: "93.184.0.0/16", via: "transit" }, { prefix: "0.0.0.0/0", via: "home" }],
transit: [{ prefix: "93.184.216.0/24", via: "edge" }, { prefix: "0.0.0.0/0", via: "isp" }],
edge: [{ prefix: "93.184.216.34/32", via: "local" }, { prefix: "0.0.0.0/0", via: "transit" }],
};