Routing Protocols

A router picks the longest prefix match first, then the lowest administrative distance, then the lowest metric. Most routing questions are that sequence applied to a table.

Route selection, in order

StepRule
1Longest prefix match wins, whatever the source
2Lowest administrative distance wins between sources
3Lowest metric wins within one protocol
4Equal-cost paths load balance

Administrative distance

SourceADNotes
Connected interface0Always preferred
Static route1Manually configured
EIGRP summary5
External BGP20
Internal EIGRP90Cisco proprietary
OSPF110Open standard
IS-IS115
RIP120Hop count, max 15
External EIGRP170
Internal BGP200
Unknown / unreachable255Never installed

Protocol comparison

ProtocolTypeMetricScope
RIPv2Distance vectorHop countSmall networks, 15 hop limit
EIGRPAdvanced distance vectorBandwidth and delayCisco environments
OSPFLink stateCost, from bandwidthEnterprise, multi-vendor
IS-ISLink stateCostService provider cores
BGPPath vectorPath attributesBetween autonomous systems

OSPF essentials

TermDetail
Area 0The backbone. Every other area must touch it
Router IDHighest loopback, else highest active interface, else configured
Hello / dead timers10 / 40 seconds on broadcast networks
Cost formulaReference bandwidth divided by interface bandwidth
DR and BDRElected on multi-access networks to limit adjacencies
Neighbour statesDown, Init, 2-Way, ExStart, Exchange, Loading, Full
Adjacency requirementsMatching area, subnet, timers, authentication, MTU

Now test yourself

Memorizing a table is a start. Practice questions are what make it stick, and every answer carries the full explanation.