OSPF (Single Area OSPF)
Routing Protocols and Concepts – Chapter 11
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
ITE PC v4.0
Chapter 1
1
Introduction
•In this chapter, you will learn basic, single-area OSPF implementations
and configurations
ITE PC v4.0
Chapter 1
2
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
and
configurations
.
•More complex OSPF configurations and concepts (multi-areas OSPF)
are reserved for CCNP-level courses.
Introduction to OSPF
Introduction
to
OSPF
Background of OSPF
Began in 1987
1989 OSPFv1 released in RFC 1131
This version was experimental & never deployed
1991 OSPFv2 released in RFC 1247
1998 OSPFv2 updated in RFC 2328
1999 OSPFv3
p
ublished in RFC 2740
p
ITE PC v4.0
Chapter 1
3
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Introduction to OSPF
Introduction
to
OSPF
OSPF Message Encapsulation
OSPF packet type
OSPF
packet
type
– There exist 5 types (next slide)
OSPF packet header
–Contains - Router ID an area ID
and Type code for OSPF packet
type
IP packet header
– Contains - Source IP address,
D
es
tin
a
ti
o
n IP
add
r
ess,
&
Pr
o
t
oco
l
es a o add ess, & o oco
field set to 89. the destination
address is set to one of two
multicast addresses: 224.0.0.5 or
224006
224
.
0
.
0
.
6
.
Data Link Frame Header
–
Contains - destination MAC address is
ITE PC v4.0
Chapter 1
4
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
also a multicast address: 01-00-5E-00-
00-05 or 01-00-5E-00-00-06.
I t d ti t OSPF
I
n
t
ro
d
uc
ti
on
t
o
OSPF
5 OSPF Packet Types:
1. Hello - Hello packets are used to establish and
maintain adjacency with other OSPF routers.
2. DBD - The Database Description (DBD) packet
contains an
abbre iated list of the sending ro ter's
contains
an
abbre
v
iated
list
of
the
sending
ro
u
ter's
link-state database and is used by receiving
routers to check against the local link-state
database.
3. LSR - Receiving routers can then request more
information about any entry in the DBD by sending
a Link-State Request (LSR).
4. LSU - Link-State Update (LSU) packets are
used to reply to LSRs as well as to announce new
information.
–
LSUs contain 7 different types of Link-State
Advertisements (LSAs).
–LSUs and LSAs are discussed in a later topic.
5LSAk
Wh LSU i i d th t
ITE PC v4.0
Chapter 1
5
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
5
.
LSA
c
k
-
Wh
en an
LSU
i
s rece
i
ve
d
,
th
e rou
t
er
sends a Link-State Acknowledgement (LSAck) to
confirm receipt of the LSU.
OSPF: Hello Protocol
OSPF:
Hello
Protocol
Purpose of Hello Packet
Discover OSPF neighbors & establish adjacencies
Discover
OSPF
neighbors
&
establish
adjacencies
Advertise parameters on which routers must agree to become
neighbors
Used by multi-access networks to elect a Designated Router and
a Backup Designated Router
Type: OSPF Packet Type: Hello (1), DD (2), LS
Request (3), LS Update (4), LS ACK (5)
Router ID: ID of the originating router
Area ID: area from which the packet originated
Network Mask: Subnet mask associated with the
sending interface
sending
interface
Hello Interval: number of seconds between the
sending router's hellos
Router Priority: Used in DR/BDR election (discussed
lt )
l
a
t
er
)
Designated Router (DR): Router ID of the DR, if any
Backup Designated Router (BDR): Router ID of the
BDR, if any
ITE PC v4.0
Chapter 1
6
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
List of Neighbors: lists the OSPF Router ID of the
neighboring router(s)
OSPF: Hello Protocol
OSPF:
Hello
Protocol
Establish adjacencies:
–
The
y
must a
g
ree on three values: Hello
Why 10 second hello interval
Also need to have the
same Area ID.
yg
interval, Dead interval, and network type.
OSPF Hello Intervals
–Hello interval indicates how often an OSPF
router transmits its Hello packets
Why
10
second
hello
interval
communications consider better than
the 30 second routing update for RIP?
router
transmits
its
Hello
packets
–Usually multicast (224.0.0.5) for
ALLSPFRouters
–
sent ever
y
10 seconds on multiaccess and
y
point-to-point segments
–Sent every 30 seconds for NBMA segments
OSPF Dead Intervals
–
This is the time that must transpire before the
neighbor is considered down
–Default time is 4 times the hello interval
–
For multiaccess and point
-
to
-
point segments
For
multiaccess
and
point
to
point
segments
,
this period is 40 seconds.
–For NBMA networks, the Dead interval is 120
seconds.
If the Dead interval expires before the routers
ITE PC v4.0
Chapter 1
7
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
–
If
the
Dead
interval
expires
before
the
routers
receive a Hello packet, OSPF will remove that
neighbor from its link-state database.
OSPF: Hello Protocol
To reduce the amount of OSPF traffic on
To
reduce
the
amount
of
OSPF
traffic
on
multiaccess networks, OSPF elects a
Designated Router (DR) and Backup
Desi
g
nated Router
(
BDR
)
.
g()
Hello protocol packets contain information that
is used in electing DR and BDR
The DR is responsible for updating all other
–
The
DR
is
responsible
for
updating
all
other
OSPF routers (called DROthers) when a change
occurs in the multiaccess network.
–
The BDR monitors the DR and takes over as
The
BDR
monitors
the
DR
and
takes
over
as
DR if the current DR fails.
In the figure, R1, R2, and R3 are connected
through point
to
point links Therefore no
More detail discussion
through
point
-
to
-
point
links
.
Therefore
,
no
DR/BDR election occurs.
–The DR/BDR election and processes will be
discussed in a later topic and the topology will
More
detail
discussion
on the DR, BDR,
DROther later. You
need to know this for
ITE PC v4.0
Chapter 1
8
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
discussed
in
a
later
topic
and
the
topology
will
be changed to a multiaccess network.
need
to
know
this
for
CCNA exam.
Introduction to OSPF
Introduction
to
OSPF
OSPF Link-state Updates
Purpose of a Link State Update (LSU)
Purpose
of
a
Link
State
Update
(LSU)
–Used to deliver link state advertisements
Purpose of a Link State Advertisement (LSA)
–Contains information about neighbors & path costs
–An LSU packet can contain 11 different types of LSAs,
ITE PC v4.0
Chapter 1
9
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Introduction to OSPF
Introduction
to
OSPF
OSPF Algorithm
OSPF routers build &
maintain link-state
dtb
tii LSA
d
a
t
a
b
ase con
t
a
i
n
i
ng
LSA
received from other
routers
routers
1. Information found in
database is utilized upon
e ec tion of Dijkstra SPF
e
x
ec
u
tion
of
Dijkstra
SPF
algorithm
2. SPF al
g
orithm used to
g
create SPF tree
3. SPF tree used to populate
routing table
ITE PC v4.0
Chapter 1
10
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
routing
table
Introduction to OSPF
Introduction
to
OSPF
Administrative Distance
Administrative
Distance
Default Administrative Distance for OSPF is 110
ITE PC v4.0
Chapter 1
11
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Introduction to OSPF
Introduction
to
OSPF
OSPF Authentication
–
It is good practice to authenticate transmitted
It
is
good
practice
to
authenticate
transmitted
routing information.
–
This is an interface s
p
ecific confi
g
uration
pg
–This practice ensures that routers will only accept
routing information from other routers that have been
configured with the same password or authentication
configured
with
the
same
password
or
authentication
information
MD5 authentication
kIDtht
Note: Authentication
does not encrypt the
router
'
s routing table
uses a
k
ey
ID
th
a
t
allows the router to
reference multiple
p
asswords
,
makin
g
?
router s
routing
table
.
p,g
password migration
easier and more
secure.
ITE PC v4.0
Chapter 1
12
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
?
Basic OSPF Configuration
Lab Topology
Lab
Topology
Topology used for this chapter
–Discontiguous IP addressing
scheme
–Since OSPF is a classless
routing protocol the subnet mask
is will be configured as part of our
is
will
be
configured
as
part
of
our
OSPF configuration.
ITE PC v4.0
Chapter 1
13
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Basic OSPF Configuration
Basic
OSPF
Configuration
The router ospf command
The
router
ospf
command
To enable OSPF on a router use the following
command
R1(config)#router ospf process-id
Process id
ID cannot be 0
A locally significant number between 1 and 65535
ITE PC v4.0
Chapter 1
14
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Basic OSPF Configuration
Basic
OSPF
Configuration
OSPF network command
–
Re
q
uires enterin
g
:
qg
•network address
•wildcard mask - the inverse of the subnet mask
•
area
-
id
-
area
-
id refers to the OSPF area OSPF area
•
area
-
id
-
area
-
id
refers
to
the
OSPF
area
.
OSPF
area
is a group of routers that share link state information
Router(config
-
router)#
network
network
-
address wildcard
-
ask
area
area
-
id
Router(config
router)#
network
network
address
wildcard
ask
area
area
id
255.255.255.255
- 255.255.255.240
00 015
Subtract the
subnet mask
Wildcard mask
0
.
0
.
0
.
15
255.255.255.255
- 255.255.255.252
Subtract the
subnet mask
ITE PC v4.0
Chapter 1
15
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
0. 0. 0. 03
Wildcard mask
Basic OSPF Configuration
Basic
OSPF
Configuration
Cisco IOS now properly handles overlapping network area configuration commands.
Consider the followin
g
exam
p
le:
gp
fw#conf t
Enter configuration commands, one per line. End with CNTL/Z.
fw(config)#router ospf 100
fw
(
config
router)#
network 0 0 0 0 255 255 255 255 area 0
fw
(
config
-
router)#
network
0
.
0
.
0
.
0
255
.
255
.
255
.
255
area
0
fw(config-router)#network 10.0.0.0 0.0.3.255 area 1
13:06:57: %OSPF-6-AREACHG: 10.0.0.0 255.255.252.0 changed from area 0 to area 1
fw(config-router)#network 10.0.0.0 0.0.0.7 area 2
13:07:10: %OSPF-6-AREACHG: 10.0.0.0 255.255.255.248 changed from area 1 to area 2
fw(config-router)#^Z
I've entered overlapping network statements, each one with a smaller address range. Not
l d IOS d t t th t th l it l i t i
l
dd
on
l
y
d
oes
IOS
d
e
t
ec
t
th
a
t
th
ey over
l
ap,
it
a
l
so pr
i
n
t
s n
i
ce sys
l
og messages an
d
reor
d
ers
the commands in the running configuration. Well done !
fw#show run | begin router ospf
router os
p
f 100
p
log-adjacency-changes
network 10.0.0.0 0.0.0.7 area 2
network 10.0.0.0 0.0.3.255 area 1
network0000255255255255area0
o/2006/11/
network-statements-in-ospf-
ht l
ITE PC v4.0
Chapter 1
16
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
network
0
.
0
.
0
.
0
255
.
255
.
255
.
255
area
0
process-are.
ht
m
l
Basic OSPF Configuration
Basic
OSPF
Configuration
ospf network definition for adding all interfaces / default route
What’s the difference?
router ospf 1
network 0.0.0.0 0.0.0.0 area 0
vs
vs
.
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
Both add all existing interfaces into area 0 and all later added interfaces
also. Both statements are valid.
/>ITE PC v4.0
Chapter 1
17
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
B i OSPF C fi ti
B
as
i
c
OSPF
C
on
fi
gura
ti
on
Area area
id
Area
area
-
id
An OSPF area is a group of routers that share link-state
information.
In this chapter, we will configure all of the OSPF routers within a
single area. This is known as single-area OSPF.
Multi-area OSPF is covered in CCNP.
ITE PC v4.0
Chapter 1
18
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
B i OSPF C fi ti
B
as
i
c
OSPF
C
on
fi
gura
ti
on
Router ID
– This is an IP address used to identify a router
– 3 criteria for deriving the router ID
1 U IP dd fi d ith OSPF
t
id
d
1
.
U
se
IP
a
dd
ress con
fi
gure
d
w
ith
OSPF
rou
t
er
-
id
comman
d
-Takes precedence over loopback and physical interface
addresses
2. If router-id command not used then router chooses highest
IP address of any loopback interfaces
3
If no loopback interfaces are configured then the
highest IP
3
.
If
no
loopback
interfaces
are
configured
then
the
highest
IP
address on any active physical interface is used
The interface does not need to be enabled for OSPF,
meaning that it does not need to be included in one of the
meaning
that
it
does
not
need
to
be
included
in
one
of
the
OSPF network commands.
However, the interface must be active - it must be in the
up state
ITE PC v4.0
Chapter 1
19
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
up
state
.
However!!!!!!
B i OSPF C fi ti
B
as
i
c
OSPF
C
on
fi
gura
ti
on
RtID
R
ou
t
er
ID
If th ki h th
–
If
you are
th
e
ki
ng w
h
en
th
e
kingdom is built, you are the
kingdom
is
built,
you
are
the
KING for life
– It means when ID is elected, it
ithIDf th t l
i
s
th
e
ID
f
or
th
e rou
t
er, un
l
ess
…………
ITE PC v4.0
Chapter 1
20
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Basic OSPF Configuration
Basic
OSPF
Configuration
OSPF Router ID
Commands used to verify current router ID
–Show ip protocols
–Show ip ospf
–Show ip ospf interface
ITE PC v4.0
Chapter 1
21
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Basic OSPF Configuration
Basic
OSPF
Configuration
OSPF Router ID
Router ID (not configured) & Loopback addresses
(configured)
–
Highest loopback address will be used as router ID
Highest
loopback
address
will
be
used
as
router
ID
–Advantage of using loopback address the loopback
interface cannot fail Æ OSPF stability
The OSPF router
-
id command
The
OSPF
router
id
command
–Introduced in IOS 12.0
–OSPF router-id command, which is a fairly recent
addition to IOS
,
it is more common to find loo
p
back
,p
addresses used for configuring OSPF router IDs.
–Command syntax
Router(config)#router ospf process-id
Router(config-router)#router-id ip-address
Modifying the Router ID
–
Use the command
Router
#clear ip
ospf process
ITE PC v4.0
Chapter 1
22
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
Use
the
command
Router
#clear
ip
ospf
process
This command does not work in PT.
Basic OSPF Configuration
Basic
OSPF
Configuration
Modif
y
in
g
the Router ID
yg
The router ID is selected when OSPF is
configured with its first OSPF network command.
–
If the OSPF router
-
id command or the loopback
If
the
OSPF
router
id
command
or
the
loopback
address is configured after the OSPF network
command, the router ID will be derived from the
interface with the highest active IP address.
f
Modi
f
ying the Router ID
The router ID can be modified with
1. the IP address from a subsequent OSPF router-id
command b reloading the ro ter or
command
b
y
reloading
the
ro
u
ter
or
2. by using the following command:
Router#clear ip ospf process
3. Modifying a router ID with a new loopback or
physical interface IP address may require
reloading the router
ITE PC v4.0
Chapter 1
23
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
reloading
the
router
Basic OSPF Configuration
Basic
OSPF
Configuration
Duplicate Router IDs
Duplicate
Router
IDs
When two routers have the same router ID in
an OSPF domain, routing may not function
properly.
properly.
– If the router ID is the same on two
neighboring routers, the neighbor
establishment may not occur.
When duplicate OSPF router IDs occur, IOS
will display a message similar to:
– %OSPF-4-DUP_RTRID1: Detected router
ith d li t t ID
w
ith
d
up
li
ca
t
e rou
t
er
ID
To correct this problem, configure all routers
so that they have unique OSPF router IDs.
¾ Because some IOS versions do not support
the router-id command, we will use the
loopback address method for assigning
router IDs
ITE PC v4.0
Chapter 1
24
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
router
IDs
.
Quick Review
Quick
Review
We just went over 3 different types of ID
We
just
went
over
3
different
types
of
ID
ospf process-id.
OSPF process
–
OSPF
process
.
– Cannot be 0
Area ID:
Area
ID:
– OFPS area
–
If it is the first
,
and the backbone area
,
it is 0
,,
Router ID
–
Router ID
– 1 IP address is elected per router,
• Highest physical address (or)
ITE PC v4.0
Chapter 1
25
© 2007 Cisco Systems, Inc. All rights reserved. Cisco Public
• Highest logical address (loopback)