Sunteți pe pagina 1din 45

OSPF

Routing Protocols and


Concepts – Chapter 11

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1
Objectives
ƒ Describe the background and basic features of OSPF
ƒ Identify and apply the basic OSPF configuration
commands
ƒ Describe, modify and calculate the metric used by
OSPF
ƒ Describe the Designated Router/Backup Designated
Router (DR/BDR) election process in multiaccess
networks
ƒ Describe the uses of additional configuration
commands in OSPF

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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 3
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 published in RFC 2740

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 4
Introduction to OSPF
OSPF Message
Encapsulation
ƒ OSPF packet type
There exist 5
types
ƒ OSPF packet header
Contains -
Router ID and
area ID and
Type code for
OSPF packet
type
ƒ IP packet header
Contains -
Source 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 5
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 6
Introduction to OSPF
11.1.3
OSPF Packet Types
ƒ The figure shows the five different types of OSPF LSPs.
Each packet serves a specific purpose in the OSPF
routing process:
1. Hello - Hello packets are used to establish and maintain adjacency with other OSPF
routers. The hello protocol is discussed in detail in the next topic.
2. DBD - The Database Description (DBD) packet contains an abbreviated list of the
sending router'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 seven different types of Link-State
Advertisements (LSAs). LSUs and LSAs are briefly discussed in a later topic.
5. LSAck - When an LSU is received, the router sends a Link-State Acknowledgement
(LSAck) to confirm receipt of the LSU.
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7
Introduction to OSPF
Hello Protocol
ƒ OSPF Hello
Packet
ƒ Purpose of
Hello Packet
ƒ Discover OSPF
neighbors &
establish
adjacencies
ƒ Advertise
guidelines on
which routers must
agree to become
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 8
Introduction to OSPF 11.1.4
ƒ Before an OSPF router can flood its link-states to
other routers, it must first determine if there are
any other OSPF neighbors on any of its links.
ƒ Hello Packets continued
Contents of a Hello Packet
router ID of transmitting router
ƒ OSPF Hello Intervals
–Usually multicast (224.0.0.5)
–Sent every 30 seconds for NBMA segments
ƒ Before two routers can form an OSPF neighbor
adjacency, they must agree on three values: Hello
interval, Dead interval, and network type.
ƒ The OSPF Hello interval indicates how often an
OSPF router transmits its Hello packets.
ƒ OSPF Dead Intervals
–This is the time that must transpire
before the neighbor is considered
down
–Default time is 4 times
ITE PC v4.0 the hello interval
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 9
Introduction to OSPF
ƒ To reduce the amount of OSPF traffic on multiaccess networks,
OSPF elects a Designated Router (DR) and Backup Designated
Router (BDR).
ƒ 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 DR if the current DR
fails.
ƒ Hello protocol 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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 10
Introduction to OSPF
OSPF Link-state Updates
ƒ 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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 11
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 of
Dijkstra SPF
algorithm
–SPF algorithm
used to create SPF
tree
–SPF tree used to
populate routing
table
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 12
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 13
Introduction to OSPF
ƒ OSPF Authentication
–Purpose is to encrypt & authenticate routing
information
–This is an interface specific configuration
–Routers will only accept routing information from
other routers that have been configured with the
same password or authentication information

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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 15
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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 16
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: Router(config-router)#network network-address
wildcard-ask area area-id

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17
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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 18
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 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 19
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 OSPF router-id command
–Introduced in IOS 12.0
–Command syntax
ƒRouter(config)#router ospfprocess-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 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 20
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-State - The OSPF state of
the interface. FULL state means that the router and its
neighbor have identical OSPF link-state databases.
-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 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
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
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

PT 11.2.6

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 23
OSPF Metric
ƒ The Cisco IOS uses the cumulative bandwidths of the outgoing
interfaces from the router to the destination network as the cost
value
ƒ OSPF uses cost as the metric for determining the best route
-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
ƒcan be modified using
ƒauto-cost reference-bandwidth command

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 24
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 25
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

11.3.1

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 26
Basic OSPF Configuration
Modifying the Cost of a link
ƒ Both sides of a serial link should be configured 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 27
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

PT 11.3.2

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28
OSPF and Multiaccess Networks
Challenges in Multiaccess
Networks
ƒ OSPF defines five network
types:
–Point-to-point
–Broadcast Multiaccess
–Nonbroadcast
Multiaccess (NBMA)
–Point-to-multipoint
–Virtual links Animation 11.4.1-2
–NBMA and point-to-multi-
point networks include
Frame Relay, ATM, and
X.25 networks.
–Virtual links are a special
type of link that can be
used in multi-area OSPF.
OSPF virtual links are
ITE PC v4.0
Chapter 1 discussed in CCNP © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 29
OSPF in Multiaccess Networks
ƒ Multiaccess networks can create two challenges for OSPF regarding the flooding of
LSAs:
ƒ 1. Creation of multiple adjacencies, one adjacency for every pair of routers.
ƒ 2. Extensive flooding of LSAs (Link-State Advertisements).

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 30
OSPF in Multiaccess Networks
ƒ Extensive flooding of LSAs
For every LSA sent out there must be an acknowledgement of
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 31
OSPF in Multiaccess Networks 11.4.1-5
ƒ Solution to LSA flooding issue is the
use of
–Designated router (DR)
–Backup designated router (BDR)
–this solution is analogous to electing
someone in the room to go around
and learn everyone's names and then
announce these names to everyone in
the room at once.
ƒ DR & BDR selection
–Routers are elected to send &
receive LSA
ƒ Sending & Receiving LSA
–DRothers send LSAs via multicast
224.0.0.6 to DR & BDR
–DR forward LSA via multicast
address 224.0.0.5 to all other routers
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 32
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 33
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 34
OSPF in Multiaccess Networks
ƒ Criteria for getting elected DR/BDR
1. DR: Router with the highest OSPF
interface priority.
2. BDR: Router with the second highest
OSPF interface priority.
3. If OSPF interface priorities are equal, the
highest router ID is used to break the tie.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 35
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 DR 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 36
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 up the DR first, followed by the BDR, and then boot all
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.

11.4.2-3
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 37
OSPF in Multiaccess Networks
OSPF Interface Priority
ƒ Manipulating the DR/BDR election 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

PT 11.4.3-2
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 38
More OSPF Configuration
Redistributing an OSPF Default Route
ƒ Topology includes a link to ISP
–Router connected to ISP
ƒCalled an autonomous system border router
ƒUsed to propagate a default route
–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 originate

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

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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 40
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

PT 11.5.2-3
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 41
Summary
ƒ RFC 2328 describes OSPF link state concepts and
operations
ƒ OSPF Characteristics
–A commonly deployed link state routing protocol
–Employs DRs & BDRs on multi-access networks
ƒDRs & BDRs are elected
ƒDR & BDRs are used to transmit and receive LSAs
–Uses 5 packet types:
1: HELLO
2: DATABASE DESCRIPTION
3: LINK STATE REQUEST
4: LINK STATE UPDATE
5: LINK STATE ACKNOWLEDGEMENT

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 42
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

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 43
Summary
ƒ Verifying OSPF configuration
–Use the following commands
ƒshow ip protocol
ƒshow ip route
ƒshow ip ospf interface
ƒshow ip ospf neighbor

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

S-ar putea să vă placă și