Sei sulla pagina 1di 52

OSPF

Routing Protocols and


Concepts – Chapter 11

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1
Introduction to OSPF
Background of OSPF
ƒ Began in 1987
ƒ 1989 OSPFv1 released in RFC 1131
This version was experimental & never deployed
y
ƒ 1991 OSPFv2 released in RFC 1247 (John Moy)
ƒ 1998 OSPFv2 updated in RFC 2328
ƒ 1999 OSPFv3 published in RFC 2740

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 2
Introduction to OSPF
OSPF Message Encapsulation
ƒ OSPF p
packet type
yp
There exist 5 types
ƒ OSPF packet header
Contains - Router ID and
area ID and Type code for
OSPF packet type
ƒ IP packet header
Co a s - Sou
Contains Source
ce IP
address, Destination IP
address, & Protocol field
set to 89

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 3
Introduction to OSPF
OSPF Message Encapsulation
ƒ Data link frame header
Contains - Source MAC address and Destination
MAC address

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 4
Introduction to OSPF
OSPF Packet Types

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 5
Introduction to OSPF
Hello Protocol
ƒ OSPF Hello Packet
–Purpose
Purpose of Hello Packet
ƒ Discover OSPF neighbors & establish adjacencies
ƒ Advertise guidelines on which routers must agree to become
g
neighbors
ƒ Used by multi-access networks to elect a designated router and
a backup designated router

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 6
Introduction to OSPF
ƒ Hello Packets continued
Contents of a Hello Packet
router ID of transmitting router
ƒ OSPF Hello Intervals
–Usually
U ll multicast
li (224
(224.0.0.5)
0 0 5) <ALLSPFRouters>
ALLSPFR t
–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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7
Introduction to OSPF
ƒ Hello p
protocol p
packets contain information that is used
in electing
-Designated Router (DR)
ƒ DR is responsible for updating all other OSPF routers
-Backup Designated Router (BDR)
ƒ This router takes over DR’s responsibilities if DR fails

ƒ To reduce the amount of OSPF traffic on multiaccess


networks, OSPF elects a DR and a BDR. The DR is
responsible for updating
pdating all other OSPF ro
routers
ters (called
DROthers) when a change occurs in the multiaccess
network.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 8
Introduction to OSPF
OSPF Link-state Updates
ƒ Purpose of a Link State Update (LSU)
U d tto d
Used deliver
li lilink
k state
t t advertisements
d ti t
ƒ Purpose of a Link State Advertisement (LSA)
Contains information about neighbors & path costs

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 9
Introduction to OSPF
OSPF Algorithm
ƒ OSPF routers build &
maintain link-state
database containing LSA
received from other routers
–Information found in
database is utilized upon
execution
ti off Dijk
Dijkstra
t SPF
algorithm
–SPF algorithm used to
create
t SPF tree
t
–SPF tree used to populate
routing table

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 10
Introduction to OSPF
Administrative Distance
ƒ Default Administrative Distance for OSPF is 110

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 11
Introduction to OSPF
ƒ OSPF Authentication
–Purpose is to encrypt & authenticate routing
information
–This is an interface specific configuration
–Routers
Routers will only accept routing information from
other routers that have been configured with the
same password or authentication information
–Authentication
Authentication does not encrypt the router's
router s routing
table.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 12
Basic OSPF Configuration
Lab Topology
ƒ Topology used for this chapter
Discontiguous IP addressing scheme
Since OSPF is a classless routing protocol the subnet mask is
should be configured

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 13
Basic OSPF Configuration
The router ospf command
ƒ To enable OSPF on a router use the following
command
R1(config)#router
( g) ospf
p pprocess-id
Process id
ƒ A locally significant number between 1 and 65535
-this
this means it does not have to match other OSPF
routers

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 14
Basic OSPF Configuration
ƒ OSPF network command
-Requires entering: network address
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:
p Router(config-router)#network
( g ) network-address
wildcard-ask area area-id

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 15
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
g with OSPF router-id command
-Takes precedence over loopback and physical interface
addresses
ƒIf router-id command not used then router chooses highest
g
IP address of any loopback interfaces
ƒIf no loopback interfaces are configured then the highest IP
address on any active interface is used

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 16
Basic OSPF Configuration
OSPF Router ID
ƒ Commands
C d used
d tto verify
if currentt router
t ID
–Show ip protocols
–Show ip ospf
–Show ip ospf interface

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17
Basic OSPF Configuration
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
Th OSPF router-id
t id command
d
–Introduced in IOS 12.0
–Command syntax
y
ƒRouter(config)#router ospf process-id
ƒRouter(config-router)#router-id ip-address
ƒ Modifying
M dif i ththe R
Router
t ID
–Use the command Router#clear ip ospf process
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 18
Basic OSPF Configuration
OSPF Router ID
ƒ Duplicate Router id
•When two routers have the same router ID in an OSPF, domain
routing
g may
y not function p
properly.
p y If the router ID is the same on
two neighboring routers, the neighbor establishment may not occur.
%OSPF-4-DUP_RTRID1: Detected router with duplicate router ID

ƒ Because some IOS versions do not support the router-id


router id
command, we will use the loopback address method for
assigning router IDs.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 19
Basic OSPF Configuration
Verifying OSPF
ƒ Use the show ip
p ospf
p command to verify
y & trouble
shoot OSPF networks
Command will display the following:
ƒ Neighbor adjacency
-No adjacency indicated by -
ƒNeighboring router’s Router ID is not displayed
ƒA
A state
t t off full
f ll is
i nott di
displayed
l d
-Consequence of no adjacency-
ƒNo link state information exchanged
ƒInaccurate SPF trees & routing tables

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 20
Basic OSPF Configuration
Verifying OSPF
ƒ Two routers may
y not form an OSPF adjacency
j y if:
•The subnet masks do not match, causing the routers to be on
separate networks.
•OSPF Hello or Dead Timers do not match.
•OSPF Network Types do not match.
•There is a missing or incorrect OSPF network command.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 21
Basic OSPF Configuration
Verifying OSPF - Additional Commands

Command Description

Displays OSPF process ID,


router ID, networks router is
Show ip protocols
advertising & administrative
distance
Displays OSPF process ID,
router ID, OSPF area information
Show ip ospf
& the last time SPF algorithm
calculated
l l t d
Displays hello interval and dead
Show ip ospf interface interval

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 22
Basic OSPF Configuration
sh ip protocols

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 23
Basic OSPF Configuration
sh ip ospf

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 24
Basic OSPF Configuration
<sh ip ospf output>
ƒ Any time a router receives new information about the
t
topology
l ( dditi
(addition, deletion,
d l ti or modification
difi ti off a lilink),
k) th
the
router must rerun the SPF algorithm, create a new SPF
tree, and update the routing table. The SPF algorithm is
CPU intensive.
CPU-intensive.
ƒ A network that cycles between an up state and a down
state is referred to as a flapping link. A flapping link can
cause OSPF routers in an area to constantly recalculate
the SPF algorithm, preventing proper convergence.
ƒ To minimize this problem, the router waits 5 seconds
(5000 msecs) after receiving an LSU before running the
SPF algorithm. This is known as the SPF schedule delay.
ƒ In order to prevent a router from constantly running the
SPF algorithm
algorithm, there is an additional Hold Time of 10
seconds (10000 msecs).
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 25
Basic OSPF Configuration
sh ip ospf interface: Hellos are sent every 10 sec (default)
on broadcast multiaccess ((like Ethernet)) and p
point-to-point
p
networks. On interfaces connecting NBMA networks, hellos
are sent every 30 seconds.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 26
Basic OSPF Configuration
Examining the routing table
ƒ Use the show ip route command to display the routing
table
-An “O’ at the beginning of a route indicates that the router
source is OSPF
-Note OSPF does not automatically summarize at major
network boundaries

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 27
OSPF Metric
ƒ OSPF uses cost as the metric for determining the
b t route
best t
-The best route will have the lowest cost
-Cost is based on bandwidth of an interface
ƒCost is calculated using the formula
108 / bandwidth
-Reference bandwidth
ƒdefaults to 100Mbps
p
ƒcan be modified using
ƒauto-cost reference-bandwidth command

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28
OSPF Metric
ƒ COST of an OSPF route
Is the accumulated value from one router to the next

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 29
OSPF Metric
ƒ Usually the actual speed of a link is different than the
default bandwidth
–This makes it imperative that the bandwidth value reflects
link’s actual speed
ƒReason: so routing table has best path information
ƒ The show interface command will display interface’s
bandwidth
-Most serial link default to 1.544Mbps

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 30
Basic OSPF Configuration
Modifying the Cost of a link
ƒ Both sides of a serial link should be configured
g with the
same bandwidth
–Commands used to modify bandwidth value
ƒBandwidth command
–Example: Router(config-if)#bandwidthbandwidth-kbps
ƒip ospf cost command – allows you to directly specify
interface cost
-Example:R1(config)#interface serial 0/0/0
R1(config-if)#ip ospf cost 1562

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 31
Basic OSPF Configuration
Modifying the Cost of the link
ƒ Difference between bandwidth command & the ip ospf
cost command
–Ip ospf cost command
ƒSets cost to a specific value
–Bandwidth command
ƒLink cost is calculated

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 32
OSPF and Multiaccess Networks
Challenges in Multiaccess Networks
ƒ OSPF defines five network types:
–Point-to-point
–Broadcast Multiaccess
–Nonbroadcast
N b d tMMultiaccess
lti (NBMA) – covered
d on CCNA 4
–Point-to-multipoint
–Virtual links – (CCNP)

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 33
OSPF iin M
Multiaccess
lti Networks
N t k
ƒ 2 challenges presented by multiaccess networks
–Multiple adjacencies
–Extensive LSA flooding

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 34
OSPF in Multiaccess Networks
ƒ Extensive flooding of LSAs
For every LSA sentt outt there
F th mustt be
b an acknowledgement
k l d t off
receipt sent back to transmitting router.
consequence: lots of bandwidth consumed and chaotic traffic

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 35
OSPF in Multiaccess Networks
ƒ Solution to LSA flooding issue
is the use of
–Designated router (DR)
–Backup designated router (BDR)

ƒ DR & BDR selection


–Routers are elected to send &
receive
i LSA

ƒ Sending & Receiving LSA


–DRothers
DRothers send LSAs via
multicast 224.0.0.6 to DR & BDR
–DR forward LSA via multicast
address 224
224.0.0.5
0 0 5 to all other
routers
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 36
OSPF in Multiaccess Networks
DR/BDR Election Process
ƒ DR/BDR elections DO NOT occur in point to point
networks

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 37
OSPF in Multiaccess Networks
ƒ DR/BDR elections will take place on multiaccess
networks as shown below

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 38
OSPF in Multiaccess Networks
ƒ Criteria for getting elected DR/BDR
1 DR: Router with the highest OSPF
1.
interface priority.
2. BDR: Router with the second highest
OSPF interface priority. ƒ Note:DROthers only form FULL
adjacencies with the DR and BDR, but will
3. If OSPF interface priorities are equal, the still form a neighbor adjacency with any
DROthers that join the network. When two
highest router ID is used to break the tie. DROther routers form a neighbor
adjacency, the neighbor state is displayed
as 2WAY.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 39
OSPF in Multiaccess Networks

ƒ Timing of DR/BDR Election


–Occurs as soon as 1st router has its interface enabled on
multiaccess network
ƒWhen a DR is elected it remains as the DR until one of the
following occurs
-The
The DR fails.
fails
-The OSPF process on the DR fails.
-The multiaccess interface on the DR fails.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 40
OSPF in Multiaccess Networks
ƒ Manipulating the election process
-If you want to influence the election of DR & BDR then do one
of the following
ƒBoot
B t up the
th DR first,
fi t ffollowed
ll dbby th
the BDR
BDR, and
d then
th b boott allll
other routers,
OR
ƒShut down the interface on all routers, followed by a no
shutdown on the DR, then the BDR, and then all other
routers.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 41
Activity

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 42
OSPF in Multiaccess Networks
OSPF Interface Priority
ƒ Manipulating
p g the DR/BDR election p
process continued
–Use the ip ospf priority interface command.
–Example:Router(config-if)#ip ospf priority {0 - 255}
ƒPriority number range 0 to 255
–0 means the router cannot become the DR or BDR
–1 is the default priority value

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 43
More OSPF Configuration
Redistributing
g an OSPF Default Route
ƒ Topology includes a link to ISP
–Router connected to ISP
ƒCalled an autonomous system border router (ASBR)
ƒUsed to propagate a default route
–Example
Example of static default route
R1(config)#ip route 0.0.0.0 0.0.0.0 loopback 1
–Requires the use of the default-information originate
command
–Example of default-information originate command
R1(config-router)#default-information
R1(config router)#default information originate

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 44
More OSPF Configuration
Redistributing
g an OSPF Default Route

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 45
More OSPF Configuration
Redistributing
g an OSPF Default Route
ƒ R1 output

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 46
More OSPF Configuration
Redistributing
g an OSPF Default Route
ƒ R2 and R3 output

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 47
More OSPF Configuration
Redistributing an OSPF Default Route
ƒ E2 denotes that this route is an OSPF External Type 2 route.
ƒ OSPF accumulates cost for an E1 route as the route is being
propagated throughout the OSPF area. This process is identical
to cost calculations for normal OSPF internal routes.
ƒ The cost of an E2 route is always the external cost,cost irrespective
of the interior cost to reach that route. In this topology, because
the default route has an external cost of 1 on the R1 router, R2
and R3 also show a cost of 1 for the default E2 routeroute. E2 routes
at a cost of 1 are the default OSPF configuration.
ƒ Changing these defaults, as well as more external route
i f
information,
ti iis di
discussed
d iin CCNP
CCNP.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 48
More OSPF Configuration

Fine-Tuning
g OSPF
ƒ Since link speeds are getting
faster it may be necessary to
change
h reference
f b
bandwidth
d id h
values
–Do this using
g the auto-cost
reference-bandwidth command
–Example:
ƒ R1(config-router)#auto-cost
R1(config router)#auto cost
reference-bandwidth 10000

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 49
More OSPF Configuration

Fine-Tuning
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
ƒRouter(config-if)#ip hello interval seconds
ƒRouter(config-if)#ip ospf dead-interval seconds
–Point to be made
ƒHello & Dead intervals must be the same between
neighbors

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 50
More OSPF Configuration

Fine-Tuning
Fine Tuning OSPF (Authentication with MD5)

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 51
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 52

Potrebbero piacerti anche