OSPF Area 0.0.0.0?

I quite often run OSPF on Juniper SSG’s – When configuring OSPF it requires you to put interfaces in areas in the format of x.x.x.x – for example 0.0.0.0

But what exactly does Area 0.0.0.0 compare to Area 0? And for that matter, where exactly does Area 10.1.1.1 fit in?

For this post, I’ll be using a simple topology. 2 Routers connected via OSPF, both redistributing their loopback addresses. If we see R2’s routes on R1 and vice-versa, we know OSPF is working. This is the topology:

OSPF actually sees areas in hex. This means that it considers Area 0 to be Area 0x00000000. OSPF will also convert dotted decimal to hex. This means that Area 0.0.0.0 is also equal to Area 0x00000000. Let’s test this to prove that it works.
R1:

router ospf 1
 log-adjacency-changes
 redistribute connected subnets
 network 172.16.1.1 0.0.0.0 area 0

R2:

router ospf 1
 log-adjacency-changes
 redistribute connected subnets
 network 172.16.1.2 0.0.0.0 area 0.0.0.0

Do they form an adjacency?
R1:

R1#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.1.1.1          1   FULL/BDR        00:00:35    172.16.1.2      FastEthernet0

R2:

R2#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.10.1      1   FULL/DR         00:00:38    172.16.1.1      FastEthernet0

Do we have routes?

R1#sh ip route ospf
O E2    10.1.1.0 [110/20] via 172.16.1.2, 00:02:27, FastEthernet0
R2#sh ip route ospf
O E2 192.168.10.0/24 [110/20] via 172.16.1.1, 00:02:45, FastEthernet0

They see each others routes just fine. What’s also interesting is that IOS will continue to show you information in the correct format depending on the OSPF configuration on that link. For example, R2 is in Area 0.0.0.0 – If we look on R2 to check it’s neighbours details more carefully, IOS will show us the area according to R2:

R2#sh ip ospf neighbor 192.168.10.1
 Neighbor 192.168.10.1, interface address 172.16.1.1
    In the area 0.0.0.0 via interface FastEthernet0

Same with R1:

R1#sh ip ospf neighbor 10.1.1.1
 Neighbor 10.1.1.1, interface address 172.16.1.2
    In the area 0 via interface FastEthernet0

Going back to the beginning of the article, how does area 10.1.1.1 fit in? We need to convert 10.1.1.1 to decimal if we want them to match. As an easier example at first, consider Area 0.0.0.50 – That would match Area 50. What about Area 0.0.1.1 ? – That would match Area 257 (both of these match Area 0x00000101 according to OSPF)

Area 10.1.1.1 converts to Area 167837953. OSPF sees both of these areas as Area 0x0a010101 – but are we sure? Let’s test to find out!

router ospf 1
 log-adjacency-changes
 redistribute connected subnets
 network 172.16.1.1 0.0.0.0 area 167837953
router ospf 1
 log-adjacency-changes
 redistribute connected subnets
 network 172.16.1.2 0.0.0.0 area 10.1.1.1

Does it work?

R1#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
10.1.1.1          1   FULL/BDR        00:00:35    172.16.1.2      FastEthernet0

R1#sh ip route ospf
O E2    10.1.1.0 [110/20] via 172.16.1.2, 00:01:10, FastEthernet0

R1#sh ip ospf neighbor 10.1.1.1
 Neighbor 10.1.1.1, interface address 172.16.1.2
    In the area 167837953 via interface FastEthernet0
R2#sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
192.168.10.1      1   FULL/DR         00:00:33    172.16.1.1      FastEthernet0

R2#sh ip route ospf
O E2 192.168.10.0/24 [110/20] via 172.16.1.1, 00:02:04, FastEthernet0

R2#sh ip ospf neighbor 192.168.10.1
 Neighbor 192.168.10.1, interface address 172.16.1.1
    In the area 10.1.1.1 via interface FastEthernet0

It all works just fine! If you’ve got a well designed network, then using dotted decimal as areas has it’s advantages. 2 Areas that look different to you could very easily speak over OSPF if they match.

© 2009-2020 Darren O'Connor All Rights Reserved -- Copyright notice by Blog Copyright