Академический Документы
Профессиональный Документы
Культура Документы
Objectives
Upon completing this lesson, you will be
able to:
Describe the features and operation of OSPF
Use Cisco IOS commands to configure
dynamic routing for a single area OSPF
network, given a functioning router
Use show and debug commands to identify
anomalies in dynamic routing operation using
OSPF, given an operational router
Overview
Link-state advertisements
(LSAs)
A topological database
Speed of convergence
Only routing (link-state) changes
flooded
Not based on periodic updates
Processes updates efficiently
OSPF Issues (cont.)
Supports VLSM
RIPv1 is a classfull protocol and does
not support VLSM.
RIPv2 also supports VLSM
OSPF Issues (cont.)
Selects paths based on bandwidth
RIP broadcasts full routing table. This
is especially problems over slow
WAN links. OSPF multicasts
minimally sized link-state updates
send these updates only when there
is a network change
Supports equal-cost multipath
OSPF Issues (cont.)
Hierarchical Design (Area concept)
OSPF can effectively segment a
network into smaller clusters of
routers
Limits traffic regionally and prevent
changes in one area from affecting
performance in other areas.
OSPF in IP Packets
89 - OSPF
6 - TCP
17 - UDP
Frame Payload
C
Frame
IP Protocol R
Header Packet Payload
Header Number C
Interfaces/ Links
Token
Ring
Link-State
Link : An interface on a router
The status of a link between two routers. Also
a routers interface and its relationship to its
neighboring routers
OSPF routers tell each other about the status
of their connections, or links to the
internetwork. In other words, OSPF routers
advertise their link states.
OSPF Terminology
Neighbors
Interfaces/ Links
Token
Ring
Neighbors
Two or more routers that have interface on
a common network. A neighbor
relationship is usually discovered and
maintained by the Hello protocol
Hello Protocol : Protocol used by OSPF to
establish and maintain neighbor
relationship.
OSPF Terminology
Neighbors
Interfaces/ Links
Cost = 10
Token
Ring
Cost = 1785 Cost = 6
Cost
The value assigned to a link. Rather than hops,
link-state protocols assign a cost to a link; for
OSPF on Cisco Routers, the cost is based on the
speed of the media. A cost is associated with the
output side of each router interface, referred to
as interface output cost.
Cisco default OSPF cost = 10^8/BW
(BW : Configured value on the interface with
bandwidth command)
With ip ospf cost command cost of an interface
may be changed.
OSPF Terminology
Neighbors
Interfaces/ Links
Area 1 Cost = 10
Area 0
Token
Ring
Cost = 1785 Cost = 6
Area
A collection of networks and routers that
have the same area identification. Each
router within an area has the same link-
state information. A router within an area
is an internal router
OSPF Terminology
Autonomous System
Neighbors
Interfaces/ Links
Area 1 Cost = 10
Area 0
Token
Ring
Cost = 1785 Cost = 6
Autonomous System
A group of routers exchanging routing
information using a common routing
protocol.
OSPF Terminology
Autonomous System
Neighbors
Interfaces/ Links
Area 1 Cost = 10
Area 0
Token
Ring
Cost = 1785 Cost = 6
Neighborship
Database
Lists Neighbors
Adjacencies (Neighborship)
Database
A listing of all the neighbors to which a
router has established bidirectional
communication using Hello protocol
OSPF Terminology
Autonomous System
Neighbors
Interfaces/ Links
Area 1 Cost = 10
Area 0
Token
Ring
Cost = 1785 Cost = 6
Neighborship Topology
Database Database
Lists Neighbors Lists All Routes
Link-state database
(Topological Database)
A list of link-state entries of all other
routers in the network. It shows the
network topology. All routers within an
area have identical link-state databases.
The link-state database is pieced together
from LSAs (Link-state advertisement)
generated by routers.
OSPF Terminology
Autonomous System
Neighbors
Interfaces/ Links
Area 1 Cost = 10
Area 0
Token
Ring
Cost = 1785 Cost = 6
DR
Neighbors
Interfaces/ Links
Area 1 Cost = 10
Area 0
Token
Ring
BDR
Cost = 1785 Cost = 6
(1)
Broadcast
Multiaccess
(2)
Point-to-Point
(3) X.25
Frame Relay
NBMA
OSPF Topologies
Others:
(4) point-to-multipoint
(5) virtual-links
OSPF Topologies (cont.)
Networks supporting more than two routers
attached together, with the capability of
addressing a single physical message (a
broadcast) to all attached routers. An ethernet
segment is an example of a broadcast
multiaccess network.
Broadcast
Multiaccess
OSPF Topologies (cont.)
A network that joins a single pair of routers. A T1
dedicated serial line is an example of a point-to-
point network.
Point-to-Point
OSPF Topologies (cont.)
Networks supporting many (more than two)
routers, but having no broadcast capability.
Frame Relay and X.25 are examples of
nonbroadcast multiaccess networks.
NBMA X.25
Frame Relay
OSPF Packet Header
Version, Type, and Packet Length - The first three fields of the OSPF packet let the
recipients know the version of OSPF that is being used by the sender (version 1 and 2),
the OSPF packet type, and length. OSPF version 2 was first introduced in 1991 (RFC
1247) and is not compatible with version 1, which is obsolete. The Cisco IOS uses OSPF
version 2 and cannot be configured to use OSPF version 1.
OSPF Packet Types
Type 1 Hello
Establishes and maintains adjaceny information iwth
neighbors
Type 2 Database Descripton Packet (DBD)
Describes the contents of an OSPF routers link state
database
Type 3 Link-state request (LSR)
Requests specific pieces of a routers link-state
database
OSPF Packet Types (cont.)
Type 4 Link-state (LSU)
Transports link-state advertisements (LSAs)
to neighbor routers
Type 5 Link-state acknowledgment
(LSAck)
Acknowledges receipt of a neighbors LSA.
OSPF Packet Header (cont.)
Router ID - The function of the hello packet is to establish and maintain adjacencies, so the sending router signs the
fourth field with its router ID, which is a 32-bit number used to identify the router to the OSPF protocol. A router uses
its IP address as its ID because both the router ID and the IP address must be unique within a network. Because routers
support multiple IP addresses, a loopback IP address is used as the router ID. In the absence of a loopback IP address,
the highest-value address interface IP is used as the router ID, regardless of whether that interface is involved in the
OSPF process.
If the interface associated with that IP address goes down, the router can no longer use that IP address as its router ID.
When a router's ID changes for any reason, the router must reintroduce itself to its neighbors on all links. To avoid the
unnecessary overhead caused by re-establishing adjacency and readvertising link states, an administrator typically
assigns an IP address to a loopback interface. Unless an administrator shuts down a loopback interface, it always stays
up, so loopback interfaces make ideal router IDs.
Note: If a loopback interface is configured with an IP address, the Cisco IOS will use that IP address as the router ID,
even if the other interfaces have higher addresses.
OSPF Packet Header (cont.)
Area ID - You can define multiple areas within an OSPF network to reduce and
summarize route information, which allows large and complex networks to continue to
grow. When configuring a single-area OSPF network, you should always use Area 0
because it is defined as the "backbone" area. You must have a backbone area to scale (add
other OSPF areas).
OSPF Packet Header (cont.)
Hello
Router ID
*
B A C
Hello/dead intervals
Neighbors
afadjfjorqpoeru
*
39547439070713
Area-ID
Router priority
Hello DR IP address
BDR IP address
Authentication password *
*
Stub area flag
Hello
Router ID
*
B A C
Hello/dead intervals
Neighbors
afadjfjorqpoeru
39547439070713
Area-ID*
Router priority
Hello DR IP address
BDR IP address
Authentication password *
*
Stub area flag
Network Mask - This 32-bit field carries subnet mask information for the
network.
Hello Interval and Dead Interval - The hello interval is the number of
seconds that an OSPF router waits to send the next hello packet. The
default for multiaccess broadcast and point-to-point networks is 10 seconds.
The dead interval is the number of seconds that a router waits before it
declares a neighbor down (if the neighbor's hello packets are no longer
being received). The dead interval is four times the hello interval by default,
or 40 seconds. Both of these intervals are configurable, which is the reason
they are advertised. If two routers have different hello intervals or if they
have different dead intervals, they will not accept OSPF information from
each other. Hellos are sent every 10 seconds by default on multiaccess and
point-to-point networks. On interfaces that connect to NBMA networks, such
as Frame Relay, hellos are sent every 30 seconds.
Hello Packet
(cont.)
Options - The router can use this field to indicate optional configurations,
including the stub area flag,
Router Priority - This field contains a value that indicates the priority of this
router when selecting a designated router (DR) and backup designated
router (BDR). The default priority is 1 and can be configured to a higher
number to ensure that a specified router becomes the DR.
Designated Router and Backup Designated Router - The router IDs of the
DR and BDR are listed here, if known by the source of the hello packet.
Neighbor Address - If the source of the hello packet has received a valid hello
from any neighbor within the dead interval, its router ID is included here.
DR and BDR
DR BDR
HelloselectDRandBDRtorepresentsegment
EachrouterthenformsadjacencywithDRandBDR
Electing the DR and BDR
P=3 P=2
DR BDR
Hello
Cost=10
10.4.4.0/24
Topology Table
Net Cost Out Interface
10.2.2.0 6 To0
10.3.3.0 7 To0 This is the best route to 10.3.3.0.
10.3.3.0 10 E0
Maintaining Routing Information
Link-State Change
DR
1 LSU
x A
B
1 LSU
x A
B
1 LSU
x
3
B
A
LSU
4 I need to update
my routing table.
1 LSU
x
3
B
A
LSU
No
No
A Add to database Go
Is seq. #
to
higher? Yes
Send LSAck A
to DR No
End End
Configuring OSPF in a Single
Area
Configuring OSPF on Internal
Routers
Broadcast Network Point-to-Point Network
E0 10.64.0.2 S0
10. 2.1.1
A 10.64.0.1 E0 B 10.2.1.2 C
S1
<OutputOmitted>
<OutputOmitted>
interfaceEthernet0
interfaceEthernet0
ipaddress10.64.0.1255.255.255.0 ipaddress10.64.0.2255.255.255.0
!
!
interfaceSerial0
<OutputOmitted>
ipaddress10.2.1.2255.255.255.0
routerospf1
<OutputOmitted>
network10.0.0.00.255.255.255area0
routerospf50
network10.2.1.20.0.0.0area0
network10.64.0.20.0.0.0area0
Network
172.16.0.0
Router ID:
Number by which the router is known to OSPF
Default: The highest IP address on an active interface at the
moment of OSPF process startup
Can be overridden by a loopback interface: Highest IP address of
any active loopback interface
Configuring Optional
Commands (cont.)
Traffic
Token
Ring
Cisco Non-Cisco
Router(config-if)#
ip ospf cost cost
show ip route
show ip ospf
Displays OSPF timers and statistics
Router#
clear ip route *
Router#
R2#shipospfinte0
Ethernet0isup,lineprotocolisup
InternetAddress192.168.0.12/24,Area0
ProcessID1,RouterID192.168.0.12,NetworkTypeBROADCAST,
Cost:10
TransmitDelayis1sec,StateDROTHER,Priority1
DesignatedRouter(ID)192.168.0.11,Interfaceaddress
192.168.0.11
BackupDesignatedrouter(ID)192.168.0.13,Interfaceaddress
192.168.0.13
Timerintervalsconfigured,Hello10,Dead40,Wait40,
Retransmit5
Helloduein00:00:04
NeighborCountis3,Adjacentneighborcountis2
Adjacentwithneighbor192.168.0.13(BackupDesignatedRouter)
Adjacentwithneighbor192.168.0.11(DesignatedRouter)
Suppresshellofor0neighbor(s)
show ip ospf neighbor
Multiaccess and Point-to-Point
NeighborIDPriStateDeadTimeAddressInterface
192.168.0.111FULL/00:00:3910.1.1.2Serial1
NeighborIDPri StateDeadTimeAddressInterface
192.168.0.121 FULL/DROTHER0:01:5610.1.1.2Serial0
192.168.0.130 FULL/DROTHER0:01:3410.1.1.3Serial0
192.168.0.111 FULL/BDR0:01:5610.1.1.1Serial0
NeighborIDPriState DeadTimeAddressInterface
192.168.0.141FULL/DR 00:00:3010.1.1.4Serial0
192.168.0.131FULL/DROTHER 00:00:3610.1.1.3Serial0
192.168.0.121FULL/DROTHER 00:00:3910.1.1.2Serial0
R2#showipospfdatabase
OSPFRouterwithID(192.168.0.12)(ProcessID1)
RouterLinkStates(Area0)
NetLinkStates(Area0)
LinkIDADVRouterAgeSeq# Checksum
192.168.0.14192.168.0.148120x80000002 0x4AC8
debug ip ospf adj
192.168.0.14onEthernet0,state2WAY
OSPF:endofWaitoninterfaceEthernet0
OSPF:DR/BDRelectiononEthernet0
OSPF:ElectBDR192.168.0.14
OSPF:ElectDR192.168.0.14
DR:192.168.0.14(Id)BDR:192.168.0.14(Id)
OSPF:SendDBDto192.168.0.14onEthernet0seq0x11DBopt0x2flag0x7len32
OSPF:BuildrouterLSAforarea0,routerID192.168.0.11
OSPF:NeighborchangeEventoninterfaceEthernet0
OSPF:RcvDBDfrom192.168.0.14onEthernet0seq0x1598opt0x2flag0x7len32
stateEXSTART
OSPF:NBRNegotiationDone.WearetheSLAVE
OSPF:SendDBDto192.168.0.14onEthernet0seq0x1598opt0x2flag0x2len52
OSPF:RcvDBDfrom192.168.0.14onEthernet0seq0x1599opt0x2flag0x3len92
stateEXCHANGE
OSPF:ExchangeDonewith192.168.0.14onEthernet0
OSPF:SendDBDto192.168.0.14onEthernet0seq0x159Aopt0x2flag0x0len32
OSPF:Synchronizedwith192.168.0.14onEthernet0,stateFULL
OSPF:BuildrouterLSAforarea0,routerID192.168.0.11
OSPF:NeighborchangeEventoninterfaceEthernet0
OSPF:DR/BDRelectiononEthernet0
OSPF:ElectBDR192.168.0.13
OSPF:ElectDR192.168.0.14
DR:192.168.0.14(Id)BDR:192.168.0.13(Id)