5.1 Creating Multiple OSPF Areas
5.1.7 Calculating costs for external routes

Costs are defined as metric values associated with a link. The cost of a path is determined by adding up the cost of each link in a path. Forwarding decisions are based on the cost of each path. Calculation of the cost for summary and external routes is as follows: The cost of a summary route is the smallest cost of a given inter-area route that appears in the summary plus the cost of the ABR link to the backbone. So if the ABR link to the backbone was 50, and the summary router had two inter-area routes, one at cost 49 and the other at cost 50, the total cost associated with the summary route would be 99. This calculation is done automatically for each summary route.

Calculating the cost for external routes

The cost of an external route differs depending on the external type configured on the ASBR. You configure the router to generate one of the following external packet types:

  • Type-1 (E1) --- If a packet is an E1, then the metric is calculated by adding the external cost to the internal cost of each link the packet crosses. Use this packet type when you have multiple ASBRs advertising a route to the same autonomous system.
  • Type-2 (E2) --- If a packet is an E2, then the packet will always have the external cost assigned, no matter where in the area it crosses (this is the default). Use this packet type if only one router is advertising a route to the autonomous system. Type-2 routes are preferred over Type-1 routes unless two equal cost routes exist to the destination.

The main figure shows the costs calculated by two OSPF networks on the internetwork.