Wednesday, April 11, 2012

OSPF Virtual Links

The Open Shortest Path First routing protocol is a critical piece of knowledge for any networking professional working in an enterprise environment. Most major networking certifications covering routing and switching including the Cisco Certified Network Associate (CCNA), Cisco Certified Network Professional (CCNP), and Cisco Certified Internetwork Expert (CCIE) extensively test OSPF knowledge and skills. OSPF is the most popular dynamic routing protocol used in complex enterprise networks. This example will demonstrate the concepts and configuration involved with setting up OSPF virtual links to support a non-contiguous backbone area. This lab is built using Dynamips/GNS3 utilizing Cisco c3725 routers.

Virtual links are designed to allow the backbone area (area 0) to be noncontiguous. They can also be used for non-backbone areas to protect against loss of end-to-end connectivity if an area is partitioned. In this example, the parts of the backbone area have no direct connection, OSPF brings up a virtual interface to allow the two separated routers in area 0 to share a common link and transmit LSAs. The following topology shows how virtual links are applied:



In order to ensure continuity in area 0, type 1 and type 2 LSAs are transmitted between routers 2.2.2.2 and 4.4.4.4. to allow all of the routers in area 0 to have a complete topology view. Type 3 (network summary) LSAs are transferred into area 0 at the two ABRs.

Virtual links can only be created over regular areas, when an area containing a virtual link is changed to a stub area or NSSA, the change fails with the following:

ABR_1_0(config-router)#area 1 nssa
% OSPF: Area cannot be nssa as it contains a virtual link


ABR_1_0(config-router)#area 1 stub
% OSPF: Area cannot be a stub as it contains a virtual link


Attempting to create a virtual link through a stub area fails

ABR_0_1(config-router)#area 1 virtual-link 4.4.4.4
% OSPF: Area 1 is a stub or nssa so virtual links are not allowed


Configuration is fairly straightforward. The area virtual-link router-id is used on the ABRs. The transit area specified is the area that divides the area involved with the virtual link (typically area 0, but other areas are also possible) and the router ID is the router ID of the ABR on the other side of the virtual link. In this example the transit area is area 1 and the virtual links are between routers 4.4.4.4 and 2.2.2.2 On the ABRs:

On ABR_0_1:

router ospf 1
 router-id 2.2.2.2
 log-adjacency-changes
 area 1 virtual-link 4.4.4.4
 network 10.0.0.0 0.0.0.3 area 0
 network 10.0.1.0 0.0.0.3 area 1
!

On ABR_1_0:

router ospf 1
 router-id 4.4.4.4
 log-adjacency-changes
 area 1 virtual-link 2.2.2.2
 network 10.0.2.0 0.0.0.3 area 1
 network 10.0.3.0 0.0.0.3 area 0
!


OSPF hello packets are not sent periodically over virtual links and all of the received LSAs are marked with the DNA (do not age) bit. In a stable network, this is not a problem, but LSAs marked with the do not age bit are not refreshed every 30 minutes and they are not automatically timed out and deleted. Here is an example of the OSPF database for area 0 on ABR_1_0:

ABR_1_0#show ip ospf database

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Router Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum Link count
1.1.1.1         1.1.1.1         27    (DNA) 0x8000001F 0x00D21B 1
2.2.2.2         2.2.2.2         1     (DNA) 0x8000002A 0x00C9CD 2

4.4.4.4         4.4.4.4         7           0x80000025 0x00CBC0 2
5.5.5.5         5.5.5.5         634         0x8000001E 0x00FDC8 1

                Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.0.1        1.1.1.1         27    (DNA) 0x80000001 0x0069B8
10.0.3.2        5.5.5.5         634         0x8000001C 0x007C5E

                Summary Net Link States (Area 0)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.0        2.2.2.2         39    (DNA) 0x80000003 0x000E13
10.0.1.0        4.4.4.4         372         0x8000001A 0x0008EF
10.0.2.0        2.2.2.2         1     (DNA) 0x80000001 0x006BAC
10.0.2.0        4.4.4.4         119         0x8000001C 0x00946A

...


None of the area 0 type-1 or type2 LSAs show up in Area 1. Instead, the database shows type-3 network summary LSAs originating from area 0:

Area1#show ip ospf database

            OSPF Router with ID (10.0.2.1) (Process ID 1)

                Router Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum Link count
2.2.2.2         2.2.2.2         184         0x80000022 0x00AF2B 1
4.4.4.4         4.4.4.4         184         0x8000002B 0x001FA0 1
10.0.2.1        10.0.2.1        199         0x80000029 0x00DBBE 2

                Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.1.2        10.0.2.1        194         0x80000003 0x0040CB
10.0.2.1        10.0.2.1        1133        0x8000001A 0x007577

                Summary Net Link States (Area 1)

Link ID         ADV Router      Age         Seq#       Checksum
10.0.0.0        2.2.2.2         200         0x8000001B 0x00E821
10.0.3.0        4.4.4.4         550         0x8000001E 0x008576



If the ABR attached to the virtual link fails, it's LSAs will continue to exist on the other area routers; however the routes will eventually disappear from the routing table. Looking that the database, OSPF picks up that the advertising router is not reachable and removes the route from the routing table, but the LSA remains in the database, Here is an example of a type-1 (router) LSA in the unreachable part of the backbone area after the virtual link goes down:

ABR_1_0#show ip ospf database router 1.1.1.1

            OSPF Router with ID (4.4.4.4) (Process ID 1)

                Router Link States (Area 0)

  Adv Router is not-reachable
  LS age: 27 (DoNotAge)
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 1.1.1.1
  Advertising Router: 1.1.1.1
  LS Seq Number: 8000001F
  Checksum: 0xD21B
  Length: 36
  Number of Links: 1

    Link connected to: a Transit Network
     (Link ID) Designated Router address: 10.0.0.1
     (Link Data) Router Interface address: 10.0.0.1
      Number of TOS metrics: 0
       TOS 0 Metrics: 10


Virtual links shouldn't exist in well designed OSPF networks. The main applications for using virtual links are to prevent connectivity loss for partitioned areas and utilizing a physically separated backbone area. For using a physically separated backbone area, this most often occurs during a merger/acquisition and the decision has been made to use a single OSPF routing domain instead of redistribution.

See Also:
The Road to the CCIE









2 comments:

  1. Hey that's really a great post and a wonderful description out here, I really like the way things are being executed and discussed here.


    Venture capital Texasr

    ReplyDelete
  2. Really appreciate your post and you explain each and every point very well.Thanks for sharing this information.And I’ll love to read your next post too.

    DTC eligibility

    ReplyDelete