In our previous discussion, we saw that dividing an OSPF autonomous system into multiple areas can improve the scalability. An example of a multi-area OSPF topology is shown in Figure 1:
Let’s imagine that we’ve allocated the IP address space as follows:
- Area 0: 10.0.0.0/24 through 10.0.255.0/24 (256 subnets)
- Area 1: 10.1.0.0/24 through 10.1.255.0/24 (256 subnets)
- Area 2: 10.2.0.0/24 through 10.2.255.0/24 (256 subnets)
Our OSPF autonomous system contains a total of 768 subnets, and unless we prevent it, each subnet will be known by every router. With a little configuration, however, we can do much better. As you can see, the subnets within the areas fall into three blocks:
- Area 0: 10.0.0.0/16
- Area 1: 10.1.0.0/16
- Area 2: 10.2.0.0/16
What we can do is configure the ABRs (R2 and R4) so that instead of advertising each individual prefix from one area to another, they will instead advertise summary blocks. For example, we will configure R2 to advertise the 10.1.0.0/16 block from Area 1 into Area 0, and likewise the 10.0.0.0/16 block from Area 0 to Area 1. Similarly, we’ll have R4 advertise the 10.2.0.0/16 block from Area 2 into Area 0, and the 10.0.0.0/16 block from Area 0 into Area 2. What will be the result?
Each internal router (R1, R3 and R5) has the LSDB for its particular area, and running SPF will send that area’s prefixes into its routing table. Thus, for the prefixes within their respective areas, the internal routers see things as follows:
- R1: 10.1.0.0/25 through 10.1.255.0/24 (the 256 subnets in Area 1)
- R3: 10.0.0.0/25 through 10.0.255.0/24 (the 256 subnets in Area 0)
- R5: 10.2.0.0/25 through 10.2.255.0/24 (the 256 subnets in Area 2)
Being an ABR, R2 will have the LSDB for both Area 2 and Area 0, and therefore will see 512 prefixes total for those two areas. Likewise, R4, the ABR connecting Area 2 to Area 0, will also see 512 prefixes for those areas.
In addition, since the ABRs are advertising the blocks of subnets from one area to another, each router will see one prefix for each area to which it is not directly connected. Therefore, the total numbers of prefixes known to the routers will be:
- R1: 258 prefixes (256 for Area 1, summaries for Area 0 and Area 2)
- R2: 513 prefixes (256 for Area 1, 256 for Area 0, summary for Area 2)
- R3: 258 prefixes (256 for Area 0, summaries for Area 1 and Area 2)
- R4: 513 prefixes (256 for Area 2, 256 for Area 0, summary for Area 1)
- R5: 258 prefixes (256 for Area 2, summaries for Area 0 and Area 1)
In the case of the internal routers (R1, R3 and R5), the routing tables have gone from 768 to 258 entries, a reduction of nearly two-thirds. In the case of the ABRs (R2 and R4), the number of routing tables has gone from 768 to 513, a reduction of nearly one-third. As you can imagine, as the total number of subnets goes up, the savings that can be realized by using multiple areas becomes even greater.
Since OSPF area numbers are thirty-two bit variables, they can be represented in dotted-decimal format, which can sometimes be convenient. For example, instead of numbering our areas 0, 1 and 2, we could make them Area 0.0.0.0, Area 10.1.0.0, and Area 10.2.0.0, deriving the area numbers from the IP address ranges within them.
What about Area 0, which contains the 10.0.0.0/16 block? Can we make that Area 10.0.0.0, then? No, because there are some rules we must follow when it comes to multiple areas.
- First, if we have more than one area, one of them must be Area 0 (or Area 0.0.0.0, if you prefer).
- Also, unless special arrangements are made, the topology of an OSPF autonomous system must be a simple hub-and-spoke, with Area 0 (the backbone) in the middle.
- One last thing … we can’t run a link directly from Area 1 to Area 2, bypassing Area 0, because OSPF won’t like that at all!
There are additional rules and options, some of which we’ll discuss in the next installment.
Author: Al Friebe