OSPF Overview
In this post, I will provide a quick, yet thorough review of OSPF (Open Shortest Path First) for students of Cisco or Juniper networking. Remember, OSPF is a powerful choice for an Interior Gateway Protocol (IGP) in your organization due to its excellent performance and scalability.
We currently work with two versions of OSPF – version 2 which handles routing in our TCP/IP version 4 world, and OSPF version 3, which handles things in IPv6 environments.
Unlike Routing Information Protocol (RIP), a distance vector protocol, OSPF is link state. It does not pass copies of its entire routing table to neighbors. Instead it floods information about it local links to an area in the network. Each router creates a Link State Database (LSDB) which is built based on the flooding of link information. Database consistency is assured through the use of Link State Advertisements (LSAs). Each router performs Shortest Path First calculations against this database in order to compute metrics to nodes and the links they contain. Best paths are marked active for consideration for inclusion in the routing table.
As described LSAs are a key part of the process in OSPF. They are sent to advertise and update prefix information, and they are also periodically flooded to ensure database synchronization in areas.
OSPF maintains a neighbor relationship with other OSPF speakers. This occurs dynamically through the use of periodic hello packets.
OSPF Neighbors
While dynamic hello packets are used to dynamically form neighborships in OSPF, there is a process to ensure that only “sane” neighborships form. Parameters such as hell time, area type, MTU, subnet mask all must match in order for the adjacency to form between devices. On a multi-access network, it would be too great a workload to have every router establish adjacencies with every other router, so a designated (DR) and backup designated router (BDR) are elected. The DR maintains an adjacency with the BDR and all other OSPF devices on the segment (DRothers). The DRothers only must worry about adjacencies to the DR and BDR. The DR would be responsible for notifying everyone on the segment of an LSA.
OSPF Router Types
One of the most powerful features of OSPF is its use of areas to control operation and efficiency. Areas create a scalable and hierarchical routing design. These areas give rise to different router types in OSPF based on where the router is functioning in the design. Note that routers can actually fulfill multiple of these types simultaneously.
- Internal – if all of your router interfaces are in a single area – this is know as an internal router. If all of these interfaces just happened to be in the backbone area, this you could also call this router a backbone router.
- Backbone router – if you router has at least one interface in the backbone area, then your router is considered a backbone router.
- Area Border Router (ABR) – this router has links in two or more areas. Note that these routers are critical in a multi-area design where the non backbone areas use be connected to the backbone.
- Autonomous System Boundary Router (ASBR) – this is a router that injects external routing information into an OSPF domain.
OSPF Area Types
The scalability in OSPF comes from its use of areas, including special area types. They are:
- Backbone – this area should always be designated as area 0; all other areas must connect to this backbone; note that the backbone is responsible for inter-area traffic transport.
- Stub – these areas do not carry any external prefix information within them. How would they direct traffic to these external prefixes then? They can use a default route.
- Totally Stubby Area – this area only receives a default route from the backbone; they do not even see the internal OSPF prefixes from other areas.
- Not So Stubby Areas (NSSAs) – this area type bends the TSA rules and allows for redistribution into this area of external prefixes as a way to get them in the OSPF domain. You can even configure a Totally Not So Stubby Area.
- Transit Areas – these areas pass traffic from on area to the backbone
LSA Types
All LSAs in the OSPF world are not created equal and they have different functions. Here are the main LSAs and their purpose and flooding scope:
- Type 1 (the router LSA) – this LSA type is generated by all OSPF routers; it is used to describe the status and the cost of the router’s links; this LSA is flooded within an area
- Type 2 (the network LSA) – this LSA is generated by the DR on a LAN; it lists each router on the broadcast segment, including the DR itself; this LSA is flooded within an area
- Type 3 (the network summary LSA) – this LSA is generated by ABRs and carries summary route information between OSPF areas; this LSA is flooded within an area
- Type 4 (the ASBR summary LSA) – this LSA provides reachability information to the ASBR in the domain (if there is one); this LSA is flooded within and area
- Type 5 (the external LSA) – this LSA is generated by the ASBR to carry the external prefix information; the flooding of this LSA is global unless their are special areas constructed
- Type 7 (the NSSA LSA) – this special LSA is used by the ASBR in a NSSA in order to advertise the external prefixes; the flooding scope is an area
- Others – other LSA types are used for various OSPF features – for example, and LSA type 9 is used to support graceful restart extensions and has a link only flooding scope
Before moving into more advanced OSPF topics, it is critical that you fully understand these fundamentals for the protocol.