Skip to main content

Routing Fundamentals

In the Indian Postal System, local post offices handle deliveries within a colony, but when a letter needs to travel across districts or states, it goes through regional postal hubs. These hubs decide the best route for the letter to reach its destination quickly and efficiently.

Routers in networking play the same role. They connect different networks together and decide the path packets should take to reach their destination.


Core Concepts

  • Router Basics
    • Routers operate at the Network Layer (Layer 3) of the OSI model.
    • They use IP addresses to forward packets between networks.
    • Like postal hubs checking the PIN code to decide which route the letter should take.
  • Routing Table
    • A router maintains a routing table with known networks and paths.
    • Each entry includes destination IP, next hop, and cost (metric).
    • Like a postal hub’s directory of routes to different cities.
  • Static vs Dynamic Routing
    • Static Routing: Manually configured paths (like fixed postal routes).
    • Dynamic Routing: Routers exchange information automatically using protocols (like postal hubs coordinating with each other).
  • Common Routing Protocols
    • RIP (Routing Information Protocol) → Simple, distance-based (like shortest postal route).
    • OSPF (Open Shortest Path First) → Advanced, considers multiple factors (like postal hubs choosing fastest transport).
    • BGP (Border Gateway Protocol) → Internet backbone routing (like international postal agreements).
  • Default Gateway
    • The router that connects your local network to the outside world.
    • Like the main post office that forwards letters from your colony to the regional hub.

Hands‑On Exercise

Check Default Gateway

ip route | grep default

Shows the router your system uses to reach external networks like the main post office forwarding letters outside your colony.

Add a Static Route (Linux)

sudo ip route add 192.168.2.0/24 via 192.168.1.1

Creates a manual route like assigning a fixed postal path to a new colony.

View Routing Table

ip route show   # Linux
route print     # Windows

Displays how your system decides packet routes like a postal hub’s route directory.


Real‑World Relevance

  • Enterprise Networks: Routers connect branch offices across cities, just like postal hubs connect districts.
  • Cloud Networking: AWS, Azure, and GCP use routing tables to connect VPCs and subnets.
  • Internet Backbone: BGP powers global routing, ensuring packets travel across countries like international mail.
  • Troubleshooting: Wrong routes = misdelivered letters; missing gateway = letters stuck at the local post office.

The Hackers Notebook

Routers are the regional postal hubs of networking. They connect different networks, maintain routing tables, and decide the best path for packets just like postal hubs ensuring letters reach the right city, state, or country.


Tips, Tricks, Roadmaps, Resources, Networking, Motivation, Guidance, and Cool Stuff ♥

Updated on Jan 3, 2026