Genie's Tech Blog

Where knowledge has no dimensions

OSPF Multi-Area Adjacency

Hey Guys,

I am back again with an interesting topic. OSPF Multi-Area Adjacency, But before we get onto this topic, lets get to the background of OSPF and why we need this feature.

OSPF always prefers intra-area routes over the inter-area routes. This may cause suboptimal routing depending on which area the link is configured. In real life scenarios, Virtual Links are also not the feasible solution to solve the suboptimal routing issue and neither adding parallel additional physical or logical links for each area as this would not scale from the aspect of cost, capacity and operational impact. A feature such that a single physical link can belong to the multiple area without creating sub-interfaces would be effective for this kind of OSPF suboptimal routing issues. This solution has been defined in the RFC 5185 as OSPF Multi-Area Adjacency. Let's understand this through an example. Consider the below topology diagram:

 

Lets have a look at the initial configuration of all the four routers. All the routers have the following format of the loopback address: x.x.x.x/32 where x is the Node number. Say for, For XR1, the loopback address is 1.1.1.1/32

Pre-configs:
===========
XR1

RP/0/0/CPU0:XR1#sh run router ospf
Fri Jul 20 03:03:33.032 IST
router ospf 100
 router-id 1.1.1.1
 area 0
  interface Loopback0
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
 !
 area 1
  interface GigabitEthernet0/0/0/1
   cost 1000
   network point-to-point
  !
 !
!

XR2

RP/0/0/CPU0:XR2#sh run router ospf
Fri Jul 20 03:05:25.837 IST
router ospf 100
 router-id 2.2.2.2
 area 0
  interface Loopback0
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
 !
 area 1
  interface GigabitEthernet0/0/0/1
   network point-to-point
  !
 !
!

XR3

RP/0/0/CPU0:XR3#sh run router ospf
Fri Jul 20 03:04:25.944 IST
router ospf 100
 router-id 3.3.3.3
 area 1
  interface Loopback0
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
  interface GigabitEthernet0/0/0/1
   network point-to-point
  !
 !

XR4

RP/0/0/CPU0:XR4#sh run router ospf
Fri Jul 20 03:05:48.933 IST
router ospf 100
 router-id 4.4.4.4
 area 1
  interface Loopback0
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
  interface GigabitEthernet0/0/0/1
   network point-to-point
  !
 !

If we see the above config, we notice that the cost of the link on XR1 towards XR4 is 1000. Thus, this will be acting as a high cost link where as all the other links being Gig links are low cost links. Now, if we try to reach out to the loopback of XR3 from XR1, the Intra-Area path will be taken as OSPF always prefers intra-area routes over inter-area routes. Thus, When we try to reach out to XR3 loopback address 3.3.3.3/32 sourcing 1.1.1.1/32 which is the loopback of XR1, the path taken is via XR4 although being a high cost link.

RP/0/0/CPU0:XR1#trace 3.3.3.3 sou 1.1.1.1
Fri Jul 20 03:02:54.259 IST

Type escape sequence to abort.
Tracing the route to 3.3.3.3

 1  14.14.14.4 1 msec  1 msec  0 msec 
 2  34.34.34.3 2 msec sh route  *  2 msec 
RP/0/0/CPU0:XR1#sh route 3.3.3.3
Fri Jul 20 03:02:59.647 IST

Routing entry for 3.3.3.3/32
  Known via "ospf 100", distance 110, metric 1002, type intra area
  Installed Jul 20 03:02:48.050 for 00:00:11
  Routing Descriptor Blocks
    14.14.14.4, from 3.3.3.3, via GigabitEthernet0/0/0/1
      Route metric is 1002
  No advertising protos. 
RP/0/0/CPU0:XR1#
 
Now, we shall see how configuring Multi-Area Adjacency make the difference.
 
Modified configs on XR1 and XR2

XR1

RP/0/0/CPU0:XR1#sh run router ospf
Sat Jul 21 11:56:27.770 IST
router ospf 100
 router-id 1.1.1.1
 area 0
  interface Loopback0
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
 !
 area 1
  multi-area-interface GigabitEthernet0/0/0/0
  !
  interface GigabitEthernet0/0/0/1
   cost 1000
   network point-to-point
  !
 !
!

XR2

RP/0/0/CPU0:XR2#sh run router ospf 
Sat Jul 21 11:56:49.831 IST
router ospf 100
 router-id 2.2.2.2
 area 0
  interface Loopback0
  !
  interface GigabitEthernet0/0/0/0
   network point-to-point
  !
 !
 area 1
  multi-area-interface GigabitEthernet0/0/0/0
  !
  interface GigabitEthernet0/0/0/1
   network point-to-point
  !
 !
!
 
Now when you see the OSPF neighborship on XR1 and XR2, you see that there is a Multi-Area Adjacency that has been formed on the interface GigabitEthernet 0/0/0/0.
 
RP/0/0/CPU0:XR1#sh ospf nei
Sat Jul 21 11:57:27.794 IST

* Indicates MADJ interface

Neighbors for OSPF 100

Neighbor ID     Pri   State           Dead Time   Address         Interface
2.2.2.2         1     FULL/  -        00:00:38    12.12.12.2      GigabitEthernet0/0/0/0
    Neighbor is up for 1d09h
2.2.2.2         1     FULL/  -        00:00:31    12.12.12.2      GigabitEthernet0/0/0/0*
    Neighbor is up for 00:01:06
4.4.4.4         1     FULL/  -        00:00:31    14.14.14.4      GigabitEthernet0/0/0/1
    Neighbor is up for 1d09h

Total neighbor count: 3
RP/0/0/CPU0:XR1#
 
Now, if we see the show ospf output for the interface GigabitEthernet for both Area 0 and Area 1, we notice that under Area 0, there is an Multi-Area Adjacency in Area 1 as well.
 
GigabitEthernet0/0/0/0 is up, line protocol is up 
  Internet Address 12.12.12.1/24, Area 0 
  Process ID 100, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1
  Transmit Delay is 1 sec, State POINT_TO_POINT, MTU 1500, MaxPktSz 1500
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:03
  Index 2/2, flood queue length 0
  Next 0(0)/0(0)
  Last flood scan length is 5, maximum is 5
  Last flood scan time is 0 msec, maximum is 0 msec
  LS Ack List: current length 0, high water mark 5
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 2.2.2.2
  Suppress hello for 0 neighbor(s)
  Multi-area interface Count is 1
    Multi-Area interface exist in area 1 Neighbor Count is 1
RP/0/0/CPU0:XR1#

RP/0/0/CPU0:XR1#sh ospf 100 1 interface GigabitEthernet 0/0/0/0
Sat Jul 21 11:59:56.813 IST

GigabitEthernet0/0/0/0 is up, line protocol is up 
  Internet Address 12.12.12.1/24, Area 1 
  Process ID 100, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1
  Interface is multi-area adjacency
  Transmit Delay is 1 sec, State POINT_TO_POINT, MTU 1500, MaxPktSz 1500
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    Hello due in 00:00:05
  Index 3/5, flood queue length 0
  Next 0(0)/0(0)
  Last flood scan length is 1, maximum is 1
  Last flood scan time is 0 msec, maximum is 0 msec
  LS Ack List: current length 0, high water mark 1
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 2.2.2.2
  Suppress hello for 0 neighbor(s)
  Multi-area interface Count is 0
RP/0/0/CPU0:XR1#
Now, since interface GigabitEthernet is also participating under Area 1 along with Area 0, we now have a low cost path to XR3 loopback 3.3.3.3/32 from XR1 loopback 1.1.1.1/32 through XR2 rather than XR4.
 
RP/0/0/CPU0:XR1#sh route 3.3.3.3
Sat Jul 21 11:59:08.202 IST

Routing entry for 3.3.3.3/32
  Known via "ospf 100", distance 110, metric 3, type intra area
  Installed Jul 21 11:56:22.311 for 00:02:46
  Routing Descriptor Blocks
    12.12.12.2, from 3.3.3.3, via GigabitEthernet0/0/0/0
      Route metric is 3
  No advertising protos. 
RP/0/0/CPU0:XR1#trace 3.3.3.3 sou 1.1.1.1
Sat Jul 21 11:59:20.602 IST

Type escape sequence to abort.
Tracing the route to 3.3.3.3

 1  12.12.12.2 2 msec  1 msec  1 msec 
 2  23.23.23.3 2 msec  *  3 msec 
RP/0/0/CPU0:XR1#

Hope this post gave you some insight on Multi-Area Adjacency.

Cheers...!!!

Comments (8) -

  • Avinash

    7/21/2012 12:59:25 PM |

    Excellent boss.. nice one..

  • Nik

    7/22/2012 10:26:12 AM |

    Nice one brother...keep up the good work Smile

  • Tarique

    7/22/2012 10:19:38 PM |

    One doubt I had is the loop avoidance mechanism on OSPF, how is it affected by Multi Area Adjacency

  • Genie

    7/25/2012 2:27:59 PM |

    Hello Tarique,
    The loop prevention mechanism will be taken care by the Dijkstra Algorithm. Since the adjacency is there between XR1 and XR2 for Area 1, the spf will be running for all the routers in Area 1 and thus those interfaces will be part of the spf calculation and loop avoidance will be taken care in a similar fashion as is done for a normal area.

  • Karan

    7/30/2012 3:53:37 PM |

    Hey Buddy..
    Cool stuff.. was not aware of this concept. is this feature also available in IOS. Please let me know.
    Thanks

    Karan

  • Cris Nitz

    3/7/2014 4:33:36 PM |

    Wow cuz this is excellent work! Congrats and keep it up.|

  • Von

    5/5/2014 4:48:32 AM |

    Hey there just wanted to give you a quick heads up. The text in your post seem to be running off the screen in Chrome. I'm not sure if this is a format issue or something to do with web browser compatibility but I thought I'd post to let you know. The layout look great though! Hope you get the issue solved soon. Kudos|

  • Genie

    5/5/2014 5:04:53 AM |

    The issue may be due to your screen resolution.

Comments are closed