OSPF
Introduction
- Attributes:
Type | Link-State |
Algorithm | Dijkstra |
Metric | Cost (Bandwidth) |
AD | 110 |
Standard | RFC 2328, RFC 2740 |
Protocols | IP |
Transport | IP/89 |
Authentication | Plaintext, MD5 |
AllSPF Address | 224.0.0.5 |
AllDR Address | 224.0.0.6 |
- OSPF Hello Packet has TTL=1. It cannot cross a hop.[1]
- Change AD in OSPF:
#router ospf 1 #distance 250 (useful in Protocol Migration) #distance 255 (invalid; do not use these routes)
- Various Packet types in OSPF:
Type | Packet Name | Description |
---|---|---|
1 | Hello | Discovers Neighbors & builds adjacencies between them |
2 | Database Description(DBD) | Checks for database sync between routers |
3 | Link-State request(LSR) | Requests specific link-state records from other router |
4 | LSU | Sends specifically requested link-state records |
5 | LSAck | Acknowledges the other packet types |
- OSPF has 3 databases which are used to create 3 Tables:
Database | Table Name | Description |
---|---|---|
Adjacency Database | Neighbor Table |
|
Link-State Database | Topology Table |
|
Forwarding Database | Routing Table |
|
- DR/BDR Election
The DR serves as a common point for all adjacencies on a multiaccess segment The BDR also maintains adjacencies with all routers in case the DR fails Election does not occur on point-to-point or multipoint links Default priority (0-255) is 1 Highest priority wins 0 cannot be elected In case of tie, Router with Highest Router ID wins election DR preemption will not occur unless the current DR is reset
- Virtual Links
Tunnel formed to join two areas across an intermediate Both end routers must share a common area At least one end must reside in area 0 Cannot traverse stub areas area 2 virtual-link 10.0.34.2
- Metric Formula
This can be modifiable with cmd:
ospf auto-cost reference-bandwidth
- To change route cost in OSPF:
ip ospf cost
- What is a Demand Circuit?
This section is under construction. |
Area Summary
- Standard areas can contain LSAs of type 1, 2, 3, 4, and 5, and may contain an ASBR. The backbone is considered a standard area.
- Stub areas can contain type 1, 2, and 3 LSAs. A default route is substituted for external routes.
- Totally stubby areas can only contain type 1 and 2 LSAs, and a single type 3 LSA. The type 3 LSA describes a default route, substituted for all external and inter-area routes.
- Not-so-stubby areas implement stub or totally stubby functionality yet contain an ASBR. Type 7 LSAs generated by the ASBR are converted to type 5 by ABRs to be flooded to the rest of the OSPF domain.
LSA
- LSA Details:
LSA type | Name | Description |
---|---|---|
Type 1 | Router LSAs | Sent from a router to other routers in the same area. It contains information regarding the routers interfaces in the same area, relevant interfaces IPs, its adjacent routers on those interfaces and sub networks |
Type 2 | Network LSAs | Represents the pseudonode (designated router) for a multiaccess link. Generated by the DR on a multi access segment, and provides similar information to an LSA type 1 for the multi access segment and subnet which it belongs |
Type 3 | Network Summary LSA | Generated by ABRs and contain the subnets & costs but omit the topological data from all subnets in one area and sent to another area via the ABR |
Type 4 | ASBR summary LSA | Represents ASBRs and are identical in structure to a type 3 LSA and sent when crossing an AS boundary |
Type 5 | AS external LSA | Originated by ASBRs and describe a route external to the OSPF domain |
Type 7 | NSSA External LSA | Used in stub areas in place of a type 5 LSA. Generated by the ASBR in an NSSA area |
- LSA as per Areas[2]:-
Adjacency
- OSPF neighbor requirements:
- Router should be in same area
- Router should have same authentication config
- Router should be on same subnet
- Router have same hello/dead interval
- Router have matching stub flags
- Difference between Adjacency & Neighbor:
- Only Adjacent Routers can sync Link State DB
- Point-to-Point Links: If Neighbors, Adjcency automatically established
- Broadcast Link: Adjacency established with DR & BDR only, rest are in 2-way state[3]
- Point-to-Multipoint:_________
- Neighbor means Physical Connectivity(Direct)
- Adjacency means Database Syncronization
- Neighbor Requirements:
- Hello exchange => Subnet Mask, Subnet Number, Hello/Dead Interval, Area ID, Authentication must match.
- Exchange hellos but not LSAs(2-Way State).
- Adjacency Requirements:
- Exchange LSAs
- Both routers are in Stable(Full) State.
- Still final LSDB is same even in Neighbors as well as Adjacent routers.
Neighbor States[4]
State | Details |
---|---|
1. Down |
|
2. Attempt |
|
3. Init |
|
4. 2-Way |
|
5. ExStart |
|
6. Exchange |
|
7. Loading |
|
8. Full |
|
LAB
Troubleshooting
- If OSPF is stuck in INIT State, check Netmask, Hello/Dead Timer, Area ID, Authentication password.
- On a shared/ethernet network, only 2 router, DR & BDR will form full relationship, all others will stay in 2-way state.[5]
- If OSPF is stuck in ExStart State, MTU mismatch may be the cause, as it is requirement to successfully pass DBD Packets.
Matching MTU is not a Adjacency Requirement, but is required to successfully pass Database Descriptor Packets
- In OSPF, MTU Mismatch causes neighbors swinging between ExStart state to Down state
Mar 1 00:10:09.535: %OSPF-5-ADJCHG: Process 1, Nbr 10.10.10.1 on Ethernet0/0 from EXSTART to DOWN, Neighbor Down: Too many retransmissions
Complete OSPF Lab
This section is under construction. |
References
{{#widget:DISQUS |id=networkm |uniqid=OSPF |url=https://aman.awiki.org/wiki/OSPF }}