cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Largest area id as a tie breaker with RFC 3101 and RFC 2328

125
Views
0
Helpful
0
Comments
meddane
Frequent Contributor

Background:

The purpose of this article is to shown how the Largest area id is OSPF is used as a tie breaker to select the best route.

The goal In this topologie  is to ensure so that R1 will prefer the path through R3 for 4.4.4.0/24 and 4::/64 without modifying the cost or the bandwidth parameters, you should do this only on R1.

 

If you read the RFC 3101 The OSPF Not-So-Stubby Area (NSSA) Option, you will find that if RFC 1583 is disabled, when a router has multiple entries in the routing table to the same destination from the same ASBR and this ASBR is reachable through different non-backbone area, it will lookup the largest area id as the tie breaker, the route learned through the highest area id will be chosen.

 

From RFC 3101 section 2.5 Calculating Type-7 AS External Routes

 

          If the forwarding address is set to 0.0.0.0 then packets

          should be sent to the ASBR itself.  If the LSA is Type-5, from

          among the multiple non-NSSA routing table entries for the ASBR

          (both NSSA and non-NSSA ASBR entries might exists on an NSSA

          border router), select the preferred entry as follows:

 

            If RFC1583Compatibility is set to "disabled", prune the set

            of routing table entries for the ASBR as described in OSPF

            Section 16.4.1.  In any case, among the remaining routing

            table entries, select the routing table entry with the least

            cost; when there are multiple least cost routing table

            entries the entry whose associated area has the largest OSPF

            Area ID (when considered as an unsigned 32-bit integer) is

            chosen.

Let's dive in

OSPF.PNG

Basic configuration:

 

R1:

ipv uni

!

interface Ethernet0/0

 ipv6 address 12::1/64

 ip address 12.0.0.1 255.255.255.0

 ip ospf 1 area 12

 ipv6 ospf 1 area 12

 no shut

!

interface Ethernet0/1

 ipv6 address 13::1/64

 ip address 13.0.0.1 255.255.255.0

 ip ospf 1 area 13

 ipv6 ospf 1 area 13

 no shu

!

router ospf 1

 router-id 0.0.0.1

!

ipv6 router ospf 1

 router-id 0.0.0.1

 

R2:

ipv uni

!

interface Ethernet0/0

 ipv6 address 12::2/64

 ip address 12.0.0.2 255.255.255.0

 ip ospf 1 area 12

 ipv6 ospf 1 area 12

 no shut

!

interface Ethernet0/1

 ipv6 address 234::2/64

 ip address 100.0.0.2 255.255.255.0

 ip ospf 1 area 0

 ipv6 ospf 1 area 0

 no shu

!

router ospf 1

 router-id 0.0.0.2

!

ipv6 router ospf 1

 router-id 0.0.0.2

 

R3:

ipv uni

!

interface Ethernet0/0

 ipv6 address 13::3/64

 ip address 13.0.0.3 255.255.255.0

 ip ospf 1 area 13

 ipv6 ospf 1 area 13

 no shut

!

interface Ethernet0/1

 ipv6 address 234::3/64

 ip address 100.0.0.3 255.255.255.0

 ip ospf 1 area 0

 ipv6 ospf 1 area 0

 no shu

!

router ospf 1

 router-id 0.0.0.3

!

ipv6 router ospf 1

 router-id 0.0.0.3

 

R4:

ipv uni

!

interface Ethernet0/1

 ipv6 address 234::4/64

 ip address 100.0.0.4 255.255.255.0

 ip ospf 1 area 0

 ipv6 ospf 1 area 0

 no shu

!

router ospf 1

 router-id 0.0.0.4

!

ipv6 router ospf 1

 router-id 0.0.0.4

 

On R1 verify the neighbor relationship for OSPFv2 and OSPFv3.

 

R1#sh ip os nei

 

Neighbor ID     Pri   State           Dead Time   Address         Interface

0.0.0.2           1   FULL/DR         00:00:39    12.0.0.2        Ethernet0/0

0.0.0.3           1   FULL/DR         00:00:32    13.0.0.3        Ethernet0/1

R1#

 

R1#sh ipv os nei

 

            OSPFv3 Router with ID (0.0.0.1) (Process ID 1)

 

Neighbor ID     Pri   State           Dead Time   Interface ID    Interface

0.0.0.2           1   FULL/DR         00:00:38    3               Ethernet0/0

0.0.0.3           1   FULL/DR         00:00:32    3               Ethernet0/1

R1#

 

On R4, redistributes the Lo0 4.4.4.0/24 and 4::/64 into OSPFv2 and OSPFv3 domains respectively.

 

R4(config)#route-map TEST-IPV4 permit 10

R4(config-route-map)# match interface Loopback0

R4(config)#router ospf 1

R4(config-router)# redistribute connected route-map TEST-IPV4 subnets

 

R4(config)#route-map TEST-IPV6 permit 10

R4(config-route-map)# match interface Loopback0

R4(config)#ipv6 router ospf 1

R4(config-rtr)# redistribute connected route-map TEST-IPV6

 

Verify that R1 receives one Type-5 LSA from R4 0.0.0.4 for the prefix 4.4.4.0/24.

 

R1#sh ip os data ext

 

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

 

             Type-5 AS External Link States

 

  LS age: 636

  Options: (No TOS-capability, DC, Upward)

  LS Type: AS External Link

  Link State ID: 4.4.4.0 (External Network Number )

  Advertising Router: 0.0.0.4

  LS Seq Number: 80000001

  Checksum: 0x3F51

  Length: 36

  Network Mask: /24

       Metric Type: 2 (Larger than any link state path)

       MTID: 0

       Metric: 20

       Forward Address: 0.0.0.0

       External Route Tag: 0

 

R1#

 

Verify that R1 receives one Type-5 LSA from R4 0.0.0.4 for the prefix 4::/64.

 

R1#sh ipv os data ext

 

            OSPFv3 Router with ID (0.0.0.1) (Process ID 1)

 

             Type-5 AS External Link States

 

  LS age: 643

  LS Type: AS External Link

  Link State ID: 0

  Advertising Router: 0.0.0.4

  LS Seq Number: 80000001

  Checksum: 0x189C

  Length: 36

  Prefix Address: 4::

  Prefix Length: 64, Options: None

  Metric Type: 2 (Larger than any link state path)

  Metric: 20

 

R1#

 

R1 has two paths to reach the external prefixes 4.4.4.0/24 and 4::/64, since the FA is not set on both Type-5 LSAs, R1 lookup the best cost to reach the ASBR R4.

 

For OSPFv2, the sh ip os bro command shows that the ASBR is reachable with the same cost 20 through R2 and R3.

 

R1#sh ip os bor

 

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

 

 

             Base Topology (MTID 0)

 

Internal Router Routing Table

Codes: i - Intra-area route, I - Inter-area route

 

i 0.0.0.2 [10] via 12.0.0.2, Ethernet0/0, ABR, Area 12, SPF 3

i 0.0.0.3 [10] via 13.0.0.3, Ethernet0/1, ABR, Area 13, SPF 5

I 0.0.0.4 [20] via 12.0.0.2, Ethernet0/0, ASBR, Area 12, SPF 3

I 0.0.0.4 [20] via 13.0.0.3, Ethernet0/1, ASBR, Area 13, SPF 5

R1#

 

Since the metric to reach R4 is the same through R2 and R3, R1 installs a load balancing to reach 4.4.4.0/24 via R2 and R3.

 

R1#sh ip route os | beg Gate

Gateway of last resort is not set

 

      4.0.0.0/24 is subnetted, 1 subnets

O E2     4.4.4.0 [110/20] via 13.0.0.3, 00:02:58, Ethernet0/1

                 [110/20] via 12.0.0.2, 00:00:28, Ethernet0/0

      100.0.0.0/24 is subnetted, 1 subnets

O IA     100.0.0.0 [110/20] via 13.0.0.3, 00:00:28, Ethernet0/1

                   [110/20] via 12.0.0.2, 00:01:52, Ethernet0/0

R1#

 

R1#sh ip route os | s 4.4.4.0

O E2     4.4.4.0 [110/20] via 13.0.0.3, 00:03:54, Ethernet0/1

                 [110/20] via 12.0.0.2, 00:01:24, Ethernet0/0

      100.0.0.0/24 is subnetted, 1 subnets

R1#

 

For OSPFv3, the sh ipv os bro command shows that the ASBR is reachable with the same cost 20 through R2 and R3.

 

R1#sh ipv os bor

 

            OSPFv3 Router with ID (0.0.0.1) (Process ID 1)

 

Codes: i - Intra-area route, I - Inter-area route

 

i 0.0.0.2 [10] via FE80::A8BB:CCFF:FE00:200, Ethernet0/0, ABR, Area 12, SPF 3

i 0.0.0.3 [10] via FE80::A8BB:CCFF:FE00:300, Ethernet0/1, ABR, Area 13, SPF 5

I 0.0.0.4 [20] via FE80::A8BB:CCFF:FE00:200, Ethernet0/0, ASBR, Area 12, SPF 3

I 0.0.0.4 [20] via FE80::A8BB:CCFF:FE00:300, Ethernet0/1, ASBR, Area 13, SPF 5

R1#

 

Since the metric to reach R4 is the same through R2 and R3, R1 installs a load balancing to reach 4::/64 via R2 and R3.

 

R1#sh ipv route os | beg App 

       lr - LISP site-registrations, ld - LISP dyn-eid, a - Application

OE2 4::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:200, Ethernet0/0

     via FE80::A8BB:CCFF:FE00:300, Ethernet0/1

OI  234::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:300, Ethernet0/1

     via FE80::A8BB:CCFF:FE00:200, Ethernet0/0

R1#

 

R1#sh ipv route os | s OE2 4::

OE2 4::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:200, Ethernet0/0

     via FE80::A8BB:CCFF:FE00:300, Ethernet0/1

R1#

 

Now how to ensure so that R1 will prefer the path through R3 for 4.4.4.0/24 and 4::/64 without modifying the cost or the bandwidth parameters, you should do this only on R1.

 

If you read the RFC 3101 The OSPF Not-So-Stubby Area (NSSA) Option, you will find that if RFC 1583 is disabled, when a router has multiple entries in the routing table to the same destination from the same ASBR and this ASBR is reachable through different non-backbone area, it will lookup the largest area id as the tie breaker, the route learned through the highest area id will be chosen.

 

From RFC 3101 section 2.5 Calculating Type-7 AS External Routes

 

          If the forwarding address is set to 0.0.0.0 then packets

          should be sent to the ASBR itself.  If the LSA is Type-5, from

          among the multiple non-NSSA routing table entries for the ASBR

          (both NSSA and non-NSSA ASBR entries might exists on an NSSA

          border router), select the preferred entry as follows:

 

            If RFC1583Compatibility is set to "disabled", prune the set

            of routing table entries for the ASBR as described in OSPF

            Section 16.4.1.  In any case, among the remaining routing

            table entries, select the routing table entry with the least

            cost; when there are multiple least cost routing table

            entries the entry whose associated area has the largest OSPF

            Area ID (when considered as an unsigned 32-bit integer) is

            chosen.

 

When we say RFC 1583 compatibility is set to "disabled”, this means that RFC 2328 is enabled, below you can see that RFC 2328 confirms what RFC 3101 said about the largest area id as tie breaker.

 

From RFC 2328 section 16.4.  Calculating AS external routes

 

If the forwarding address is set to 0.0.0.0, packets should

            be sent to the ASBR itself. Among the multiple routing table

            entries for the ASBR, select the preferred entry as follows.

            If RFC1583Compatibility is set to "disabled", prune the set

            of routing table entries for the ASBR as described in

            Section 16.4.1. In any case, among the remaining routing

            table entries, select the routing table entry with the least

            cost; when there are multiple least cost routing table

            entries the entry whose associated area has the largest OSPF

            Area ID (when considered as an unsigned 32-bit integer) is

            chosen.

 

The difference between RFC 1583 and RFC 2328, in regard to how to choose the best route among multiple external routes, is discussed in this section.

 

From RFC 1583 Section 16.4.6

 

            Otherwise, compare the cost of this new AS external path to

            the ones present in the table.  Type 1 external paths are

            always shorter than type 2 external paths.  Type 1 external

            paths are compared by looking at the sum of the distance to

            the forwarding address and the advertised type 1 metric

            (X+Y).  Type 2 external paths are compared by looking at the

            advertised type 2 metrics, and then if necessary, the

            distance to the forwarding addresses.

 

            If the new path is shorter, it replaces the present paths in

            the routing table entry.  If the new path is the same cost,

            it is added to the routing table entry's list of paths.

 

As per RFC 1583, the path selection is based solely on cost.

 

By default Cisco routers implement RFC 1583.

 

For OSPFv2, the show ip os command does not show the RFC 1583 compatibility enabled. But keep in mind that this is the default.

 

R1#sh ip os | i RFC

 Supports NSSA (compatible with RFC 3101)

 Supports Database Exchange Summary List Optimization (RFC 5243)

R1#

 

OSPFv3 shows that the Cisco routers have the RFC 1583 compatibility enabled.

 

R1#sh ipv os | i RFC

 Supports NSSA (compatible with RFC 3101)

 Supports Database Exchange Summary List Optimization (RFC 5243)

 RFC1583 compatibility enabled

R1#

 

Let’s disable RFC 1583 compatibility for both OSPFv2 and OSPFv3.

 

R1(config)#router osp 1

R1(config-router)#no compatible rfc1583

R1(config-router)#ipv router osp 1

R1(config-rtr)#no compatible rfc1583

 

Once again, by default OSPFv2 does not show that RFC 1583 compatibility is disabled unlike with OSPFv3.

 

R1#sh ip os | s RFC

 Supports NSSA (compatible with RFC 3101)

 Supports Database Exchange Summary List Optimization (RFC 5243)

R1#

 

R1#sh ipv os | s RFC

 Supports NSSA (compatible with RFC 3101)

 Supports Database Exchange Summary List Optimization (RFC 5243)

 RFC1583 compatibility disabled

    Area 12

 

R1#

 

Verify the entry for 4.4.4.0/24, we can see that the path through R3 is chosen because area id 13 connected to R3 is highest than the area id 12 connected to R2.

 

R1#sh ip route os | beg Gate

Gateway of last resort is not set

 

      4.0.0.0/24 is subnetted, 1 subnets

O E2     4.4.4.0 [110/20] via 13.0.0.3, 00:12:19, Ethernet0/1

      100.0.0.0/24 is subnetted, 1 subnets

O IA     100.0.0.0 [110/20] via 13.0.0.3, 00:02:47, Ethernet0/1

                   [110/20] via 12.0.0.2, 00:11:13, Ethernet0/0

R1#

 

R1#sh ip route os | s 4.4.4.0

O E2     4.4.4.0 [110/20] via 13.0.0.3, 00:12:22, Ethernet0/1

      100.0.0.0/24 is subnetted, 1 subnets

R1#

 

The same conclusion for the entry of the prefix 4::/64, the largest area id 13 is preferred than the area id 12, therefore the path through R3 is chosen.

 

R1#sh ipv route os | beg App

       lr - LISP site-registrations, ld - LISP dyn-eid, a - Application

OE2 4::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:300, Ethernet0/1

OI  234::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:300, Ethernet0/1

     via FE80::A8BB:CCFF:FE00:200, Ethernet0/0

R1#

 

R1#sh ipv route os | s OE2 4::

OE2 4::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:300, Ethernet0/1

R1#

 

The trace route command confirms the result.

 

R1#tracer 4.4.4.4

Type escape sequence to abort.

Tracing the route to 4.4.4.4

VRF info: (vrf in name/id, vrf out name/id)

  1 13.0.0.3 0 msec 1 msec 0 msec

  2 100.0.0.4 1 msec 2 msec *

R1#

 

R1#tracer 4::4  

Type escape sequence to abort.

Tracing the route to 4::4

 

  1 13::3 18 msec 0 msec 0 msec

  2 234::4 1 msec 1 msec 0 msec

R1#

 

To confirm, let’s configure the link R1-R2 in area 120.

 

Remove the area 12 on R1 and R2.

 

R1(config)#int e0/0

R1(config-if)#no ip ospf 1 area 12

R1(config-if)#no ipv ospf 1 area 12

 

R2(config)#int e0/0

R2(config-if)#no ip ospf 1 area 12

R2(config-if)#no ipv ospf 1 area 12

 

Reconfigure R1 and R2 in area 120.

 

R1(config)#int e0/0

R1(config-if)#ip os 1 area 120

R1(config-if)#ipv os 1 area 120

 

R2(config)#int e0/0

R2(config-if)#ip os 1 area 120

R2(config-if)#ipv os 1 area 120

 

Verify the routing table of R1 for both IPv4 and IPv6, now the path through R2 is chosen for the prefixes 4.4.4.0/24 and 4::/64 because area 120 is higher than the area 13.

 

R1#sh ip route os | beg Gate

Gateway of last resort is not set

 

      4.0.0.0/24 is subnetted, 1 subnets

O E2     4.4.4.0 [110/20] via 12.0.0.2, 00:00:47, Ethernet0/0

      100.0.0.0/24 is subnetted, 1 subnets

O IA     100.0.0.0 [110/20] via 13.0.0.3, 00:04:25, Ethernet0/1

                   [110/20] via 12.0.0.2, 00:00:47, Ethernet0/0

R1#

 

R1#sh ip route os | s 4.4.4.0

O E2     4.4.4.0 [110/20] via 12.0.0.2, 00:01:07, Ethernet0/0

      100.0.0.0/24 is subnetted, 1 subnets

R1#

 

R1#sh ipv route os | beg App

       lr - LISP site-registrations, ld - LISP dyn-eid, a - Application

OE2 4::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:200, Ethernet0/0

OI  234::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:300, Ethernet0/1

     via FE80::A8BB:CCFF:FE00:200, Ethernet0/0

R1#

 

R1#sh ipv route os | s OE2 4::

OE2 4::/64 [110/20]

     via FE80::A8BB:CCFF:FE00:200, Ethernet0/0

R1#

 

The traceroute command confirms the result.

 

R1#tracer 4.4.4.4

Type escape sequence to abort.

Tracing the route to 4.4.4.4

VRF info: (vrf in name/id, vrf out name/id)

  1 12.0.0.2 1 msec 0 msec 0 msec

  2 100.0.0.4 0 msec 1 msec *

R1#

 

R1#tracer 4::4

Type escape sequence to abort.

Tracing the route to 4::4

 

  1 12::2 0 msec 0 msec 0 msec

  2 234::4 0 msec 4 msec 5 msec

R1#