Routing in Networking
What is Routing?
Routing is the process of selecting the best path for data packets to travel from a source device to a destination across networks. It is performed by routers, which determine how packets move across different networks (LANs, WANs, the internet).
Key Functions of Routing
- Path Selection:
- Determines the most efficient route for data transmission.
- Uses routing algorithms and routing tables.
- Packet Forwarding:
- Sends packets from one network to another based on destination IP addresses.
- Uses routers and gateways.
- Network Segmentation:
- Divides large networks into smaller subnetworks (subnetting) for efficient routing.
- Redundancy & Load Balancing:
- Ensures backup paths exist in case of link failure.
- Distributes network traffic to prevent congestion.
Types of Routing
1. Static Routing
- Manually configured by network administrators.
- Does not change unless manually updated.
- Best for small networks with fixed paths.
โ Advantages:
โ
Simple and secure.
โ
No processing overhead (faster).
โ Disadvantages:
โ Not scalable.
โ Cannot adapt to network failures automatically.
๐น Example Configuration (Cisco Router CLI):

(This command sets a static route to 192.168.2.0/24 via gateway 192.168.1.1.)
2. Dynamic Routing
- Uses routing protocols to automatically adjust routes based on network changes.
- Best for large and complex networks (e.g., ISPs, enterprise networks).
โ Advantages:
โ
Automatically updates routes when network topology changes.
โ
Scalable and efficient for large networks.
โ Disadvantages:
โ More CPU and memory usage on routers.
โ Potential security risks if misconfigured.
3. Default Routing
- Used when a router does not know the specific route for a destination.
- All unknown packets are sent to a default gateway.
๐น Example Configuration:

(All unknown traffic is forwarded to 192.168.1.1.)
Routing Algorithms
Routing algorithms determine how routers find the best path for data packets.
| Algorithm Type | Description | Example Protocols |
|---|---|---|
| Distance Vector | Selects paths based on the number of hops (shortest path) | RIP |
| Link-State | Builds a complete network map and chooses the best path dynamically | OSPF, IS-IS |
| Hybrid | Combines distance vector & link-state methods for efficiency | EIGRP |
Routing Protocols
Routing protocols define how routers communicate and share network topology information.
1. Interior Gateway Protocols (IGP) โ Within an Autonomous System (AS)
| Protocol | Type | Description |
|---|---|---|
| RIP (Routing Information Protocol) | Distance Vector | Uses hop count (max 15), simple but slow. |
| OSPF (Open Shortest Path First) | Link-State | Uses Dijkstraโs algorithm, scalable and efficient. |
| EIGRP (Enhanced Interior Gateway Routing Protocol) | Hybrid | Cisco proprietary, fast convergence, uses bandwidth & delay metrics. |
| IS-IS (Intermediate System to Intermediate System) | Link-State | Similar to OSPF, used by ISPs. |
2. Exterior Gateway Protocols (EGP) โ Between Autonomous Systems
| Protocol | Type | Description |
|---|---|---|
| BGP (Border Gateway Protocol) | Path Vector | Used for internet routing between ISPs, highly scalable. |
- BGP is the backbone of the global internet, managing how ISPs route data worldwide.
Routing Table & Packet Forwarding
1. What is a Routing Table?
- A routing table stores network routes and next-hop addresses.
- Each router uses this table to decide where to forward packets.
๐น Example of a Routing Table (Simplified):
| Destination Network | Next Hop | Metric |
|---|---|---|
| 192.168.1.0/24 | 192.168.1.1 | 1 |
| 10.0.0.0/8 | 10.0.0.1 | 2 |
| 0.0.0.0/0 (default) | 192.168.1.254 | N/A |
- Metric: A value that represents the cost of using a route (lower is better).
- Next Hop: The IP address of the next router in the path.
Routing Process: Step-by-Step Example
1๏ธโฃ A user requests www.google.com
- The PC sends a packet to its default gateway (router).
2๏ธโฃ Router checks its routing table
- If it has a route for Googleโs IP, it forwards the packet.
- If not, it sends it to its next-hop router.
3๏ธโฃ Packet traverses multiple routers
- Each router checks the destination IP and forwards it accordingly.
4๏ธโฃ Packet reaches Googleโs server
- Google processes the request and sends a response back through the same or different path.
5๏ธโฃ Response reaches the user
- The webpage loads successfully.
Comparison: Static vs Dynamic vs Default Routing
| Feature | Static Routing | Dynamic Routing | Default Routing |
|---|---|---|---|
| Configuration | Manual | Automatic | Manual |
| Adaptability | No | Yes | No |
| Best For | Small networks | Large networks | Unknown destinations |
| Resource Usage | Low | High (CPU/memory) | Low |
| Example Use Case | LANs | WANs, ISPs | Internet access |
Conclusion
Routing is a crucial function of networking, ensuring data reaches its destination efficiently. Different routing types and protocols are used based on network size, scalability needs, and performance requirements.
