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

Advertisements

November 6, 2008 - Posted by | Protocols - OSPF |

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: