Networking is all about understanding the behaviour of the underlying protocols. Many of these protocols are deterministic, meaning they will always produce a predictable result for a given set of inputs.

This is achieved by using predictable values, such as MAC and IP addresses, and reproducable values such as cost and hop count. These numbers are compared to others to produce a decision.

For the exam (and in real life, of course), you have to remember how these numbers are compared. Is it the highest or the lowest? Here’s a summary.

Spanning Tree

Lowest Bridge ID on the network is the root bridge. The Bridge ID is the concatination of a 16 bit priority followed by the MAC address. The exception is that if the priority is 0, the device doesn’t participate in the election.

Lowest cost to the root bridge is marked as the root port. Lowest port priority is used to break ties.

General

Lowest administrative distance is used to select from identical prefixes (network & netmask) coming from different routing protocols. Also see Administrative Distance

OSPF

The router id is set as the highest IP address on any loopback interface. If no loopback interfaces exist, then the highest IP address on the router is used.

When electing the DR and BDR, the highest priority wins the coveted position of DR. The highest router id is used to break ties. The runner up wins BDR. Like spanning tree, a priority of 0 removes the router from the election. (Remember there is one election per segment, so one router could be both a DR and BDR, or whatever)

Lowest cost is used to figure out the route. Cost is inversely proportional to bandwidth, so a higher bandwidth pipe will have a lower cost.

In the Exstart phase of OSPF, the highest router id is used to determine the master.

Also see OSPF Neighbor States

IGRP/EIGRP

Lowest metric to a destination becomes the successor route.

BGP

The router id is set as the highest IP address on any loopback interface. If no loopback interfaces exist, then the highest IP address on the router is used. (Same as OSPF)

The selection process for a route then is:

Highest weight
Highest local preference
Locally originated routes routes are given preference
Shortest AS-PATH length
Lowest origin type (IGP Lowest Multiple Exit Discriminator (AKA metric), only if the neighbouring AS is the same
eBGP over iBGP
Lowest IGP metric to the next hop
Oldest route (ie which did the router hear first)
Lowest router id
Lowest neighbour address

See BGP Best Path Selection Algorithm

RIP

The route with the lowest hop count is chosen as the route.

IS-IS

Highest priority, followed by highest MAC address becomes the pseudonode

Added Aug 16, 2006

Multicast

PIM elects the designated router as the one with the highest IP address on the segment
IGMP elects the designated querier as the one with the lowest IP address on the segment

HSRP/VRRP/GLBP

HSRP uses the highest priority followed by the highest IP address to choose the active router. The runner up gets the standby position, the rest are listeners
VRRP first uses the owner of the virtual IP address, followed by the highest priority.
GLBP elects the Active Virtual Gateway as the one with the highest priority followed by the highest IP address.

References

  1. Administrative Distance
  2. OSPF Neighbor States
  3. BGP Best Path Selection Algorithm