A very simple question with a tricky answer ;-). How many OSPF areas are in this network?

For OSPF, areas are contiguous segments of networks and routers. One of the golden rules of standard area design is that all OSPF areas must have a connection to the backbone area (area 0). A simple topology that shows area 100 connected to the backbone is depicted below:

split_OSPF_area

How many OSPF areas are there in all?
Well, you must admit – that was simple. The answer is straightforward – there are two distinct areas on the picture, the backbone area (area 0) and area 100. But what if the link between R2 and R3 fails and area 100 falls apart? This situation is shown here:

split_OSPF_area2

Now, the answer is not so straightforward. Two or three?

Well, let’s learn to count OSPF areas first. To accomplish this we will query routers for all other interfaces in the network. For simplicity, we will assume, that every router has one single loopback interface placed in every area it belongs to. Each router has the following information for every loopback interface in the network:

  • If the interface belongs to this router, routers knows which area this interface is part of.
  • Otherwise the router knows:
    • Whether the interface is part of the same area as the router itself (in this case intra area route toward this loopback is installed in the routing table),
    • or the interface is in some other foreign area (inter area toward this loopback is installed in the routing table).

Please, keep in mind that a router is not aware of other area’s IDs, since LSAs that originate from the routers in other areas do not carry this information. They just say that a prefix in question is intra or inter-area.

For our topology, this knowledge can be summarised in the following table:
 

router Rx knows that interface Ry/Ln … R1/L0
2001::1
R1/L100
2001::100:1
R2/L100
2001::100:2
R3/L100
2001::100:3
R4/L0
2001::4
R4/L100
2001::100:4
R1 belongs to me in the backbone area belongs to me in area 100 belongs to R2 in area 100 belongs to R3 in some foreign area belongs to R4 in the backbone area belongs to R4 in some foreign area
R2 belongs to R1 in some foreign area belongs to R1 in area 100 belongs to me in area 100 belongs to R3 in some foreign area belongs to R4 in some foreign area belongs to R4 in some foreign area
R3 belongs to R1 in some foreign area belongs to R1 in some foreign area belongs to R2 in some foreign area belongs to me in area 100 belongs to R4 in some foreign area belongs to R4 in area 100
R4 belongs to R1 in the backbone area belongs to R1 in some foreign area belongs to R2 in some foreign area belongs to R3 in area 100 belongs to me in the backbone area belongs to me in area 100

 
From the router’s perspective, we obviously have three distinct areas in our topology. R1 and R4 are aware of at least 3 (for the “foreign” areas they can’be be sure if they are the same or not), and R2 and R3 are aware of at least two. If we combine all statements, three is the final answer.

Let me verify the first row. Router R1 says:

R1>show ipv6 route connected | inc ^L
LC  2001::1/128 [0/0]
LC  2001::100:1/128 [0/0]

R1>show ipv6 route ospf | inc ^O
O   2001::4/128 [110/1]
O   2001::100:2/128 [110/1]
OI  2001::100:3/128 [110/2]
OI  2001::100:4/128 [110/1]

Trivially, 2001::1 and 2001::100:1 are local. Other loopbacks are known via OSPF. Let’s check the internal ones first:

R1>show ipv6 ospf database prefix internal | inc (Intra Area|Address)
Intra Area Prefix Link States (Area 0)
  Prefix Address: 2001::1
  Prefix Address: 2001::4
Intra Area Prefix Link States (Area 100)
  Prefix Address: 2001::100:1
  Prefix Address: 2001::100:2

We see LSAs for both local loopbacks (2001::1 and 2001::100:1), for example:

Intra Area Prefix Link States (Area 0)

  Routing Bit Set on this LSA
  Now in buffer table
  Table index: 11 min 19 sec
  LS age: 91
  LS Type: Intra-Area-Prefix-LSA
  Link State ID: 0
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0x82CF
  Length: 52
  Referenced LSA Type: 2001
  Referenced Link State ID: 0
  Referenced Advertising Router: 1.1.1.1
  Number of Prefixes: 1
  Prefix Address: 2001::1
  Prefix Length: 128, Options: LA, Metric: 0

…and LSAs for 2001::4 and 2001::100:2, which originate from neighbouring routers. In this case, router R1 knows the area IDs, because these areas are local for it. 2001::100:2, for example, comes from router R2 and it resides in area 100:

Intra Area Prefix Link States (Area 100)

  Routing Bit Set on this LSA
  Now in buffer table
  Table index: 11 min 19 sec
  LS age: 125
  LS Type: Intra-Area-Prefix-LSA
  Link State ID: 0
  Advertising Router: 2.2.2.2
  LS Seq Number: 80000001
  Checksum: 0xD770
  Length: 52
  Referenced LSA Type: 2001
  Referenced Link State ID: 0
  Referenced Advertising Router: 2.2.2.2
  Number of Prefixes: 1
  Prefix Address: 2001::100:2
  Prefix Length: 128, Options: LA, Metric: 0

Finally, here are the Type 0×2003 LSAs that carry information about prefixes from another area. In this case router R1 does not have a clue about the origin area ID.

R1>show ipv6 ospf database inter-area prefix 2001::100:3/128

            OSPFv3 Router with ID (1.1.1.1) (Process ID 1)
  Routing Bit Set on this LSA
  LS age: 347
  LS Type: Inter Area Prefix Links
  Link State ID: 1
  Advertising Router: 4.4.4.4
  LS Seq Number: 80000001
  Checksum: 0xA1D5
  Length: 44
  Metric: 1
  Prefix Address: 2001::100:3
  Prefix Length: 128, Options: None

  LS age: 333
  LS Type: Inter Area Prefix Links
  Link State ID: 2
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0xF789
  Length: 44
  Metric: 2
  Prefix Address: 2001::100:3
  Prefix Length: 128, Options: None

R1>show ipv6 ospf database inter-area prefix 2001::100:4/128

            OSPFv3 Router with ID (1.1.1.1) (Process ID 1)
  Routing Bit Set on this LSA
  LS age: 438
  LS Type: Inter Area Prefix Links
  Link State ID: 0
  Advertising Router: 4.4.4.4
  LS Seq Number: 80000001
  Checksum: 0xBFB8
  Length: 44
  Metric: 0
  Prefix Address: 2001::100:4
  Prefix Length: 128, Options: None

  LS age: 361
  LS Type: Inter Area Prefix Links
  Link State ID: 3
  Advertising Router: 1.1.1.1
  LS Seq Number: 80000001
  Checksum: 0x27E
  Length: 44
  Metric: 1
  Prefix Address: 2001::100:4
  Prefix Length: 128, Options: None

For your reference, here are an interesting educative post by Marko Milivojević – OSPF Split Areas – and some usefull Cisco IOS CLI commands:

  • A list of loopbacks in OSPF domain:
    show ipv6 ospf interface brief | inc (State|LOOP)
  • Intra-area routes:
    show ipv6 route ospf | inc ^O .
  • Inter-area routes:
    show ipv6 route ospf | inc ^OI
  • Information about some prefix from a foreign area:
    show ipv6 ospf database inter-area prefix
  • Intra-area prefixes in the database:
    show ipv6 ospf database prefix internal | inc (Intra Area|Address)

From a human perspective a split OSPF area in an area that was partitioned by a broken link. But for routers there are no split areas. Once split, an area transforms into two distinct areas which just happen to have the same area ID. But they are still separate areas.

Advertisements