Open Shortest Path First (OSPF) is a link state protocol that has been around for a long time. It is geneally well understood, but design considerations often focus on the maximum number of routers in an area. What other design considerations are important for OSPF? What can we do to build a scalable network with OSPF as the Interior Gateway Protocol (IGP)?
The main goal of any IGP is to be stable, converge quickly and to provide loop free connectivity. OSPF is a link state protocol and all routers within an area maintain an identical Link State Data Base (LSDB). How the LSDB is built it out of scope for this post but one relevant factor is that OSPF by default advertises stub links for all the OSPF enabled interfaces. This means that every router running OSPF installs these transit links into the routing table. In most networks these routes are not needed, only connectivity between loopbacks is needed because peering is setup between the loopbacks. What is the drawback of this default behavior?
- Larger LSDB
- SPF run time increased
- Growth of the routing table
To change this behavior, there is a feature called prefix suppression. When this feature is enabled the stub links are no longer advertised. The benefits of using prefix suppression is:
- Smaller LSDB
- Shorter SPF run time
- Faster convergence
- Remote attack vector decreased
If there needs to be connectivity to these prefixes for the sake of monitoring or other reasons, these prefixes can be carried in BGP.
How Many Routers in an Area?
The most common question is “How many routers in an Area?”. As usual, the answer is, it depends… In the past the hardware of routers such as the CPU and memory severely limited the scalability of an IGP but these are not much of an factor on modern devices. So what factors decide how many routers can be deployed in an area?
- Number of adjacent neighbors
- How much information is flooded in the area? How many LSAs are in the area?
- Keep router LSA under MTU size
– Implies lots of interfaces (and possibly lots of neighbors)
– Exceeding the MTU leeds to IP fragmentation which should be avoided
It’s impossible to give an exact answer to how many routers that fit into an area. There are ISPs out there running hundreds or even thousands in the same area. Doing so creates a very large failure domain though, a misbehaving router or link will cause all routers in the area to run SPF. To create a smaller failure domain, areas could be used, on the other hand MPLS does not play well with areas… So it depends…That is also why we see technologies like BGP-LS where you can have IGP islands glued together by BGP.
How many ABRs in an Area?
How many ABRs are suitable in an area? The ABR is very critical in OSPF due to the distance vector behavior between areas in OSPF. Traffic must pass through the ABR. Having one ABR may not be enough but adding too many adds complexity and adds flooding of LSAs and increases the size of the LSDB.
- More ABRs create more Type 3 LSA replication within the backbone and in other areas
- This can create scalability issues in large scale routing
- 10 prefixes in area 0 and 10 prefixes in area 1 would generate 60 summary LSAs with just 3 ABRs
- Increasing the number of areas or the number of ABRs would worsen the situation
How Many Areas per ABR?
Based on what we learned above, increasing the number of areas on an ABR quickly adds up to a lot of LSAs.
This ABR is in four areas, if every area contains 10 prefixes, the ABR has to generate 120 Type 3 summary LSAs in total.
- More areas per ABR puts more burden on the ABR
- More type 3 LSAs will be generated by the ABR
- Increasing the number of areas will worsen the situation
Considerations for Intra-Area Routing Scalability
To build a stable and scalable intra-area network, take the following parameters into consideration:
- Physical link flaps can cause instability in OSPF
– Consider using IP dampening
- Avoid having physical links in OSPF through the use of prefix suppression
- BGP can be used to carry transit links for monitoring purpose
Considerations for Inter-Area Routing Scalability
- Filter physical links outside the area through type 3 filtering feature
- Every area should only carry loopback addresses for all routers
- NMS station may keep track of physical links if needed
- These can be redistributed into BGP
OSPF Border Connections
OSPF always prefers intra-area paths to inter-area paths, regardless of metric. This may cause suboptimal routing under certain conditions.
- Assume the link between D and E is in area 0
- If the link between D and F fails, traffic will follow the intra area path D -> G, G -> E and E -> F
This could be solved by adding an extra interface/subinterface between D and E in area 1. This would increase the number of LSAs though…
OSPF Hub and Spoke
- Make spoke areas as stubby as possible
– If possible, make the area totally stubby
– If redistribution is needed, make the area totally not-so-stubby
- Be aware of reachability issues, make sure hub router becomes DR and use network type of Point to Multipoint (P2MP) if needed
– P2MP has smaller DB size compared to Point to Point (P2P)
– P2P will use more address space and increase the DB size compared to P2MP but it may be beneficial for other reasons when trying to achieve fast convergence
- If the number of spokes is small, the hub and spokes can be placed within an area such as the backbone
- If the number of spokes is large, make the hub an ABR and split off the spokes in area(s)
OSPF is a link state protocol that can scale to large networks if the network is designed according to the characteristics of OSPF. This post described design considerations and features such as prefix suppression that will help in scaling OSPF. For a deeper look at OSPF design, go through BRKRST-2337, available at Cisco Live 365.