OSPF areas - how to achieve optimal routing - Cisco way
OSPF areas - how to achieve optimal routing - Cisco way

In previous article "OSPF areas: Analysing an apprently redundant design - Cisco way"
http://forum.ivorde.ro/ospf-areas-analysing-an-apprently-redundant-design-cisco-way-t19241.html I discussed about a an OSPF design that has some caveats.
I will continue here with an aspect that can be seen in many networks: What path will traffic from R5 to R4 take ? (virtual link between R1 and R3 is not configured).
Code:
R5#traceroute 4.4.4.4 source 5.5.5.5
Type escape sequence to abort.
Tracing the route to 4.4.4.4
1 172.16.9.1 40 msec 24 msec 64 msec
2 172.16.2.2 60 msec 64 msec 64 msec
3 172.16.1.1 92 msec 120 msec 96 msec
4 172.16.7.2 140 msec 164 msec 112 msec
R5#sh ip ospf datab summary 4.4.4.4
OSPF Router with ID (5.5.5.5) (Process ID 1)
Summary Net Link States (Area 20)
Routing Bit Set on this LSA
LS age: 94
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 4.4.4.4 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xBC64
Length: 28
Network Mask: /32
TOS: 0 Metric: 4
So sub-optimal routing takes place for traffic between two network extremities (R5 and R4). How can we route traffic through R3 ?
- Virtual link between R3 and R1. In this case R3 will become an ABR and for all destinations in area 20 will inject a summary LSA in area 10.
- Add another loopback on R3 and add it to Area 0.
We've seen the first solution in previous article. I will look now at second one:
Code:
R3(config)#int lo1
R3(config-if)#ip addr 3.3.3.33 255.255.255.255
R3(config-if)#ip ospf 1 area 0
R3(config-if)#
And now on R5:
Code:
R5#sh ip ospf datab summary 4.4.4.4
OSPF Router with ID (5.5.5.5) (Process ID 1)
Summary Net Link States (Area 20)
Routing Bit Set on this LSA
LS age: 361
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 4.4.4.4 (summary Network Number)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0xBC64
Length: 28
Network Mask: /32
TOS: 0 Metric: 4
Routing Bit Set on this LSA
LS age: 57
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(Network)
Link State ID: 4.4.4.4 (summary Network Number)
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x8A94
Length: 28
Network Mask: /32
TOS: 0 Metric: 2
R5#traceroute 4.4.4.4 source 5.5.5.5
Type escape sequence to abort.
Tracing the route to 4.4.4.4
1 172.16.8.1 32 msec 40 msec 32 msec
2 172.16.5.2 96 msec 92 msec 92 msec
At this point, R5 OSPF database contains two summary LSAs with ID 4.4.4.4: One from R2 via area0 (the long/sub-optimal path) with a metric of 4 and the other from R3 with a metric of 2. Traffic from R5 to R4 flows via R3 now.