OSPF Explained Step By Step With Practicals From CCNA To CCIE Level
In OSPF cost will calculate for 100mbps and higher bandwidth links will be 1, to get proper cost for every link we use reference bandwidth.
Default Metric Calcualtion is 10*5/bandwidth
Check the Cost in OSPF
Router ospf interface cost
R3#show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Gi4/0 1 1 32.0.0.3/8 1 DR 1/1
Fa1/1 1 1 36.0.0.3/8 1 BDR 1/1
Fa1/0 1 1 23.0.0.3/8 1 DR 1/1
Fa0/0 1 2 35.0.0.3/8 1 BDR 1/1
Here we can see all interfaces who have 100mbps or more than 100 mbps, they have same cost calculated
Now enable the reference bandwidth in Mbps 10000 (so it will use the calculation as per 10*7/bandwidth)
Reference bandwidth with 10000Mbps
router ospf 1
auto-cost reference-bandwidth 10000
exit
When we enable reference bandwidth, we make sure to have consistent bandwidth across all routers to have a stable path metric calculation.
Check the Cost in OSPF
Router ospf interface cost
R3#show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Gi4/0 1 1 32.0.0.3/8 10 DR 1/1
Fa1/1 1 1 36.0.0.3/8 100 BDR 1/1
Fa1/0 1 1 23.0.0.3/8 100 DR 1/1
Fa0/0 1 2 35.0.0.3/8 100 BDR 1/1
Now we can see a different metric calculation for all the interfaces.
Now enable the reference bandwidth in Mbps 100000 (so it will use the calculation as per 10*8/bandwidth)
Reference bandwidth with 100000Mbps
router ospf 1
auto-cost reference-bandwidth 100000
exit
When we enable reference bandwidth, we make sure to have consistent bandwidth across all routers to have a stable path metric calculation.
Check the Cost in OSPF
Router ospf interface cost
R3#show ip ospf interface brief
Interface PID Area IP Address/Mask Cost State Nbrs F/C
Gi4/0 1 1 32.0.0.3/8 100 DR 1/1
Fa1/1 1 1 36.0.0.3/8 1000 BDR 1/1
Fa1/0 1 1 23.0.0.3/8 1000 DR 1/1
Fa0/0 1 2 35.0.0.3/8 1000 BDR 1/1
Now we can see a different metric calculation for all the interfaces.
In OSPF when we do the summarization, so we have 2 point where we can do the summarization and summarization can be done only for LSA3 and LSA5
1. On ABR To summerize LSA-3
2. On ASBR To summerize LSA-5
A summary of inter-area routes:
* Is generated if at least one subnet within the area falls in the summary address range.
* Has a metric equal to the lowest cost of all subnets within the summary address range.
* Will have a route to Null 0 to avoid loops.
A summary of external routes:
* ASBRs can summarize external routes.
* A summary route to Null 0 will be created for each summary range.
To create summary addresses for OSPFv2 at an AS boundary, use the summary-address command in the router configuration mode.
In OSPFv3, summarization of redistributed networks is configured using the summary-prefix command in the address-family section of the router ospfv3 configuration mode
OSPF has a solution to extend the reach of the backbone across other areas. This solution is called the virtual link. It provides an extension to the OSPF backbone and allows a router to connect logically to the backbone, even though there is no direct physical link. Between the two routers that are involved in the creation of the virtual link, there is a nonbackbone area. The routers at each end become part of the backbone, and both act as ABRs.
Virtual links are not allowed in STUB Area and NSSA Area
Virtual links are used for two purposes:
* An extension to the backbone—Links an area that does not have a physical connection to the backbone.
* Repair a discontiguous Area 0—Patch the backbone in case a discontinuity with Area 0 occurs
Router-R5 Database before enabling Virtual Link
Router-5 Database
R5#show ip ospf database
OSPF Router with ID (5.5.5.5) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 12 0x80000002 0x00D9F1 1
5.5.5.5 5.5.5.5 11 0x80000002 0x004D47 2
Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
35.0.0.5 5.5.5.5 11 0x80000001 0x004F8E
Router-R3 OSPF neighbor before enabling Virtual link
Router-R3 Neighbor status
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
6.6.6.6 1 FULL/DR 00:00:38 36.0.0.6 FastEthernet1/1
2.2.2.2 1 FULL/BDR 00:00:38 23.0.0.2 FastEthernet1/0
5.5.5.5 1 FULL/DR 00:00:30 35.0.0.5 FastEthernet0/0
Now we need to enable Virtual link in between Router 3 and ABR (will take R2)
Router-2 (ABR) Router-ID 2.2.2.2
router ospf 1
area 1 virtual-link 3.3.3.3
exit
Router-3 Router ID 3.3.3.3
router ospf 1
area 1 virtual-link 2.2.2.2
exit
Router-R3 OSPF neighbor after enabling Virtual link
Router-R3 Neighbor status
R3#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:33 23.0.0.2 OSPF_VL1
6.6.6.6 1 FULL/DR 00:00:37 36.0.0.6 FastEthernet1/1
2.2.2.2 1 FULL/BDR 00:00:38 23.0.0.2 FastEthernet1/0
5.5.5.5 1 FULL/DR 00:00:39 35.0.0.5 FastEthernet0/0
Router-R5 database afer enabling Virtual link
Router-R5 database
R5#show ip ospf database
OSPF Router with ID (5.5.5.5) (Process ID 1)
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
3.3.3.3 3.3.3.3 157 0x80000005 0x00D6F0 1
5.5.5.5 5.5.5.5 573 0x80000002 0x004D47 2
Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
35.0.0.5 5.5.5.5 573 0x80000001 0x004F8E
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 3.3.3.3 147 0x80000001 0x001F0B
2.2.2.2 3.3.3.3 157 0x80000001 0x00E640
3.3.3.3 3.3.3.3 158 0x80000001 0x00AE75
4.4.4.4 3.3.3.3 143 0x80000002 0x00928A
6.6.6.6 3.3.3.3 143 0x80000002 0x002CE9
12.0.0.0 3.3.3.3 147 0x80000001 0x00A67C
14.0.0.0 3.3.3.3 147 0x80000001 0x009689
23.0.0.0 3.3.3.3 157 0x80000001 0x000D0C
36.0.0.0 3.3.3.3 157 0x80000001 0x0063A8
46.0.0.0 3.3.3.3 143 0x80000002 0x00E817
Whenever we enable virtual link between routers, so new ABR router (R3 in our case) will install other area route with label (DNA) Do not age, these other area routes will no longer support Age concept, they will stuck on the same timer and will not flush even after 3600 sec
This concept is used to prevent unknown flooding on virtual link neighborship.