Viewing the World in Binary

OSPF – Cost Metric and LSA’s.

TOPOLOGY

cost-topology

 

I read OSPF related articles on PacketLife and IPCorner, must say very consice and well written articles. I have decided to explore more into OSPF and  believe this exercise should be usefull for my future plan on working towards CCIE. As I read and practise more on OSPF, I find there is a lot more to it then I had previously thought. I can’t conquer the world with a Dynamips lab setup, but I am getting pretty good exposure on working and behaviour of OSPF. Anyways, the routers which we will focus in this lab are ASBR-A0R1 (Area 0 Backbone Router) which has Point-to-Point connectivity to ABR-a-0-2 and ABR-b-0-2. The two ABR’s are providing redundacy to Totally Stubby Area 2 and A2-R1 is Area 2 Internal router.

In this lab I will be tracing the changes to route tables after using Interface Specific OSPF COST command and OSPF PROCESS specific MAX-METRIC command.

Area 2 Internal Router A2-R1 Routing table without OSPF interface Cost configured comes up as:;

     2.0.0.0/30 is subnetted, 2 subnets
C       2.2.2.4 is directly connected, Serial0/1
C       2.2.2.12 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/65] via 2.2.2.13, 00:09:04, Serial0/0     ! Default Route is available via both ABR’s
               [110/65] via 2.2.2.5, 00:09:04, Serial0/1

Route table changes after configuring COST command on Serial Interface of Internal Router in Area 2

interface Serial0/0
 ip address 2.2.2.14 255.255.255.252
 ip ospf cost 10         ! S0/0 is now the preferred exit interface for traffic destined out of Area 2.
 serial restart-delay 0
!
interface Serial0/1
 ip address 2.2.2.6 255.255.255.252
 ip ospf cost 20
 serial restart-delay 0

! As expected Route via S0/1 interface has been removed. 

     2.0.0.0/30 is subnetted, 2 subnets
C       2.2.2.4 is directly connected, Serial0/1
C       2.2.2.12 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/11] via 2.2.2.13, 00:00:44, Serial0/0   ! Route via Serial 0/1 is no more present in routing table.

A2-R1 Router, which was configured with specific Cost under S 0/0 and S 0/1 interface (this will be covered by Router Self-Originate)

A2-R1#sh ip ospf database router self-originate 

            OSPF Router with ID (2.2.2.14) (Process ID

                Router Link States (Area 2)

  LS age: 1016
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 2.2.2.14
  Advertising Router: 2.2.2.14
  LS Seq Number: 80000004
  Checksum: 0xDEF6
  Length: 72
  Number of Links: 4

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 192.0.0.6
     (Link Data) Router Interface address: 2.2.2.6
      Number of TOS metrics: 0
       TOS 0 Metrics: 20   <– Cost metric effect on Self Originating Router LSA’s for interface S0/1 after applying cost metric to the interface.

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 2.2.2.4
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 20

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 192.0.0.14
     (Link Data) Router Interface address: 2.2.2.14 
      Number of TOS metrics: 0
       TOS 0 Metrics: 10 <– Cost metric effect on Self Originating Router LSA’s for interface S0/1 after applying cost metric to the interface.

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 2.2.2.12
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

ABR-a-0-2#sh ip ospf database router adv-router 2.2.2.14   ! Router LSA as recieved from A2-R1 by ABR-a-0-2/ABR-b-0-2

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

                Router Link States (Area 2)

  LS age: 1626
  Options: (No TOS-capability, DC)
  LS Type: Router Links
  Link State ID: 2.2.2.14
  Advertising Router: 2.2.2.14
  LS Seq Number: 80000005
  Checksum: 0xDCF7
  Length: 72
  Number of Links: 4

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 192.0.0.6
     (Link Data) Router Interface address: 2.2.2.6
      Number of TOS metrics: 0
       TOS 0 Metrics: 20

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 2.2.2.4
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 20

    Link connected to: another Router (point-to-point)
     (Link ID) Neighboring Router ID: 192.0.0.14
     (Link Data) Router Interface address: 2.2.2.14
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

    Link connected to: a Stub Network
     (Link ID) Network/subnet number: 2.2.2.12
     (Link Data) Network Mask: 255.255.255.252
      Number of TOS metrics: 0
       TOS 0 Metrics: 10

 

Route Table Changes after OSPF PROCESS specific command ‘max-metric router-lsa summary-lsa’ on ABR-a-0-2

Lets change Router LSA metric on ABR-a-0-2 which presents itself as the “Better” cost link. The cost on the link will be changed to default max. This will lead to the ABR router ABR-a-0-2 advertise a metric high enough for the traffic to take alternative path (which was not being used due to previously define cost of 20). All Area Border Routers (ABR’s) originate default routes into stub areas. These routes are advertised as inter-area summary routes. Below find max-metric command associated with summary-lsa, this will force the ABR to send Max-Metric out as Summary LSA to Stub Area Internal Router.

router ospf 1
 max-metric router-lsa summary-lsa   !  LSA Originating from this process will advertise 16711680 i.e. max COST METRIC on all interfaces via summary LSA’s.
 log-adjacency-changes
 area 0 authentication message-digest
 area 2 stub no-summary
 network 2.2.2.12 0.0.0.3 area 2
 network 192.0.0.12 0.0.0.3 area 0

 

A2-R1#sh ip ospf database summary  <- Check on What metric Area 2 internal router recieves as Summary LSA from the two ABR’s

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

                Summary Net Link States (Area 2)

  Routing Bit Set on this LSA
  LS age: 1556
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 0.0.0.0 (summary Network Number) <– ABR-b-0-2 advertises default route as Summary LSA.
  Advertising Router: 192.0.0.6
  LS Seq Number: 8000000C
  Checksum: 0xB0BB
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 1 <– Recieved from ABR-a-0-2 as default route Metric via Summary LSA

  Routing Bit Set on this LSA
  LS age: 629
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 0.0.0.0 (summary Network Number)  <– ABR-a-0-2 advertises default route as Summary LSA.
  Advertising Router: 192.0.0.14
  LS Seq Number: 80000014
  Checksum: 0x66F6
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 16711680  <– Recieved from ABR-a-0-2 as default route Metric for summary LSA.

A2-R1# sh ip route
     2.0.0.0/30 is subnetted, 2 subnets
C       2.2.2.4 is directly connected, Serial0/1
C       2.2.2.12 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/21] via 2.2.2.5, 01:34:06, Serial0/1  <– Default Route has changed via 2.2.2.5 (i.e. ABR-b-0-2) instead of 2.2.2.13 (i.e. ABR-a-0-2).

ABR-a-0-2#sh ip ospf
 Routing Process “ospf 1” with ID 192.0.0.14
 Start time: 00:00:23.516, Time elapsed: 04:01:11.640
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Supports area transit capability
 It is an area border router
 Originating router-LSAs with maximum metric
    Condition: always, State: active
    Advertise summary-LSAs with metric 16711680
 Initial SPF schedule delay 5000 msecs
USEFULL COMMANDS:

ABR-b-0-2#sh ip ospf
 Routing Process “ospf 1” with ID 192.0.0.6
 Start time: 00:00:23.336, Time elapsed: 02:33:35.156
 Supports only single TOS(TOS0) routes
 Supports opaque LSA
 Supports Link-local Signaling (LLS)
 Supports area transit capability
 It is an area border router
Router is not originating router-LSAs with maximum metric
 Initial SPF schedule delay 5000 msecs
 Minimum hold time between two consecutive SPFs 10000 msecs
 Maximum wait time between two consecutive SPFs 10000 msecs

Lets try changing default-cost sent by ABR-b-0-2 from the default 1 (for Serial Links) to an higher value. We will accomplish this by using OSPF PROCESS area option ‘default-cost’

router ospf 1
 log-adjacency-changes
 area 0 authentication message-digest
 area 2 stub no-summary
 area 2 default-cost 64000
 network 2.2.2.4 0.0.0.3 area 2
 network 192.0.0.4 0.0.0.3 area 0

A2-R1#sh ip ospf data summary 0.0.0.0

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

                Summary Net Link States (Area 2)

  Routing Bit Set on this LSA
  LS age: 5
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 0.0.0.0 (summary Network Number)
  Advertising Router: 192.0.0.6
  LS Seq Number: 80000002
  Checksum: 0x8DEE
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 64000

  LS age: 774
  Options: (No TOS-capability, DC, Upward)
  LS Type: Summary Links(Network)
  Link State ID: 0.0.0.0 (summary Network Number)
  Advertising Router: 192.0.0.14
  LS Seq Number: 80000001
  Checksum: 0x8CE3
  Length: 28
  Network Mask: /0
        TOS: 0  Metric: 16711680

CONCLUSION: This technique can be used to change the traffic flow effectively and with minimal interuption. And is a technique which is widely referenced in various articles. This is just another attempt to practise and document it for my own reading. Any Comments or suggestions are very welcome.

NOTE: Commands for Reference.

A2-R1#sh ip ospf database ?
  adv-router        Advertising Router link states
  asbr-summary      ASBR summary link states
  database-summary  Summary of database
  external          External link states
  network           Network link states <– Type 2 and will result in no output in P-to-P as are generated by DR’s.
  nssa-external     NSSA External link states
  opaque-area       Opaque Area link states
  opaque-as         Opaque AS link states
  opaque-link       Opaque Link-Local link states
  router            Router link states ! <– Type-1 inter router (i.e non-DR/BDR) LSA’s. e.g. LSA’s between ABR and Internal Router on P-to-P are Type-1.
  self-originate    Self-originated link states
  summary           Network summary link states !<– Type 3 will provide with Summary Network Number i.e. 0.0.0.0 incase of Stub areas.
  |                 Output modifiers
  <cr>

ABR-a-0-2(config-router)#max-metric router-lsa ?
  external-lsa  Override external-lsa metric with max-metric value
  include-stub  Set maximum metric for stub links in router-LSAs
  on-startup    Set maximum metric temporarily after reboot
  summary-lsa   Override summary-lsa metric with max-metric value

November 6, 2008 Posted by | Protocols - OSPF | | Leave a comment

OSPF – EIGRP Redistribution

TOPOLOGY (snagged from our Multi Area Topology)

 

redist-topo

 

A1-R2 ——- ABR-VL-R8 ——– ASBR-A10R1 ———– ISP2

Area 1        Area 1 – 10(nssa)     AREA 10(nssa) – EIGRP 1          EIGRP 1

<—— One Way Redistribution EIGRP TO OSPF

Following config and route output is to study Route Propagation for network 50.50.16.0/20 and 50.50.32.0/20 from EIGRP Router to OSPF NSSA Area 10 and OSPF Area 1

! ISP2 Router with EIGRP Network

router eigrp 1
 network 50.50.16.0 0.0.15.255
 network 50.50.32.0 0.0.15.255
 network 70.71.72.4 0.0.0.3
 default-metric 10000 100 255 1 1500 ! [Speed/kbps] [delay/ms] [reliability] [load] [MTU]
 auto-summary ! Autosummarization – EIGRP installs the summary route with the next hop to Null0 for loop-prevention.

     50.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C       50.50.16.0/20 is directly connected, FastEthernet1/0
C       50.50.32.0/20 is directly connected, FastEthernet2/0
D       50.0.0.0/8
is a summary, 01:26:55, Null0

! Auto summarization is enabled, directly connected route is installed with next hop as Null0 for loop-prevention.

     70.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
D       70.0.0.0/8 is a summary, 01:26:55, Null0
C       70.71.72.4/30 is directly connected, Serial0/0

! ASBR-A10R1 Not So Stubby Area (nssa) ASBR Router – OSPF Area 10 nssa/EIGRP 1 AS

router eigrp 1
network 70.71.72.4 0.0.0.3
auto-summary
!
router ospf 1
log-adjacency-changes
area 10 nssa
redistribute eigrp 1
network 10.10.1.4 0.0.0.3 area 10

1.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O IA 1.1.1.4/30 [110/192] via 10.10.1.6, 00:02:27, Serial0/0
O IA 1.1.1.8/30 [110/128] via 10.10.1.6, 00:02:27, Serial0/0
O IA 1.1.30.0/24 [110/129] via 10.10.1.6, 00:02:27, Serial0/0
D 50.0.0.0/8 [90/2172416] via 70.71.72.5, 00:22:22, Serial0/1

! Internal EIGRP (route directly placed into EIGRP is classified as Internal EIGRP route) route Administrative Distance(AD) is 90, Feasible Distance is 2172416. See below for how we got that number.

70.0.0.0/30 is subnetted, 1 subnets
C 70.71.72.4 is directly connected, Serial0/1
101.0.0.0/32 is subnetted, 2 subnets
O IA 101.0.0.1 [110/65] via 10.10.1.6, 00:02:27, Serial0/0
O IA 101.0.0.2 [110/193] via 10.10.1.6, 00:02:27, Serial0/0
D 40.0.0.0/8 [90/2172416] via 70.71.72.5, 00:22:22, Serial0/1
10.0.0.0/30 is subnetted, 1 subnets
C 10.10.1.4 is directly connected, Serial0/0

ASBR-A10R1#sh ip eigrp topology 50.0.0.0
IP-EIGRP (AS 1): Topology entry for 50.0.0.0/8
State is Passive, Query origin flag is 1, 1 Successor(s), FD is 2172416
Routing Descriptor Blocks:
70.71.72.5 (Serial0/1), from 70.71.72.5, Send flag is 0x0
Composite metric is (2172416/28160), Route is Internal ! 28160 is Advertised Distance i.e metric peer advertised.
Vector metric:
Minimum bandwidth is 1544 Kbit
Total delay is 20100 microseconds
Reliability is 255/255
Load is 1/255
Minimum MTU is 1500
Hop count is 1

NOTE: Advertised Distance – Distance from neighbor to destination | Feasible Distance – Complete path from Source to Destination. Route’s where neighbors AD is less than our FD will not result in a loop.

Calculating Feasible Distance – The above `sh ip eigrp topology 50.0.0.0` command gives us Composite metric with Bandwidth and delay, we can now calculate the Feasible Distance. Command output shows 1 hop delay in micro seconds as 20100 and Minimum Bandwidth as 1544kb. We dont have to add delay as the destination is only 1 hop.

K2,K4,K5 by default have value 0 leading to this minimal metric formula.

metric = 256 * ( 10r7/1544 + 20100/10) = 256 * (6476.684 + 2010) = 2172591

So why the difference? what we got is 2172591 and EIGRP calculates it as 2172416

Actual Formula for computing is –

 

 

 

ABR-VL-R8 Area Border Router between NSSA and Area 1 (Area 10 is connected to Area 0 via Virtual Link)

router ospf 1
log-adjacency-changes
area 0 authentication message-digest
area 1 virtual-link 101.0.0.2 message-digest-key 1 md5 dracula
area 10 nssa
network 1.1.1.8 0.0.0.3 area 1
network 10.10.1.4 0.0.0.3 area 10
network 101.0.0.1 0.0.0.0 area 0

1.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
O 1.1.1.4/30 [110/128] via 1.1.1.10, 00:26:13, Serial0/0
C 1.1.1.8/30 is directly connected, Serial0/0
O 1.1.30.0/24 [110/65] via 1.1.1.10, 00:26:13, Serial0/0
O N2 50.0.0.0/8 [110/20] via 10.10.1.5, 00:00:02, Serial0/1

! N2 – Type 7 advertisements cross the NSSA and are converted back to type 5 LSAs at ABR. NSSA external routes show up as N1 or N2 instead of E1 or E2.

! [110/20] [OSPF Protocol Administrative Distance / Cost Metric] OSPF Cost Metric calculations are as below.

! OSPF Cost Metric – ‘Reference Bandwidth / Configured Bandwidth of interface in kbps’ : Reference Bandwidth is 100Mbs by default (100000000).


101.0.0.0/32 is subnetted, 2 subnets
C 101.0.0.1 is directly connected, Loopback0
O 101.0.0.2 [110/129] via 1.1.1.10, 00:00:02, Serial0/0
O N2 40.0.0.0/8 [110/20] via 10.10.1.5, 00:00:02, Serial0/1
10.0.0.0/30 is subnetted, 1 subnets
C 10.10.1.4 is directly connected, Serial0/1
192.0.0.0/30 is subnetted, 1 subnets
O 192.0.0.16 [110/192] via 1.1.1.10, 00:00:02, Serial0/0

`sh ip ospf database` Output from ABR-VL-R8 for Area 10

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

Router Link States (Area 10)   <– Type-1 Router LS i.e intra-area LSA

Link ID ADV Router Age Seq# Checksum Link count
70.71.72.6 70.71.72.6 61 0x8000000B 0x007DC6 2
101.0.0.1 101.0.0.1 57 0x8000000C 0x00F3C2 2

Summary Net Link States (Area 10)  <– Type-3 Inter Area LS

Link ID ADV Router Age Seq# Checksum
0.0.0.0 101.0.0.1 155 0x80000004 0x009C30

Type-7 AS External Link States (Area 10)  

Link ID ADV Router Age Seq# Checksum Tag
40.0.0.0 70.71.72.6 59 0x80000009 0x00A2CD 0
50.0.0.0 70.71.72.6 59 0x80000009 0x002046 0

Type-5 AS External Link States

Link ID ADV Router Age Seq# Checksum Tag
40.0.0.0 101.0.0.1 46 0x80000001 0x008176 0
50.0.0.0 101.0.0.1 46 0x80000001 0x00FEEE 0

! A1-R2 (Area 1 Router with External Routes from NSSA)

1.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C 1.1.1.4/30 is directly connected, Serial0/2
C 1.1.1.8/30 is directly connected, Serial0/1
C 1.1.30.0/24 is directly connected, FastEthernet1/0
O E2 50.0.0.0/8 [110/20] via 1.1.1.9, 00:03:10, Serial0/1

! E2 is default metric for External Routes – External cost of the path from the ASBR is only considered for calculation. (E1 – cost of path to reach ASBR internally is also added. Useful when internal routing should be included in path selection, E1 is the preffered path)


101.0.0.0/32 is subnetted, 2 subnets
O IA 101.0.0.1 [110/65] via 1.1.1.9, 00:29:14, Serial0/1
O IA 101.0.0.2 [110/65] via 1.1.1.6, 00:29:14, Serial0/2
O E2 40.0.0.0/8 [110/20] via 1.1.1.9, 00:03:10, Serial0/1
10.0.0.0/30 is subnetted, 1 subnets
O IA 10.10.1.4 [110/128] via 1.1.1.9, 00:09:13, Serial0/1
192.0.0.0/30 is subnetted, 1 subnets
O IA 192.0.0.16 [110/128] via 1.1.1.6, 00:03:15, Serial0/2

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

If we remove EIGRP network for 70.71.72.4/30 from ASBR-A10R1, we see the following:

ASBR-A10R1#
70.0.0.0/30 is subnetted, 1 subnets
C 70.71.72.4 is directly connected, Serial0/1
10.0.0.0/30 is subnetted, 1 subnets
C 10.10.1.4 is directly connected, Serial0/0

debug ip EIGRP 1

!! ASBR-A10R1 shows the following debug information and you can see the changes in route table.

ASBR-A10R1#
*Mar 1 01:03:59.227: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 1: Neighbor 70.71.72.5 (Serial0/1) is up: new a
djacency
*Mar 1 01:03:59.771: IP-EIGRP(Default-IP-Routing-Table:1): Processing incoming UPDATE packet
*Mar 1 01:03:59.775: IP-EIGRP(Default-IP-Routing-Table:1): 70.71.72.4/30 – do advertise out Serial0
/1
*Mar 1 01:04:00.075: IP-EIGRP(Default-IP-Routing-Table:1): Processing incoming UPDATE packet
*Mar 1 01:04:00.079: IP-EIGRP(Default-IP-Routing-Table:1): Int 40.0.0.0/8 M 2172416 – 1657856 51456
0 SM 28160 – 25600 2560
*Mar 1 01:04:00.083: IP-EIGRP(Default-IP-Routing-Table:1): route installed for 40.0.0.0 ()
*Mar 1 01:04:00.087: IP-EIGRP(Default-IP-Routing-Table:1): Int 50.0.0.0/8 M 2172416 – 1657856 51456
0 SM 28160 – 25600 2560
*Mar 1 01:04:00.091: IP-EIGRP(Default-IP-Routing-Table:1): route installed for 50.0.0.0 ()
*Mar 1 01:04:00.095: IP-EIGRP(Default-IP-Routing-Table:1): 70.71.72.4/30 – do advertise out Serial0
/1
*Mar 1 01:04:00.115: IP-EIGRP(Default-IP-Routing-Table:1): Processing incoming UPDATE packet
*Mar 1 01:04:00.119: IP-EIGRP(Default-IP-Routing-Table:1): Int 40.0.0.0/8 M 2172416 – 1657856 51456
0 SM 28160 – 25600 2560
*Mar 1 01:04:00.123: IP-EIGRP(Default-IP-Routing-Table:1): Int 50.0.0.0/8 M 2172416 – 1657856 51456
0 SM 28160 – 25600 2560

Default Seed Metrics

 

NOTE: EXPERIMENT WITH Redistribution from EIGRP to OSPF with Route Maps.

November 5, 2008 Posted by | Protocols - OSPF | | Leave a comment