Quick OSPF Reference Guide
5 min read
In this post, I want to discuss one of OSPF's most important building blocks.
For OSPF, the route discovery process involves understanding the area types and how they relate to the LSAs. The path evaluation process involves cost.
LSAs
In OSPF, Link-State Advertisements (LSAs) are used for both purposes: exchanging routing and topology information between routers within an OSPF network and evaluating paths. A good approach to better understanding is to know who and why.
Who generates the LSA?
Why is this LSA type needed?
Each type of LSA serves a specific purpose in building and maintaining the OSPF routing table. Here's a brief overview of common LSA types:
Type 1: Router LSA
Generated by every OSPF router.
Describes the router's directly connected links and their states.
Flooded within the area the router belongs to.
Content:
Type 2: Network LSA
Generated by the Designated Router (DR) on a multi-access network (like Ethernet).
Describes all routers connected to the segment.
Flooded within the local area.
Reduces the number of LSAs by having a single DR represent the entire network segment.
Type 3: Summary LSA
Generated by Area Border Routers (ABRs) to summarize and advertise routes from one area to another.
Flooded into other areas to advertise inter-area routes.
Type 4: ASBR Summary LSA
Generated by ABRs
To inform other areas about the presence and location of an ASBR.
Used to route traffic to external destinations.
💡External Route Awareness: Ensures that routers in different areas know how to reach external destinations by directing them to the ASBR.
Type 5: AS External LSA
Generated by ASBRs.
Provide information about routes outside the OSPF autonomous system.
Flooded throughout the OSPF network, unless blocked by area boundaries.
Type 7: NSSA External LSA
Generated in Not-So-Stubby Areas (NSSAs) by ASBRs.
Similar to Type 5 LSAs but restricted to the NSSA.
Translated to Type 5 LSAs by ABRs for use in the rest of the OSPF network.
💡Provides a way to control and limit the dissemination of external routing information.
Summary of LSA
LSA Type | Name | Generated By | Purpose |
1 | Router LSA | Every Router | Describes router’s local links within an area |
2 | Network LSA | Designated Router | Describes all routers on a multi-access network |
3 | Summary LSA | ABRs | Summarizes routes between different areas |
4 | ASBR Summary LSA | ABRs | Advertises location of ASBRs for external routing |
5 | AS External LSA | ASBRs | Advertises external routes to the OSPF domain |
7 | NSSA External LSA | ASBRs in NSSA | Advertises external routes within NSSAs |
Area Types
Some special area types are used to insert default routes into an area and replace type 3 summary LSAs and type 5 external LSAs. This approach minimizes LSA flooding, keeps the LSDB smaller, reduces SPF calculations, and results in a smaller routing table.
Let me start by summing up the special area types:
Stub area
Totally stub area
NSSA (Not-So-Stubby Area)
Totally NSSA (Totally Not-So-Stubby Area)
If you configure an area as a stub, it will block all type 5 external LSAs. Any prefixes redistributed into OSPF from another routing protocol are not allowed in the stub area. What about a totally stub area? This type will block both type 5 external LSAs and type 3 summary LSAs.
Since you are not allowed to have type 5 external LSAs in the stub area it’s also impossible to have an ASBR in the stub area. In order to reach networks in other areas there will be a default route.
Of course, there’s always an exception. So what if you want an area to be stub area but you also have an ASBR in this area? You can use the NSSA (not-so-stubby-area). This is the same thing as the stub area with the exception that you are allowed to have an ASBR within the area. How does it work? This is where the type 7 external LSA kicks in. Since we are not allowed to use the type 5 external LSA we’ll just use a new LSA type.
If you want to block type 3 summary LSAs and type 5 external LSAs but still need an ASBR within the totally stub area you can turn it into a totally NSSA (totally not-so-stubby area). This will block both LSA types but you can still have an ASBR in this area type.
Putting it all together
Now we can think of some examples of why and how we would leverage these features from the protocol.
NSSA
Let’s imagine the following topology
Route Selection
When we have the routes to the same prefix, OSPF breaks the tie like this:
IA > E2 > E1 > N2 > N1
COST
Cost is calculated based on the interface bandwidth. It follows the following equation:Interface BW / Reference BW
The disadvantage is that all the routes learned from that interface will add the same cost to it. This provides much less flexibility if you compare it to protocols such as EIGRP and BGP.