No history yet

Interior Routing and OSPF

Building Scalable Networks with OSPF Areas

A flat network where every router shares its link-state information with every other router works fine, but only up to a point. As the network grows, the constant flooding of Link State Advertisements (LSAs) can overwhelm routers, leading to high CPU usage and slow convergence times. The solution is hierarchy.

OSPF allows you to divide a large network, or Autonomous System (AS), into smaller, more manageable segments called areas. This design has two major benefits: it reduces the amount of LSA flooding and it contains routing instability to a single area. If a link flaps in one area, only the routers within that area need to rerun the SPF algorithm. Routers in other areas are unaffected.

This hierarchical structure revolves around a special area known as the backbone, or Area 0. All other non-backbone areas must connect directly to Area 0. Traffic moving between two non-backbone areas must pass through the backbone. Routers that connect different areas are called Area Border Routers (ABRs).

The routers inside a single area all share an identical link-state database (LSDB). The ABRs are responsible for filtering and summarizing the routing information they pass between areas. This summarization is key to OSPF's scalability. Instead of flooding every single link-state change across the entire network, an ABR can advertise a single summary route for an entire area.

The Language of OSPF

Routers use Link State Advertisements (LSAs) to describe the network topology. There are several types of LSAs, and understanding them is crucial to troubleshooting OSPF. Each LSA type has a specific purpose and a defined scope of where it is flooded.

LSA TypeNameScopeDescription
Type 1Router LSAIntra-AreaDescribes a router's directly connected links and their states. Flooded only within the area.
Type 2Network LSAIntra-AreaGenerated by a Designated Router (DR) to describe all routers on a multi-access segment. Flooded only within the area.
Type 3Summary LSAInter-AreaGenerated by an ABR to advertise routes from one area to another. Flooded throughout the backbone and into other non-backbone areas.
Type 4ASBR Summary LSAInter-AreaGenerated by an ABR to advertise the location of an ASBR to other areas.
Type 5External LSAAS-ExternalGenerated by an ASBR to advertise routes external to the OSPF domain (e.g., from another routing protocol). Flooded to all areas.
Type 7NSSA External LSANSSA-OnlyA special external LSA used in Not-So-Stubby Areas to import external routes. Converted to a Type 5 LSA by the ABR.

The first two LSA types, Router and Network, are the building blocks for the topology map within an area. ABRs take this detailed intra-area information and create Type 3 Summary LSAs to advertise to other areas. This is how a router in Area 1 learns how to reach a network in Area 2 without needing to know the complete topology of Area 2.

Type 5 and 7 LSAs handle routes from outside the OSPF domain entirely. An Autonomous System Boundary Router (ASBR) is responsible for injecting these external routes. An ABR then generates a Type 4 LSA to tell the rest of the network, "If you want to reach those external routes, send your traffic to this ASBR."

Calculating the Best Path

Once a router has built its LSDB from all the LSAs it has received, it runs the Dijkstra Shortest Path First (SPF) algorithm to calculate the best, loop-free path to every destination. The "best" path is determined by a metric called cost.

By default, OSPF calculates the cost of an interface based on its bandwidth. The formula is: Cost=Reference BandwidthInterface BandwidthCost = \frac{Reference \ Bandwidth}{Interface \ Bandwidth}

The default reference bandwidth is typically 100 Mbps. This means a 100 Mbps FastEthernet link has a cost of 1, while a 10 Mbps Ethernet link has a cost of 10. A lower total cost is always preferred. You can see a problem here: with the default reference, any link faster than 100 Mbps (like GigabitEthernet or 10-GigabitEthernet) will also have a cost of 1. To fix this, you must adjust the reference bandwidth on all routers to a value higher than the fastest link in your network.

For traffic engineering, you can manually set the cost of an interface. This allows you to influence path selection, forcing traffic to take a specific route even if it's not the one with the highest bandwidth.

For example, you might have a high-bandwidth satellite link that you only want to use for backup. By setting its OSPF cost to a very high value, you ensure that routers will only use it if the primary, lower-cost terrestrial link fails.

Network Types and Neighbors

OSPF behaves differently depending on the type of network a link is part of. The two most common types are Point-to-Point and Broadcast.

A Point-to-Point link connects exactly two routers. Neighbor relationships are formed automatically, and LSAs are sent via multicast.

A Broadcast network, like Ethernet, can connect more than two routers. To prevent a flood of adjacencies (where every router becomes a neighbor to every other router), OSPF elects a Designated Router (DR) and a Backup Designated Router (BDR). All other routers on the segment form a full adjacency only with the DR and BDR. They send their LSAs to the DR, which is then responsible for flooding them to everyone else on the segment. This is where Type 2 Network LSAs are created.

Lesson image

There are also other, less common network types like Non-Broadcast Multi-Access (NBMA), which is used for technologies like Frame Relay. NBMA networks require manual configuration of neighbors because they don't support broadcast or multicast capabilities to automatically discover them.

OSPF provides a robust and scalable solution for interior routing. By understanding its hierarchical design, LSA types, and cost calculation, you can effectively engineer traffic flow and build resilient, fast-converging networks.

Quiz Questions 1/6

What is the primary reason for dividing a large OSPF network into multiple areas?

Quiz Questions 2/6

In an OSPF multi-area design, all non-backbone areas must connect directly to Area 0.