Route Selection
- if a router has multiple entries to similar networks in its routing table,
- it must determine which route to prefer
- longer prefixes are preferred over shorter ones
- called longest prefix match
- E.g.,
198.51.100.0/24 g0
198.51.100.0/28 g1
- if router receives a packet for
198.51.100.1, it will route it via g1
- it has the longer and more specific prefix
- Each routing protocol supported by the router can add a single route for any given destination prefix to the routing table
- means that there might be more than one route with an identical length prefix in the routing table
- each routing protocol uses its metric to determine the least-cost path for routes with identical prefix lengths
- cannot compare routes from different protocols in the overall IP routing table
- bc each routing protocol uses different methods to calculate the metric
- instead, an Administrative Distance (AD) value is used to express the relative trustworthiness of the protocol supplying the route
- default AD values are coded into the router
- can be adjusted by the administrator
| Source | AD |
|---|
| Local interface/Directly connected | 0 |
| Static route | 1 |
| BGP | 20 |
| EIGRP | 90 |
| OSPF | 110 |
| RIP | 120 |
| Unknown | 255 |
- given identical prefix lengths,
- a static route will be preferred to anything other than directly connected networks
- a route discovered by EIGRP would be preferred to one reported by OSPF
- value of 255 for unknown routes means that they will not be used
- conversely, a static route with a high AD could be defined to function as a backup if a learned route update fails
- normally, the router will prefer the learned route because it has a lower AD value