# IP Routing

## What is Routing?
Routing is the process of forwarding IP packets from a source network to a destination network based on entries in a **routing table**.

## Routing Table
A routing table contains entries that tell the router where to send packets for a given destination network.

| Network | Subnet Mask | Next Hop / Interface | Metric |
|---------|-------------|----------------------|--------|
| 192.168.1.0 | /24 | Connected (Fa0/0) | 0 |
| 10.0.0.0 | /8 | 192.168.1.1 | 1 |
| 0.0.0.0 | /0 | 192.168.1.254 | 1 |

The last entry (`0.0.0.0/0`) is the **default route** — used when no specific match is found.

## Static vs Dynamic Routing

| Type | Description | When to use |
|------|-------------|-------------|
| Static | Manually configured routes | Small, simple networks |
| Dynamic | Routes learned automatically via protocols | Large, complex networks |

## Dynamic Routing Protocols

| Protocol | Type | Description |
|----------|------|-------------|
| RIP | Distance Vector | Sends full routing table every 30s; max 15 hops |
| EIGRP | Advanced Distance Vector | Cisco proprietary; fast convergence |
| OSPF | Link State | Uses cost metric; scales well |

## Default Gateway
The default gateway is the router interface that a device sends packets to when the destination is outside its local network.

## Common Routing Failures
- Misconfigured interface (wrong IP or subnet)
- Missing route entry for destination network
- Gateway not set or unreachable
- Routing protocol not converged yet

## Observed in
- Activity 5.2.2 — IP Packet Simulation
- Activity 5.3.4 — Packet Tracing Across Networks
- Activity 5.4.3 — Observing Dynamic Routing Protocol Updates
- Activity 5.5.1 — Examining a Device's Gateway
- Activity 5.5.2 — Examining a Route
- Activity 5.6.1 — Skills Integration: Routing IP Packets
