Routing
This page provides introduction to Routing.
Overview
Routing is the process that routers uses to determine the path that IP packets should take over a network to reach their destination. Routers stores routes to all of their known destinations in a routing table.
There are two main routing methods:
- Dynamic Routing: Routers uses dynamic rounting protocol(OSPF, BGP, etc.) to exchange routing information with other routers.
- Static Routing: A Network Administrator manually configures the routing table.
Route Selection
When a router receives a packet, it selects the most specific route to use to send the packet. The most specific route is the route that matches the destination IP address the most.
For example, a packet destined for 192.168.1.1 is matched by both routes as below:
- 192.168.1.0/24 (192.168.1.0 is the network address and 24 is the subnet mask which means all addresses from 192.168.1.0 to 192.168.1.255 are included)
- 192.168.1.1/32 (192.168.1.1 is the destination IP address and 32 is the subnet mask which means only the address 192.168.1.1 is included)
The router will select the most specific route to use to send the packet. In this case, the router will select the route with the longest prefix match.