Review of OSPF
Fundamentals
OSPF Fundamentals
• OSPF is an open standard
• OSPF is a Link State routing protocol
• Every router has a “map” of the network,
called a Link State Database
• OSPF runs the Dijkstra Algorithm to
determine the shortest path to a network
OSPF Terminology
•Hello: A protocol used to discover OSPF neighbors and confirm reachability to those
neighbors (also used in the election of a Designated Router)
•Link State Advertisement (LSA): Information a router sends and receives about network
reachability (used to construct a router’s Link State Database)
• Link State Update (LSU): A packet that carries LSAs
•Link State Request (LSR): Used by a router to request specific LSA information from a
neighbor
• Link State Acknowledgement (LSAck): Used by a router to confirm it received an LSU
Neighborship vs. Adjacencies
Neighbors are routers that:
• Reside on the same network link
• Exchange Hello messages
Router Switch Router
Hello ([Link])
Adjacencies are routers that: Hello ([Link])
• Are neighbors
• Have exchanged Link State Updates (LSUs) and Database Description (DD) packets
Router Switch Router
Hello
Hello
Database Description
Database Description
Link State Update
Link State Update
Neighborship Requirements
• Matching Area
• Matching Authentication
• Matching Subnet
• Matching Timers
• Matching Stub Flags
• Matching MTU (EXSTART/EXCHANGE State)
The Need for Designated Routers
R1 R2
R3 R4
R5 R6
# of Adjacencies = [n * (n - 1)] / 2, where n is the number of routers.
The Need for Designated Routers
Adjacencies only need to be formed with the DR and BDR.
DR R1 R2 BDR
R3 R4
R5 R6
• [Link] or FF02::5 - All OSPF routers
• [Link] or FF02::6 - All designated routers
DR and BDR Election
Highest Router Priority Wins
• Carried in Hello packet
• Configured in interface configuration mode:
- Router(config-if)# ip ospf priority number
- A priority of 0 prevents a router from participating in the election.
R4
TIE BREAKER: Highest Router ID Wins
• Configured in router configuration mode:
- Router(config-router)# router-id id
• If there’s no configured Router ID, the highest IP address on a Loopback interface wins.
• If there’s no Loopback interface, the highest IP address on an interface that’s up wins.
OSPF Areas
Area Border Routers
R2
(ABRs)
R8
R1 R3 R7 R9
Area 1 Area 2
R5
R4 R6
Area 0
OSPF Timers
•Hello Timer: The interval (in seconds) at which a router sends
Hello messages out of an OSPF-enabled interface
• Dead Timers: The time (in seconds) that an OSPF-enabled
interface will wait to receive a Hello message from a neighbor,
before considering that neighbor to be down
• Dead Timer = Hello Timer * 4
• Timers must match between neighbors
OSPF Metric
Calculation
OSPF Cost
Cost = Reference BW / Interface BW
The default reference bandwidth is 100,000,000 bits per second (100 Mbps).
Cost = 100 Mbps / 100 Mbps = 1
R2 Cost for R1-R2-R3 = 1 + 1 + 1 = 3
Cost for R1-R3 = 10 + 1 = 11
100 Mbps Cost = 1 100 Mbps
Cost = 1
R1 Cost = 100 Mbps / 10 Mbps = 10 R3
Cost = 10 10 Mbps
100 Mbps 100 Mbps Cost = 1
SW1 SW2
PC1 [Link] /24 [Link] /24
PC2
OSPF Network Types
Broadcast Network Type
R1
R2 SW1 R3
• Broadcast is the default OSPF network type for any Ethernet interface.
• DR and BDR routers are elected.
• Default HELLO interval: 10 seconds.
Point-to-Point Network Type
R1 R2
• Point-to-Point is the default OSPF network type on a non-Frame Relay serial interface.
• DR and BDR routers are not elected.
• Default HELLO interval: 10 seconds.
Non-Broadcast (NBMA) Network Type
R2
Frame
R1 Relay R3
• NBMA is the default OSPF network type on a physical Frame
Relay serial interface.
• DR and BDR routers are elected. R4
• Uses the neighbor command to specify a neighbor’s IP
address.
• Default HELLO interval: 30 seconds.
Point-to-Multipoint Network Type
R2
R1 R3
• Replicates packets to send to neighbors.
• Treats each PVC as a Point-to-Point link. R4
• DR and BDR routers are not elected.
• Default HELLO interval: 30 seconds.
Valid OSPF Network Types for Peers
R2
• Broadcast - Broadcast
• Non-Broadcast - Non-Broadcast
Frame
R1 Relay R3
• Point-to-Point - Point-to-Point
• Broadcast - Non-Broadcast (requires timer adjustment)
• Point-to-Point to Point-to-Multipoint (requires timer adjustment)
R4
OSPF LSAs and Area
Types
Area 0 LSA Types Area 1
Type 1 LSA Type 1 LSA
Type 2 LSA ABR
R1R1 R2
R2 R3
Type 3 LSAs
• Type 1 LSA: A Router LSA is created by each router and contains information about that router’s directly attached networks.
• Type 2 LSA: A Network LSA is created for each transit network within an area on which a DR is elected.
• Type 3 LSA: A Summary LSA is sent from one area to another and is used to advertise a network in the source area.
Area 0 LSA Types Area 1
Type 1 LSA Type 1 LSA
ASBR Type 2 LSA ABR
EIGRP R1R1 R2
R2 R3
Type 3 LSAs
Type 5 LSA Type 5 LSA
Type 4 LSA
• Type 1 LSA: A Router LSA is created by each router and contains information about that router’s directly attached networks.
• Type 2 LSA: A Network LSA is created for each transit network within an area on which a DR is elected.
• Type 3 LSA: A Summary LSA is sent from one area to another and is used to advertise a network in the source area.
• Type 4 LSA: A Summary ASBR LSA is created by an ABR to tell members of an area how to reach an ASBR.
• Type 5 LSA: An AS External LSA is created by and ASBR to advertise networks in a different AS.
Area 0 LSA Types Area 1
Type 1 LSA Type 1 LSA
ASBR Type 2 LSA ABR
EIGRP R1R1 Type 3 LSAs R2
R2 Type 3 LSAs R3
Type 3 Default LSA
Type 5 LSA STUB AREA
• Type 1 LSA: A Router LSA is created by each router and contains information about that router’s directly attached networks.
• Type 2 LSA: A Network LSA is created for each transit network within an area on which a DR is elected.
• Type 3 LSA: A Summary LSA is sent from one area to another and is used to advertise a network in the source area.
• Type 4 LSA: A Summary ASBR LSA is created by an ABR to tell members of an area how to reach an ASBR.
• Type 5 LSA: An AS External LSA is created by and ASBR to advertise networks in a different AS.
Area 0 LSA Types Area 1
Type 1 LSA Type 1 LSA
ASBR Type 2 LSA ABR
EIGRP R1R1 Type 3 LSAs R2
R2 Type 3 LSAs R3
Type 5 LSA
Type 3 Default LSA TOTALLY STUBBY
STUB AREA
AREA
• Type 1 LSA: A Router LSA is created by each router and contains information about that router’s directly attached networks.
• Type 2 LSA: A Network LSA is created for each transit network within an area on which a DR is elected.
• Type 3 LSA: A Summary LSA is sent from one area to another and is used to advertise a network in the source area.
• Type 4 LSA: A Summary ASBR LSA is created by an ABR to tell members of an area how to reach an ASBR.
• Type 5 LSA: An AS External LSA is created by and ASBR to advertise networks in a different AS.
Area 0 LSA Types Area 1
Type 1 LSA Type 1 LSA
ASBR Type 2 LSA ABR
EIGRP R1R1 Type 3 LSAs R2
R2 Type 3 LSAs R3
Type 3 Default LSA
Type 5 LSA STUB AREA
• Type 1 LSA: A Router LSA is created by each router and contains information about that router’s directly attached networks.
• Type 2 LSA: A Network LSA is created for each transit network within an area on which a DR is elected.
• Type 3 LSA: A Summary LSA is sent from one area to another and is used to advertise a network in the source area.
• Type 4 LSA: A Summary ASBR LSA is created by an ABR to tell members of an area how to reach an ASBR.
• Type 5 LSA: An AS External LSA is created by and ASBR to advertise networks in a different AS.
Area 0 LSA Types Area 1
Type 1 LSA Type 1 LSA
ASBR Type 2 LSA ABR ASBR
EIGRP R2 R3
RIP
R1R1 Type 3 LSAs R2 Type 3 LSAs
Type 5 LSA Type 3 Default LSA NOT-SO-STUBBY
TOTALLY STUBBY
Type 5 LSA
AREAAREA
(NSSA)
Type 4 LSA Type 7 LSA
• Type 1 LSA: A Router LSA is created by each router and contains information about that router’s directly attached networks.
• Type 2 LSA: A Network LSA is created for each transit network within an area on which a DR is elected.
• Type 3 LSA: A Summary LSA is sent from one area to another and is used to advertise a network in the source area.
• Type 4 LSA: A Summary ASBR LSA is created by an ABR to tell members of an area how to reach an ASBR.
• Type 5 LSA: An AS External LSA is created by and ASBR to advertise networks in a different AS.
• Type 7 LSA: An NSSA LSA is sent from an ASBR into an NSSA to advertise networks from a different AS.
Area 0 LSA Types Area 1
Type 1 LSA Type 1 LSA
ASBR Type 2 LSA ABR ASBR
EIGRP R2 R3
RIP
R1R1 Type 3 LSAs R2 Type 3 LSAs
Type 5 LSA Type 3 Default LSA NOT-SO-STUBBY
Type 5 LSA TOTALLY NSSA
AREA (NSSA)
Type 4 LSA Type 7 LSA
• Type 1 LSA: A Router LSA is created by each router and contains information about that router’s directly attached networks.
• Type 2 LSA: A Network LSA is created for each transit network within an area on which a DR is elected.
• Type 3 LSA: A Summary LSA is sent from one area to another and is used to advertise a network in the source area.
• Type 4 LSA: A Summary ASBR LSA is created by an ABR to tell members of an area how to reach an ABR.
• Type 5 LSA: An AS External LSA is created by and ASBR to advertise networks in a different AS.
• Type 7 LSA: An NSSA LSA is sent from an ASBR into an NSSA to advertise networks from a different AS.
OSPFv2
Configuration
OSPF Virtual Links
OSPF Virtual Links
Virtual Link
Lo0: [Link] /32
Lo0: [Link] /32 Lo0: [Link] /32
Gig 0/2
Gig 0/2
Gig 0/2
Gig 0/1
Gig 0/1
Gig 0/1
SW1 .1 R1 .1 .2 R2 .1 .2 R3 .1 SW2
[Link] /24 [Link] /30 [Link] /30 [Link] /24
Area 0 Area 1 Area 2
• All OSPF areas must be adjacent to the backbone area (Area 0 or Area [Link]) physically or logically.
• An OSPF Virtual Link logically spans a transit area (Area 1 in this topology).
• Routing updates are tunneled, while data is sent natively, resulting in no tunnel overhead for data.
• The transit area must not be a stub area.
OSPF Route
Summarization
Route Summarization Options
OSPF Summarization
Options
• ABR: area range
• ASBR: summary-address
ABR ASBR
OSPFv3 Traditional
Configuration
OSPFv3 Address
Families
Configuration