SlideShare a Scribd company logo
Open Shortest Path First (OSPF)
OSPF Routing Protocol in-depth analysis
2
www.meddane.com
OSPF Routing Protocol
in-depth analysis
Theory translated into practice
BY Redouane MEDDANE
OSPF Routing Protocol in-depth analysis
3
www.meddane.com
Contents
Part I : OSPF theory and definitions
1-Introduction
2-Area Types
3-Router Roles
4-OSPF Metric
5-OSPF Neighbors
6-Packet Types:
7-OSPF States
8-DR and BDR
9-Route Summarization
10-OSPF Passive Interfaces
11-OSPF Default Routes:
12-Link State Advertisements (LSAs)
13-Standard,Stub and Not-So-Stubby Areas
14-OSPF Virtual Links
15-OSPF Route Types
16-OSPF Network Types
Part II : Practices Labs
Lab 1: OSPFv3 Virtual-Link
Lab 2: External path selection in NSSA
Lab 3: Stub and totally stuby area
Lab 4: Manipulating of the Forwarding Address and the path selection
Lab 5 : ABRs election and Forward Address in NSSA with OSPFv3
Lab 6 : loop prevention mechanism of inter-area ospf
Lab 7: Forward Address and path selection in OSPFv2
Lab 8: OSPFv3 and the Forwarding Address
Lab 9: OSPF path selection for external route
Lab 10: OSPFv2 and OSPFv3 comparison
Lab 11: OSPF over Frame-Relay and redistribution between two OSPF Processes-ID
Lab 12: Redistribution between two OSPF Processes-ID
Lab 13: OSPFv3 external path selection and Forward Address
Lab 14: Forwarding Address selection
Lab 15: Forwarding Address selection among two LSAs Type 7 for the same destination
Lab 16: NSSA with OSPFv3
Lab 17: Virtual-Link OSPF
Lab 18: Effects of ABR Loop Prevention with OSPFv3
Lab 19: Forwarding Address
Lab 20: OSPFv3 and the use of forwarding address
Lab 21: The Forwarding Address and path selection
Lab 22: Routing Problem with OSPF Forwarding Address with all possible solutions
Lab 23: How an ABR sets the Forward Address in the LSA Type 7
Lab 24: Routing Problem with OSPFv3 when advertising external routes in NSSA
Lab 25: OSPFv3 LSAs : Types 2001 and 2002, Types 0008 and 2009 (Router and Network, Link and
Intra-Area-Prefix)
Lab 26: P-bit in LSA Type 7 loop prevention
Lab 27: LSA Type-7 and LSA Type-5 which will win?
Lab 28: LSA Type-7 With P-bit Clear and LSA Type-5 which win?
Lab 29: Effect of the prefix-suppression Feature over the LSAs Type-1 and Type-2
Lab 30:V-bit and B-bit in LSA Type 1
Lab 31:Effect of the ABR Loop Prevention over the LSA Type 4
Lab 32:External Default route in NSSA area
Lab 33:External Routes over LSA Type-7 and LSA Type-5
Lab 34: Next-Hop Field in OSPFv2 and OSPFv3
Lab 35:Adjacencies in OSPFv3
Lab 36:Suppressing the Forward Address in the LSA Type 7
Lab 37:LSA Type-7 and the P-Bit
Lab 38: Analysing the LSAs Type of OSPFv3
Lab 39: Understanding of Not-So-Stubby Area (NSSA)
Lab 40: LSA Type 4 asb-summary LSA Part1
Lab 41: LSA Type 4 asb-summary LSA Part 2
Lab 42: Fields of the LSAs Type on OSPFv3
Lab 43: Suboptimal Routing with LSA Type 4
Lab 44: Third-Party Next-Hop
Part III : Appendixes
Reference RFC3101
Notes
OSPF Routing Protocol in-depth analysis
4
www.meddane.com
Part I : OSPF theory and definitions
1-Introduction
2-Area Types
3-Router Roles
4-OSPF Metric
5-OSPF Neighbors
6-Packet Types:
7-OSPF States
8-DR and BDR
9-Route Summarization
10-OSPF Passive Interfaces
11-OSPF Default Routes:
12-Link State Advertisements (LSAs)
13-Standard,Stub and Not-So-Stubby Areas
14-OSPF Virtual Links
15-OSPF Route Types
16-OSPF Network Types
OSPF Routing Protocol in-depth analysis
5
www.meddane.com
1-Introduction:
OSPF, or Open Shortest Path First, is a link-state, open-standard, dynamic routing protocol. OSPF uses an
algorithm known as SPF, or Dijkstra’s Shortest Path First, to compute internally the best path to any given route.
OSPF is classless and converges fairly quickly, using cost as it’s metric. A router running OSPF creates its own
database which contains information on the entire OSPF network, not simply neighbour's routes like EIGRP. This
allows the router to make intelligent choices about path selection on its own instead of relying exclusively on
neighbour information.
OSPF routers do form neighbour relationships though. They exchange hellos with neighbouring routers and in the
process learn their neighbour's Router ID (RID) and cost. Those values are then sent to the adjacency table.
Every router is responsible for computing its own best paths to all destinations within an OSPF domain. Once the
SPF algorithm selects the best paths, they are then eligible to be added to the routing table.
2-Area Types:
Backbone area:
Another name for area 0.
Regular area:
Non-backbone area, with both internal and external routes.
Stub area:
Contains only internal routes and a default route.
Totally Stubby Area:
Cisco proprietary option for a stub area.
Not-So-Stubby area (NSSA):
Contains internal routes, redistributed routes, and optionally a default route.
Totally Stubby NSSA:
Cisco proprietary option for NSSA.
3 tables:
- neighbour : same as eigrp
- Topology: every network in the area
- Routing: best path ways to networks
Although OSPF does not send routing updates on a periodic interval, as do distance vector protocols, OSPF does
reflood each LSA every 30 minutes based on each LSA’s age variable. The router that creates the LSA sets this age
to 0 (seconds). Each router then increments the age of its copy of each LSA over time. If 30 minutes pass with no
changes to an LSA–meaning no other reason existed in that 30 minutes to cause a reflooding of the LSA.
3-Router Roles:
 Internal : Routers which have all interfaces in a single area
 Backbone routers : Routers with at least one interface in area 0
 Area Border Routers (ABRs) : Routers with at least two interfaces in different areas
 Autonomous System Boundary Routers (ASBR) : Routers which redistribute information from an external
source
4-OSPF Metric:
Each interface is assigned a cost value based on bandwidth.The formula is:
OSPF Routing Protocol in-depth analysis
6
www.meddane.com
Cost = (100Mbs/bandwidth).
Higher bandwidth means a lower cost.
5-OSPF Neighbors:
Hellos are sent out periodically using multicast on OSPF enabled routers. The router forms an adjacency with a peer
router when it sees its own Router ID in the neighbor field of another router’s hello message. That indicates there is
direct, bi-directional communication on the same subnet.
Note: On multi-access links, adjacencies are only formed between the router and the DR and BDR.
All of the following fields in an OSPF hello message must match for an adjacency to form:
-hello timer
-dead timer
-area ID
-authentication type
-password
-stub area flag
With OSPF, if four consecutive hellos are not received (the dead time), the router is considered down.
- Point-point interfaces: hellos every 10 seconds, 40 second dead timer.
-Non-broadcast multi-access (NBMA) interfaces: hellos every 30 seconds, 120 second dead timer
6-Packet Types:
 Hello - Used to establish communication with directly connected neighbors
 Database Descriptor (DBD) - Lists router IDs from which the router has an LSA and its current sequence number
 Link State Request (LSR) - Request for an LSA
 Link State Update (LSU) - Reply to an LSR with the requested information
 Link State Acknowledgment (LSAck) - Used to confirm receipt of link-state information
7-OSPF States:
There are 7 different OSPF states when forming neighbor relationships. Take the time to learn the states and their
corresponding functions.
1. Down State
OSPF has not started and no hellos have been sent.
2. Init State
Hellos are sent out all OSPF-participating interfaces.
3. Two-way State
A hello is received from another router with its own RID in the neighbor field. All other required elements match and
the routers become neighbors.
OSPF Routing Protocol in-depth analysis
7
www.meddane.com
4. Exstart State
Routers determine which one will begin the route exchange process with the other.
5. Exchange State
Routers exchange DBDs.
6. Loading State
Routers compare the DBD to their LS database. LSRs are sent out for missing or outdated LSAs. Each router then
responds to the LSRs with a Link State Update. Finally, the LSUs are acknowledged.
7. Full State
The LSDB is completely synchronized with the OSPF neighbour.
8-DR and BDR:
SPF works by mapping all paths to every destination on each router. It uses the RID to identify hops along each path
and uses bandwidth as a metric between those hops. This whole system works really well when routers are
connected with point-to-point links and OSPF traffic is simply sent using multicast address 224.0.0.5.
It doesn’t work well, however, when a router is connecting to multi-access networks like an Ethernet VLAN. Multi-
access OSPF links require a Designated Router (DR) be elected to represent the entire segment. Another router is
then elected as the Backup Designated Router, or BDR. On that specific multi-access segment, routers only form
adjacencies with the DR and BDR.
The DR uses type 2, network LSAs to advertise the segment over multicast address 224.0.0.5. The Non-Designated
routers then use IP address 224.0.0.6 to communicate directly with the DR.
Elections:
1. When the OSPF process on a router starts up, it listens for hellos. If it does not receive any within its dead time, it
elects itself the DR.
2. If hellos are received before the dead time expires, the router with the highest OSPF priority is elected as the
DR. Next, the same process happens to elect the BDR. Note: If a router’s OSPF priority is set to 0, it will not
participate in the elections.
3. If two routers happen to have the same OSPF priority, the router with the highest Router ID will become DR. The
same is true for BDR.
Once a DR is elected, elections cannot take place again until either the DR or BDR go down. This essentially means
that there is no OSPF DR preemption if another router comes online with a higher OSPF priority. In the case that the
DR goes down, the BDR automatically is assigned the DR role and a new BDR election occurs.
Be aware that a router with a non-zero priority that happens to boots first can become the DR just because it did not
receive any hellos when the OSPF process was started – even though it may have a low OSPF priority.
The default OSPF priority is 1 and Cisco recommends manually changing that on routers you want to become the DR
and BDR.
Remember that DRs are only used on multi-access links, so they are only significant on an interface level. A router
with two different interfaces connected to two different multi-access links will have separate DR elections for each
segment.
OSPF Routing Protocol in-depth analysis
8
www.meddane.com
9-Route Summarization:
First, it’s important to note that running the SPF algorithm ,a router uses a lot the CPU resources and can easily
consume them all. The reason is because OSPF has to compute the best path to every destination within its
area. Avoiding running the algorithm when it is not required. Summarization has two important benefits for OSPF. It
prevents topology changes from being passed outside an area – thus reducing the number of routers re-running the
SPF algorithm. It also consolidates many routes in to a single statement, reducing the memory load and database
size on OSPF-enabled routers. There are two types of route summarization, inter-area and external.
a- Inter-area Summarization (LSA Type 3):
This occurs on ABRs to summarize routes between areas. This really only works well if the networks contained
within an area are subnetted contiguously so that they can be easily summarized into a single statement. The new
summary route’s cost will be equal to the lowest cost route within the summary range. After the command is entered,
the router will automatically create a static route pointing to Null0.
Example:
router ospf 1
area 1 range 10.10.0.0 255.255.252.0
b- External Summarization (LSA Type 5)
This occurs on ASBRs for routes that are injected into OSPF via route redistribution. After the command is entered,
the router will automatically create a static route pointing to Null0.
Example:
router ospf 1
summary-address 192.168.0.0 255.255.252.0
10-OSPF Passive Interfaces:
OSPF supports the use of passive interfaces. The passive-interface interface command disables OSPF hellos from
being sent out, thus disabling the interface from forming adjacencies out that interface.
11-OSPF Default Routes:
Default routes are injected into OSPF via type 5 LSAs. There are multiple ways to inject default routes into OSPF,
but Cisco recommends using the default-information originate command under the OSPF routing process.
Using the default-information originate command, there are two ways to advertise a default route into a normal
area. The first is to advertise 0.0.0.0 into the OSPF domain, provided the advertising router already has a default
route. The second is to advertise 0.0.0.0 regardless of whether the advertising router already has a default route. The
second method can be accomplished by adding the keyword always to the default-information originate command.
Another option is to use the area range and summary-address commands discussed in the summarization
above. Using these options will result in the router advertising a default route pointing to itself.
OSPF Routing Protocol in-depth analysis
9
www.meddane.com
12-Link State Advertisements (LSAs):
Type 1: Router link advertisements generated by each router for each area it belongs to. Type 1 LSAs are flooded to
a single area only.
Type 2: Network link advertisements generated by designated routers (DRs) giving the set of routers attached to a
particular network. Type 2 LSAs are flooded to the area that contains the network.
Type 3/4: These are summary link advertisements generated by ABRs. Type 3 describes inter-area routes to
networks and is used for summarization. Type 4 describes how to reach the ASBR.
Type 5: Generated by the ASBR and provides links external to the Autonomous System (AS). Type 5 LSAs are
flooded to all areas except stub areas and totally stubby areas.
Type 7: NSSA external routes generated by ASBR. Only flooded to the NSSA. The ABR converts LSA type 7 into
LSA type 5 before flooding them into the backbone (area 0).
Note: only changes Type 1 and 2 LSAs require an SPF calculation
The commands used to see each LSA:
-LSA Type 1: show ip ospf database router
-LSA Type 2: show ip ospf database network
-LSA Type 3 : show ip ospf database summary
-LSA Type 4 : show ip ospf database asbr-summary
-LSA Type 5 : show ip ospf database external
-LSA Type 7 :show ip ospf database nssa-external
OSPF Routing Protocol in-depth analysis
10
www.meddane.com
Part II : Practices Labs
Lab 1: OSPFv3 Virtual-Link
Lab 2: External path selection in NSSA
Lab 3: Stub and totally stuby area
Lab 4: Manipulating of the Forwarding Address and the path selection
Lab 5 : ABRs election and Forward Address in NSSA with OSPFv3
Lab 6 : loop prevention mechanism of inter-area ospf
Lab 7: Forward Address and path selection in OSPFv2
Lab 8: OSPFv3 and the Forwarding Address
Lab 9: OSPF path selection for external route
Lab 10: OSPFv2 and OSPFv3 comparison
Lab 11: OSPF over Frame-Relay and redistribution between two OSPF Processes-ID
Lab 12: Redistribution between two OSPF Processes-ID
Lab 13: OSPFv3 external path selection and Forward Address
Lab 14: Forwarding Address selection
Lab 15: Forwarding Address selection among two LSAs Type 7 for the same destination
Lab 16: NSSA with OSPFv3
Lab 17: Virtual-Link OSPF
Lab 18: Effects of ABR Loop Prevention with OSPFv3
Lab 19: Forwarding Address
Lab 20: OSPFv3 and the use of forwarding address
Lab 21: The Forwarding Address and path selection
Lab 22: Routing Problem with OSPF Forwarding Address with all possible solutions
Lab 23: How an ABR sets the Forward Address in the LSA Type 7
Lab 24: Routing Problem with OSPFv3 when advertising external routes in NSSA
Lab 25: OSPFv3 LSAs : Types 2001 and 2002, Types 0008 and 2009 (Router and
Network, Link and Intra-Area-Prefix)
Lab 26: P-bit in LSA Type 7 loop prevention
Lab 27: LSA Type-7 and LSA Type-5 which will win?
Lab 28: LSA Type-7 With P-bit Clear and LSA Type-5 which win?
Lab 29: Effect of the prefix-suppression Feature over the LSAs Type-1 and Type-2
Lab 30:V-bit and B-bit in LSA Type 1
Lab 31:Effect of the ABR Loop Prevention over the LSA Type 4
Lab 32:External Default route in NSSA area
Lab 33:External Routes over LSA Type-7 and LSA Type-5
Lab 34: Next-Hop Field in OSPFv2 and OSPFv3
Lab 35:Adjacencies in OSPFv3
Lab 36:Suppressing the Forward Address in the LSA Type 7
Lab 37:LSA Type-7 and the P-Bit
Lab 38: Analysing the LSAs Type of OSPFv3
Lab 39: Understanding of Not-So-Stubby Area (NSSA)
Lab 40: LSA Type 4 asb-summary LSA Part1
Lab 41: LSA Type 4 asb-summary LSA Part 2
Lab 42: Fields of the LSAs Type on OSPFv3
Lab 43: Suboptimal Routing with LSA Type 4
Lab 44: Third-Party Next-Hop
OSPF Routing Protocol in-depth analysis
11
www.meddane.com
Lab 1: OSPFv3 Virtual-Link
Virtual-Link over OSPFv3
By definition:
All areas in an OSPF autonomous system must be physically connected to the backbone
area (area 0). In some cases where this physical connection is not possible, you can
use a virtual link to connect to the backbone through a non-backbone area.
In this case without the virtual-link, you cannot have a full connectivity.
let's look the routing table of R1 and R4:
On R1 notice the prefixes missing ,2001:210:10:3::/64 and FEC0:3::/64:
R1(config-if)#do show ipv route ospf
OI 2001:210:10:2::/64 [110/74]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
O FEC0:2::/64 [110/20]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
OI FEC0:3::/64 [110/84]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
On R4 there are no routes OSPF installed even if R4 has an adjacencies with R3:
R4(config-if)#do show ipv ospf nei
Neighbor ID Pri State Dead Time Interface ID Interface
3.3.3.3 1 FULL/DR 00:00:32 4 FastEthernet0/0
R4(config-if)#do show ipv route ospf
IPv6 Routing Table - 6 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
R4(config-if)#
Finally the ping fails:
R1#ping FEC0:4::4 source FEC0:1::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FEC0:4::4, timeout is 2 seconds:
OSPF Routing Protocol in-depth analysis
12
www.meddane.com
Packet sent with a source address of FEC0:1::1
.....
Success rate is 0 percent (0/5)
Let's configure the virtual link between R2 and R3:
R2(config)#ipv6 router ospf 1
R2(config-rtr)# router-id 2.2.2.2
R2(config-rtr)# area 11 virtual-link 3.3.3.3
R3(config)#ipv6 router ospf 1
R3(config-rtr)# router-id 3.3.3.3
R3(config-rtr)# area 11 virtual-link 2.2.2.2
Let's look the routing table of R1:
Now the prefixes are installed : 2001:210:10:3::/64 and FEC0:3::/64
R1# show ipv route ospf
IPv6 Routing Table - 13 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
OI 2001:210:10:2::/64 [110/74]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
OI 2001:210:10:2::1/128 [110/10]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
OI 2001:210:10:3::/64 [110/84]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
O FEC0:2::/64 [110/20]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
OI FEC0:3::/64 [110/84]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
OI FEC0:3::3/128 [110/74]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
OI FEC0:4::/64 [110/94]
via FE80::C201:27FF:FED8:0, FastEthernet0/0
R4 has a full routing table as shown by the following output:
R4#show ipv route ospf
IPv6 Routing Table - 13 entries
Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP
U - Per-user Static route
I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary
O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2
ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2
OI 2001:210:10:1::/64 [110/84]
via FE80::C202:27FF:FED8:0, FastEthernet0/0
OI 2001:210:10:2::/64 [110/74]
via FE80::C202:27FF:FED8:0, FastEthernet0/0
OI 2001:210:10:2::1/128 [110/74]
via FE80::C202:27FF:FED8:0, FastEthernet0/0
OI FEC0:1::/64 [110/94]
via FE80::C202:27FF:FED8:0, FastEthernet0/0
OI FEC0:2::/64 [110/84]
via FE80::C202:27FF:FED8:0, FastEthernet0/0
OI FEC0:3::/64 [110/20]
via FE80::C202:27FF:FED8:0, FastEthernet0/0
OI FEC0:3::3/128 [110/10]
OSPF Routing Protocol in-depth analysis
13
www.meddane.com
via FE80::C202:27FF:FED8:0, FastEthernet0/0
Let's verify the virtual-link
The adjacencies appear between the two routers R2 and R3 over the virtual-link and
they are displayed in the show ip ospf nei but without dead time:
R2#show ipv ospf nei
Neighbor ID Pri State Dead Time Interface ID Interface
3.3.3.3 1 FULL/ - - 10 OSPFv3_VL0
1.1.1.1 1 FULL/BDR 00:00:39 4 FastEthernet0/0
3.3.3.3 1 FULL/ - 00:00:35 6 Serial0/0
R3#show ipv ospf nei
Neighbor ID Pri State Dead Time Interface ID Interface
2.2.2.2 1 FULL/ - - 10 OSPFv3_VL0
2.2.2.2 1 FULL/ - 00:00:39 6 Serial0/0
4.4.4.4 1 FULL/DR 00:00:39 4 FastEthernet0/0
We have end to end connectivity as shown by the ping:
R1#ping FEC0:4::4 source FEC0:1::1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to FEC0:4::4, timeout is 2 seconds:
Packet sent with a source address of FEC0:1::1
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/47/84 ms
Another point to rememeber is that the LSA Type 1 plays an important role to carry
some important informations whether a router is an ABR ,an ASBR or end point of
virtual-link by setting the B bit ,the E bit or the V bit respectively.So The LSA Type
1 (Router LSA) is used by a Router to indicate whether it is an ASBR ,ABR or end point
of virtual link.
We can verify the LSA Type 1(Router LSA) on R2 and the virtual-link option :
R2#show ipv osp data router self-originate
OSPFv3 Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 236
Options: (V6-Bit E-Bit R-bit DC-Bit)
LS Type: Router Links
Link State ID: 0
Advertising Router: 2.2.2.2
LS Seq Number: 80000006
Checksum: 0x1C47
Length: 56
Area Border Router
Number of Links: 2
Link connected to: a Virtual Link
Link Metric: 64
Local Interface ID: 10
Neighbor Interface ID: 10
Neighbor Router ID: 3.3.3.3
Link connected to: a Transit Network
Link Metric: 10
Local Interface ID: 4
Neighbor (DR) Interface ID: 4
OSPF Routing Protocol in-depth analysis
14
www.meddane.com
Neighbor (DR) Router ID: 2.2.2.2
....Output omitted for brevity....
Notice in the LSA Type-1 of R2.
The following sections in area 0(because now R2 is connected to R3 through a virtual-
link with an area 0, describe the links that this router is attached to, which is the
virtual link:
Link connected to: a Virtual Link
Link Metric: 64
Local Interface ID: 10
Neighbor Interface ID: 10
Neighbor Router ID: 3.3.3.3
Remember the Local Interface ID=10 and the Neighbor Interface ID=10.
Let's looks the LSA Type-1 on R3:
R3#show ipv ospf database router self-originate
OSPFv3 Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 0)
LS age: 51
Options: (V6-Bit E-Bit R-bit DC-Bit)
LS Type: Router Links
Link State ID: 0
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0x385A
Length: 40
Area Border Router
Number of Links: 1
Link connected to: a Virtual Link
Link Metric: 64
Local Interface ID: 10
Neighbor Interface ID: 10
Neighbor Router ID: 2.2.2.2
....Output omitted for brevity....
Notice the following section:
Link connected to: a Virtual Link
Link Metric: 64
Local Interface ID: 10
Neighbor Interface ID: 10
Neighbor Router ID: 2.2.2.2
R3 defines its link as a virtual-link connected to R2(2.2.2.2)
Notice the Local Interface ID =10 and the Neighbor Interface ID=10
What is the Purpose of the Interface ID?
The answer is given by the RFC 5340:
The Hello packet now contains no address information at all.
Rather, it now includes an Interface ID that the originating
router has assigned to uniquely identify (among its own
interfaces) its interface to the link. This Interface ID will be
used as the network-LSA's Link State ID if the router becomes the
Designated Router on the link.
Let's verify this RFC:
we will take an example of the segment R1--R2.
OSPF Routing Protocol in-depth analysis
15
www.meddane.com
The DR is R2 as shown by the following output:
R1#show ipv ospf neighbor
Neighbor ID Pri State Dead Time Interface ID Interface
2.2.2.2 1 FULL/DR 00:00:30 4 FastEthernet0/0
Let's looks the LSA Type 1 advertised by R2:
R2#show ipv ospf data router self-originate
OSPFv3 Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
LS age: 249
Options: (V6-Bit E-Bit R-bit DC-Bit)
LS Type: Router Links
Link State ID: 0
Advertising Router: 2.2.2.2
LS Seq Number: 80000009
Checksum: 0x164A
Length: 56
Area Border Router
Number of Links: 2
Link connected to: a Virtual Link
Link Metric: 64
Local Interface ID: 10
Neighbor Interface ID: 10
Neighbor Router ID: 3.3.3.3
Link connected to: a Transit Network
Link Metric: 10
Local Interface ID: 4
Neighbor (DR) Interface ID: 4
Neighbor (DR) Router ID: 2.2.2.2
Notice the following section :
Link connected to: a Transit Network
Link Metric: 10
Local Interface ID: 4
Neighbor (DR) Interface ID: 4
Neighbor (DR) Router ID: 2.2.2.2
R2 is the DR for this transit network(the segment shared with R1).
Notice the Local Interface ID and the Neighbor (DR) Interface ID which is 4.remember
it
An LSA Type 2 is created by the R2 the DR as shown by the following output:
R2# show ipv ospf data net sel
OSPFv3 Router with ID (2.2.2.2) (Process ID 1)
Net Link States (Area 0)
LS age: 340
Options: (V6-Bit E-Bit R-bit DC-Bit)
LS Type: Network Links
Link State ID: 4 (Interface ID of Designated Router)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x3ED
Length: 32
OSPF Routing Protocol in-depth analysis
16
www.meddane.com
Attached Router: 2.2.2.2
Attached Router: 1.1.1.1
Notice the Link State ID:4,it is the same that the Local Interface ID and the Neighbor
(DR) Interface ID displayed in the LSA Type-1 and created by the DR,so This Interface
ID will be used as the network-LSA's Link State ID if the router becomes the
Designated Router on the link(RFC 5340)
We can confirm the result by looking the LSA Type 2 received by R1 from the DR R2 ,
the Link State ID is 4 ,notice between parenthesis( Interface ID of Designated Router
) which tells to R1 that 4 is the LSID of the DR:
R1#show ipv ospf data net adv 2.2.2.2
OSPFv3 Router with ID (1.1.1.1) (Process ID 1)
Net Link States (Area 0)
LS age: 368
Options: (V6-Bit E-Bit R-bit DC-Bit)
LS Type: Network Links
Link State ID: 4 (Interface ID of Designated Router)
Advertising Router: 2.2.2.2
LS Seq Number: 80000001
Checksum: 0x3ED
Length: 32
Attached Router: 2.2.2.2
Attached Router: 1.1.1.1
Another way to see this Interface ID is the show ipv ospf nei 1.1.1.1 command which
displays the Interface ID of 4:
R2#show ipv ospf neighbor 1.1.1.1
Neighbor 1.1.1.1
In the area 0 via interface FastEthernet0/0
Neighbor: interface-id 4, link-local address FE80::C200:27FF:FED8:0
Neighbor priority is 1, State is FULL, 18 state changes
DR is 2.2.2.2 BDR is 1.1.1.1
Options is 0x000013 in Hello (V6-Bit E-Bit R-bit )
Options is 0x000013 in DBD (V6-Bit E-Bit R-bit )
Dead timer due in 00:00:37
Neighbor is up for 00:22:12
Index 1/1/2, retransmission queue length 0, number of retransmission 5
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 3, maximum is 5
Last retransmission scan time is 0 msec, maximum is 0 msec
Notice that in OSPFv3 the LSA Type 1 does not include the prefixes (like
OSPFv2),instead it interacts with the LSA Type 8 and the LSA Type 9 in order to know
all intra-area information.
Another point to notice for the virtual-link over OSPFv3 is the ipv address used in
virtual-link
Still from RFC 2740 the best resource:
OSPF for IPv6 assumes that each router has been assigned link-local
unicast addresses on each of the router's attached physical links
[IP6ADDR]. On all OSPF interfaces except virtual links, OSPF packets
are sent using the interface's associated link-local unicast address
as the source address. A router learns the link-local addresses of
all other routers attached to its links and uses these addresses as
next-hop information during packet forwarding.
The IPv6 interface address of a virtual link must be an IPv6
OSPF Routing Protocol in-depth analysis
17
www.meddane.com
address having site-local or global scope, instead of the link-
local addresses used by other interface types. This address is
used as the IPv6 source for OSPF protocol packets sent over the
virtual link.
Let's verify with the show ipv ospf neighbor 3.3.3.3 command ,we can see that the ipv6
address used over the virtual-link(interface OSPFv3_VL1) is 2001:210:10:2::2( which is
the Global Ipv6 address of R3's serial 0/0----the ipv6 address used over the serial
link is FE80::C202:27FF:FED8:0 which is the Link-Local Address of R3's s0/0 as
confirmed by the show ipv int br command :
R2#show ipv ospf neighbor 3.3.3.3
Neighbor 3.3.3.3
In the area 0 via interface OSPFv3_VL1
Neighbor: interface-id 11, IPv6 address 2001:210:10:2::2
Neighbor priority is 1, State is FULL, 6 state changes
Options is 0x000033 in Hello (V6-Bit E-Bit R-bit DC-Bit)
Options is 0x000033 in DBD (V6-Bit E-Bit R-bit DC-Bit)
Neighbor is up for 00:21:33
Index 1/2/3, retransmission queue length 0, number of retransmission 0
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 0, maximum is 0
Last retransmission scan time is 0 msec, maximum is 0 msec
Neighbor 3.3.3.3
In the area 11 via interface Serial0/0
Neighbor: interface-id 6, link-local address FE80::C202:27FF:FED8:0
Neighbor priority is 1, State is FULL, 6 state changes
Options is 0x000013 in Hello (V6-Bit E-Bit R-bit )
Options is 0x000013 in DBD (V6-Bit E-Bit R-bit )
Dead timer due in 00:00:30
Neighbor is up for 00:21:39
Index 1/1/1, retransmission queue length 0, number of retransmission 1
First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0)
Last retransmission scan length is 7, maximum is 7
Last retransmission scan time is 0 msec, maximum is 0 msec
R3(config-if)#do show ipv int br
FastEthernet0/0 [up/up]
FE80::C202:27FF:FED8:0
2001:210:10:3::1
Serial0/0 [up/up]
FE80::C202:27FF:FED8:0
2001:210:10:2::2
FastEthernet0/1 [up/up]
FE80::C202:27FF:FED8:1
FEC0:3::3
.
So as the RFC 2740 said :
Over virtual-link R2 receives the hello packets from R3 with the source address :the
global ipv6 address of R3's s0/0
Over the serial link R2 receives the hello packets from R3 with the source address:
the Link-Local Address of R3's s0/0
In other word:
Over virtual-link R2 sends the hello packets to R3 with the source address :the
global ipv6 address of R2's s0/0
Over the serial link R2 sends the hello packets to R3 with the source address: the
Link-Local Address of R2's s0/0
OSPF Routing Protocol in-depth analysis
18
www.meddane.com
Lab 4: Manipulating of the Forwarding Address and the path selection
Both R1 and R2 will do the redistribution of the static routes toward the same
destination 172.16.1.0 as shown in the topology.
R3 receives two LSAs Type 5 from R1 and R2 with the same Forward Address set to
0.0.0.0 which means to reach the external subnet route the packet through the ASBR:
R3#show ip ospf database external | include Forward Address|Advertising Router
Advertising Router: 1.1.1.1
Forward Address: 0.0.0.0
Advertising Router: 2.2.2.2
Forward Address: 0.0.0.0
R3 looks the costs to reach both ASBRs (R1 and R2) which are the same and is equal to
10 as shown by the show ip ospf border-routers command and the forward metric 10 shown
by show ip route 172.16.1.0 command thus it installs a load balancing:
R3#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 1.1.1.1 [10] via 10.1.13.1, FastEthernet0/0, ASBR, Area 0, SPF 5
i 2.2.2.2 [10] via 10.1.23.2, FastEthernet0/1, ASBR, Area 0, SPF 5
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
Last update from 10.1.13.1 on FastEthernet0/0, 00:00:05 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:00:05 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
10.1.13.1, from 1.1.1.1, 00:00:05 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
Now let's activate ospf in fa0/0 of R1 and s0/0 of R2:
R2(config-if)#ip ospf 1 area 0
R1(config-if)#ip ospf 1 area 0
OSPF Routing Protocol in-depth analysis
19
www.meddane.com
R3 receives still two LSAs Type 5 from R1 and R2 ,but in this case the Forward
Addresses set to non-zero as shown by the following output:
R3#show ip ospf database external | include Forward Address|Advertising Router
Advertising Router: 1.1.1.1
Forward Address: 192.168.1.4
Advertising Router: 2.2.2.2
Forward Address: 192.168.2.5
Remember the two definitions of the Forwarding Address:
1-The selection of the FA will be:
-The highest IP address from among the loopback interfaces on which OSPF is activated.
-If there are no loopback interfaces, then the IP address of the physical interface on
which OSPF is activated.
2-The forwarding address is set to 0.0.0.0 if the ASBR redistributes routes and OSPF
is not enabled on the next hop interface for those routes. This is out case if R1 and
R2 do not have OSPF enabled on the fastethernet interface fa0/0.
These conditions set the forwarding address field to a non-zero address:
OSPF is enabled on the ASBR's next hop interface AND
ASBR's next hop interface is non-passive under OSPF AND
ASBR's next hop interface is not point-to-point AND
ASBR's next hop interface is not point-to-multipoint AND
ASBR's next hop interface address falls under the network range specified in the
router ospf command.
What the Router R3 will do?
R3 looks the best intra-area or inter-area to reach the FA ,in this case it looks the
best intra-area to reach the FA 192.168.1.4 advertised by R1 and the FA 192.168.2.5
advertised by R5 ,the best intra-area routes are through R1 and R2 respectively,then
R3 find that the costs to reach these FA via the intra-area route are the same =20
,notice the "type intra area" field in the following output which tells us that this
route is an intra-area:
R3#show ip route 192.168.1.4
Routing entry for 192.168.1.0/24
Known via "ospf 1", distance 110, metric 20, type intra area
Last update from 10.1.13.1 on FastEthernet0/0, 00:08:48 ago
Routing Descriptor Blocks:
* 10.1.13.1, from 1.1.1.1, 00:08:48 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
R3#show ip route 192.168.2.5
Routing entry for 192.168.2.0/24
Known via "ospf 1", distance 110, metric 20, type intra area
Last update from 10.1.23.2 on FastEthernet0/1, 00:08:53 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:08:53 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
Then R3 installs a load balancing toward the external subnet 172.16.1.0:
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20
Last update from 10.1.13.1 on FastEthernet0/0, 00:00:01 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:00:01 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
10.1.13.1, from 1.1.1.1, 00:00:01 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
Now what happen if we configure the static routes with an outgoing interface instead
of the next-hop?
OSPF Routing Protocol in-depth analysis
20
www.meddane.com
R1(config)#no ip route 172.16.1.0 255.255.255.0 192.168.1.4
R1(config)#ip route 172.16.1.0 255.255.255.0 fa0/0
R2(config-if)#no ip route 172.16.1.0 255.255.255.0 192.168.2.5
R2(config)#ip route 172.16.1.0 255.255.255.0 fa0/0
Let's look the LSA Type 5.
Now the LSAs Type 5 received by R3 have the FA set to zero 0.0.0.0
R3#show ip ospf database external | include Forward Address|Advertising Router
Advertising Router: 1.1.1.1
Forward Address: 0.0.0.0
Advertising Router: 2.2.2.2
Forward Address: 0.0.0.0
Thus R3 looks the costs to reach both ASBRs (R1 and R2) which are the same and
installs a load balancing.
Now let' remove the static routes and instead we will enable OSPF between R1 and R4 in
area 1, R2 and R5 in area 1,then R4 and R5 redistribute the subnet 172.16.1.0 as
follow:
R1(config)#interface FastEthernet0/0
R1(config-if)#no ip ospf 1 area 0
R1(config)#no ip route 172.16.1.0 255.255.255.0 fa0/0
R1(config)#router ospf 1
R1(config-router)#no redistribute static subnets
R2(config)#interface FastEthernet0/0
R2(config-if)#no ip ospf 1 area 0
R2(config)#no ip route 172.16.1.0 255.255.255.0 fa0/0
R2(config)#router ospf 1
R2(config-router)#no redistribute static subnets
Let' change the configuration of R1 ,R2, R4 and R5:
R1(config)#interface FastEthernet0/0
R1(config-if)#ip ospf 1 area 1
R2(config)#interface FastEthernet0/0
R2(config-if)#ip ospf 1 area 1
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#exi
R4(config)#int fa0/0
R4(config-if)#ip ospf 1 area 1
R4(config-if)#exit
R4(config)#route-map CONNECTED permit
R4(config-route-map)#match int fa0/1
R4(config-route-map)#router ospf 1
R4(config-router)#redistribute connected route-map CONNECTED subnet
R5(config-if)#router ospf 1
R5(config-router)#router-id 5.5.5.5
R5(config-router)#int fa0/0
R5(config-if)#ip ospf 1 area 1
R4(config-if)#exi
R5(config)#route-map CONNECTED permit
R5(config-route-map)#match interface fa0/1
R5(config-route-map)#exi
R5(config)#router ospf 1
R5(config-router)#redistribute connected route-map CONNECTED subnet
OSPF Routing Protocol in-depth analysis
21
www.meddane.com
After making these changes , as a result ,now the ASBRs are R4 and R5 , the ABRs are
R1 and R2:
Now R3 receives two LSAs Type 5 from R4 and R5(the ASBRs),notice the router-ID 4.4.4.4
of R4 and the router-ID 5.5.5.5 of R5 and the same Forward Address set to 0.0.0.0.
R3#show ip ospf database external | include Forward Address|Advertising Router
Advertising Router: 4.4.4.4
Forward Address: 0.0.0.0
Advertising Router: 5.5.5.5
Forward Address: 0.0.0.0
R3 looks the costs to reach the two ASBR R4 and R5 and finds that they are the same
which is 20,notice the lines corresponding to the letters I:
R3#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i - Intra-area route, I - Inter-area route
I 4.4.4.4 [20] via 10.1.13.1, FastEthernet0/0, ASBR, Area 0, SPF 15
i 1.1.1.1 [10] via 10.1.13.1, FastEthernet0/0, ABR/ASBR, Area 0, SPF 15
I 5.5.5.5 [20] via 10.1.23.2, FastEthernet0/1, ASBR, Area 0, SPF 15
i 2.2.2.2 [10] via 10.1.23.2, FastEthernet0/1, ABR/ASBR, Area 0, SPF 15
Thus R3 installs a load balancing toward 172.16.1.0 with the Forward metric of 20 ,the
same cost displayed in the show ip ospf border-routers command:
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20
Last update from 10.1.13.1 on FastEthernet0/0, 00:05:33 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 5.5.5.5, 00:05:33 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
10.1.13.1, from 4.4.4.4, 00:05:33 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
Now what happen if we configure area 1 as NSSA:
R1(config)#router ospf 1
R1(config-router)#area 1 nssa
R2(config)#router ospf 1
R2(config-router)#area 1 nssa
R4(config)#router ospf 1
R4(config-router)#area 1 nssa
R5(config)#router ospf 1
R5(config-router)#area 1 nssa
Notice now R3 receives two LSAs Type 5 with the Advertising Router R1(1.1.1.1) and
R2(2.2.2.2) with two Forward Addresses set to non-zero ,192.168.1.4 and 192.168.2.5
respectively :
R3#show ip ospf database external | include Forward Address|Advertising Router
Advertising Router: 1.1.1.1
Forward Address: 192.168.1.4
Advertising Router: 2.2.2.2
Forward Address: 192.168.2.5
OSPF Routing Protocol in-depth analysis
22
www.meddane.com
because in NSSA ,the ASBR generates an LSA Type 7 for an external subnet and
advertises this LSA into NSSA,in this LSA Type-7 the ASBR set the P-bit in order to
tell to the ABR to translate this LSA into an LSA Type 5 and the ASBR also set the FA
to a non-zero when creating an LSA Type 7 as shown by the following outputs which show
the LSAs Type 7 created by R4 and R5 ,notice the FA 192.168.1.4 for R4 and 192.168.2.5
for R5 , also notice the "Type 7/5 translation" in the Options field which means that
the P-bit is set:
R4#show ip ospf data nssa-external | include Forward Address|Advertising
Router|Options
Options: (No TOS-capability, Type 7/5 translation, DC)
Advertising Router: 4.4.4.4
Forward Address: 192.168.1.4
R5#show ip ospf data nssa-external | include Forward Address|Advertising
Router|Options
Options: (No TOS-capability, Type 7/5 translation, DC)
Advertising Router: 5.5.5.5
Forward Address: 192.168.2.5
R3 then looks the best inter-area routes to reach the two FA 192.168.1.4 and
192.168.2.5 which are through R4 and R5 respectively and finds that the costs to
reach these FA are the same (20) :
R3#show ip route 192.168.1.4
Routing entry for 192.168.1.0/24
Known via "ospf 1", distance 110, metric 20, type inter area
Last update from 10.1.13.1 on FastEthernet0/0, 00:23:06 ago
Routing Descriptor Blocks:
* 10.1.13.1, from 1.1.1.1, 00:23:06 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
R3#show ip route 192.168.2.5
Routing entry for 192.168.2.0/24
Known via "ospf 1", distance 110, metric 20, type inter area
Last update from 10.1.23.2 on FastEthernet0/1, 00:23:10 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:23:10 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
Thus R3 installs a load-balancing:
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20
Last update from 10.1.23.2 on FastEthernet0/1, 00:05:41 ago
Routing Descriptor Blocks:
10.1.23.2, from 2.2.2.2, 00:05:41 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
* 10.1.13.1, from 1.1.1.1, 00:05:41 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
Remember the selection of the FA:
1-The selection of the FA will be:
-The highest IP address from among the loopback interfaces on which OSPF is activated.
-If there are no loopback interfaces, then the IP address of the physical interface on
which OSPF is activated.
In this case, because there is no loopback interfaces configured yet on R4 and R5,
these ASBRs chooses the FA among the highest ip address of the physical interface on
which OSPF is activated, 192.168.1.4 is the ip address of R4'fa0/0 and 192.168.2.5 is
the ip address of R5'fa0/0.
OSPF Routing Protocol in-depth analysis
23
www.meddane.com
Now what happen if i configure one loopback interface on R4 only and activate OSPF in
area 1:
R4(config)#int lo0
R4(config-if)#ip address 44.44.44.44 255.255.255.0
R4(config-if)#ip ospf 1 area 1
Now the FA advertised by R4 is 44.44.44.44, R5 still advertises the FA(physical
interface) 192.168.2.5:
R4#show ip ospf data nssa-external | include Forward Address|Advertising
Advertising Router: 4.4.4.4
Forward Address: 44.44.44.44
R5#show ip ospf data nssa-external | include Forward Address|Advertising
Advertising Router: 5.5.5.5
Forward Address: 192.168.2.5
R3#show ip ospf database external | include Forward Address|Advertising Router
Advertising Router: 1.1.1.1
Forward Address: 44.44.44.44
Advertising Router: 2.2.2.2
Forward Address: 192.168.2.5
Let's look the external route on R3:
R3 now installs only path ,the best path to reach 172.16.1.0 is through R2.
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20
Last update from 10.1.23.2 on FastEthernet0/1, 00:02:03 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:02:03 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
When R3 received two FA ,it looks the best inter-area to reach these FA and finds that
the cost to reach the FA 192.168.2.5 is 20 and the cost to reach the FA 44.44.44.44 is
21, thus R3 prefers the inter-area route toward the FA 192.168.2.5 because the lowest
cost ,Because the inter-area route toward the FA 192.168.2.5 is through R2 ,thus R3
installs the path through R2 toward the external route 172.16.1.0,as shown by the
following outputs:
R3#show ip route 192.168.2.5
Routing entry for 192.168.2.0/24
Known via "ospf 1", distance 110, metric 20, type inter area
Last update from 10.1.23.2 on FastEthernet0/1, 00:34:56 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:34:56 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
R3#show ip route 44.44.44.44
Routing entry for 44.44.44.44/32
Known via "ospf 1", distance 110, metric 21, type inter area
Last update from 10.1.13.1 on FastEthernet0/0, 00:03:59 ago
Routing Descriptor Blocks:
* 10.1.13.1, from 1.1.1.1, 00:03:59 ago, via FastEthernet0/0
Route metric is 21, traffic share count is 1
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20
Last update from 10.1.23.2 on FastEthernet0/1, 00:15:56 ago
OSPF Routing Protocol in-depth analysis
24
www.meddane.com
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:15:56 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
Let's add loopback interface on R5 and activate OSPF in area 1:
R5(config)#int lo0
R5(config-if)#ip address 55.55.55.55 255.255.255.0
R5(config-if)#ip ospf 1 area 1
R3 receives two LSAs Type 5 with the FA 44.44.44.44 from R4 and 55.55.55.55 from R5:
R3#$f database external | include Forward Address|Advertising Router
Advertising Router: 1.1.1.1
Forward Address: 44.44.44.44
Advertising Router: 2.2.2.2
Forward Address: 55.55.55.55
R3 find that the cost to reach both FA is the same thus R3 installs a load balancing:
R3#show ip route 55.55.55.55
Routing entry for 55.55.55.55/32
Known via "ospf 1", distance 110, metric 21, type inter area
Last update from 10.1.23.2 on FastEthernet0/1, 00:04:56 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:04:56 ago, via FastEthernet0/1
Route metric is 21, traffic share count is 1
R3#show ip route 44.44.44.44
Routing entry for 44.44.44.44/32
Known via "ospf 1", distance 110, metric 21, type inter area
Last update from 10.1.13.1 on FastEthernet0/0, 00:22:04 ago
Routing Descriptor Blocks:
* 10.1.13.1, from 1.1.1.1, 00:22:04 ago, via FastEthernet0/0
Route metric is 21, traffic share count is 1
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 21
Last update from 10.1.13.1 on FastEthernet0/0, 00:05:06 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:05:06 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
10.1.13.1, from 1.1.1.1, 00:05:06 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
Now if we want to ensure that the packet goes through R2 from R3,we will suppress the
FA advertised by R5 to R2 to be 0.0.0.0 instead of 55.55.55.55:
R2(config-router)# area 1 nssa translate type7 suppress-fa
Notice the FA of R4 is still 44.44.44.44 ,the FA of R5 is now suppressed by R2 to be
0.0.0.0:
R3#$f database external | include Forward Address|Advertising Router
Advertising Router: 1.1.1.1
Forward Address: 44.44.44.44
Advertising Router: 2.2.2.2
Forward Address: 0.0.0.0
R3 looks the best cost to reach either the FA 44.44.44.44 or the ASBR R2,remember R2
is the ABR so it does the translation of the LSA Type 7 to the LSA Type 5 ,thus R2
appears both as an ABR and ASBR as shown by the following output:
OSPF Routing Protocol in-depth analysis
25
www.meddane.com
The cost to reach the ABR/ASBR R2 is 10:
R3#show ip ospf border-routers
OSPF Process 1 internal Routing Table
Codes: i - Intra-area route, I - Inter-area route
i 1.1.1.1 [10] via 10.1.13.1, FastEthernet0/0, ABR/ASBR, Area 0, SPF 15
i 2.2.2.2 [10] via 10.1.23.2, FastEthernet0/1, ABR/ASBR, Area 0, SPF 15
The cost to reach the FA 44.44.44.44 is 21:
R3#show ip route 44.44.44.44
Routing entry for 44.44.44.44/32
Known via "ospf 1", distance 110, metric 21, type inter area
Last update from 10.1.13.1 on FastEthernet0/0, 00:17:15 ago
Routing Descriptor Blocks:
* 10.1.13.1, from 1.1.1.1, 00:17:15 ago, via FastEthernet0/0
Route metric is 21, traffic share count is 1
So R3 installs the best path through R2 to reach the external subnet 172.16.1.0:
R3#show ip route 172.16.1.0
Routing entry for 172.16.1.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10
Last update from 10.1.23.2 on FastEthernet0/1, 00:06:11 ago
Routing Descriptor Blocks:
* 10.1.23.2, from 2.2.2.2, 00:06:11 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
OSPF Routing Protocol in-depth analysis
26
www.meddane.com
Lab 9: OSPF path selection for external route
R4 and R5 redistribute between EIGRP and OSPF:
R1#show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 2
Last update from 10.1.13.3 on FastEthernet0/1, 00:00:42 ago
Routing Descriptor Blocks:
10.1.13.3, from 5.5.5.5, 00:00:42 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
* 10.1.12.2, from 4.4.4.4, 00:00:42 ago, via FastEthernet0/0
Route metric is 20, traffic share count is 1
The metric via both R2 and R3 is 20 (default metric for Type 2 E2) and the forward
metric is =2 the cost to the ASBRs (R4 and R5)
R4(config)#router ospf 1
R4(config-router)#redistribute eigrp 1 subnets metric-type 1
R1#show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 22, type extern 1
Last update from 10.1.12.2 on FastEthernet0/0, 00:00:05 ago
Routing Descriptor Blocks:
* 10.1.12.2, from 4.4.4.4, 00:00:05 ago, via FastEthernet0/0
Route metric is 22, traffic share count is 1
The metric now is set to 22 (20+2) Cost 2 to ASBR and Cost 20 advertised by the
ASBR,the route installed now on R1 is via R2 because E1 advertised by R4 is preferred
over the route E2 advertised by R5.even if we will change the metric for E1 route on
R4 to be higher than E2 route advertised by R5 , we have always the route E1 via R2
installed on R1 s'routing table.
OSPF Routing Protocol in-depth analysis
27
www.meddane.com
R4(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 100
R1#show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 102, type extern 1
Last update from 10.1.12.2 on FastEthernet0/0, 00:00:17 ago
Routing Descriptor Blocks:
* 10.1.12.2, from 4.4.4.4, 00:00:17 ago, via FastEthernet0/0
Route metric is 102, traffic share count is 1
R4(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 100
The total cost of the route via R4 is 100+forward metric 2=102 and via R5 is
20+forward metric 2=22
R1#show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 2
Last update from 10.1.13.3 on FastEthernet0/1, 00:00:04 ago
Routing Descriptor Blocks:
* 10.1.13.3, from 5.5.5.5, 00:00:04 ago, via FastEthernet0/1
Route metric is 20, traffic share count is 1
R4(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 100
R5(config-router)#redistribute eigrp 1 subnets metric-type 1
R1 chooses always the path via R5(R3)
R1#show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 22, type extern 1
Last update from 10.1.13.3 on FastEthernet0/1, 00:00:04 ago
Routing Descriptor Blocks:
* 10.1.13.3, from 5.5.5.5, 00:00:04 ago, via FastEthernet0/1
Route metric is 22, traffic share count is 1
R1(config)#interface Fa0/0
R1(config-subif)#ip ospf cost 100
R4(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 99
R5(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 198
The cost via R2 is calculated as follow: cost to R2 100+ cost the link of R4
1+99(redistributed metric)=200
The cost via R3 is calculated as follow:cost to R3 1+ cost the link of R5
1+198(redistributed metric)=200
We have load balancing on R1:
R1#show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 200, type extern 1
Last update from 10.1.13.3 on FastEthernet0/1, 00:00:06 ago
Routing Descriptor Blocks:
10.1.13.3, from 5.5.5.5, 00:00:06 ago, via FastEthernet0/1
Route metric is 200, traffic share count is 1
* 10.1.12.2, from 4.4.4.4, 00:00:06 ago, via FastEthernet0/0
Route metric is 200, traffic share count is 1
R4(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 99
OSPF Routing Protocol in-depth analysis
28
www.meddane.com
R5(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 198
The path via R4 is installed because 99 is less than 198 (redistributed metric)
R1# show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 99, type extern 2, forward metric 101
Last update from 10.1.12.2 on FastEthernet0/0, 00:00:02 ago
Routing Descriptor Blocks:
* 10.1.12.2, from 4.4.4.4, 00:00:02 ago, via FastEthernet0/0
Route metric is 99, traffic share count is 1
R4(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 1
R5(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 1
R1#show ip route 10.1.6.0
Routing entry for 10.1.6.0/24
Known via "ospf 1", distance 110, metric 1, type extern 2, forward metric 2
Last update from 10.1.13.3 on FastEthernet0/1, 00:04:27 ago
Routing Descriptor Blocks:
* 10.1.13.3, from 5.5.5.5, 00:04:27 ago, via FastEthernet0/1
Route metric is 1, traffic share count is 1
Why R1 prefer the path via R3--R5?
R1 receives two LSAs Type 4 by the show ip ospf database asbr-summary 4.4.4.4 and
show ip ospf database asbr-summary 5.5.5.5 commands,one from R2(2.2.2.2) with the Link
State ID 4.4.4.4 (R4) and another from R3(3.3.3.3) with the Link State ID 5.5.5.5 (R5)
with the same metric(the LSA Type 4 lists the cost to reach the ASBR from the ABR):
R1#show ip ospf database asbr-summary 4.4.4.4
OSPF Router with ID (1.1.1.1) (Process ID 1)
Summary ASB Link States (Area 0)
Routing Bit Set on this LSA
LS age: 1525
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(AS Boundary Router)
Link State ID: 4.4.4.4 (AS Boundary Router address)
Advertising Router: 2.2.2.2
LS Seq Number: 80000003
Checksum: 0x8C94
Length: 28
Network Mask: /0
TOS: 0 Metric: 1
R1#show ip ospf database asbr-summary 5.5.5.5
OSPF Router with ID (1.1.1.1) (Process ID 1)
Summary ASB Link States (Area 0)
Routing Bit Set on this LSA
LS age: 1484
Options: (No TOS-capability, DC, Upward)
LS Type: Summary Links(AS Boundary Router)
Link State ID: 5.5.5.5 (AS Boundary Router address)
Advertising Router: 3.3.3.3
LS Seq Number: 80000003
Checksum: 0x40D8
Length: 28
Network Mask: /0
TOS: 0 Metric: 1
Now R1 needs to know which ABR is closer, R2 or R3? This is accomplished by looking up
the Type-1 Router LSA to the ABRs that are originating the Type-4 ASBR Summary LSAs.
R1 look that the cost to R2:2.2.2.2 (DR) is 100 and the cost to R3 :3.3.3.3 (DR) is 1
the total cost to reach 10.1.6.0 via R2 is: cost to R2:100 + cost the link R4:1 + the
redistributed metric:1=102
OSPF Routing Protocol in-depth analysis
29
www.meddane.com
The total cost via R3 is :cost to R3:1 + cost the link R5:1 + the redistributed
metric:1=3
R1#show ip ospf database router 1.1.1.1
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 0)
LS age: 492
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 1.1.1.1
Advertising Router: 1.1.1.1
LS Seq Number: 80000009
Checksum: 0xFD4C
Length: 48
Number of Links: 2
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.1.13.3
(Link Data) Router Interface address: 10.1.13.1
Number of TOS metrics: 0
TOS 0 Metrics: 1
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.1.12.2
(Link Data) Router Interface address: 10.1.12.1
Number of TOS metrics: 0
TOS 0 Metrics: 100
R1 chooses the shorter path to the ASBR, which is through R1-R3-R5
OSPF Routing Protocol in-depth analysis
30
www.meddane.com
Lab 39: Understanding of Not-So-Stubby Area (NSSA)
By definition when an ASBR redistributes into an NSSA area it creates a special type
of link-state advertisement (LSA) which is the LSA Type 7, which can only exist in an
NSSA area. Then an NSSA area border router (ABR) translates it into an LSA Type 5,
this LSA Type 5 is propagated into the OSPF domain (other areas).
R3 creates an LSA Type 7 for the external subnet 172.16.3.0 and is advertised to R2 by
setting the P-bit options:
-"Type 7/5 translation" means bit P = 1.
Remember the P-bit is used in order to tell the NSSA ABR whether to translate type 7
into type 5.
-If bit P = 0, then the NSSA ABR must not translate this LSA into Type 5. This happens
when NSSA ASBR is also an NSSA
ABR.
-If bit P = 1, then the NSSA ABR must translate this type 7 LSA into a type 5 LSA. If
there are multiple NSSA ABRs, the
one with highest router ID.
R2#show ip ospf database nssa-external
OSPF Router with ID (2.2.2.2) (Process ID 1)
Type-7 AS External Link States (Area 23)
LS age: 25
Options: (No TOS-capability, Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 172.16.3.0 (External Network Number )
Advertising Router: 3.3.3.3
LS Seq Number: 80000001
Checksum: 0x2B9
OSPF Routing Protocol in-depth analysis
31
www.meddane.com
Length: 36
Network Mask: /24
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 20
Forward Address: 10.1.3.1
External Route Tag: 0
An NSSA blocks the LSA Type 5 and Type 4 LSAs, but allows the LSAs Type 3 as shown by
the database of R3:
We can see that R3 receives 3 LSAs Type 3 (Summary LSAs) for the subnets 10.1.1.0 ,
10.1.2.0 and 10.1.12.0 representing the inter-area routes toward these subnets.
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 452 0x80000003 0x0039FD 2
3.3.3.3 3.3.3.3 451 0x80000004 0x00888A 3
Summary Net Link States (Area 23)
Link ID ADV Router Age Seq# Checksum
10.1.1.0 2.2.2.2 456 0x80000002 0x00E3FC
10.1.2.0 2.2.2.2 456 0x80000002 0x0056C9
10.1.12.0 2.2.2.2 456 0x80000002 0x006076
Type-7 AS External Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Tag
172.16.3.0 3.3.3.3 473 0x80000001 0x0002B9 0
R3 has three inter-area routes:
R3#show ip route ospf
10.0.0.0/24 is subnetted, 5 subnets
O IA 10.1.12.0 [110/128] via 10.1.23.2, 00:09:53, Serial0/1
O IA 10.1.2.0 [110/65] via 10.1.23.2, 00:09:53, Serial0/1
O IA 10.1.1.0 [110/129] via 10.1.23.2, 00:09:53, Serial0/1
Now we will configure the area 23 as NSSA totally stub areas.
By defining the area 23 as a NSSA totally stub area ,the NSSA ABR R2 generates a
default route and is advertised into the area 23.
There are two ways to generate the default route on an NSSA ABR:
-default-information originate keyword, The NSSA ABR generates a Type 7 LSA with the
link-state ID 0.0.0.0 and is
advertised into the NSSA. This default route will be propagated into the NSSA as Type
7 LSA.But The NSSA ABR still
advertises the inter-area routes (LSAs Type 3).
-no-summary keyword, the NSSA ABR will not advertise the inter-area routes (LSAs Type
3 and Type 4 summary) into the
NSSA, instead it will advertise a default route. This default route will be
propagated in the NSSA as an LSA Type 3
with the LSID 0.0.0.0
OSPF Routing Protocol in-depth analysis
32
www.meddane.com
R2(config)#router ospf 1
R2(config-router)#area 23 nssa default-information-originate
The following output shown that he NSSA ABR R2 generates an LSA Type 7 with the Link
State ID 0.0.0.0 ,which represents the default route.
"No Type 7/5 translation" means that the P-bit is cleared and = 0 ,thus if there is
another ABR ,it does not translate this LSA Type 7.In this case the P-bit is cleared
because the P bit is also used as a routing loop prevention mechanism.
R2#show ip ospf database nssa-external self-originate
OSPF Router with ID (2.2.2.2) (Process ID 1)
Type-7 AS External Link States (Area 23)
LS age: 159
Options: (No TOS-capability, No Type 7/5 translation, DC)
LS Type: AS External Link
Link State ID: 0.0.0.0 (External Network Number )
Advertising Router: 2.2.2.2
LS Seq Number: 80000003
Checksum: 0xCCDA
Length: 36
Network Mask: /0
Metric Type: 2 (Larger than any link state path)
TOS: 0
Metric: 1
Forward Address: 0.0.0.0
External Route Tag: 0
Now let's looks the database of the NSSA ASBR R3:
R3 receives successfully the LSA Type 7 with the LSID 0.0.0.0 from R2 (2.2.2.2),R3
still receives the LSAs Type 3 for the subnet 10.1.1.0,10.1.2.0 and 10.1.12.0:
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 1698 0x80000003 0x0039FD 2
3.3.3.3 3.3.3.3 1697 0x80000004 0x00888A 3
Summary Net Link States (Area 23)
Link ID ADV Router Age Seq# Checksum
10.1.1.0 2.2.2.2 358 0x80000001 0x00E5FB
10.1.2.0 2.2.2.2 358 0x80000001 0x0058C8
10.1.12.0 2.2.2.2 358 0x80000001 0x006275
Type-7 AS External Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 2.2.2.2 353 0x80000003 0x00CCDA 0
172.16.3.0 3.3.3.3 1720 0x80000001 0x0002B9 0
R3 receives the default route NSSA-external Type 2 (O*N2) and 3 inter-area routes as
shown by the routing table displayed below:
R3#show ip route ospf
10.0.0.0/24 is subnetted, 5 subnets
O IA 10.1.12.0 [110/128] via 10.1.23.2, 00:07:48, Serial0/1
OSPF Routing Protocol in-depth analysis
33
www.meddane.com
O IA 10.1.2.0 [110/65] via 10.1.23.2, 00:07:48, Serial0/1
O IA 10.1.1.0 [110/129] via 10.1.23.2, 00:07:48, Serial0/1
O*N2 0.0.0.0/0 [110/1] via 10.1.23.2, 00:07:43, Serial0/1
Now we add the key word no-summary :
R2(config-router)#area 23 nssa default-information-originate no-summary
Let's looks the database of the NSSA ASBR R3:
-R3 receives an LSA Type 7 with the LSID 0.0.0.0=default route.
-R3 receives an LSA Type 3 with the LSID 0.0.0.0=default route.
-R3 now filters the LSAs Type 3 for the subnet 10.1.1.0,10.1.2.0 and 10.1.12.0
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 30 0x80000004 0x0037FE 2
3.3.3.3 3.3.3.3 6 0x80000005 0x00868B 3
Summary Net Link States (Area 23)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 22 0x80000001 0x00FC31
Type-7 AS External Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 2.2.2.2 616 0x80000003 0x00CCDA 0
172.16.3.0 3.3.3.3 6 0x80000002 0x00FFBA 0
Let's looks the routing table of R3:
R3 installs an inter-area default route(Default Summary Route) because an inter-area
route is always preferred over the nssa external type 2 route:
R3#show ip route ospf
O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:04:38, Serial0/1
Let's filter the inter-area route by filtering the LSA Type 3 with filter-list feature
in order to see in the routing table of R3 the default route of the Type LSA 7 instead
of the default route generated by the LSA Type 3:
-the seq 5 with 0.0.0.0/0 deny only a default route .
-the seq 10 with 0.0.0.0/0 le 32 matches all prefixes, with prefix lengths between 0
and 32,so permit all
-area 23 filter-list prefix DEFAULT in command filters the default route 0.0.0.0/0
from being sent into area 23
R2(config)#ip prefix-list DEFAULT seq 5 deny 0.0.0.0/0
R2(config)#ip prefix-list DEFAULT seq 10 permit 0.0.0.0/0 le 32
R2(config)#router ospf 1
R2(config-router)#area 23 filter-list prefix DEFAULT in
In the database of R3 we can see that it receive only the LSA Type 7 with LSID
0.0.0.0, the LSA Type 3 with the LSID 0.0.0.0 does not exist:
R3#show ip ospf database
OSPF Routing Protocol in-depth analysis
34
www.meddane.com
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 2 0x80000006 0x003301 2
3.3.3.3 3.3.3.3 1 0x80000007 0x00828D 3
Type-7 AS External Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Tag
0.0.0.0 2.2.2.2 11 0x80000004 0x00CADB 0
172.16.3.0 3.3.3.3 2 0x80000004 0x00FBBC 0
Let's verify the routing table of R3:
Now R3 installs the the nssa external type 2 default route (O*N2):
R3#show ip route ospf
O*N2 0.0.0.0/0 [110/1] via 10.1.23.2, 00:01:43, Serial0/1
Now we will configure NSSA Totally Stub in area 23 as follow:
R2(config)#router ospf 1
R2(config-router)#no area 23 nssa default-information-originate no-summary
R2(config-router)#no area 23 filter-list prefix DEFAULT in
R2(config-router)#area 23 nssa no-summary
R3(config-router)#area 23 nssa
And redistribution between OSPF and EIGRP on R2:
R2:
router eigrp 24
redistribute ospf 1 metric 1 1 1 1 1
!
router ospf 1
redistribute eigrp 24 subnets
Let's looks the database of R3:
R3 receives four LSAs Type 7 from R2 for the subnets 192.168.24.0 , 192.168.40.0 ,
192.168.41.0 and 192.168.42.0 and one LSA Type 3 Default route because the area 23 is
configured as NSSA totally stub and R2 is configured with the key word no-summary:
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 961 0x80000006 0x003301 2
3.3.3.3 3.3.3.3 959 0x80000007 0x00828D 3
Summary Net Link States (Area 23)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 299 0x80000001 0x00FC31
Type-7 AS External Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Tag
OSPF Routing Protocol in-depth analysis
35
www.meddane.com
172.16.3.0 3.3.3.3 960 0x80000004 0x00FBBC 0
192.168.24.0 2.2.2.2 523 0x80000001 0x00D440 0
192.168.40.0 2.2.2.2 73 0x80000001 0x0024E0 0
192.168.41.0 2.2.2.2 73 0x80000001 0x0019EA 0
192.168.42.0 2.2.2.2 73 0x80000001 0x000EF4 0
If we look these LSAs Type 7 in depth we can see that the P-bit is cleared:
Notice the line "No Type 7/5 translation".
"No Type 7/5 translation" means that the P-bit is cleared and = 0 ,thus if there is
another ABR or if we configure R3 as an ABR ,it does not translate these LSAs Type 7
and they are not propagated beyond the NSSA area .
The type-7 originated by the NSSA area border router must have the P-bit cleared so
that these routes originated by the NSSA area border router will not find its way out
of the NSSA into the rest of the AS system via another NSSA area border router.
R3#show ip ospf database nssa-external adv-router 2.2.2.2 | include Options|Link State
ID
Options: (No TOS-capability, No Type 7/5 translation, DC)
Link State ID: 192.168.24.0 (External Network Number )
Options: (No TOS-capability, No Type 7/5 translation, DC)
Link State ID: 192.168.40.0 (External Network Number )
Options: (No TOS-capability, No Type 7/5 translation, DC)
Link State ID: 192.168.41.0 (External Network Number )
Options: (No TOS-capability, No Type 7/5 translation, DC)
Link State ID: 192.168.42.0 (External Network Number )
R3 installs four nssa external type 2 routes :
R3#show ip route ospf
O N2 192.168.42.0/24 [110/20] via 10.1.23.2, 00:00:15, Serial0/1
O N2 192.168.24.0/24 [110/20] via 10.1.23.2, 00:03:56, Serial0/1
O N2 192.168.40.0/24 [110/20] via 10.1.23.2, 00:00:15, Serial0/1
O N2 192.168.41.0/24 [110/20] via 10.1.23.2, 00:00:15, Serial0/1
O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:04:01, Serial0/1
Because we have already one default inter-area route advertised by R2 into NSSA
because the Totally Stub ,we can avoid to inject the external routes learned from
EIGRP Domain into the NSSA (area 23) as type 7 by adding the key-word no-
redistribution in R2,so no need to have an external routes in R3 instead to reach them
it will use the default route O*IA :
router ospf 1
R2(config-router)#area 23 nssa no-summary no-redistribution
The LSAs Type 7 for 192.168.24.0 ,192.168.40.0 , 192.168.41.0 and 192.168.42.0 do not
appear now in the databse of R3:
R3#show ip ospf database
OSPF Router with ID (3.3.3.3) (Process ID 1)
Router Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 1844 0x80000006 0x003301 2
3.3.3.3 3.3.3.3 1843 0x80000007 0x00828D 3
Summary Net Link States (Area 23)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 22 0x80000002 0x00FA32
OSPF Routing Protocol in-depth analysis
36
www.meddane.com
Type-7 AS External Link States (Area 23)
Link ID ADV Router Age Seq# Checksum Tag
172.16.3.0 3.3.3.3 1844 0x80000004 0x00FBBC 0
Therfore we have only one route OSPF on R3 which is an inter-area default route
advertised by R2:
R3#show ip route ospf
O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:01:47, Serial0/1
R3#ping 192.168.24.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.24.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/21/48 ms
R3#ping 192.168.40.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.40.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/20/44 ms
R3#ping 192.168.41.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.41.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/16/44 ms
R3#ping 192.168.42.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.42.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/17/52 ms
OSPF Routing Protocol in-depth analysis
37
www.meddane.com
Part III : Appendixes
Reference RFC3101
Notes
OSPF Routing Protocol in-depth analysis
38
www.meddane.com
END
Ad

More Related Content

What's hot (20)

Eigrp.ppt
Eigrp.pptEigrp.ppt
Eigrp.ppt
Edgardo Scrimaglia
 
Ospf.ppt
Ospf.pptOspf.ppt
Ospf.ppt
Edgardo Scrimaglia
 
How BGP Works
How BGP WorksHow BGP Works
How BGP Works
ThousandEyes
 
Ospf
 Ospf Ospf
Ospf
DeeN Mohammad
 
BGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionBGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and Discussion
APNIC
 
Ccna ppt1
Ccna ppt1Ccna ppt1
Ccna ppt1
AIRTEL
 
CCNA presentation.
CCNA presentation.CCNA presentation.
CCNA presentation.
Ajaigururaj R
 
OSPF Fundamental
OSPF FundamentalOSPF Fundamental
OSPF Fundamental
Reza Farahani
 
Chapter 17 : static routing
Chapter 17 : static routingChapter 17 : static routing
Chapter 17 : static routing
teknetir
 
CCNA 1 Routing and Switching v5.0 Chapter 9
CCNA 1 Routing and Switching v5.0 Chapter 9CCNA 1 Routing and Switching v5.0 Chapter 9
CCNA 1 Routing and Switching v5.0 Chapter 9
Nil Menon
 
Dynamic Routing All Algorithms, Working And Basics
Dynamic Routing All Algorithms, Working And BasicsDynamic Routing All Algorithms, Working And Basics
Dynamic Routing All Algorithms, Working And Basics
Harsh Mehta
 
MPLS L3 VPN Deployment
MPLS L3 VPN DeploymentMPLS L3 VPN Deployment
MPLS L3 VPN Deployment
APNIC
 
CCNA Chapter1
CCNA Chapter1CCNA Chapter1
CCNA Chapter1
Mohammed Ali
 
CCNP Route - EIGRP
CCNP Route - EIGRPCCNP Route - EIGRP
CCNP Route - EIGRP
mdyabi
 
GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)
Netwax Lab
 
Open Shortest Path First
Open Shortest Path FirstOpen Shortest Path First
Open Shortest Path First
Kashif Latif
 
CCNA Basic Switching and Switch Configuration
CCNA Basic Switching and Switch ConfigurationCCNA Basic Switching and Switch Configuration
CCNA Basic Switching and Switch Configuration
Dsunte Wilson
 
CCNA PPT
CCNA PPTCCNA PPT
CCNA PPT
AIRTEL
 
Dynamic routing protocols (CCNA)
Dynamic routing protocols (CCNA)Dynamic routing protocols (CCNA)
Dynamic routing protocols (CCNA)
Varinder Singh Walia
 
Bgp For Presentation
Bgp For PresentationBgp For Presentation
Bgp For Presentation
Alp isik
 
BGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and DiscussionBGP Flowspec (RFC5575) Case study and Discussion
BGP Flowspec (RFC5575) Case study and Discussion
APNIC
 
Ccna ppt1
Ccna ppt1Ccna ppt1
Ccna ppt1
AIRTEL
 
Chapter 17 : static routing
Chapter 17 : static routingChapter 17 : static routing
Chapter 17 : static routing
teknetir
 
CCNA 1 Routing and Switching v5.0 Chapter 9
CCNA 1 Routing and Switching v5.0 Chapter 9CCNA 1 Routing and Switching v5.0 Chapter 9
CCNA 1 Routing and Switching v5.0 Chapter 9
Nil Menon
 
Dynamic Routing All Algorithms, Working And Basics
Dynamic Routing All Algorithms, Working And BasicsDynamic Routing All Algorithms, Working And Basics
Dynamic Routing All Algorithms, Working And Basics
Harsh Mehta
 
MPLS L3 VPN Deployment
MPLS L3 VPN DeploymentMPLS L3 VPN Deployment
MPLS L3 VPN Deployment
APNIC
 
CCNP Route - EIGRP
CCNP Route - EIGRPCCNP Route - EIGRP
CCNP Route - EIGRP
mdyabi
 
GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)GLBP (gateway load balancing protocol)
GLBP (gateway load balancing protocol)
Netwax Lab
 
Open Shortest Path First
Open Shortest Path FirstOpen Shortest Path First
Open Shortest Path First
Kashif Latif
 
CCNA Basic Switching and Switch Configuration
CCNA Basic Switching and Switch ConfigurationCCNA Basic Switching and Switch Configuration
CCNA Basic Switching and Switch Configuration
Dsunte Wilson
 
CCNA PPT
CCNA PPTCCNA PPT
CCNA PPT
AIRTEL
 
Bgp For Presentation
Bgp For PresentationBgp For Presentation
Bgp For Presentation
Alp isik
 

Similar to Ospf routing protocol (20)

Ospf
OspfOspf
Ospf
Vishnu Vardhan
 
Osp fv3 cs
Osp fv3 csOsp fv3 cs
Osp fv3 cs
Fred Bovy
 
Allwyn ospf ppt
Allwyn ospf pptAllwyn ospf ppt
Allwyn ospf ppt
Allwyngeorge4
 
ch2_p3_ospf.pptx
ch2_p3_ospf.pptxch2_p3_ospf.pptx
ch2_p3_ospf.pptx
NilsJuanSoncoMedina
 
OSPF Overview
OSPF OverviewOSPF Overview
OSPF Overview
NetProtocol Xpert
 
OSPF.pptx
OSPF.pptxOSPF.pptx
OSPF.pptx
Atakan ATAK
 
Menggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.ppt
Menggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.pptMenggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.ppt
Menggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.ppt
RochmadGSaputra
 
ospf.ppt
ospf.pptospf.ppt
ospf.ppt
parthashee3
 
Routing and OSPF
Routing and OSPFRouting and OSPF
Routing and OSPF
arpit
 
Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)
Respa Peter
 
Ccna day3
Ccna day3Ccna day3
Ccna day3
Reetesh Gupta
 
11Chapter8R_InternetRoutingProtocols.ppt
11Chapter8R_InternetRoutingProtocols.ppt11Chapter8R_InternetRoutingProtocols.ppt
11Chapter8R_InternetRoutingProtocols.ppt
abdelrahman7ossam200
 
OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -
OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -
OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -
Duane Bodle
 
OSPF Open Shortest Path First protocol full details
OSPF Open Shortest Path First  protocol full detailsOSPF Open Shortest Path First  protocol full details
OSPF Open Shortest Path First protocol full details
Vignesh kumar
 
Ccna day3-140715152337-phpapp01
Ccna day3-140715152337-phpapp01Ccna day3-140715152337-phpapp01
Ccna day3-140715152337-phpapp01
Sachin Morya
 
Ccna day3
Ccna day3Ccna day3
Ccna day3
Sabiulla Barkathullah
 
Ccna day3
Ccna day3Ccna day3
Ccna day3
danishrafiq
 
Ccna day3
Ccna day3Ccna day3
Ccna day3
AHMED NADIM JILANI
 
OSPF - Copie.pptx
OSPF - Copie.pptxOSPF - Copie.pptx
OSPF - Copie.pptx
MAROUANEAZZA3
 
Layer3protocols
Layer3protocolsLayer3protocols
Layer3protocols
assinha
 
Menggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.ppt
Menggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.pptMenggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.ppt
Menggali Lebih Dalam tentang OSPF: Protokol Routing Dinamis yang Efisien.ppt
RochmadGSaputra
 
Routing and OSPF
Routing and OSPFRouting and OSPF
Routing and OSPF
arpit
 
Open shortest path first (ospf)
Open shortest path first (ospf)Open shortest path first (ospf)
Open shortest path first (ospf)
Respa Peter
 
11Chapter8R_InternetRoutingProtocols.ppt
11Chapter8R_InternetRoutingProtocols.ppt11Chapter8R_InternetRoutingProtocols.ppt
11Chapter8R_InternetRoutingProtocols.ppt
abdelrahman7ossam200
 
OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -
OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -
OSPF Beyond Stump-the-Chump_Interview_Questions - Part 01 -
Duane Bodle
 
OSPF Open Shortest Path First protocol full details
OSPF Open Shortest Path First  protocol full detailsOSPF Open Shortest Path First  protocol full details
OSPF Open Shortest Path First protocol full details
Vignesh kumar
 
Ccna day3-140715152337-phpapp01
Ccna day3-140715152337-phpapp01Ccna day3-140715152337-phpapp01
Ccna day3-140715152337-phpapp01
Sachin Morya
 
Layer3protocols
Layer3protocolsLayer3protocols
Layer3protocols
assinha
 
Ad

More from Edgardo Scrimaglia (8)

Link state protocols.ppt
Link state protocols.pptLink state protocols.ppt
Link state protocols.ppt
Edgardo Scrimaglia
 
Multicast address
Multicast addressMulticast address
Multicast address
Edgardo Scrimaglia
 
Layer 3 redundancy hsrp
Layer 3 redundancy   hsrpLayer 3 redundancy   hsrp
Layer 3 redundancy hsrp
Edgardo Scrimaglia
 
Ether channel fundamentals
Ether channel fundamentalsEther channel fundamentals
Ether channel fundamentals
Edgardo Scrimaglia
 
Subnet mask vs wildcard mask
Subnet mask vs wildcard maskSubnet mask vs wildcard mask
Subnet mask vs wildcard mask
Edgardo Scrimaglia
 
Mecanismos de transicion pv6
Mecanismos de transicion pv6Mecanismos de transicion pv6
Mecanismos de transicion pv6
Edgardo Scrimaglia
 
Como definir un esquema de direcciones IPv6
Como definir un esquema de direcciones IPv6Como definir un esquema de direcciones IPv6
Como definir un esquema de direcciones IPv6
Edgardo Scrimaglia
 
Conceptos ipv6, direccionamiento
Conceptos ipv6, direccionamientoConceptos ipv6, direccionamiento
Conceptos ipv6, direccionamiento
Edgardo Scrimaglia
 
Ad

Ospf routing protocol

  • 1. Open Shortest Path First (OSPF)
  • 2. OSPF Routing Protocol in-depth analysis 2 www.meddane.com OSPF Routing Protocol in-depth analysis Theory translated into practice BY Redouane MEDDANE
  • 3. OSPF Routing Protocol in-depth analysis 3 www.meddane.com Contents Part I : OSPF theory and definitions 1-Introduction 2-Area Types 3-Router Roles 4-OSPF Metric 5-OSPF Neighbors 6-Packet Types: 7-OSPF States 8-DR and BDR 9-Route Summarization 10-OSPF Passive Interfaces 11-OSPF Default Routes: 12-Link State Advertisements (LSAs) 13-Standard,Stub and Not-So-Stubby Areas 14-OSPF Virtual Links 15-OSPF Route Types 16-OSPF Network Types Part II : Practices Labs Lab 1: OSPFv3 Virtual-Link Lab 2: External path selection in NSSA Lab 3: Stub and totally stuby area Lab 4: Manipulating of the Forwarding Address and the path selection Lab 5 : ABRs election and Forward Address in NSSA with OSPFv3 Lab 6 : loop prevention mechanism of inter-area ospf Lab 7: Forward Address and path selection in OSPFv2 Lab 8: OSPFv3 and the Forwarding Address Lab 9: OSPF path selection for external route Lab 10: OSPFv2 and OSPFv3 comparison Lab 11: OSPF over Frame-Relay and redistribution between two OSPF Processes-ID Lab 12: Redistribution between two OSPF Processes-ID Lab 13: OSPFv3 external path selection and Forward Address Lab 14: Forwarding Address selection Lab 15: Forwarding Address selection among two LSAs Type 7 for the same destination Lab 16: NSSA with OSPFv3 Lab 17: Virtual-Link OSPF Lab 18: Effects of ABR Loop Prevention with OSPFv3 Lab 19: Forwarding Address Lab 20: OSPFv3 and the use of forwarding address Lab 21: The Forwarding Address and path selection Lab 22: Routing Problem with OSPF Forwarding Address with all possible solutions Lab 23: How an ABR sets the Forward Address in the LSA Type 7 Lab 24: Routing Problem with OSPFv3 when advertising external routes in NSSA Lab 25: OSPFv3 LSAs : Types 2001 and 2002, Types 0008 and 2009 (Router and Network, Link and Intra-Area-Prefix) Lab 26: P-bit in LSA Type 7 loop prevention Lab 27: LSA Type-7 and LSA Type-5 which will win? Lab 28: LSA Type-7 With P-bit Clear and LSA Type-5 which win? Lab 29: Effect of the prefix-suppression Feature over the LSAs Type-1 and Type-2 Lab 30:V-bit and B-bit in LSA Type 1 Lab 31:Effect of the ABR Loop Prevention over the LSA Type 4 Lab 32:External Default route in NSSA area Lab 33:External Routes over LSA Type-7 and LSA Type-5 Lab 34: Next-Hop Field in OSPFv2 and OSPFv3 Lab 35:Adjacencies in OSPFv3 Lab 36:Suppressing the Forward Address in the LSA Type 7 Lab 37:LSA Type-7 and the P-Bit Lab 38: Analysing the LSAs Type of OSPFv3 Lab 39: Understanding of Not-So-Stubby Area (NSSA) Lab 40: LSA Type 4 asb-summary LSA Part1 Lab 41: LSA Type 4 asb-summary LSA Part 2 Lab 42: Fields of the LSAs Type on OSPFv3 Lab 43: Suboptimal Routing with LSA Type 4 Lab 44: Third-Party Next-Hop Part III : Appendixes Reference RFC3101 Notes
  • 4. OSPF Routing Protocol in-depth analysis 4 www.meddane.com Part I : OSPF theory and definitions 1-Introduction 2-Area Types 3-Router Roles 4-OSPF Metric 5-OSPF Neighbors 6-Packet Types: 7-OSPF States 8-DR and BDR 9-Route Summarization 10-OSPF Passive Interfaces 11-OSPF Default Routes: 12-Link State Advertisements (LSAs) 13-Standard,Stub and Not-So-Stubby Areas 14-OSPF Virtual Links 15-OSPF Route Types 16-OSPF Network Types
  • 5. OSPF Routing Protocol in-depth analysis 5 www.meddane.com 1-Introduction: OSPF, or Open Shortest Path First, is a link-state, open-standard, dynamic routing protocol. OSPF uses an algorithm known as SPF, or Dijkstra’s Shortest Path First, to compute internally the best path to any given route. OSPF is classless and converges fairly quickly, using cost as it’s metric. A router running OSPF creates its own database which contains information on the entire OSPF network, not simply neighbour's routes like EIGRP. This allows the router to make intelligent choices about path selection on its own instead of relying exclusively on neighbour information. OSPF routers do form neighbour relationships though. They exchange hellos with neighbouring routers and in the process learn their neighbour's Router ID (RID) and cost. Those values are then sent to the adjacency table. Every router is responsible for computing its own best paths to all destinations within an OSPF domain. Once the SPF algorithm selects the best paths, they are then eligible to be added to the routing table. 2-Area Types: Backbone area: Another name for area 0. Regular area: Non-backbone area, with both internal and external routes. Stub area: Contains only internal routes and a default route. Totally Stubby Area: Cisco proprietary option for a stub area. Not-So-Stubby area (NSSA): Contains internal routes, redistributed routes, and optionally a default route. Totally Stubby NSSA: Cisco proprietary option for NSSA. 3 tables: - neighbour : same as eigrp - Topology: every network in the area - Routing: best path ways to networks Although OSPF does not send routing updates on a periodic interval, as do distance vector protocols, OSPF does reflood each LSA every 30 minutes based on each LSA’s age variable. The router that creates the LSA sets this age to 0 (seconds). Each router then increments the age of its copy of each LSA over time. If 30 minutes pass with no changes to an LSA–meaning no other reason existed in that 30 minutes to cause a reflooding of the LSA. 3-Router Roles:  Internal : Routers which have all interfaces in a single area  Backbone routers : Routers with at least one interface in area 0  Area Border Routers (ABRs) : Routers with at least two interfaces in different areas  Autonomous System Boundary Routers (ASBR) : Routers which redistribute information from an external source 4-OSPF Metric: Each interface is assigned a cost value based on bandwidth.The formula is:
  • 6. OSPF Routing Protocol in-depth analysis 6 www.meddane.com Cost = (100Mbs/bandwidth). Higher bandwidth means a lower cost. 5-OSPF Neighbors: Hellos are sent out periodically using multicast on OSPF enabled routers. The router forms an adjacency with a peer router when it sees its own Router ID in the neighbor field of another router’s hello message. That indicates there is direct, bi-directional communication on the same subnet. Note: On multi-access links, adjacencies are only formed between the router and the DR and BDR. All of the following fields in an OSPF hello message must match for an adjacency to form: -hello timer -dead timer -area ID -authentication type -password -stub area flag With OSPF, if four consecutive hellos are not received (the dead time), the router is considered down. - Point-point interfaces: hellos every 10 seconds, 40 second dead timer. -Non-broadcast multi-access (NBMA) interfaces: hellos every 30 seconds, 120 second dead timer 6-Packet Types:  Hello - Used to establish communication with directly connected neighbors  Database Descriptor (DBD) - Lists router IDs from which the router has an LSA and its current sequence number  Link State Request (LSR) - Request for an LSA  Link State Update (LSU) - Reply to an LSR with the requested information  Link State Acknowledgment (LSAck) - Used to confirm receipt of link-state information 7-OSPF States: There are 7 different OSPF states when forming neighbor relationships. Take the time to learn the states and their corresponding functions. 1. Down State OSPF has not started and no hellos have been sent. 2. Init State Hellos are sent out all OSPF-participating interfaces. 3. Two-way State A hello is received from another router with its own RID in the neighbor field. All other required elements match and the routers become neighbors.
  • 7. OSPF Routing Protocol in-depth analysis 7 www.meddane.com 4. Exstart State Routers determine which one will begin the route exchange process with the other. 5. Exchange State Routers exchange DBDs. 6. Loading State Routers compare the DBD to their LS database. LSRs are sent out for missing or outdated LSAs. Each router then responds to the LSRs with a Link State Update. Finally, the LSUs are acknowledged. 7. Full State The LSDB is completely synchronized with the OSPF neighbour. 8-DR and BDR: SPF works by mapping all paths to every destination on each router. It uses the RID to identify hops along each path and uses bandwidth as a metric between those hops. This whole system works really well when routers are connected with point-to-point links and OSPF traffic is simply sent using multicast address 224.0.0.5. It doesn’t work well, however, when a router is connecting to multi-access networks like an Ethernet VLAN. Multi- access OSPF links require a Designated Router (DR) be elected to represent the entire segment. Another router is then elected as the Backup Designated Router, or BDR. On that specific multi-access segment, routers only form adjacencies with the DR and BDR. The DR uses type 2, network LSAs to advertise the segment over multicast address 224.0.0.5. The Non-Designated routers then use IP address 224.0.0.6 to communicate directly with the DR. Elections: 1. When the OSPF process on a router starts up, it listens for hellos. If it does not receive any within its dead time, it elects itself the DR. 2. If hellos are received before the dead time expires, the router with the highest OSPF priority is elected as the DR. Next, the same process happens to elect the BDR. Note: If a router’s OSPF priority is set to 0, it will not participate in the elections. 3. If two routers happen to have the same OSPF priority, the router with the highest Router ID will become DR. The same is true for BDR. Once a DR is elected, elections cannot take place again until either the DR or BDR go down. This essentially means that there is no OSPF DR preemption if another router comes online with a higher OSPF priority. In the case that the DR goes down, the BDR automatically is assigned the DR role and a new BDR election occurs. Be aware that a router with a non-zero priority that happens to boots first can become the DR just because it did not receive any hellos when the OSPF process was started – even though it may have a low OSPF priority. The default OSPF priority is 1 and Cisco recommends manually changing that on routers you want to become the DR and BDR. Remember that DRs are only used on multi-access links, so they are only significant on an interface level. A router with two different interfaces connected to two different multi-access links will have separate DR elections for each segment.
  • 8. OSPF Routing Protocol in-depth analysis 8 www.meddane.com 9-Route Summarization: First, it’s important to note that running the SPF algorithm ,a router uses a lot the CPU resources and can easily consume them all. The reason is because OSPF has to compute the best path to every destination within its area. Avoiding running the algorithm when it is not required. Summarization has two important benefits for OSPF. It prevents topology changes from being passed outside an area – thus reducing the number of routers re-running the SPF algorithm. It also consolidates many routes in to a single statement, reducing the memory load and database size on OSPF-enabled routers. There are two types of route summarization, inter-area and external. a- Inter-area Summarization (LSA Type 3): This occurs on ABRs to summarize routes between areas. This really only works well if the networks contained within an area are subnetted contiguously so that they can be easily summarized into a single statement. The new summary route’s cost will be equal to the lowest cost route within the summary range. After the command is entered, the router will automatically create a static route pointing to Null0. Example: router ospf 1 area 1 range 10.10.0.0 255.255.252.0 b- External Summarization (LSA Type 5) This occurs on ASBRs for routes that are injected into OSPF via route redistribution. After the command is entered, the router will automatically create a static route pointing to Null0. Example: router ospf 1 summary-address 192.168.0.0 255.255.252.0 10-OSPF Passive Interfaces: OSPF supports the use of passive interfaces. The passive-interface interface command disables OSPF hellos from being sent out, thus disabling the interface from forming adjacencies out that interface. 11-OSPF Default Routes: Default routes are injected into OSPF via type 5 LSAs. There are multiple ways to inject default routes into OSPF, but Cisco recommends using the default-information originate command under the OSPF routing process. Using the default-information originate command, there are two ways to advertise a default route into a normal area. The first is to advertise 0.0.0.0 into the OSPF domain, provided the advertising router already has a default route. The second is to advertise 0.0.0.0 regardless of whether the advertising router already has a default route. The second method can be accomplished by adding the keyword always to the default-information originate command. Another option is to use the area range and summary-address commands discussed in the summarization above. Using these options will result in the router advertising a default route pointing to itself.
  • 9. OSPF Routing Protocol in-depth analysis 9 www.meddane.com 12-Link State Advertisements (LSAs): Type 1: Router link advertisements generated by each router for each area it belongs to. Type 1 LSAs are flooded to a single area only. Type 2: Network link advertisements generated by designated routers (DRs) giving the set of routers attached to a particular network. Type 2 LSAs are flooded to the area that contains the network. Type 3/4: These are summary link advertisements generated by ABRs. Type 3 describes inter-area routes to networks and is used for summarization. Type 4 describes how to reach the ASBR. Type 5: Generated by the ASBR and provides links external to the Autonomous System (AS). Type 5 LSAs are flooded to all areas except stub areas and totally stubby areas. Type 7: NSSA external routes generated by ASBR. Only flooded to the NSSA. The ABR converts LSA type 7 into LSA type 5 before flooding them into the backbone (area 0). Note: only changes Type 1 and 2 LSAs require an SPF calculation The commands used to see each LSA: -LSA Type 1: show ip ospf database router -LSA Type 2: show ip ospf database network -LSA Type 3 : show ip ospf database summary -LSA Type 4 : show ip ospf database asbr-summary -LSA Type 5 : show ip ospf database external -LSA Type 7 :show ip ospf database nssa-external
  • 10. OSPF Routing Protocol in-depth analysis 10 www.meddane.com Part II : Practices Labs Lab 1: OSPFv3 Virtual-Link Lab 2: External path selection in NSSA Lab 3: Stub and totally stuby area Lab 4: Manipulating of the Forwarding Address and the path selection Lab 5 : ABRs election and Forward Address in NSSA with OSPFv3 Lab 6 : loop prevention mechanism of inter-area ospf Lab 7: Forward Address and path selection in OSPFv2 Lab 8: OSPFv3 and the Forwarding Address Lab 9: OSPF path selection for external route Lab 10: OSPFv2 and OSPFv3 comparison Lab 11: OSPF over Frame-Relay and redistribution between two OSPF Processes-ID Lab 12: Redistribution between two OSPF Processes-ID Lab 13: OSPFv3 external path selection and Forward Address Lab 14: Forwarding Address selection Lab 15: Forwarding Address selection among two LSAs Type 7 for the same destination Lab 16: NSSA with OSPFv3 Lab 17: Virtual-Link OSPF Lab 18: Effects of ABR Loop Prevention with OSPFv3 Lab 19: Forwarding Address Lab 20: OSPFv3 and the use of forwarding address Lab 21: The Forwarding Address and path selection Lab 22: Routing Problem with OSPF Forwarding Address with all possible solutions Lab 23: How an ABR sets the Forward Address in the LSA Type 7 Lab 24: Routing Problem with OSPFv3 when advertising external routes in NSSA Lab 25: OSPFv3 LSAs : Types 2001 and 2002, Types 0008 and 2009 (Router and Network, Link and Intra-Area-Prefix) Lab 26: P-bit in LSA Type 7 loop prevention Lab 27: LSA Type-7 and LSA Type-5 which will win? Lab 28: LSA Type-7 With P-bit Clear and LSA Type-5 which win? Lab 29: Effect of the prefix-suppression Feature over the LSAs Type-1 and Type-2 Lab 30:V-bit and B-bit in LSA Type 1 Lab 31:Effect of the ABR Loop Prevention over the LSA Type 4 Lab 32:External Default route in NSSA area Lab 33:External Routes over LSA Type-7 and LSA Type-5 Lab 34: Next-Hop Field in OSPFv2 and OSPFv3 Lab 35:Adjacencies in OSPFv3 Lab 36:Suppressing the Forward Address in the LSA Type 7 Lab 37:LSA Type-7 and the P-Bit Lab 38: Analysing the LSAs Type of OSPFv3 Lab 39: Understanding of Not-So-Stubby Area (NSSA) Lab 40: LSA Type 4 asb-summary LSA Part1 Lab 41: LSA Type 4 asb-summary LSA Part 2 Lab 42: Fields of the LSAs Type on OSPFv3 Lab 43: Suboptimal Routing with LSA Type 4 Lab 44: Third-Party Next-Hop
  • 11. OSPF Routing Protocol in-depth analysis 11 www.meddane.com Lab 1: OSPFv3 Virtual-Link Virtual-Link over OSPFv3 By definition: All areas in an OSPF autonomous system must be physically connected to the backbone area (area 0). In some cases where this physical connection is not possible, you can use a virtual link to connect to the backbone through a non-backbone area. In this case without the virtual-link, you cannot have a full connectivity. let's look the routing table of R1 and R4: On R1 notice the prefixes missing ,2001:210:10:3::/64 and FEC0:3::/64: R1(config-if)#do show ipv route ospf OI 2001:210:10:2::/64 [110/74] via FE80::C201:27FF:FED8:0, FastEthernet0/0 O FEC0:2::/64 [110/20] via FE80::C201:27FF:FED8:0, FastEthernet0/0 OI FEC0:3::/64 [110/84] via FE80::C201:27FF:FED8:0, FastEthernet0/0 On R4 there are no routes OSPF installed even if R4 has an adjacencies with R3: R4(config-if)#do show ipv ospf nei Neighbor ID Pri State Dead Time Interface ID Interface 3.3.3.3 1 FULL/DR 00:00:32 4 FastEthernet0/0 R4(config-if)#do show ipv route ospf IPv6 Routing Table - 6 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 R4(config-if)# Finally the ping fails: R1#ping FEC0:4::4 source FEC0:1::1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to FEC0:4::4, timeout is 2 seconds:
  • 12. OSPF Routing Protocol in-depth analysis 12 www.meddane.com Packet sent with a source address of FEC0:1::1 ..... Success rate is 0 percent (0/5) Let's configure the virtual link between R2 and R3: R2(config)#ipv6 router ospf 1 R2(config-rtr)# router-id 2.2.2.2 R2(config-rtr)# area 11 virtual-link 3.3.3.3 R3(config)#ipv6 router ospf 1 R3(config-rtr)# router-id 3.3.3.3 R3(config-rtr)# area 11 virtual-link 2.2.2.2 Let's look the routing table of R1: Now the prefixes are installed : 2001:210:10:3::/64 and FEC0:3::/64 R1# show ipv route ospf IPv6 Routing Table - 13 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 OI 2001:210:10:2::/64 [110/74] via FE80::C201:27FF:FED8:0, FastEthernet0/0 OI 2001:210:10:2::1/128 [110/10] via FE80::C201:27FF:FED8:0, FastEthernet0/0 OI 2001:210:10:3::/64 [110/84] via FE80::C201:27FF:FED8:0, FastEthernet0/0 O FEC0:2::/64 [110/20] via FE80::C201:27FF:FED8:0, FastEthernet0/0 OI FEC0:3::/64 [110/84] via FE80::C201:27FF:FED8:0, FastEthernet0/0 OI FEC0:3::3/128 [110/74] via FE80::C201:27FF:FED8:0, FastEthernet0/0 OI FEC0:4::/64 [110/94] via FE80::C201:27FF:FED8:0, FastEthernet0/0 R4 has a full routing table as shown by the following output: R4#show ipv route ospf IPv6 Routing Table - 13 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 OI 2001:210:10:1::/64 [110/84] via FE80::C202:27FF:FED8:0, FastEthernet0/0 OI 2001:210:10:2::/64 [110/74] via FE80::C202:27FF:FED8:0, FastEthernet0/0 OI 2001:210:10:2::1/128 [110/74] via FE80::C202:27FF:FED8:0, FastEthernet0/0 OI FEC0:1::/64 [110/94] via FE80::C202:27FF:FED8:0, FastEthernet0/0 OI FEC0:2::/64 [110/84] via FE80::C202:27FF:FED8:0, FastEthernet0/0 OI FEC0:3::/64 [110/20] via FE80::C202:27FF:FED8:0, FastEthernet0/0 OI FEC0:3::3/128 [110/10]
  • 13. OSPF Routing Protocol in-depth analysis 13 www.meddane.com via FE80::C202:27FF:FED8:0, FastEthernet0/0 Let's verify the virtual-link The adjacencies appear between the two routers R2 and R3 over the virtual-link and they are displayed in the show ip ospf nei but without dead time: R2#show ipv ospf nei Neighbor ID Pri State Dead Time Interface ID Interface 3.3.3.3 1 FULL/ - - 10 OSPFv3_VL0 1.1.1.1 1 FULL/BDR 00:00:39 4 FastEthernet0/0 3.3.3.3 1 FULL/ - 00:00:35 6 Serial0/0 R3#show ipv ospf nei Neighbor ID Pri State Dead Time Interface ID Interface 2.2.2.2 1 FULL/ - - 10 OSPFv3_VL0 2.2.2.2 1 FULL/ - 00:00:39 6 Serial0/0 4.4.4.4 1 FULL/DR 00:00:39 4 FastEthernet0/0 We have end to end connectivity as shown by the ping: R1#ping FEC0:4::4 source FEC0:1::1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to FEC0:4::4, timeout is 2 seconds: Packet sent with a source address of FEC0:1::1 !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 36/47/84 ms Another point to rememeber is that the LSA Type 1 plays an important role to carry some important informations whether a router is an ABR ,an ASBR or end point of virtual-link by setting the B bit ,the E bit or the V bit respectively.So The LSA Type 1 (Router LSA) is used by a Router to indicate whether it is an ASBR ,ABR or end point of virtual link. We can verify the LSA Type 1(Router LSA) on R2 and the virtual-link option : R2#show ipv osp data router self-originate OSPFv3 Router with ID (2.2.2.2) (Process ID 1) Router Link States (Area 0) LS age: 236 Options: (V6-Bit E-Bit R-bit DC-Bit) LS Type: Router Links Link State ID: 0 Advertising Router: 2.2.2.2 LS Seq Number: 80000006 Checksum: 0x1C47 Length: 56 Area Border Router Number of Links: 2 Link connected to: a Virtual Link Link Metric: 64 Local Interface ID: 10 Neighbor Interface ID: 10 Neighbor Router ID: 3.3.3.3 Link connected to: a Transit Network Link Metric: 10 Local Interface ID: 4 Neighbor (DR) Interface ID: 4
  • 14. OSPF Routing Protocol in-depth analysis 14 www.meddane.com Neighbor (DR) Router ID: 2.2.2.2 ....Output omitted for brevity.... Notice in the LSA Type-1 of R2. The following sections in area 0(because now R2 is connected to R3 through a virtual- link with an area 0, describe the links that this router is attached to, which is the virtual link: Link connected to: a Virtual Link Link Metric: 64 Local Interface ID: 10 Neighbor Interface ID: 10 Neighbor Router ID: 3.3.3.3 Remember the Local Interface ID=10 and the Neighbor Interface ID=10. Let's looks the LSA Type-1 on R3: R3#show ipv ospf database router self-originate OSPFv3 Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 0) LS age: 51 Options: (V6-Bit E-Bit R-bit DC-Bit) LS Type: Router Links Link State ID: 0 Advertising Router: 3.3.3.3 LS Seq Number: 80000003 Checksum: 0x385A Length: 40 Area Border Router Number of Links: 1 Link connected to: a Virtual Link Link Metric: 64 Local Interface ID: 10 Neighbor Interface ID: 10 Neighbor Router ID: 2.2.2.2 ....Output omitted for brevity.... Notice the following section: Link connected to: a Virtual Link Link Metric: 64 Local Interface ID: 10 Neighbor Interface ID: 10 Neighbor Router ID: 2.2.2.2 R3 defines its link as a virtual-link connected to R2(2.2.2.2) Notice the Local Interface ID =10 and the Neighbor Interface ID=10 What is the Purpose of the Interface ID? The answer is given by the RFC 5340: The Hello packet now contains no address information at all. Rather, it now includes an Interface ID that the originating router has assigned to uniquely identify (among its own interfaces) its interface to the link. This Interface ID will be used as the network-LSA's Link State ID if the router becomes the Designated Router on the link. Let's verify this RFC: we will take an example of the segment R1--R2.
  • 15. OSPF Routing Protocol in-depth analysis 15 www.meddane.com The DR is R2 as shown by the following output: R1#show ipv ospf neighbor Neighbor ID Pri State Dead Time Interface ID Interface 2.2.2.2 1 FULL/DR 00:00:30 4 FastEthernet0/0 Let's looks the LSA Type 1 advertised by R2: R2#show ipv ospf data router self-originate OSPFv3 Router with ID (2.2.2.2) (Process ID 1) Router Link States (Area 0) LS age: 249 Options: (V6-Bit E-Bit R-bit DC-Bit) LS Type: Router Links Link State ID: 0 Advertising Router: 2.2.2.2 LS Seq Number: 80000009 Checksum: 0x164A Length: 56 Area Border Router Number of Links: 2 Link connected to: a Virtual Link Link Metric: 64 Local Interface ID: 10 Neighbor Interface ID: 10 Neighbor Router ID: 3.3.3.3 Link connected to: a Transit Network Link Metric: 10 Local Interface ID: 4 Neighbor (DR) Interface ID: 4 Neighbor (DR) Router ID: 2.2.2.2 Notice the following section : Link connected to: a Transit Network Link Metric: 10 Local Interface ID: 4 Neighbor (DR) Interface ID: 4 Neighbor (DR) Router ID: 2.2.2.2 R2 is the DR for this transit network(the segment shared with R1). Notice the Local Interface ID and the Neighbor (DR) Interface ID which is 4.remember it An LSA Type 2 is created by the R2 the DR as shown by the following output: R2# show ipv ospf data net sel OSPFv3 Router with ID (2.2.2.2) (Process ID 1) Net Link States (Area 0) LS age: 340 Options: (V6-Bit E-Bit R-bit DC-Bit) LS Type: Network Links Link State ID: 4 (Interface ID of Designated Router) Advertising Router: 2.2.2.2 LS Seq Number: 80000001 Checksum: 0x3ED Length: 32
  • 16. OSPF Routing Protocol in-depth analysis 16 www.meddane.com Attached Router: 2.2.2.2 Attached Router: 1.1.1.1 Notice the Link State ID:4,it is the same that the Local Interface ID and the Neighbor (DR) Interface ID displayed in the LSA Type-1 and created by the DR,so This Interface ID will be used as the network-LSA's Link State ID if the router becomes the Designated Router on the link(RFC 5340) We can confirm the result by looking the LSA Type 2 received by R1 from the DR R2 , the Link State ID is 4 ,notice between parenthesis( Interface ID of Designated Router ) which tells to R1 that 4 is the LSID of the DR: R1#show ipv ospf data net adv 2.2.2.2 OSPFv3 Router with ID (1.1.1.1) (Process ID 1) Net Link States (Area 0) LS age: 368 Options: (V6-Bit E-Bit R-bit DC-Bit) LS Type: Network Links Link State ID: 4 (Interface ID of Designated Router) Advertising Router: 2.2.2.2 LS Seq Number: 80000001 Checksum: 0x3ED Length: 32 Attached Router: 2.2.2.2 Attached Router: 1.1.1.1 Another way to see this Interface ID is the show ipv ospf nei 1.1.1.1 command which displays the Interface ID of 4: R2#show ipv ospf neighbor 1.1.1.1 Neighbor 1.1.1.1 In the area 0 via interface FastEthernet0/0 Neighbor: interface-id 4, link-local address FE80::C200:27FF:FED8:0 Neighbor priority is 1, State is FULL, 18 state changes DR is 2.2.2.2 BDR is 1.1.1.1 Options is 0x000013 in Hello (V6-Bit E-Bit R-bit ) Options is 0x000013 in DBD (V6-Bit E-Bit R-bit ) Dead timer due in 00:00:37 Neighbor is up for 00:22:12 Index 1/1/2, retransmission queue length 0, number of retransmission 5 First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0) Last retransmission scan length is 3, maximum is 5 Last retransmission scan time is 0 msec, maximum is 0 msec Notice that in OSPFv3 the LSA Type 1 does not include the prefixes (like OSPFv2),instead it interacts with the LSA Type 8 and the LSA Type 9 in order to know all intra-area information. Another point to notice for the virtual-link over OSPFv3 is the ipv address used in virtual-link Still from RFC 2740 the best resource: OSPF for IPv6 assumes that each router has been assigned link-local unicast addresses on each of the router's attached physical links [IP6ADDR]. On all OSPF interfaces except virtual links, OSPF packets are sent using the interface's associated link-local unicast address as the source address. A router learns the link-local addresses of all other routers attached to its links and uses these addresses as next-hop information during packet forwarding. The IPv6 interface address of a virtual link must be an IPv6
  • 17. OSPF Routing Protocol in-depth analysis 17 www.meddane.com address having site-local or global scope, instead of the link- local addresses used by other interface types. This address is used as the IPv6 source for OSPF protocol packets sent over the virtual link. Let's verify with the show ipv ospf neighbor 3.3.3.3 command ,we can see that the ipv6 address used over the virtual-link(interface OSPFv3_VL1) is 2001:210:10:2::2( which is the Global Ipv6 address of R3's serial 0/0----the ipv6 address used over the serial link is FE80::C202:27FF:FED8:0 which is the Link-Local Address of R3's s0/0 as confirmed by the show ipv int br command : R2#show ipv ospf neighbor 3.3.3.3 Neighbor 3.3.3.3 In the area 0 via interface OSPFv3_VL1 Neighbor: interface-id 11, IPv6 address 2001:210:10:2::2 Neighbor priority is 1, State is FULL, 6 state changes Options is 0x000033 in Hello (V6-Bit E-Bit R-bit DC-Bit) Options is 0x000033 in DBD (V6-Bit E-Bit R-bit DC-Bit) Neighbor is up for 00:21:33 Index 1/2/3, retransmission queue length 0, number of retransmission 0 First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0) Last retransmission scan length is 0, maximum is 0 Last retransmission scan time is 0 msec, maximum is 0 msec Neighbor 3.3.3.3 In the area 11 via interface Serial0/0 Neighbor: interface-id 6, link-local address FE80::C202:27FF:FED8:0 Neighbor priority is 1, State is FULL, 6 state changes Options is 0x000013 in Hello (V6-Bit E-Bit R-bit ) Options is 0x000013 in DBD (V6-Bit E-Bit R-bit ) Dead timer due in 00:00:30 Neighbor is up for 00:21:39 Index 1/1/1, retransmission queue length 0, number of retransmission 1 First 0x0(0)/0x0(0)/0x0(0) Next 0x0(0)/0x0(0)/0x0(0) Last retransmission scan length is 7, maximum is 7 Last retransmission scan time is 0 msec, maximum is 0 msec R3(config-if)#do show ipv int br FastEthernet0/0 [up/up] FE80::C202:27FF:FED8:0 2001:210:10:3::1 Serial0/0 [up/up] FE80::C202:27FF:FED8:0 2001:210:10:2::2 FastEthernet0/1 [up/up] FE80::C202:27FF:FED8:1 FEC0:3::3 . So as the RFC 2740 said : Over virtual-link R2 receives the hello packets from R3 with the source address :the global ipv6 address of R3's s0/0 Over the serial link R2 receives the hello packets from R3 with the source address: the Link-Local Address of R3's s0/0 In other word: Over virtual-link R2 sends the hello packets to R3 with the source address :the global ipv6 address of R2's s0/0 Over the serial link R2 sends the hello packets to R3 with the source address: the Link-Local Address of R2's s0/0
  • 18. OSPF Routing Protocol in-depth analysis 18 www.meddane.com Lab 4: Manipulating of the Forwarding Address and the path selection Both R1 and R2 will do the redistribution of the static routes toward the same destination 172.16.1.0 as shown in the topology. R3 receives two LSAs Type 5 from R1 and R2 with the same Forward Address set to 0.0.0.0 which means to reach the external subnet route the packet through the ASBR: R3#show ip ospf database external | include Forward Address|Advertising Router Advertising Router: 1.1.1.1 Forward Address: 0.0.0.0 Advertising Router: 2.2.2.2 Forward Address: 0.0.0.0 R3 looks the costs to reach both ASBRs (R1 and R2) which are the same and is equal to 10 as shown by the show ip ospf border-routers command and the forward metric 10 shown by show ip route 172.16.1.0 command thus it installs a load balancing: R3#show ip ospf border-routers OSPF Process 1 internal Routing Table Codes: i - Intra-area route, I - Inter-area route i 1.1.1.1 [10] via 10.1.13.1, FastEthernet0/0, ASBR, Area 0, SPF 5 i 2.2.2.2 [10] via 10.1.23.2, FastEthernet0/1, ASBR, Area 0, SPF 5 R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10 Last update from 10.1.13.1 on FastEthernet0/0, 00:00:05 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:00:05 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 10.1.13.1, from 1.1.1.1, 00:00:05 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 Now let's activate ospf in fa0/0 of R1 and s0/0 of R2: R2(config-if)#ip ospf 1 area 0 R1(config-if)#ip ospf 1 area 0
  • 19. OSPF Routing Protocol in-depth analysis 19 www.meddane.com R3 receives still two LSAs Type 5 from R1 and R2 ,but in this case the Forward Addresses set to non-zero as shown by the following output: R3#show ip ospf database external | include Forward Address|Advertising Router Advertising Router: 1.1.1.1 Forward Address: 192.168.1.4 Advertising Router: 2.2.2.2 Forward Address: 192.168.2.5 Remember the two definitions of the Forwarding Address: 1-The selection of the FA will be: -The highest IP address from among the loopback interfaces on which OSPF is activated. -If there are no loopback interfaces, then the IP address of the physical interface on which OSPF is activated. 2-The forwarding address is set to 0.0.0.0 if the ASBR redistributes routes and OSPF is not enabled on the next hop interface for those routes. This is out case if R1 and R2 do not have OSPF enabled on the fastethernet interface fa0/0. These conditions set the forwarding address field to a non-zero address: OSPF is enabled on the ASBR's next hop interface AND ASBR's next hop interface is non-passive under OSPF AND ASBR's next hop interface is not point-to-point AND ASBR's next hop interface is not point-to-multipoint AND ASBR's next hop interface address falls under the network range specified in the router ospf command. What the Router R3 will do? R3 looks the best intra-area or inter-area to reach the FA ,in this case it looks the best intra-area to reach the FA 192.168.1.4 advertised by R1 and the FA 192.168.2.5 advertised by R5 ,the best intra-area routes are through R1 and R2 respectively,then R3 find that the costs to reach these FA via the intra-area route are the same =20 ,notice the "type intra area" field in the following output which tells us that this route is an intra-area: R3#show ip route 192.168.1.4 Routing entry for 192.168.1.0/24 Known via "ospf 1", distance 110, metric 20, type intra area Last update from 10.1.13.1 on FastEthernet0/0, 00:08:48 ago Routing Descriptor Blocks: * 10.1.13.1, from 1.1.1.1, 00:08:48 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 R3#show ip route 192.168.2.5 Routing entry for 192.168.2.0/24 Known via "ospf 1", distance 110, metric 20, type intra area Last update from 10.1.23.2 on FastEthernet0/1, 00:08:53 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:08:53 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 Then R3 installs a load balancing toward the external subnet 172.16.1.0: R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20 Last update from 10.1.13.1 on FastEthernet0/0, 00:00:01 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:00:01 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 10.1.13.1, from 1.1.1.1, 00:00:01 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 Now what happen if we configure the static routes with an outgoing interface instead of the next-hop?
  • 20. OSPF Routing Protocol in-depth analysis 20 www.meddane.com R1(config)#no ip route 172.16.1.0 255.255.255.0 192.168.1.4 R1(config)#ip route 172.16.1.0 255.255.255.0 fa0/0 R2(config-if)#no ip route 172.16.1.0 255.255.255.0 192.168.2.5 R2(config)#ip route 172.16.1.0 255.255.255.0 fa0/0 Let's look the LSA Type 5. Now the LSAs Type 5 received by R3 have the FA set to zero 0.0.0.0 R3#show ip ospf database external | include Forward Address|Advertising Router Advertising Router: 1.1.1.1 Forward Address: 0.0.0.0 Advertising Router: 2.2.2.2 Forward Address: 0.0.0.0 Thus R3 looks the costs to reach both ASBRs (R1 and R2) which are the same and installs a load balancing. Now let' remove the static routes and instead we will enable OSPF between R1 and R4 in area 1, R2 and R5 in area 1,then R4 and R5 redistribute the subnet 172.16.1.0 as follow: R1(config)#interface FastEthernet0/0 R1(config-if)#no ip ospf 1 area 0 R1(config)#no ip route 172.16.1.0 255.255.255.0 fa0/0 R1(config)#router ospf 1 R1(config-router)#no redistribute static subnets R2(config)#interface FastEthernet0/0 R2(config-if)#no ip ospf 1 area 0 R2(config)#no ip route 172.16.1.0 255.255.255.0 fa0/0 R2(config)#router ospf 1 R2(config-router)#no redistribute static subnets Let' change the configuration of R1 ,R2, R4 and R5: R1(config)#interface FastEthernet0/0 R1(config-if)#ip ospf 1 area 1 R2(config)#interface FastEthernet0/0 R2(config-if)#ip ospf 1 area 1 R4(config)#router ospf 1 R4(config-router)#router-id 4.4.4.4 R4(config-router)#exi R4(config)#int fa0/0 R4(config-if)#ip ospf 1 area 1 R4(config-if)#exit R4(config)#route-map CONNECTED permit R4(config-route-map)#match int fa0/1 R4(config-route-map)#router ospf 1 R4(config-router)#redistribute connected route-map CONNECTED subnet R5(config-if)#router ospf 1 R5(config-router)#router-id 5.5.5.5 R5(config-router)#int fa0/0 R5(config-if)#ip ospf 1 area 1 R4(config-if)#exi R5(config)#route-map CONNECTED permit R5(config-route-map)#match interface fa0/1 R5(config-route-map)#exi R5(config)#router ospf 1 R5(config-router)#redistribute connected route-map CONNECTED subnet
  • 21. OSPF Routing Protocol in-depth analysis 21 www.meddane.com After making these changes , as a result ,now the ASBRs are R4 and R5 , the ABRs are R1 and R2: Now R3 receives two LSAs Type 5 from R4 and R5(the ASBRs),notice the router-ID 4.4.4.4 of R4 and the router-ID 5.5.5.5 of R5 and the same Forward Address set to 0.0.0.0. R3#show ip ospf database external | include Forward Address|Advertising Router Advertising Router: 4.4.4.4 Forward Address: 0.0.0.0 Advertising Router: 5.5.5.5 Forward Address: 0.0.0.0 R3 looks the costs to reach the two ASBR R4 and R5 and finds that they are the same which is 20,notice the lines corresponding to the letters I: R3#show ip ospf border-routers OSPF Process 1 internal Routing Table Codes: i - Intra-area route, I - Inter-area route I 4.4.4.4 [20] via 10.1.13.1, FastEthernet0/0, ASBR, Area 0, SPF 15 i 1.1.1.1 [10] via 10.1.13.1, FastEthernet0/0, ABR/ASBR, Area 0, SPF 15 I 5.5.5.5 [20] via 10.1.23.2, FastEthernet0/1, ASBR, Area 0, SPF 15 i 2.2.2.2 [10] via 10.1.23.2, FastEthernet0/1, ABR/ASBR, Area 0, SPF 15 Thus R3 installs a load balancing toward 172.16.1.0 with the Forward metric of 20 ,the same cost displayed in the show ip ospf border-routers command: R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20 Last update from 10.1.13.1 on FastEthernet0/0, 00:05:33 ago Routing Descriptor Blocks: * 10.1.23.2, from 5.5.5.5, 00:05:33 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 10.1.13.1, from 4.4.4.4, 00:05:33 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 Now what happen if we configure area 1 as NSSA: R1(config)#router ospf 1 R1(config-router)#area 1 nssa R2(config)#router ospf 1 R2(config-router)#area 1 nssa R4(config)#router ospf 1 R4(config-router)#area 1 nssa R5(config)#router ospf 1 R5(config-router)#area 1 nssa Notice now R3 receives two LSAs Type 5 with the Advertising Router R1(1.1.1.1) and R2(2.2.2.2) with two Forward Addresses set to non-zero ,192.168.1.4 and 192.168.2.5 respectively : R3#show ip ospf database external | include Forward Address|Advertising Router Advertising Router: 1.1.1.1 Forward Address: 192.168.1.4 Advertising Router: 2.2.2.2 Forward Address: 192.168.2.5
  • 22. OSPF Routing Protocol in-depth analysis 22 www.meddane.com because in NSSA ,the ASBR generates an LSA Type 7 for an external subnet and advertises this LSA into NSSA,in this LSA Type-7 the ASBR set the P-bit in order to tell to the ABR to translate this LSA into an LSA Type 5 and the ASBR also set the FA to a non-zero when creating an LSA Type 7 as shown by the following outputs which show the LSAs Type 7 created by R4 and R5 ,notice the FA 192.168.1.4 for R4 and 192.168.2.5 for R5 , also notice the "Type 7/5 translation" in the Options field which means that the P-bit is set: R4#show ip ospf data nssa-external | include Forward Address|Advertising Router|Options Options: (No TOS-capability, Type 7/5 translation, DC) Advertising Router: 4.4.4.4 Forward Address: 192.168.1.4 R5#show ip ospf data nssa-external | include Forward Address|Advertising Router|Options Options: (No TOS-capability, Type 7/5 translation, DC) Advertising Router: 5.5.5.5 Forward Address: 192.168.2.5 R3 then looks the best inter-area routes to reach the two FA 192.168.1.4 and 192.168.2.5 which are through R4 and R5 respectively and finds that the costs to reach these FA are the same (20) : R3#show ip route 192.168.1.4 Routing entry for 192.168.1.0/24 Known via "ospf 1", distance 110, metric 20, type inter area Last update from 10.1.13.1 on FastEthernet0/0, 00:23:06 ago Routing Descriptor Blocks: * 10.1.13.1, from 1.1.1.1, 00:23:06 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 R3#show ip route 192.168.2.5 Routing entry for 192.168.2.0/24 Known via "ospf 1", distance 110, metric 20, type inter area Last update from 10.1.23.2 on FastEthernet0/1, 00:23:10 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:23:10 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 Thus R3 installs a load-balancing: R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20 Last update from 10.1.23.2 on FastEthernet0/1, 00:05:41 ago Routing Descriptor Blocks: 10.1.23.2, from 2.2.2.2, 00:05:41 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 * 10.1.13.1, from 1.1.1.1, 00:05:41 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 Remember the selection of the FA: 1-The selection of the FA will be: -The highest IP address from among the loopback interfaces on which OSPF is activated. -If there are no loopback interfaces, then the IP address of the physical interface on which OSPF is activated. In this case, because there is no loopback interfaces configured yet on R4 and R5, these ASBRs chooses the FA among the highest ip address of the physical interface on which OSPF is activated, 192.168.1.4 is the ip address of R4'fa0/0 and 192.168.2.5 is the ip address of R5'fa0/0.
  • 23. OSPF Routing Protocol in-depth analysis 23 www.meddane.com Now what happen if i configure one loopback interface on R4 only and activate OSPF in area 1: R4(config)#int lo0 R4(config-if)#ip address 44.44.44.44 255.255.255.0 R4(config-if)#ip ospf 1 area 1 Now the FA advertised by R4 is 44.44.44.44, R5 still advertises the FA(physical interface) 192.168.2.5: R4#show ip ospf data nssa-external | include Forward Address|Advertising Advertising Router: 4.4.4.4 Forward Address: 44.44.44.44 R5#show ip ospf data nssa-external | include Forward Address|Advertising Advertising Router: 5.5.5.5 Forward Address: 192.168.2.5 R3#show ip ospf database external | include Forward Address|Advertising Router Advertising Router: 1.1.1.1 Forward Address: 44.44.44.44 Advertising Router: 2.2.2.2 Forward Address: 192.168.2.5 Let's look the external route on R3: R3 now installs only path ,the best path to reach 172.16.1.0 is through R2. R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20 Last update from 10.1.23.2 on FastEthernet0/1, 00:02:03 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:02:03 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 When R3 received two FA ,it looks the best inter-area to reach these FA and finds that the cost to reach the FA 192.168.2.5 is 20 and the cost to reach the FA 44.44.44.44 is 21, thus R3 prefers the inter-area route toward the FA 192.168.2.5 because the lowest cost ,Because the inter-area route toward the FA 192.168.2.5 is through R2 ,thus R3 installs the path through R2 toward the external route 172.16.1.0,as shown by the following outputs: R3#show ip route 192.168.2.5 Routing entry for 192.168.2.0/24 Known via "ospf 1", distance 110, metric 20, type inter area Last update from 10.1.23.2 on FastEthernet0/1, 00:34:56 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:34:56 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 R3#show ip route 44.44.44.44 Routing entry for 44.44.44.44/32 Known via "ospf 1", distance 110, metric 21, type inter area Last update from 10.1.13.1 on FastEthernet0/0, 00:03:59 ago Routing Descriptor Blocks: * 10.1.13.1, from 1.1.1.1, 00:03:59 ago, via FastEthernet0/0 Route metric is 21, traffic share count is 1 R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 20 Last update from 10.1.23.2 on FastEthernet0/1, 00:15:56 ago
  • 24. OSPF Routing Protocol in-depth analysis 24 www.meddane.com Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:15:56 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 Let's add loopback interface on R5 and activate OSPF in area 1: R5(config)#int lo0 R5(config-if)#ip address 55.55.55.55 255.255.255.0 R5(config-if)#ip ospf 1 area 1 R3 receives two LSAs Type 5 with the FA 44.44.44.44 from R4 and 55.55.55.55 from R5: R3#$f database external | include Forward Address|Advertising Router Advertising Router: 1.1.1.1 Forward Address: 44.44.44.44 Advertising Router: 2.2.2.2 Forward Address: 55.55.55.55 R3 find that the cost to reach both FA is the same thus R3 installs a load balancing: R3#show ip route 55.55.55.55 Routing entry for 55.55.55.55/32 Known via "ospf 1", distance 110, metric 21, type inter area Last update from 10.1.23.2 on FastEthernet0/1, 00:04:56 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:04:56 ago, via FastEthernet0/1 Route metric is 21, traffic share count is 1 R3#show ip route 44.44.44.44 Routing entry for 44.44.44.44/32 Known via "ospf 1", distance 110, metric 21, type inter area Last update from 10.1.13.1 on FastEthernet0/0, 00:22:04 ago Routing Descriptor Blocks: * 10.1.13.1, from 1.1.1.1, 00:22:04 ago, via FastEthernet0/0 Route metric is 21, traffic share count is 1 R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 21 Last update from 10.1.13.1 on FastEthernet0/0, 00:05:06 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:05:06 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 10.1.13.1, from 1.1.1.1, 00:05:06 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 Now if we want to ensure that the packet goes through R2 from R3,we will suppress the FA advertised by R5 to R2 to be 0.0.0.0 instead of 55.55.55.55: R2(config-router)# area 1 nssa translate type7 suppress-fa Notice the FA of R4 is still 44.44.44.44 ,the FA of R5 is now suppressed by R2 to be 0.0.0.0: R3#$f database external | include Forward Address|Advertising Router Advertising Router: 1.1.1.1 Forward Address: 44.44.44.44 Advertising Router: 2.2.2.2 Forward Address: 0.0.0.0 R3 looks the best cost to reach either the FA 44.44.44.44 or the ASBR R2,remember R2 is the ABR so it does the translation of the LSA Type 7 to the LSA Type 5 ,thus R2 appears both as an ABR and ASBR as shown by the following output:
  • 25. OSPF Routing Protocol in-depth analysis 25 www.meddane.com The cost to reach the ABR/ASBR R2 is 10: R3#show ip ospf border-routers OSPF Process 1 internal Routing Table Codes: i - Intra-area route, I - Inter-area route i 1.1.1.1 [10] via 10.1.13.1, FastEthernet0/0, ABR/ASBR, Area 0, SPF 15 i 2.2.2.2 [10] via 10.1.23.2, FastEthernet0/1, ABR/ASBR, Area 0, SPF 15 The cost to reach the FA 44.44.44.44 is 21: R3#show ip route 44.44.44.44 Routing entry for 44.44.44.44/32 Known via "ospf 1", distance 110, metric 21, type inter area Last update from 10.1.13.1 on FastEthernet0/0, 00:17:15 ago Routing Descriptor Blocks: * 10.1.13.1, from 1.1.1.1, 00:17:15 ago, via FastEthernet0/0 Route metric is 21, traffic share count is 1 So R3 installs the best path through R2 to reach the external subnet 172.16.1.0: R3#show ip route 172.16.1.0 Routing entry for 172.16.1.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 10 Last update from 10.1.23.2 on FastEthernet0/1, 00:06:11 ago Routing Descriptor Blocks: * 10.1.23.2, from 2.2.2.2, 00:06:11 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1
  • 26. OSPF Routing Protocol in-depth analysis 26 www.meddane.com Lab 9: OSPF path selection for external route R4 and R5 redistribute between EIGRP and OSPF: R1#show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 2 Last update from 10.1.13.3 on FastEthernet0/1, 00:00:42 ago Routing Descriptor Blocks: 10.1.13.3, from 5.5.5.5, 00:00:42 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 * 10.1.12.2, from 4.4.4.4, 00:00:42 ago, via FastEthernet0/0 Route metric is 20, traffic share count is 1 The metric via both R2 and R3 is 20 (default metric for Type 2 E2) and the forward metric is =2 the cost to the ASBRs (R4 and R5) R4(config)#router ospf 1 R4(config-router)#redistribute eigrp 1 subnets metric-type 1 R1#show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 22, type extern 1 Last update from 10.1.12.2 on FastEthernet0/0, 00:00:05 ago Routing Descriptor Blocks: * 10.1.12.2, from 4.4.4.4, 00:00:05 ago, via FastEthernet0/0 Route metric is 22, traffic share count is 1 The metric now is set to 22 (20+2) Cost 2 to ASBR and Cost 20 advertised by the ASBR,the route installed now on R1 is via R2 because E1 advertised by R4 is preferred over the route E2 advertised by R5.even if we will change the metric for E1 route on R4 to be higher than E2 route advertised by R5 , we have always the route E1 via R2 installed on R1 s'routing table.
  • 27. OSPF Routing Protocol in-depth analysis 27 www.meddane.com R4(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 100 R1#show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 102, type extern 1 Last update from 10.1.12.2 on FastEthernet0/0, 00:00:17 ago Routing Descriptor Blocks: * 10.1.12.2, from 4.4.4.4, 00:00:17 ago, via FastEthernet0/0 Route metric is 102, traffic share count is 1 R4(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 100 The total cost of the route via R4 is 100+forward metric 2=102 and via R5 is 20+forward metric 2=22 R1#show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 20, type extern 2, forward metric 2 Last update from 10.1.13.3 on FastEthernet0/1, 00:00:04 ago Routing Descriptor Blocks: * 10.1.13.3, from 5.5.5.5, 00:00:04 ago, via FastEthernet0/1 Route metric is 20, traffic share count is 1 R4(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 100 R5(config-router)#redistribute eigrp 1 subnets metric-type 1 R1 chooses always the path via R5(R3) R1#show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 22, type extern 1 Last update from 10.1.13.3 on FastEthernet0/1, 00:00:04 ago Routing Descriptor Blocks: * 10.1.13.3, from 5.5.5.5, 00:00:04 ago, via FastEthernet0/1 Route metric is 22, traffic share count is 1 R1(config)#interface Fa0/0 R1(config-subif)#ip ospf cost 100 R4(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 99 R5(config-router)#redistribute eigrp 1 subnets metric-type 1 metric 198 The cost via R2 is calculated as follow: cost to R2 100+ cost the link of R4 1+99(redistributed metric)=200 The cost via R3 is calculated as follow:cost to R3 1+ cost the link of R5 1+198(redistributed metric)=200 We have load balancing on R1: R1#show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 200, type extern 1 Last update from 10.1.13.3 on FastEthernet0/1, 00:00:06 ago Routing Descriptor Blocks: 10.1.13.3, from 5.5.5.5, 00:00:06 ago, via FastEthernet0/1 Route metric is 200, traffic share count is 1 * 10.1.12.2, from 4.4.4.4, 00:00:06 ago, via FastEthernet0/0 Route metric is 200, traffic share count is 1 R4(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 99
  • 28. OSPF Routing Protocol in-depth analysis 28 www.meddane.com R5(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 198 The path via R4 is installed because 99 is less than 198 (redistributed metric) R1# show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 99, type extern 2, forward metric 101 Last update from 10.1.12.2 on FastEthernet0/0, 00:00:02 ago Routing Descriptor Blocks: * 10.1.12.2, from 4.4.4.4, 00:00:02 ago, via FastEthernet0/0 Route metric is 99, traffic share count is 1 R4(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 1 R5(config-router)#redistribute eigrp 1 subnets metric-type 2 metric 1 R1#show ip route 10.1.6.0 Routing entry for 10.1.6.0/24 Known via "ospf 1", distance 110, metric 1, type extern 2, forward metric 2 Last update from 10.1.13.3 on FastEthernet0/1, 00:04:27 ago Routing Descriptor Blocks: * 10.1.13.3, from 5.5.5.5, 00:04:27 ago, via FastEthernet0/1 Route metric is 1, traffic share count is 1 Why R1 prefer the path via R3--R5? R1 receives two LSAs Type 4 by the show ip ospf database asbr-summary 4.4.4.4 and show ip ospf database asbr-summary 5.5.5.5 commands,one from R2(2.2.2.2) with the Link State ID 4.4.4.4 (R4) and another from R3(3.3.3.3) with the Link State ID 5.5.5.5 (R5) with the same metric(the LSA Type 4 lists the cost to reach the ASBR from the ABR): R1#show ip ospf database asbr-summary 4.4.4.4 OSPF Router with ID (1.1.1.1) (Process ID 1) Summary ASB Link States (Area 0) Routing Bit Set on this LSA LS age: 1525 Options: (No TOS-capability, DC, Upward) LS Type: Summary Links(AS Boundary Router) Link State ID: 4.4.4.4 (AS Boundary Router address) Advertising Router: 2.2.2.2 LS Seq Number: 80000003 Checksum: 0x8C94 Length: 28 Network Mask: /0 TOS: 0 Metric: 1 R1#show ip ospf database asbr-summary 5.5.5.5 OSPF Router with ID (1.1.1.1) (Process ID 1) Summary ASB Link States (Area 0) Routing Bit Set on this LSA LS age: 1484 Options: (No TOS-capability, DC, Upward) LS Type: Summary Links(AS Boundary Router) Link State ID: 5.5.5.5 (AS Boundary Router address) Advertising Router: 3.3.3.3 LS Seq Number: 80000003 Checksum: 0x40D8 Length: 28 Network Mask: /0 TOS: 0 Metric: 1 Now R1 needs to know which ABR is closer, R2 or R3? This is accomplished by looking up the Type-1 Router LSA to the ABRs that are originating the Type-4 ASBR Summary LSAs. R1 look that the cost to R2:2.2.2.2 (DR) is 100 and the cost to R3 :3.3.3.3 (DR) is 1 the total cost to reach 10.1.6.0 via R2 is: cost to R2:100 + cost the link R4:1 + the redistributed metric:1=102
  • 29. OSPF Routing Protocol in-depth analysis 29 www.meddane.com The total cost via R3 is :cost to R3:1 + cost the link R5:1 + the redistributed metric:1=3 R1#show ip ospf database router 1.1.1.1 OSPF Router with ID (1.1.1.1) (Process ID 1) Router Link States (Area 0) LS age: 492 Options: (No TOS-capability, DC) LS Type: Router Links Link State ID: 1.1.1.1 Advertising Router: 1.1.1.1 LS Seq Number: 80000009 Checksum: 0xFD4C Length: 48 Number of Links: 2 Link connected to: a Transit Network (Link ID) Designated Router address: 10.1.13.3 (Link Data) Router Interface address: 10.1.13.1 Number of TOS metrics: 0 TOS 0 Metrics: 1 Link connected to: a Transit Network (Link ID) Designated Router address: 10.1.12.2 (Link Data) Router Interface address: 10.1.12.1 Number of TOS metrics: 0 TOS 0 Metrics: 100 R1 chooses the shorter path to the ASBR, which is through R1-R3-R5
  • 30. OSPF Routing Protocol in-depth analysis 30 www.meddane.com Lab 39: Understanding of Not-So-Stubby Area (NSSA) By definition when an ASBR redistributes into an NSSA area it creates a special type of link-state advertisement (LSA) which is the LSA Type 7, which can only exist in an NSSA area. Then an NSSA area border router (ABR) translates it into an LSA Type 5, this LSA Type 5 is propagated into the OSPF domain (other areas). R3 creates an LSA Type 7 for the external subnet 172.16.3.0 and is advertised to R2 by setting the P-bit options: -"Type 7/5 translation" means bit P = 1. Remember the P-bit is used in order to tell the NSSA ABR whether to translate type 7 into type 5. -If bit P = 0, then the NSSA ABR must not translate this LSA into Type 5. This happens when NSSA ASBR is also an NSSA ABR. -If bit P = 1, then the NSSA ABR must translate this type 7 LSA into a type 5 LSA. If there are multiple NSSA ABRs, the one with highest router ID. R2#show ip ospf database nssa-external OSPF Router with ID (2.2.2.2) (Process ID 1) Type-7 AS External Link States (Area 23) LS age: 25 Options: (No TOS-capability, Type 7/5 translation, DC) LS Type: AS External Link Link State ID: 172.16.3.0 (External Network Number ) Advertising Router: 3.3.3.3 LS Seq Number: 80000001 Checksum: 0x2B9
  • 31. OSPF Routing Protocol in-depth analysis 31 www.meddane.com Length: 36 Network Mask: /24 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 20 Forward Address: 10.1.3.1 External Route Tag: 0 An NSSA blocks the LSA Type 5 and Type 4 LSAs, but allows the LSAs Type 3 as shown by the database of R3: We can see that R3 receives 3 LSAs Type 3 (Summary LSAs) for the subnets 10.1.1.0 , 10.1.2.0 and 10.1.12.0 representing the inter-area routes toward these subnets. R3#show ip ospf database OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 23) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 452 0x80000003 0x0039FD 2 3.3.3.3 3.3.3.3 451 0x80000004 0x00888A 3 Summary Net Link States (Area 23) Link ID ADV Router Age Seq# Checksum 10.1.1.0 2.2.2.2 456 0x80000002 0x00E3FC 10.1.2.0 2.2.2.2 456 0x80000002 0x0056C9 10.1.12.0 2.2.2.2 456 0x80000002 0x006076 Type-7 AS External Link States (Area 23) Link ID ADV Router Age Seq# Checksum Tag 172.16.3.0 3.3.3.3 473 0x80000001 0x0002B9 0 R3 has three inter-area routes: R3#show ip route ospf 10.0.0.0/24 is subnetted, 5 subnets O IA 10.1.12.0 [110/128] via 10.1.23.2, 00:09:53, Serial0/1 O IA 10.1.2.0 [110/65] via 10.1.23.2, 00:09:53, Serial0/1 O IA 10.1.1.0 [110/129] via 10.1.23.2, 00:09:53, Serial0/1 Now we will configure the area 23 as NSSA totally stub areas. By defining the area 23 as a NSSA totally stub area ,the NSSA ABR R2 generates a default route and is advertised into the area 23. There are two ways to generate the default route on an NSSA ABR: -default-information originate keyword, The NSSA ABR generates a Type 7 LSA with the link-state ID 0.0.0.0 and is advertised into the NSSA. This default route will be propagated into the NSSA as Type 7 LSA.But The NSSA ABR still advertises the inter-area routes (LSAs Type 3). -no-summary keyword, the NSSA ABR will not advertise the inter-area routes (LSAs Type 3 and Type 4 summary) into the NSSA, instead it will advertise a default route. This default route will be propagated in the NSSA as an LSA Type 3 with the LSID 0.0.0.0
  • 32. OSPF Routing Protocol in-depth analysis 32 www.meddane.com R2(config)#router ospf 1 R2(config-router)#area 23 nssa default-information-originate The following output shown that he NSSA ABR R2 generates an LSA Type 7 with the Link State ID 0.0.0.0 ,which represents the default route. "No Type 7/5 translation" means that the P-bit is cleared and = 0 ,thus if there is another ABR ,it does not translate this LSA Type 7.In this case the P-bit is cleared because the P bit is also used as a routing loop prevention mechanism. R2#show ip ospf database nssa-external self-originate OSPF Router with ID (2.2.2.2) (Process ID 1) Type-7 AS External Link States (Area 23) LS age: 159 Options: (No TOS-capability, No Type 7/5 translation, DC) LS Type: AS External Link Link State ID: 0.0.0.0 (External Network Number ) Advertising Router: 2.2.2.2 LS Seq Number: 80000003 Checksum: 0xCCDA Length: 36 Network Mask: /0 Metric Type: 2 (Larger than any link state path) TOS: 0 Metric: 1 Forward Address: 0.0.0.0 External Route Tag: 0 Now let's looks the database of the NSSA ASBR R3: R3 receives successfully the LSA Type 7 with the LSID 0.0.0.0 from R2 (2.2.2.2),R3 still receives the LSAs Type 3 for the subnet 10.1.1.0,10.1.2.0 and 10.1.12.0: R3#show ip ospf database OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 23) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 1698 0x80000003 0x0039FD 2 3.3.3.3 3.3.3.3 1697 0x80000004 0x00888A 3 Summary Net Link States (Area 23) Link ID ADV Router Age Seq# Checksum 10.1.1.0 2.2.2.2 358 0x80000001 0x00E5FB 10.1.2.0 2.2.2.2 358 0x80000001 0x0058C8 10.1.12.0 2.2.2.2 358 0x80000001 0x006275 Type-7 AS External Link States (Area 23) Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 2.2.2.2 353 0x80000003 0x00CCDA 0 172.16.3.0 3.3.3.3 1720 0x80000001 0x0002B9 0 R3 receives the default route NSSA-external Type 2 (O*N2) and 3 inter-area routes as shown by the routing table displayed below: R3#show ip route ospf 10.0.0.0/24 is subnetted, 5 subnets O IA 10.1.12.0 [110/128] via 10.1.23.2, 00:07:48, Serial0/1
  • 33. OSPF Routing Protocol in-depth analysis 33 www.meddane.com O IA 10.1.2.0 [110/65] via 10.1.23.2, 00:07:48, Serial0/1 O IA 10.1.1.0 [110/129] via 10.1.23.2, 00:07:48, Serial0/1 O*N2 0.0.0.0/0 [110/1] via 10.1.23.2, 00:07:43, Serial0/1 Now we add the key word no-summary : R2(config-router)#area 23 nssa default-information-originate no-summary Let's looks the database of the NSSA ASBR R3: -R3 receives an LSA Type 7 with the LSID 0.0.0.0=default route. -R3 receives an LSA Type 3 with the LSID 0.0.0.0=default route. -R3 now filters the LSAs Type 3 for the subnet 10.1.1.0,10.1.2.0 and 10.1.12.0 R3#show ip ospf database OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 23) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 30 0x80000004 0x0037FE 2 3.3.3.3 3.3.3.3 6 0x80000005 0x00868B 3 Summary Net Link States (Area 23) Link ID ADV Router Age Seq# Checksum 0.0.0.0 2.2.2.2 22 0x80000001 0x00FC31 Type-7 AS External Link States (Area 23) Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 2.2.2.2 616 0x80000003 0x00CCDA 0 172.16.3.0 3.3.3.3 6 0x80000002 0x00FFBA 0 Let's looks the routing table of R3: R3 installs an inter-area default route(Default Summary Route) because an inter-area route is always preferred over the nssa external type 2 route: R3#show ip route ospf O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:04:38, Serial0/1 Let's filter the inter-area route by filtering the LSA Type 3 with filter-list feature in order to see in the routing table of R3 the default route of the Type LSA 7 instead of the default route generated by the LSA Type 3: -the seq 5 with 0.0.0.0/0 deny only a default route . -the seq 10 with 0.0.0.0/0 le 32 matches all prefixes, with prefix lengths between 0 and 32,so permit all -area 23 filter-list prefix DEFAULT in command filters the default route 0.0.0.0/0 from being sent into area 23 R2(config)#ip prefix-list DEFAULT seq 5 deny 0.0.0.0/0 R2(config)#ip prefix-list DEFAULT seq 10 permit 0.0.0.0/0 le 32 R2(config)#router ospf 1 R2(config-router)#area 23 filter-list prefix DEFAULT in In the database of R3 we can see that it receive only the LSA Type 7 with LSID 0.0.0.0, the LSA Type 3 with the LSID 0.0.0.0 does not exist: R3#show ip ospf database
  • 34. OSPF Routing Protocol in-depth analysis 34 www.meddane.com OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 23) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 2 0x80000006 0x003301 2 3.3.3.3 3.3.3.3 1 0x80000007 0x00828D 3 Type-7 AS External Link States (Area 23) Link ID ADV Router Age Seq# Checksum Tag 0.0.0.0 2.2.2.2 11 0x80000004 0x00CADB 0 172.16.3.0 3.3.3.3 2 0x80000004 0x00FBBC 0 Let's verify the routing table of R3: Now R3 installs the the nssa external type 2 default route (O*N2): R3#show ip route ospf O*N2 0.0.0.0/0 [110/1] via 10.1.23.2, 00:01:43, Serial0/1 Now we will configure NSSA Totally Stub in area 23 as follow: R2(config)#router ospf 1 R2(config-router)#no area 23 nssa default-information-originate no-summary R2(config-router)#no area 23 filter-list prefix DEFAULT in R2(config-router)#area 23 nssa no-summary R3(config-router)#area 23 nssa And redistribution between OSPF and EIGRP on R2: R2: router eigrp 24 redistribute ospf 1 metric 1 1 1 1 1 ! router ospf 1 redistribute eigrp 24 subnets Let's looks the database of R3: R3 receives four LSAs Type 7 from R2 for the subnets 192.168.24.0 , 192.168.40.0 , 192.168.41.0 and 192.168.42.0 and one LSA Type 3 Default route because the area 23 is configured as NSSA totally stub and R2 is configured with the key word no-summary: R3#show ip ospf database OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 23) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 961 0x80000006 0x003301 2 3.3.3.3 3.3.3.3 959 0x80000007 0x00828D 3 Summary Net Link States (Area 23) Link ID ADV Router Age Seq# Checksum 0.0.0.0 2.2.2.2 299 0x80000001 0x00FC31 Type-7 AS External Link States (Area 23) Link ID ADV Router Age Seq# Checksum Tag
  • 35. OSPF Routing Protocol in-depth analysis 35 www.meddane.com 172.16.3.0 3.3.3.3 960 0x80000004 0x00FBBC 0 192.168.24.0 2.2.2.2 523 0x80000001 0x00D440 0 192.168.40.0 2.2.2.2 73 0x80000001 0x0024E0 0 192.168.41.0 2.2.2.2 73 0x80000001 0x0019EA 0 192.168.42.0 2.2.2.2 73 0x80000001 0x000EF4 0 If we look these LSAs Type 7 in depth we can see that the P-bit is cleared: Notice the line "No Type 7/5 translation". "No Type 7/5 translation" means that the P-bit is cleared and = 0 ,thus if there is another ABR or if we configure R3 as an ABR ,it does not translate these LSAs Type 7 and they are not propagated beyond the NSSA area . The type-7 originated by the NSSA area border router must have the P-bit cleared so that these routes originated by the NSSA area border router will not find its way out of the NSSA into the rest of the AS system via another NSSA area border router. R3#show ip ospf database nssa-external adv-router 2.2.2.2 | include Options|Link State ID Options: (No TOS-capability, No Type 7/5 translation, DC) Link State ID: 192.168.24.0 (External Network Number ) Options: (No TOS-capability, No Type 7/5 translation, DC) Link State ID: 192.168.40.0 (External Network Number ) Options: (No TOS-capability, No Type 7/5 translation, DC) Link State ID: 192.168.41.0 (External Network Number ) Options: (No TOS-capability, No Type 7/5 translation, DC) Link State ID: 192.168.42.0 (External Network Number ) R3 installs four nssa external type 2 routes : R3#show ip route ospf O N2 192.168.42.0/24 [110/20] via 10.1.23.2, 00:00:15, Serial0/1 O N2 192.168.24.0/24 [110/20] via 10.1.23.2, 00:03:56, Serial0/1 O N2 192.168.40.0/24 [110/20] via 10.1.23.2, 00:00:15, Serial0/1 O N2 192.168.41.0/24 [110/20] via 10.1.23.2, 00:00:15, Serial0/1 O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:04:01, Serial0/1 Because we have already one default inter-area route advertised by R2 into NSSA because the Totally Stub ,we can avoid to inject the external routes learned from EIGRP Domain into the NSSA (area 23) as type 7 by adding the key-word no- redistribution in R2,so no need to have an external routes in R3 instead to reach them it will use the default route O*IA : router ospf 1 R2(config-router)#area 23 nssa no-summary no-redistribution The LSAs Type 7 for 192.168.24.0 ,192.168.40.0 , 192.168.41.0 and 192.168.42.0 do not appear now in the databse of R3: R3#show ip ospf database OSPF Router with ID (3.3.3.3) (Process ID 1) Router Link States (Area 23) Link ID ADV Router Age Seq# Checksum Link count 2.2.2.2 2.2.2.2 1844 0x80000006 0x003301 2 3.3.3.3 3.3.3.3 1843 0x80000007 0x00828D 3 Summary Net Link States (Area 23) Link ID ADV Router Age Seq# Checksum 0.0.0.0 2.2.2.2 22 0x80000002 0x00FA32
  • 36. OSPF Routing Protocol in-depth analysis 36 www.meddane.com Type-7 AS External Link States (Area 23) Link ID ADV Router Age Seq# Checksum Tag 172.16.3.0 3.3.3.3 1844 0x80000004 0x00FBBC 0 Therfore we have only one route OSPF on R3 which is an inter-area default route advertised by R2: R3#show ip route ospf O*IA 0.0.0.0/0 [110/65] via 10.1.23.2, 00:01:47, Serial0/1 R3#ping 192.168.24.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.24.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/21/48 ms R3#ping 192.168.40.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.40.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/20/44 ms R3#ping 192.168.41.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.41.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/16/44 ms R3#ping 192.168.42.4 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.42.4, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 4/17/52 ms
  • 37. OSPF Routing Protocol in-depth analysis 37 www.meddane.com Part III : Appendixes Reference RFC3101 Notes
  • 38. OSPF Routing Protocol in-depth analysis 38 www.meddane.com END