20088-1 CCNA3 3.1-02 Single-Area OSPF -jp

Download Report

Transcript 20088-1 CCNA3 3.1-02 Single-Area OSPF -jp

Cisco 3 - OSPF
Module 2
OSPF Overview
Open Shortest Path First (OSPF) is a link-state routing protocol based on
open standards, most recently describes in the RFC 2328.
The Open in OSPF means that it is open to the public and is nonproprietary.
OSPF’s considerable capability to scale is achieved through hierarchical
design. This is done by sectioning off an OSPF network into multiple areas.
By defining areas in a properly designed network, an administrator can reduce
routing overhead & improve performance.
Perrine & Brierley
3/29/2016
Page 1
Cisco 3 - OSPF
Module 2
OSPF Overview
The information gathered from OSPF neighbors is not a complete routing
table. Instead, OSPF routers tell each other about the status of their
connections, or links, to the internetwork.
That is, OSPF routers advertise their link states. The routers build a link-state
database, which is essentially a picture of which device is connected to what.
Then the routers run the Shortest Path First (SPF) algorithm, Dijkstra
algorithm, on the link-state database to determine the best routes to a
destination.
The SPF algorithm adds up the cost (usually based on bandwidth) of each
link between the particular router and its destination. The router then chooses
the lowest-cost path to be added to its routing table, know as the forwarding
database.
In general, cost decreases as the speed of the link increases. Less the cost, better
the route.
Perrine & Brierley
3/29/2016
Page 2
Cisco 3 - OSPF
Module 2
OSPF Packet Types
OSPF routers rely on 5 different types of packets to identify their neighbors
and to update link-state routing information:
OSPF Packet Type
Description
Type 1 – Hello
Establishes & maintains adjacency information
with neighbors
Type 2 – Database description packet
Describes the content of an OSPF router’s linkstate database
Type 3 – Link-state request (LSR)
Requests specific pieces of a router’s link-state
database
Type 4 – Link-state update (LSU)
Transports link-state advertisements (LSAs) to
neighbor routers
Type 5 – Link-state acknowledgement
Acknowledge receipt of a neighbor’s LSA
(LSAck)
Perrine & Brierley
3/29/2016
Page 3
Cisco 3 - OSPF
Module 2
OSPF 7 States
The key to effectively designing & trouble shooting OSPF is to understand the
7 states that OSPF transitions to:
• Down
• Init
• Two-way
• ExStart
• Exchange
• Loading
• Full adjacency
Perrine & Brierley
3/29/2016
Page 4
Cisco 3 - OSPF
Module 2
Down State
Down State
OSPF process has not exchanged information with any neighbors, and is
waiting to enter the Init state
Perrine & Brierley
3/29/2016
Page 5
Cisco 3 - OSPF
Module 2
Init State
Init State
OSPF routers send Type 1 (hello) packets at regular intervals (usually 10
seconds) to establish special relationships with neighbor routers. When an
interface receives its 1st hello packet, the router enters the Init state.
Generally there are 2 kinds of relationships:
1. 2-way state
2. adjacency
The router MUST receive a hello from a neighbor before it establishes any
relationship.
Perrine & Brierley
3/29/2016
Page 6
Cisco 3 - OSPF
Module 2
Two-Way State
Two-Way State
Using hello packets, every OSPF router tries to establish a two-way state with
every neighbor router on the same IP network. A router enters the two-way
state when it sees itself in a neighbor’s hello packet.
Two-state is most basic relationship, but routing information is not shared
between routers in this relationship.
To learn about other routers’ link states & eventually build a routing table,
every OSPF router must form at least one adjacency.
Perrine & Brierley
3/29/2016
Page 7
Cisco 3 - OSPF
Module 2
ExStart State
ExStart State
The 1st state to full adjacency is this state. Technically, when a router & its
neighbor enter the ExStart state, their conversation is characterized as an
adjacency, but the routers haven’t become fully adjacent yet.
ExStart is established using Type 1 Data Base Description packets (DBD). The
2 neighbor routers use these DBD packets to negotiate who is the master &
who is the slave.
To see this process -- use <debug ip ospf events>
The router with highest OSPF router ID (IP address) is the master
Perrine & Brierley
3/29/2016
Page 8
Cisco 3 - OSPF
Module 2
Exchange State
Exchange State
In this state, neighbor routers use Type 2 DBD packets to send each other
their link-state information.
If either of the routers receives information about a link that is not already in its
database, the router requests a complete update from its neighbor.
Complete routing information is exchanged in the loading state.
Perrine & Brierley
3/29/2016
Page 9
Cisco 3 - OSPF
Module 2
Loading State
Loading State
After the database has been described to each router, more complete
information must be request by using Type 3 packets (LSR).
When a router receives an LSR, it responds with an update by using a Type 4
link-state update (LSU) packet. These Type 4 LSU packets contain the actual
LSAs.
Perrine & Brierley
3/29/2016
Page 10
Cisco 3 - OSPF
Module 2
Full Adjacency
Full Adjacency
With the loading state complete, the routers are fully adjacent.
Each router keeps a list of adjacent neighbors called the adjacency database.
Because adjacency is required for OSPF routers to share routing information,
a router tries to become adjacent to at least one other router on each IP
network to which it is connected.
Perrine & Brierley
3/29/2016
Page 11
Cisco 3 - OSPF
Module 2
OSPF Router Databases
Adjacency database
List of all the neighbor routers to which a router has established bi-directional
communication.
Link-state database
List of information about all other routers in the network. This database shows
the network topology.
Forwarding database (the routing table)
A list of routes generated when an algorithm is run on the link-state database.
Perrine & Brierley
3/29/2016
Page 12
Cisco 3 - OSPF
Module 2
Selecting Routes
OSPF selects routes based on cost, which is related to bandwidth. The higher the
bandwidth, the lower the OSPF cost for the link.
OSPF selects the fastest loop free path and the shortest path first as the best
path in the network.
OSPF guarantees loop-free routing, whereas distance vector protocols can cause
routing loops.
Perrine & Brierley
3/29/2016
Page 13
Cisco 3 - OSPF
Module 2
OSPF Network Types
OSPF interfaces automatically recognize 4 types of networks:
1.
broadcast multiaccess
2.
non-broadcast multiaccess (NBMA)
3.
point-to-point
4.
point-to-multipoint (which is configured by an administrator)
Perrine & Brierley
3/29/2016
Page 14
Cisco 3 - OSPF
Module 2
OSPF Network Types
Network Type
Determining Characteristic
Broadcast multiaccess
Ethernet, Token Ring or FDDI
DR Election?
Yes
Nonbroadcast multiaccess Frame relay, X.25, SMDS
Yes
Point-to-point
PPP, HDLC
No
Point-to-multipoint
Configured by an administrator
No
Perrine & Brierley
3/29/2016
Page 15
Cisco 3 - OSPF
Module 2
DR and BDR
Because a significant number of routers can exist on a multiaccess network,
OSPF’s designers developed a system to avoid the overhead that would be
created if every router established full adjacency with every other router.
Designated router (DR)
Backup designated router (BDR)
Perrine & Brierley
3/29/2016
Page 16
Cisco 3 - OSPF
Module 2
DR and BDR
Designated router (DR)
For every multiaccess IP network, one router will be elected the DR. This DR has
2 main functions:
• to become adjacent to all other routers on the network
• to act as a spokesperson for the network
Because the DR becomes adjacent to all other routers on the IP network, it is the
focal point for collecting routing information (LSAs).
Perrine & Brierley
3/29/2016
Page 17
Cisco 3 - OSPF
Module 2
DR and BDR
Backup designated router (BDR)
Because the DR could become a single point of failure, a 2nd router is elected as
the BDR to provide fault tolerance. Hence the BDR must become adjacent to all
router on the network & serves as the the 2nd focal point for LSAs.
However, the BDR is not responsible for updating the other routers or sending
network LSAs. The BDR keeps a timer on the DR’s update activity to ensure that it
is operational.
Perrine & Brierley
3/29/2016
Page 18
Cisco 3 - OSPF
Module 2
DR and BDR
NOTE:
Since there are only 2 nodes in a point-topoint network, no DR or BDR is elected.
Perrine & Brierley
3/29/2016
Page 19
Cisco 3 - OSPF
Module 2
OSPF Hello Protocol
At layer 3, all OSPF routers send hello packets to the multicast address
224.0.0.5.
OSPF routers use hello packets to initiate new adjacencies and to ensure that
adjacent neighbors haven’t disappeared.
Hellos are sent every 10 seconds by default for multiaccess and point-to-point
networks.
For NBMA networks, such as Frame Relay, hellos are sent ever 30 seconds.
Hello interval is the number of seconds that an OSPF router waits to send the
next hello packet (10 sec for multi-access and P-P, but 30 sec for NBMA).
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 4 times the hello interval by default, 40 seconds or 120
seconds in this example.
Perrine & Brierley
3/29/2016
Page 20
Cisco 3 - OSPF
Module 2
OSPF Router ID
Router ID 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 address must
be unique within a network, as it the IP address.
Because routers support multiple IP address, the highest value IP address is
used as the router ID.
When a router’s ID changes for any reason (interface goes down), the router
must reintroduce itself to its neighbors on all links.
To avoid the unnecessary overhead caused by reestablishing adjacency & readvertising link states, an administrator assigns an IP address to a loopback
interface.
If a loopback interface is configured with an IP address, the Cisco IOS will use
that IP address (loopback) as the router’s ID, even if the other interfaces
have higher addresses.
Perrine & Brierley
3/29/2016
Page 21
Cisco 3 - OSPF
Module 2
OSPF Area ID
In CCNP course on routing protocols, we will learn about creating different
areas for OSPF.
Note that 32 bits are used to represent the area ID, and that number can
be written in either decimal and dotted-decimal notation.
However, you will always have an Area 0 which is defined as the
backbone area.
Perrine & Brierley
3/29/2016
Page 22
Cisco 3 - OSPF
Module 2
Steps in the Operation of OSPF
OSPF routers progress through five distinct steps of operation:
1.
Establish router adjacencies
2.
Elect a DR and BDR (if necessary)
3.
Discover routes
4.
Select the appropriate routes to use
5.
Maintain routing information
Perrine & Brierley
3/29/2016
Page 23
Cisco 3 - OSPF
Module 2
Electing a DR and a BDR
The election process is done by the hello packets which contains router’s ID and
priority value.
The router with the highest priority value among adjacent neighbors is the DR,
and the router with the 2nd highest priority is elected the BDR.
After the DR & BDR are elected, they keep their roles until one of them fails,
even if additional routers with higher priorities show up on the network.
By default, OSPF routers have the same priority value of 1. An administrator can
assign a priority of between 0 and 255 on any given OSPF interface.
A priority of 0 prevents the router from winning any election on that interface.
A priority of 255 ensures at least a tie.
If two routers have the same priority, then the tie breaker is who has the
highest ID.
Perrine & Brierley
3/29/2016
Page 24
Cisco 3 - OSPF
Module 2
10.5.0.0/16
10.4.0.0/16
E0 10.4.0.1
10.6.0.0/16
A
C
B
BDR
Broadcast multiaccess
S1 10.6.0.1
DR
E1 10.5.0.1
S0 10.6.0.2
E0 10.5.0.2
Broadcast multiaccess
Pt-to-pt
For network 10.5.0.0, who is the DR and who is the BDR?
For network 10.4.0.0, who is the DR and who is the BDR?
No election of BDR, yet.
For network 10.6.0.0, who is the DR and who is the BDR?
No DR or BDR, because it is a point-to-point network!
Perrine & Brierley
3/29/2016
Page 25
Cisco 3 - OSPF
Module 2
Discover Routes
On a multiaccess network, the exchange of routing information occurs between
the DR or BDR and every other router on the network.
For point-to-point & point-to-multipoint network, the link partners also exchange
information.
But who goes first? This is determined in the ExStart state which establish a
master/salve relationship between the two routers.
The router with the highest ID acts as the master.
Perrine & Brierley
3/29/2016
Page 26
Cisco 3 - OSPF
Module 2
Select Appropriate Routes
After a router has a complete link-state database, it is ready to create its
routing table so that it can forward traffic.
OSPF uses the metric value cost to determine the best path to a destination.
The default cost metric is based on media bandwidth. In general, cost
decreases as the speed of the link increases.
To calculate the lowest cost to a destination, a router uses the SPF algorithm
which adds up the total costs between the local router and each destination
network. If there are multiple paths to a destination, the lowest-cost path is
preferred.
But note that OSPF can keep up to 4 equal-cost route entries in the routing
table for load balancing.
Perrine & Brierley
3/29/2016
Page 27
Cisco 3 - OSPF
Module 2
Cisco IOS Default OSPF Path Costs
The Cisco IOS automatically determines cost based on the bandwidth of an
interface using the formula: 108 / bps (bandwidth value).
Medium
Cost
56kbps serial link
1785
T1 (1.544Mbps)
64
E1 (2.048Mbps)
48
4-Mbps Token Ring
25
Ethernet
10
16-Mbps Token Ring
6
100-Mbps Fast Ethernet, FDDI
1
Perrine & Brierley
3/29/2016
Page 28
Cisco 3 - OSPF
Module 2
Maintain Routing Information
When there is a change in a link-state, OSPF routers use a flooding process to
notify other routers on the network about the change. LSU packet containing the
new link-state information is sent.
• point-to-point
New link-state information is sent to the 224.0.0.5 multicast address.
• Multiaccess networks
If the DR or BDR needs to send information, it will be sent to all OSPF
routers via 224.0.0.5. However, the other routers on a multiaccess network
are adjacent only to the DR & BDR and thus can send LSUs only to them.
Therefore DR & BDR have their own multicast address, 224.0.0.6.
Non-DR/BDR routers send their LSUs via 224.0.0.6.
When the DR receives and acknowledges the LSU destined for 224.0.0.6, it
floods the LSU to all OSPF router on the network via 224.0.0.5.
Perrine & Brierley
3/29/2016
Page 29
Cisco 3 - OSPF
Module 2
Configuring OSPF on Routers within a Single Area
We will cover the commands necessary to configure the OSPF process ID,
loopback IP address (router ID), OSPF priority, link cost, authentication, and
hello timers.
The process ID is any number between 1 and 65,535 to identify multiple OSPF
processes on the same router.
Router(config)# router ospf process-id
Router(config-router)# network address wildcard-mask area area-id
Perrine & Brierley
3/29/2016
Page 30
Cisco 3 - OSPF
Module 2
10.5.0.0/16
E0 10.4.0.1
S1 10.6.0.1
E1 10.5.0.1
A
10.4.0.0/16
10.6.0.0/16
C
B
E0 10.5.0.2
S0 10.6.0.2
Area 0
RTB(config)# router ospf 1
RTB(config-router)# network 10.5.0.0 255.255.0.0 area 0
RTB(config-router)# network 10.6.0.0 255.255.0.0 area 0
OR
RTB(config-router)# network 10.5.0.2 0.0.0.0 area 0
RTB(config-router)# network 10.6.0.1 0.0.0.0 area 0
Perrine & Brierley
3/29/2016
Page 31
Cisco 3 - OSPF
Module 2
OSPF Verification Commands
Verification commands for OSPF:
Router# show ip protocols ; verifies routing information
Router# show ip ospf
Perrine & Brierley
; verifies router ID & SPF holdtime
3/29/2016
Page 32
Cisco 3 - OSPF
Module 2
Configuring a Loopback Address for Stability
When the OSPF process starts, the Cisco IOS uses the highest local IP
address as its OSPF router ID, unless a loopback interface is configured for
IP, in which case that address is used, regardless of its value.
Though remember, the loopback interface must be configured first, and
then the OSPF process configuration to override the highest interface IP
address.
**You must be careful in configuring the loopback.
Router(config)# interface loopback0
Router(config-if)# ip address 1.1.1.1 255.255.255.255
OR
Router(config)# int lo0
Router(config-if)# ip address 1.1.1.1 255.255.255.255
Perrine & Brierley
3/29/2016
Page 33
Cisco 3 - OSPF
Module 2
Modifying OSPF Router Priority
Administrators manipulate the DR/BDR elections by configuring the priority
value to a number other than the default value of one (1).
A value of 0 guarantees that the router will not be elected as DR or BDR.
Remember that OSPF is defined to the interface, so to configure an interface,
and hence the network, NOT to be a DR or BDR, do the following:
Router(config)# interface e0
Router(config-if)# ip ospf priority 0
The verification command, show ip ospf interface, gives the following info:
• which router has been elected DR and/or BDR
• network type (broadcast multiaccess, etc.)
• cost of link
• timer intervals specific to the interface
Perrine & Brierley
3/29/2016
Page 34
Cisco 3 - OSPF
Module 2
Modifying Cost
For OSPF to calculate routers properly, all interfaces connected to the same
link must agree on the cost of that link.
Again, remember, the cost is per interface.
Router(config)# int e0
Router(config-if)# ip ospf cost 10000
To calculate the cost for OSPF, 108 / bandwidth value
Perrine & Brierley
3/29/2016
Page 35
Cisco 3 - OSPF
Module 2
Configuring Authentication
Authentication is interface specific configuration. Use the following command:
Router(config-if)# ip ospf authentication-key password
After a password is configured, you can enable authentication on an area-wide
basis by:
Router(config-router)# area number authentication [message-digest]
By default, authentication passwords will be sent in clear text. It is recommended
that one uses the option, message-digest, so the password is hashed when it is
sent over the wire. If you use message-digest, you must use the command:
Router(config-if)# ip ospf message-digest-key key-id md5 [encryption-type] password
Perrine & Brierley
3/29/2016
Page 36
Cisco 3 - OSPF
Module 2
Configuring Authentication
Router(config-if)# ip ospf message-digest-key key-id md5 [encryption-type] password
Command Parameter
Description
key-id
Key ID on each router must match to authenticate
Md5
Required value specifying MD5 algorithm
encryption-type
Optional. From 0-7. Type 0 is default. 7 Cisco encryption
password
alphanumeric
Perrine & Brierley
3/29/2016
Page 37
Cisco 3 - OSPF
Module 2
Configuring OSPF Timers
For OSPF routers to exchange information, they must have the same hello
intervals & same dead intervals on the interface.
By default, hello interval is 10 seconds, and dead interval is 4 times hello
interval, 40 seconds.
However, if the intervals must be changed for efficient issues, then use the
commands:
Router(config-if)# ip ospf hello-interval seconds
Router(config-if)# ip ospf dead-interval seconds
Perrine & Brierley
3/29/2016
Page 38
Cisco 3 - OSPF
Module 2
OSPF over Nonbroadcast Networks
NBMA, such as Frame Relay, includes more than two nodes, and hence will try
to elect DR & BDR.
But NBMA networks follow layer 2 rules which prevents the delivery of
broadcast and multicasts messages needed to elect DR & BDR.
Cisco presents methods in CCNA4 to get around this ( illustrated in a lab
assignment ):
Full-mesh Frame Relay, use the ‘network’ command to identify the nodes,
or use subinterfaces
Partial-mesh Frame Relay (hub & spoke), manually configure a point-tomultipoint network
Perrine & Brierley
3/29/2016
Page 39
Cisco 3 - OSPF
Module 2
Propagating Default Route in OSPF
To gain access to networks that are not in the routing table, a default gateway
must be set at a border router.
To propagate the default route, 0.0.0.0 /0, to all the routers in a normal OSPF
area, use the following configuration:
Router(config-router)# default-information originate
Perrine & Brierley
3/29/2016
Page 40
Cisco 3 - OSPF
Module 2
END
Perrine & Brierley
3/29/2016
Page 41