Routing is the process of selecting the best path for data packets to travel from source to destination across one or more networks. Routers use routing tables to make forwarding decisions based on destination IP addresses.
| Feature | Static Routing | Dynamic Routing |
|---|---|---|
| Configuration | Manually configured by admin | Automatically learned via routing protocols |
| Adaptability | Does not adapt to network changes | Adapts automatically to topology changes |
| Overhead | No routing protocol overhead | Routing protocol traffic overhead |
| Scalability | Poor (manual updates needed) | Excellent |
| Security | More secure (no protocol to exploit) | Less secure (routing updates can be spoofed) |
| Use Case | Small networks, stub networks, default routes | Large, complex networks |
| Protocol | Type | Algorithm | Use Case |
|---|---|---|---|
| RIP | IGP, Distance Vector | Bellman-Ford | Small networks (max 15 hops) |
| OSPF | IGP, Link State | Dijkstra (SPF) | Large enterprise networks |
| EIGRP | IGP, Hybrid | DUAL | Cisco networks |
| BGP | EGP, Path Vector | Best Path Selection | Internet backbone, ISPs |
| IS-IS | IGP, Link State | Dijkstra | Large ISP networks |
IGP = Interior Gateway Protocol (within an autonomous system) | EGP = Exterior Gateway Protocol (between autonomous systems)
| Feature | Distance Vector | Link State |
|---|---|---|
| Knowledge | Only knows neighbors and distances | Complete topology map |
| Updates | Periodic full tl-table updates to neighbors | Triggered updates (LSAs) flooded to all |
| Convergence | Slow | Fast |
| Memory/CPU | Low | High |
| Loops | Prone to routing loops | Loop-free (SPF algorithm) |
| Examples | RIP, IGRP | OSPF, IS-IS |
NAT allows multiple devices on a private network to share a single public IP address. It translates private IP addresses to public IP addresses and vice versa.
The default gateway is the router that a device uses to send traffic to destinations outside its local network. When a device doesn't have a specific route for a destination, it sends the packet to the default gateway.
Example: If your PC has IP 192.168.1.100/24 and default gateway 192.168.1.1, all traffic to non-192.168.1.x addresses goes to 192.168.1.1 (your router).
Explore 500+ free tutorials across 20+ languages and frameworks.