![]() ![]() |
6.2 | ![]() |
OSPF Operation | |
6.2.5 | ![]() |
Step 4: Select appropriate routes |
After a router has a complete link-state
database, it is ready to create its routing table so that it can
forward traffic. As mentioned earlier in the module, OSPF uses the
metric value called cost. This is used to determine the best path to a destination,
as shown in the figure. The default cost value is based on media
bandwidth. In general, cost decreases as the speed of the link
increases. For example, the 10 Mbps Ethernet interface used by RTB has a lower
cost than its T1 serial line because 10 Mbps is faster than 1.544
Mbps.
To calculate the lowest cost to a destination, RTB uses the SPF algorithm. In simple terms, the SPF algorithm adds up the total costs between the local router, called the root, and each destination network. If there are multiple paths to a destination, the lowest cost path is preferred. By default, OSPF keeps up to four equal cost route entries in the routing table for load balancing. Sometimes a link, such as a serial line, will go up and down rapidly. This is a condition called flapping. If a flapping link causes LSUs to be generated, routers that receive those updates must rerun the SPF algorithm to recalculate routes. Prolonged flapping can severely affect performance. Repeated SPF calculations can overtax the router CPU. Also, the constant updates may prevent link-state databases from converging. To resist this problem, the Cisco IOS uses an SPF hold timer. After receiving an LSU, the SPF hold timer determines how long a router will wait before running the SPF algorithm. The timers spf command enables the timer to be adjusted, which defaults to ten seconds. After RTB has selected the best routes using the SPF algorithm, it moves into the final phase of OSPF operation.
|