Tuesday, January 28, 2014

OSPF Path Selection with Cost


Pic. 1 - Topology Diagram.



Task 1
Configure OSPF area 0 between R1 and R2 using Frame-Relay connection (Ser0/0).

Task 2
After you have completed Task1, check OSPF path on R2 towards the rest of the OSPF domain (check next-hop router's address). Configure R2 to use the newly created Frame-Relay link as the best path. Use interface cost command to accomplish this.

Questions
Try to answer the following questions:
  1. How does OSPF calculate the metric on Cisco routers by default?
  2. How can you influence the path selection in OSPF?
  3. How does Cisco OSPF router calculate the cost by default (as of writing this post)?
  4. How would you configure support so that the higher than 100Mbps interfaces have their cost automatically calculated?
Lab Solution

Solution configuration can be accessed below (if you want to save it, click the link, then go to File-->Download):
https://drive.google.com/file/d/0BwE5C95tpjZORlpIR0RDNnU5QW8/edit?usp=sharing


Task 1
Configure OSPF area 0 between R1 and R2 using Frame-Relay connection (Ser0/0).

Notice!
It is a good idea to check how R1 is already configured (ospf mode, authentication etc.) in order to configure R2 properly on Frame-Relay link.

R1 Current Config:
!
router ospf 1
 log-adjacency-changes
 area 0 authentication
 network 10.0.1.1 0.0.0.0 area 0
 network 172.16.0.0 0.0.0.255 area 0
 network 172.16.13.1 0.0.0.0 area 13
!

interface FastEthernet0/0

 ip address 172.16.12.1 255.255.255.0

 ip ospf authentication null
 ip ospf 1 area 0
 speed 100
 full-duplex
!
interface Serial0/0
 ip address 172.16.0.1 255.255.255.0
 encapsulation frame-relay
 ip ospf authentication-key G33K
 ip ospf network point-to-multipoint
 clock rate 2000000
 frame-relay map ip 172.16.0.1 103
 frame-relay map ip 172.16.0.3 103 broadcast
 frame-relay map ip 172.16.0.4 104 broadcast
 no frame-relay inverse-arp
!

Notice!
  • R1 uses simple password authentication in area 0 but it is disabled on Fas0/0.
  • R1 does not have Frame-Relay IP mapping towards R2 (R2 has this mapping towards R3; not shown here).
  • R1 ospf mode is point-to-multipoint
  • R1 authentication key = G33K

R1 Config:
!
interface serial0/0
 frame-relay map ip 172.16.0.2 102 broadcast
!

R2 Config:
!
interface serial0/0
 ip ospf authentication
 ip ospf authentication-key G33K
 ip ospf network point-to-multipoint
 ip ospf 1 area 0
!
Pic. 2 - OSPF Neighborship Verification.


Task 2
After you have completed Task1, check OSPF path on R2 towards the rest of the OSPF domain (check next-hop router's address). Configure R2 to use the newly created Frame-Relay link as the best path. Use interface cost command to accomplish this.

Pic. 3 - R2's Routing Table.


Notice!
For all OSPF destination R2 uses FastEthernet0/0 as expected.

Pic. 4 - R2's OSPF Costs of Interfaces.



The last thing to complete the goal is to change the cost of the interface preferring Serial0/0.

R2 Config:
!
interface FastEthernet0/0
 ip ospf cost 65
!

Pic. 5 - R2's Current Routing Table (after few seconds).


R2 prefers Serial0/0 as its outgoing interface for all OSPF networks.

Study Drill

There are bunch of methods to influence the path selection process in OSPF:

  • ip ospf cost
  • auto-cost reference-bandwidth
  • bandwidth
  • summarization a range of prefixes
  • neighbor costs (working in certain ospf modes)
  • etc.
It is worth mentioning that OSPF will calculate the cost based on the reference bandwidth (value of 100 representing 100,000,000 bps by default) according to the formula:

cost = ref_band / bandwidth_of_the_link.