Routing is the process that directs traffic between different IP networks, ensuring packets find their way from a source subnet to a destination subnet—no matter how many hops or intermediate routers lie in between. In essence, routers build and consult a routing table to make forwarding decisions, much like a GPS chooses the best roads to reach a destination.
Why Routing Matters
- Scalability: Enables networks to grow beyond a single LAN, linking thousands of subnets across the globe.
- Resilience: Dynamic rerouting around failed links or congested paths keeps traffic flowing.
- Policy Control: Administrators can influence path choice for performance, security, or cost reasons.
- Isolation: Keeps broadcast domains separate, reducing unnecessary traffic and collisions.
Core Routing Functions
- Forwarding
- Examine each incoming packet’s destination IP.
- Look up the best‑matching entry in the routing table.
- Send the packet out the corresponding interface.
- Route Learning
- Static Routes: Manually configured “always use this path” entries.
- Dynamic Routes: Discovered automatically via routing protocols.
- Route Maintenance
- Update the routing table when links go up/down or when new paths become available.
- Remove stale or inferior routes to keep tables accurate.
Routing Table Basics
A router’s table contains entries like:
| Destination |
Next Hop |
Interface |
Metric |
Type |
| 10.0.1.0/24 |
192.168.0.2 |
eth0 |
10 |
Dynamic |
| 10.0.2.0/24 |
192.168.0.3 |
eth1 |
20 |
Static |
| 0.0.0.0/0 |
192.168.0.1 |
eth0 |
5 |
Default |
- Destination: The subnet being reached.
- Next Hop: The IP of the next router in the path (or “directly connected”).
- Interface: The local port used to forward packets.
- Metric: A numerical cost—lower is preferred.