Thursday, June 2, 2011

notes: OSPF Path Selection

- Each OSPF route entry is classified according to a destination type. The destination type will be either network or router.
- Network entries are the addresses of networks to which packets can be routed. These destinations are inserted into the routing table.

Seen by #sh ip route ospf

- Router entries are routes to ABRs and ASBRs. This information kept is in a separate, internal route table.

- Seen by show ip ospf border-routers

- OSPF Route Table Lookups:

1.  Longest Match
2.  Most to Least Preferred Path Type:
     a. O - Intra-area paths are to destinations within one of the router's attached areas
     b. O IA - Inter-area paths are to destinations in another area but within the OSPF autonomous system
     c. E1 (N1) - External paths are to destinations outside the OSPF autonomous system, (Ext cost + Cost to      ASBR)
    d. E2 (N2) - External paths are to destinations outside the OSPF autonomous system, (Ext cost to dst is used) !DEFAULT!

3.  Use Lowest cost metric (OSPF Cost), unless equal-cost paths exist.

4.  if everything i s equal highest RID wins.

additional note:

- OSPF external routes are, by default, E2 paths.
- E1 and N1 are cumulative metrics, the ASBR advertised cost and internal OSPF cost to the ASBR.
- E2 and N2 are static metrics as advertised by ASBR.
- Using E1 Metrics: Packets will be routed to external destinations out of the network, usually at the closest exit point.
- Using E2 Metrics: If one wants packets to exit the network at the closest point to their external destination.

Changing the Cost Metric

- Cost is the OSPF metric, expressed as an 16-bit integer in the range of 1 to 65535.
- The Cisco implementation of OSPF calculates the metric using the following formula:

cost = reference bandwidth / bandwidth

- The default reference bandwidth is 100 Mbps. The bandwidth value is that which is configured on the interface using the bandwidth command. If you use many interfaces faster than 100 Mbps, consider resetting the reference bandwidth value. You can do so on each router using the following router configuration mode


 Cost can be modified in the following ways:

1.  interface "bandwidth" command.
         
         interface  e/0
         bandwidht 100 (kbps)


2.  interface "ip ospf cost"  You can also override the calculated cost value in any interface directly by using the following interface configuration. Values range from 1 to 65,535.
         
         interface e0/0
         ip ospf cost 1

note:  The best practice here is specifying ip ospf cost manually for every interface. This is a best method to avoid confusion in route selection.

3.  process "auto-cost"  To control how OSPF calculates default metrics for the interface, use the auto-cost command in router configuration mode. 

- The reference bandwidth of 10^8 (100MB) creates a problem for some modern media with bandwidths higher than 100M.
- To remedy this, Cisco provides the command "auto-cost reference-bandwidth"
which allows the default reference bandwidth to be changed.

command:

auto-cost reference-bandwidth refbw 

note: refbw is in MB, ensure proper bandwidth command are configured on all interfaces.

 Reference bandwidth is in megabits per second. For example, if you want to ensure Gigabit Ethernet interfaces evaluate to a cost of 5, set the refbw on each router to 5000. (Valid values are from 1 to 4,294,967.)

CCIE LAB:  Gigabit link to show cost of 50. so 50,000 will give you a cost of 50.

 auto-cost reference-bandwidth 50000

 verification:

show ip interface | include Cost
show ip route ospf

4.  process "neighbor x.x.x.x cost" Assigns a cost to the neighbor, in the form of an integer from 1 to 65535. Neighbors with no specific cost configured will assume the cost of the interface, based on the ip ospf cost command. On point-to-multipoint interfaces, this is the only keyword and argument that make sense. This keyword does not apply to NBMA networks.

command


neighbor 10.0.1.3 cost #

iOSPF (Incremental OSPF)

- Incremental SPF is more efficient than the full SPF algorithm, allowing slightly faster convergence.
- Incremental SPF allows the system to recompute only the affected part of the SPF tree.

command:

router ospf 1
ispf
 
OSPF Load Balancing

- multiple things must be equal
     - metric of routers themselves
                show ip route
    - metric of path to the router's next-hop
               show ip ospf border-routers 
          note: this will show ABRs/ASBRs with metrics

example below shows the metric and cost of directcly connected ABR/ASBR router via e0/0 link.

Hurd#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i - Intra-area route, I - Inter-area route

i 172.17.1.1 [1] via 10.8.1.2, Ethernet0/0, ABR/ASBR, Area 0, SPF 10

Hurd#sho ip ospf interface e0/0
Ethernet0/0 is up, line protocol is up
  Internet Address 10.8.1.1/24, Area 0
  Process ID 1, Router ID 172.20.1.5, Network Type BROADCAST, Cost: 1
  Transmit Delay is 1 sec, State DR, Priority 1
  Designated Router (ID) 172.20.1.5, Interface address 10.8.1.1
  Backup Designated router (ID) 172.17.1.1, Interface address 10.8.1.2
  Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
    oob-resync timeout 40
    Hello due in 00:00:03
  Supports Link-local Signaling (LLS)
  Index 1/1, flood queue length 0
  Next 0x0(0)/0x0(0)
  Last flood scan length is 0, maximum is 1
  Last flood scan time is 0 msec, maximum is 4 msec
  Neighbor Count is 1, Adjacent neighbor count is 1
    Adjacent with neighbor 172.17.1.1  (Backup Designated Router)
  Suppress hello for 0 neighbor(s)

1 comment: