Networking Fundamentals
How Routers Work
A router's job sounds simple — forward data toward its destination — but doing it billions of times a second across a global network is what makes the internet possible.
The core job: forwarding
A router connects different networks and decides where to send each packet next. When a packet arrives, the router reads its destination IP address, consults a routing table, and forwards the packet out the appropriate interface toward its goal. Packets typically pass through many routers — each making its own local decision — on the way to their destination.
Your home router does several jobs at once
The box in your home labeled "router" is actually several devices in one:
- A router connecting your home network to your ISP.
- A switch connecting your wired devices to each other.
- A wireless access point providing Wi-Fi.
- A DHCP server handing out private addresses, and a NAT engine sharing one public IP.
- A basic firewall blocking unsolicited inbound traffic.
Routing tables and default routes
A router cannot possibly know a path to every network on Earth. Instead it knows the networks near it and a default route — "if you don't know where something goes, send it this way." Your home router's default route points at your ISP, which has bigger routers with more complete tables, and so on up the hierarchy.
The internet's core routers
At the internet's core, massive routers run a protocol called BGP to exchange reachability information between the world's networks. This is how a packet from your laptop can find its way to a server on another continent through a chain of independent networks that have never met.
The takeaway
Every web page you load is a relay race of routers, each one looking at the destination address and passing the packet one hop closer. Your home router is the first runner in that race — and the reason your whole household can share a single internet connection.