Professional Documents
Culture Documents
Introduction To OSPF
Manjunath Krishna
Objectives 2
Vendor Neutral
Rise of MPLS
IP FAST REROUTE
Administrative Distance
• Default Administrative Distance for OSPF is 110
12
Z’s Link-state
Q’s Link-state
Z
A Q 2
B Z 13
Q Y X 13
C
Topology information is
X stored in a DB separate
X’s Link-state from the routing table
Link-State Routing 15
• Neighbor discovery
• Construct a Link State Packet (LSP)
• Distribute the LSP
– Link State Announcement – LSA
• Route calculation
• If a link fails
– Flood new LSPs
– All routers recalculate their routing tables
Low Bandwidth Utilization 16
OSPF Routers
LSA
X R1
LSA
R2
R3
N1 R1 N5
Cost = 10
R4
N4 Cost = 10
Fast Convergence 18
R2
Alternate Path
N1
R1
X R3
N2
Primary Path
Fast Convergence 19
• Multi-Access networks
– All routers must accept packets sent to the AllSPFRouters (224.0.0.5)
address
– All DR and BDR routers must accept packets sent to the AllDRouters
(224.0.0.6) address
• Hello packets are sent to the AllSPFRouters address (Unicast
for point-to-point and virtual links)
21
OSPF Areas
OSPF Areas 25
• Group of contiguous
nodes/networks
• Per area topology DB
Area 2 Area 3
– Invisible outside the area
– Reduces routing traffic
Area 0
• Backbone Area is contiguous Backbone Area
– All others areas must connect to the
backbone
• Virtual Links
Area 1
Area 4
26
OSPF States
OSPF States 27
OSPF States 28
29
Types OF Routers
Router Classification 30
IR
Area 2 Area 3
ABR/BR
Area 0
• Internal Router (IR)
IR/BR • Area Border Router (ABR)
ASBR
• Backbone Router (BR)
To another AS • Autonomous System Border
Area 1 Router (ASBR)
31
Types OF Routes
OSPF Route Types 32
External Route
– Routes imported into OSPF from
another protocol or Static routes
33
DR/BDR Election
Designated Router (DR) 34
Designated Backup
Router Designated
Router
Designated Router by Priority 35
131.108.3.2 131.108.3.3
DR
144.254.3.5
Inter-Area Route Summarization 36
RIP
IGRP
EIGRP
OSPF BGP
etc.
Redistribute
External Routes 38
Cost = 10
R1
To N1
R2 External Cost = 2
Cost = 8
R3
Network Type 1 Next Hop
N1 11 R2
N1 10 R3 Selected
Route
External Routes 39
Cost = 10
R1
To N1
R2 External Cost = 2
Cost = 8
R3
Network Type 2 Next Hop
N1 1 R2 Selected Route
N1 2 R3
Topology/Links-State DB 40
• Bringing up adjacencies
• LSA Types
• Area Classification
The Hello Protocol 42
Hello
FDDI
Dual Ring
Hello Hello
The Hello Packet 43
• Router Priority
• Hello Interval
Hello
• Router dead interval
• Network mask FDDI
Dual Ring
• Options: T-bit, E-bit Hello Hello
• List of neighbors
Neighbor States 44
• 2-way
– The router sees itself in other Hello packets
– DR is selected from neighbors in state 2-way or greater
2-way
DR BDR
Neighbor States 45
• Full
– Routers are fully adjacent
– DB is synchronized
– Relationship to the DR and
BDR
Full
DR BDR
When to Become Adjacent 46
DR BDR
LSA Types
Different Types of LSAs 52
Backbone
1.A Area #0 3.A
1.B 3.B
1.C 3.C
1.D 3.D
2.A
2.B
2.C
1.B 1.A 3.B
3.A
Token
Ring
Token
Token
Ring 2.B Token
Ring
Ring
Token
Ring
Token 3.C 3.D
1.D
1.C Ring
2.A
2.C
Summarized: Summary Links 59
Backbone
Area #0
1 3
1.A
2.A 1.B
2.B Backboen 1.C
2.C 1.A Area #0 1.D
3.A 1.B 2.A
3.B 1.C 2.B
3.C 1.D 2.C
3.D 3.A
3.B
3.C
3.D
1.B 1.A 3.B
3.A
Token Token
Token Ring
Ring
2.B Token
Ring
Ring
Token
Ring
3.D
1.D Token 3.C
1.C Ring
2.A
2.C
Summarized: Summary Links 61
Backbone
Area #0
2,3 1,2
1,3
1.B 1.A 3.B 3.A
Token
Ring Token
Token
2.B Ring Ring
Token
Ring
Token 3.D
Ring 1.D 3.C
1.C
2.A
Token
Ring
62
OSPF Areas
Regular Area (Not a stub) 63
1,3
3.D
2.C
Normal Stub Area 64
1,3
2.C
Totally Stubby Area 65
1,3
2.C
Not-So-Stubby Area 66
ASBR X.1
1,3
External
Ring
2.B 2.A Ring
X.2
Token
Ring X.1 1.D
Token
Ring
Networks X.1, X.2
1.C
Token
Ring
3.C 3.D
Token
Ring
2.D
X.1, X.2
2.C
67
Basic OSPF Configuration
The router ospf command
• To enable OSPF on a router use the following command
– R1(config)#router ospf process-id
– Process id
A locally significant number between 1 and 65535
– -this means it does not have to match other OSPF
routers
68
Basic OSPF Configuration
• OSPF network command
– -Requires entering: network add
– wildcard mask - the inverse of the subnet mask
– area-id - area-id refers to the OSPF area. OSPF area is a
group of routers that share link state information
– -Example: Router(config-router)#network network-address
wildcard-ask area area-id
69
Basic OSPF Configuration
• Router ID
– This is an IP address used to identify a router
– 3 criteria for deriving the router ID
Use IP address configured with OSPF router-id command
-Takes precedence over loopback and physical interface addresses
If router-id command not used then router chooses highest IP
address of any loopback interfaces
If no loopback interfaces are configured then the highest IP
address on any active interface is used
70
Basic OSPF Configuration
OSPF Router ID
• Commands used to verify current router ID
– Show ip protocols
– Show ip ospf
– Show ip ospf interface
Basic OSPF Configuration 71
OSPF Router ID
• Router ID & Loopback addresses
– -Highest loopback address will be used as router ID if router-id
command isn’t used
– -Advantage of using loopback address
– the loopback interface cannot fail OSPF stability
• The OSPF router-id command
– Introduced in IOS 12.0
– Command syntax
Router(config)#router ospfprocess-id
Router(config-router)#router-idip-address
• Modifying the Router ID
– Use the command Router#clear ip ospf process
72
Basic OSPF Configuration
Verifying OSPF
• Use the show ip ospf command to verify & trouble shoot
OSPF networks
– Command will display the following:
Neighbor adjacency
– -No adjacency indicated by -
Neighboring router’s Router ID is not displayed
A state of full is not displayed
– -Consequence of no adjacency-
No link state information exchanged
Inaccurate SPF trees & routing tables
73
Command Description
Fine-Tuning OSPF
• Since link speeds are getting
faster it may be necessary to
change reference bandwidth
values
– Do this using the auto-cost
reference-bandwidth
command
– Example:
R1(config-router)#auto-cost
reference-bandwidth 10000
82
More OSPF Configuration
Fine-Tuning OSPF
• Modifying OSPF timers
– Reason to modify timers
Faster detection of network failures
– Manually modifying Hello & Dead intervals
Router(config-if)#ip ospf hello-interval seconds
Router(config-if)#ip ospf dead-interval seconds
– Point to be made
Hello & Dead intervals must be the same between neighbors
83
Summary
• OSPF Characteristics
– Metric = cost
Lowest cost = best path
• Configuration
– Enable OSPF on a router using the following command
R1(config)#router ospf process-id
– use the network command to define which interfaces will
participate in a given OSPF process
Router(config-router)#network network-address
wildcard-mask area area-id
Summary 85