Fun with OSPF LSA Type 5, External Type 1

So maybe you're running around, getting last minute presents, trying to work a ton today so you can rest easy over the long weekend... and you need a break. Coffee at the local Panera, whilst listening to even more Christmas carols? Stopping by holiday party leftovers in the conference room? Or how about refreshing your memory on how OSPF deals with External type 1 LSAs? 

For those of you opting for the latter, if you didn't do so already, check out the previous post on Type 5 external type 2 LSAs.

To create an "E1" (OSPF type 5, external metric type 1) LSA, the router injecting the LSA into OSPF - the ASBR - must override the default of E2, specifically choosing to inject the route as an E1. When making the route an E1, the rules are similar to E2, with one big difference: In addition to the external metric, the OSPF costs (internal metric) are considered when calculating the metric for each possible route. Summarizing the rules:

  • Type 5 LSA is created by the ASBR
  • Type 5 LSA contains the metric as dictated by the ASBR
  • Type 5 LSA is flooded by ABR's to other normal (non-stubby) OSPF areas
  • The flooding process does not change the metric in the type 5 LSA
  • When flooding into another normal area, the ABR injects a type 4 LSA
  • Routers choose "best" route based on the metric in the type 5 LSA, PLUS the OSPF cost from the router to the ASBR.

Of these points, the first 5 are true about both E1 and E2 routes. The last point is the part that's unique to E1 routes, and the part that needs some discussion. For a better backdrop, consider this figure, which shows a simpler version of last week's figure, in order to make room for the flow of both Type 4 and Type 5 LSAs:

The Type 4 LSA exists so that the cost for E1 routes can be calculated. The Type 4 LSA lists the ABR's cost to reach the ASBR. Then, a router in a different area (as compared to the ASBR that advertises the E1 route) can calculate the metric in three parts:

  • 1. The cost listed in the Type 5 LSA (created by the ASBR)
  • 2. The cost listed in the Type 4 LSA (created by the ABR)
  • 3. The cost from that router to the ABR (based on the ABR's Type 1 LSA)

In the example figure, R1 still floods the Type 5 LSA with cost 10. R2 creates a type 4 LSA, listing the ASBR's RID (, and R2's cost to reach ASBR (R1). R3's logic then runs as follows:

  • I see a Type 5 LSA, metric type E1 - what RID is listed? (answer
  • I don't have a Type 1 LSA for RID, so find the Type 4 that lists RID What's the metric, and what ABR created it? (Answers: cost 6, ABR RID, or R2)
  • Calculate my cost to reach RID, which is a type 1 LSA in my area 1 LSDB. What's the cost inside area 1? (answer: 5)
  • Add Type 5 LSA cost (10), cost from ABR (R2) to ASBR (R1) as listed in Type 4 LSA (6), and intra-area cost to ABR (R2) connected to my area (5), so the cost is 21.

If you built the small lab exercise with two routers in my post from the week before Christmas, and you want to try an E1 router, just change R2's redistribute connected metric 10 command to be redistribute connected metric 10 metric-type 1 command, and try these commands:

Show ip ospf database

Show ip ospf database external

Show ip ospf database asbr-summary

Show ip ospf database router

Questions? Fire away. I may well tack some show commands in here in the next post, to examine this just a little more, especially if I hear that some of you are interested!

Join the Network World communities on Facebook and LinkedIn to comment on topics that are top of mind.

Copyright © 2008 IDG Communications, Inc.