CCNA NOTES 8 # OSPF Complete Reference Guide for CCNA & CCNP | Areas, LSAs, DR/BDR & Configuration
OSPF Network Protocol Reference Notes
OSPF
OPEN SHORTEST PATH FIRST — COMPLETE REFERENCE
01Protocol Overview
Metric
100 / BW
Cost = 100 ÷ Interface BW (Mbps)
Algorithm
SPF
Dijkstra Shortest Path First
Key concept — Routes are never directly advertised. Complete topology data (LSAs) floods the domain. Each router independently runs SPF to calculate its best paths.
| Interface | Speed | Default Cost |
|---|---|---|
| Ethernet | 10 Mbps | 10 |
| FastEthernet | 100 Mbps | 1 |
| Serial (T1) | 1.544 Mbps | 64 |
02Areas & Router Types
Rule — Area 0 is the backbone and must be central. All non-backbone areas must connect to Area 0, directly or via a Virtual Link. Only one Area 0 per domain.
| Router Type | Definition | Generates |
|---|---|---|
| Backbone Router | All interfaces in Area 0 | LSA 1 |
| Non-Backbone Router | All interfaces in a non-backbone area | LSA 1 |
| ABR | Interface in Area 0 + at least one other area. Holds full LSDB of each connected area. | LSA 3, 4 |
| ASBR | Connects OSPF to an external AS. Redistributes external routes into OSPF. | LSA 5 |
03Process ID & Router ID
Process ID Range
1 – 65535
Locally significant · never advertised
Router ID Format
32-bit
Looks like an IP · unique within area
| Priority | RID Election Method |
|---|---|
| 1st | Manually configured Router ID |
| 2nd | Highest Loopback interface IP address |
| 3rd | Highest physical interface IP (even if not OSPF-enabled) |
04Neighborship Requirements
Same Subnet & MaskSame Area IDUnique Router IDHello/Dead Timers matchMTU matchAuthentication match
| Timer | Broadcast / P2P | Non-Broadcast / Multipoint |
|---|---|---|
| Hello Interval | 10 sec | 30 sec |
| Dead Interval | 40 sec | 120 sec |
| Wait Timer | 40 sec | 120 sec |
05Packet Types & Tables
| # | Type | Purpose |
|---|---|---|
| 1 | Hello | Neighbor discovery, keepalive, DR/BDR election |
| 2 | DBD | Database Description — LSA headers exchanged |
| 3 | LSR | Request missing or outdated LSA details |
| 4 | LSU | Carries full LSA data in response to LSR |
| 5 | LSAck | Confirms receipt of LSU |
Neighbor TableTopology / LSDB TableRouting Table (RIB)
06Neighbor States
Down
›Init
›2-Way
›ExStart
›Exchange
›Loading
›Full ✓
| State | What happens |
|---|---|
| Down | No Hellos sent or received. Interface or process is down. |
| Init | Hello sent but own RID not yet seen in neighbor's Hello. One-way only. |
| 2-Way | Own RID seen in neighbor's Hello. DR/BDR election occurs here on BMA networks. |
| ExStart | Null DBD exchanged. Master/Slave election — higher RID wins. MTU & sequence negotiated. |
| Exchange | DBD packets (LSA headers only) exchanged. Both learn what the other has. |
| Loading | LSRs sent for missing info. Slave responds with LSUs. Acknowledged with LSAck. |
| Full ✓ | LSDB fully synchronized. Adjacency established. Wait timer = 40 sec. |
07DR & BDR Election
Why elect? Full-mesh adjacency on BMA networks requires n(n−1)/2 adjacencies. DR/BDR reduces this — DROthers form adjacency only with DR & BDR. Election is non-preemptive. Priority 0 = permanently ineligible.
Designated Router
R1
Priority: 100
DR
Backup DR
R2
Priority: 50
BDR
Other
R3
Priority: 1
DROther
224.0.0.5
All OSPF Routers — everyone receives
224.0.0.6
DR and BDR only — DROthers send here
If DR fails → BDR automatically becomes DR, then a new BDR is elected. No DR/BDR on Point-to-Point segments.
08LSA Types
Type 1
Router LSA
Generated byEvery router
ScopeSame area only
LSIDOriginator RID
Type 2
Network LSA
Generated byDR only
ScopeSame area only
LSIDDR interface IP
Type 3
Summary LSA
Generated byABR
ScopeInter-area
LSIDNetwork ID
Type 4
ASBR Summary
Generated byABR
ScopeAreas without ASBR
LSIDASBR Router ID
Type 5
AS-External LSA
Generated byASBR
ScopeAll areas (non-stub)
LSIDExternal Network
09Virtual Link & Redistribution
Virtual Link — A logical tunnel over a transit area to connect a disconnected area to Area 0. Configured between two ABRs using Router IDs. Transit area must be a normal area (not stub).
! Virtual Link — on R2 (ABR: Area 0 ↔ Area 1) router ospf 1 area 1 virtual-link <R3-Router-ID> ! Virtual Link — on R3 (ABR: Area 1 ↔ Area 2) router ospf 1 area 1 virtual-link <R2-Router-ID> ! Redistribution (on ASBR) router ospf 1 redistribute static subnets ! static → OSPF redistribute connected subnets ! connected → OSPF
Redistributed routes become LSA Type 5. Always use the subnets keyword to include classless (VLSM) networks.
10Configuration & Verification
! Basic OSPF setup router ospf 1 router-id 1.1.1.1 network 192.168.1.0 0.0.0.255 area 0 ! Timer tuning interface fa0/1 ip ospf hello-interval 20 ! Dead = 4 × Hello ip mtu 1400 ! range: 68 – 1500 ! Authentication (plain text) interface fa0/1 ip ospf authentication ip ospf authentication-key CISCO ! DR Priority interface fa0/0 ip ospf priority 100 ! 0 = ineligible
! Verification show ip protocols show ip ospf neighbor show ip ospf database show ip route show ip ospf interface debug ip ospf events ! live event logs clear ip ospf process ! reset: Down → Full
Comments
Post a Comment