ICND210S04L01-Implementing OSP CCNAF.ppt

nguyenhuulamtung 20 views 56 slides Sep 01, 2025
Slide 1
Slide 1 of 56
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56

About This Presentation

Advance knowledge about CCNA CCNP CCIE


Slide Content

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-1
Single-Area OSPF Implementation
Implementing
OSPF

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-2
Overview of link-state routing
Protocol Description Characteristics
Link-stateOpen Shortest Path
First (OSPF)
Intermediate-system
to Intermediate-
system (IS-IS)
•Use shortest path
•Updates are event triggered
•Fast to converge
•Send link-state packets to all network routers
•Has common view of network
•Not as susceptible to routing loops
•Harder to configure
•Requires more memory and processing power
than distance vector
•Consumes less bandwidth than distance
vector

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-3
Link-state routing protocol functions
Link-state routing protocols collect routing information
from all other routers in the network.
Each router maintains its own complex database of
topology information, the own view of the network.
Link-state routing protocols functions:
Respond quickly to network changes
Send triggered updates only when a network change
has occurred
Send periodic updates known as link-state refreshes
Use a hello mechanism to determine the reachability of
neighbors

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-4
Link-state routing protocol features
Uses the hello information and Link-state advertisements
(LSAs) it receives from other routers to build a
database about the network
 A topological database
Uses the shortest path first (SPF) algorithm (Dijkstra
algorithm) to calculate the shortest route to each
network
 The resulting SPF tree
Stores this route information in its routing table

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-5
How routing information is maintained
When a failure occurs in the network, each link-state
router take flowing action:
Flood LSAs using a special multicast address throughout
an area.
Copy of the LSA and updates its link-state, or topological
database.
Then forward the LSA to all neighboring devices
Recalculate their routing tables.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-6
Link-state routing algorithms
They are known collectively as shortest path first (SPF)
protocols.
They maintain a complex database of the network
topology.
They are based on the Dijkstra algorithm.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-7
Advantages and disadvantages of link-state
routing
Advantages Disadvantages
•Fast convergence: Changes are
reported immediately by the source
affected
•Robustness against routing loops
•Routers know the topology
•Link-state packets are sequenced
and aged
•The link-state database sizes can
minimized with careful network
design
•Significant demands on memory and
processing resources
•Requires very strict network design
•Requires a knowledgeable network
administrator
•Initial flooding can impede network
performance

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-8
OSPF Overview
Creates a neighbor relationship by exchanging hello packets
Propagates LSAs rather than routing table updates
–Link: Router interface
–State: Description of an interface and its relationship to neighboring
routers
Floods LSAs to all OSPF routers in the area, not just directly connected
routers
Pieces together all the LSAs generated by the OSPF routers to create the
OSPF link-state database
Uses the SPF algorithm to calculate the shortest path to each destination
and places it in the routing table

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-9
OSPF Hierarchy Example
Minimizes routing table entries
Localizes the impact of a topology change within an area

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-10
OSPF terminology: Link Cost
The value assigned to a link. Link-state protocols assign
a cost to a link that is based on the speed of the media.
Interface Output Cost.
Neighbors
Token
Ring
Interfaces
Cost = 10
Cost = 6
Cost = 1785

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-11
OSPF terminology: Adjacency database
A listing of all the neighbors to which a router has
established bi-directional communication. Not every pair of
neighboring routers become adjacent
Adjacency
database
Neighbors
Token
Ring

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-12
OSPF terminology: Link-state database
Also known as a topological database
A list of link-state entries of all other routers in the internetwork
Token
Ring
Topological
Database
Adjacency
database

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-13
OSPF terminology: Routing table
The routing table (also known as forwarding database)
generated when an algorithm is run on the link-state database.
Each router’s routing table is unique
Adjacency
Database
Lists neighbors
Token
Ring
Topological
Database
Lists all routes
Routing
Table
Lists best routes

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-14
OSPF terminology: DR and BDR router
Designated router (DR) and backup designated router (BDR):
A router that is elected by all other routers on the same LAN to represent all
the routers.
Each network has a DR and BDR
Token
Ring
DRDR
BDR

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-15
Shortest path algorithm
1
4
1 4
2
22
ABC
D
E F G
The best path is the lowest cost path.
Cost = Reference Bandwidth / Interface Bandwidth
(b/s)

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-16
Shortest Path First Tree for node B
1
(1, B)
1
4
2
22
A
B
C
D
E F G
(3, C)
(4, E)
2
(5, E) (6, A)
(4, B)

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-17
OSPF network types

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-18
DR and BDR receive LSAs
•Hellos elect DR and BDR to present segment
•Each router then forms adjacency with DR and
BDR

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-19
OSPF Hello Protocol
The rules that govern the exchange of OSPF hello packets are called
the Hello protocol.
Hello packets use : 224.0.0.5 (all routers).
Hello packets are sent at regular intervals (default):
Multi access and Point-to-point: 10s
NBMA : 30s
On multi-access networks the Hello protocol elects a designated router
(DR) and a backup designated router (BDR).
The hello packet carries information that all neighbors must agree upon
before an adjacency is formed, and link-state information is exchanged.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-20
OSPF packet header
• For the hello packet the type field is set to 1.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-21
OSPF Hello Protocol - Hello header

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-22
OSPF Topologies
Point-to-Point
Broadcast
Multiaccess
NBMA X.25
Frame Relay

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-23
Steps in the operation of OSPF
5 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.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-24
OSPF Operation in a
Broadcast Multiaccess Topology
Broadcast
Multiaccess

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-25
Configuring Loopback Interfaces
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
Can be set manually using the router-id command

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-26
Step 1: Establish router adjacencies
First step in OSPF operation is to establish router adjacencies
RTB sends hello packets, advertising its own router ID  highest IP
address:10.6.0.1(no loopback)

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-27
Step 1: Establish router adjacencies
(cont.)
Router ID
Hello/dead intervals
Neighbors
Area-ID
Router priority
DR IP address
BDR IP address
Authentication password
Stub area flag
*
*
*
*
* Entry must match on neighboring routers
Hello
afadjfjorqpoeru
39547439070713
Hello
A
D E
CB

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-28
Step 2: Electing the DR and BDR (if
necessary).
P=1 P=0P=1
P=3 P=2
DR BDR
Hello
•The router with the highest priority value is the
DR.
•The router with the second highest priority value
is the BDR.
•The default for the interface OSPF priority is 1. In
case of a tie, the router’s router ID is used.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-29
Step 3: Discover routes
On difference network have differ discover process.
On multi-access network, the exchange of routing information occurs
between the DR or BDR and every other router on the network.
Link partners on a point-to-point or point-to-multipoint network also
engage (tham gia) in the exchange process.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-30
Exchange Process
Router B
Neighbors List
172.16.5.1/24, int E1
172.16.5.1/24
E0
I am router ID 172.16.5.2, and I see 172.16.5.1.
Router A
Neighbors List
172.16.5.2/24, int E0
172.16.5.2/24
E1
I am router ID 172.16.5.1 and I see no one.
Down State
Init State
A B
Two-way State
Two-way State
I am router ID 172.16.51, and I see 172.16.5.2.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-31
Step 3: Discover routes (cont.)
DBD
afadjfjorqpoeru
39547439070713
Here is a summary of my link-state database.
Here is a summary of my link-state database.DBD
afadjfjorqpoeru
39547439070713
E0
172.16.5.1
DR
E0
172.16.5.3
No, I will start exchange because I have a
higher router ID.
I will start exchange because I have router ID 172.16.5.1.Hello
afadjfjorqpoeru
39547439070713
Hello
afadjfjorqpoeru
39547439070713
Exstart State
Exchange State
Exchange State
Exstart State

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-32
Step 3: Discover routes (cont.)
Full State
I need the complete entry for network 172.16.6.0/24.
Here is the entry for network 172.16.6.0/24.
Thanks for the information!
LSR
afadjfjorqpoeru
39547439070713
LSAck
afadjfjorqpoeru
39547439070713
LSU
afadjfjorqpoeru
39547439070713
Loading State
E0
172.16.5.1
E0
172.16.5.3
LSAck
afadjfjorqpoeru
39547439070713
Thanks for the information!
LSAck
afadjfjorqpoeru
39547439070713
DR

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-33
Step 4: Choosing Routes
Topology Table
Net Cost Out Interface
10.2.2.0 6 To0
10.3.3.0 7 To0
10.3.3.0 10 E0
This is the best route to 10.3.3.0.
Token
Ring
Cost=10
Cost=6
FDDI
Cost=1
A B C
10.1.1.0/24 10.2.2.0/24 10.3.3.0/24
10.4.4.0/24

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-34
Step 5: Maintaining Routing Information
Router A tells all OSPF DRs on 224.0.0.6
xx
LSU
1
Link-State Change
DR
A
B

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-35
Step 5: Maintaining Routing Information
Router A tells all OSPF DRs on 224.0.0.6
DR tells all others on 224.0.0.5
LSU
2
xx
Link-State Change
LSU
1
DR
A
B

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-36
LSU
3
Step 5: Maintaining Routing Information
LSU
2
xx
Link-State Change
LSU
1
DR
A
B
Router A tells all OSPF DRs on 224.0.0.6
DR tells all others on 224.0.0.5

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-37
Step 5: Maintaining Routing Information
I need to update
my routing table.
4
LSU
3
LSU
2
xx
Link-State Change
LSU
1
DR
A
B
Router A tells all OSPF DRs on 224.0.0.6
DR tells all others on 224.0.0.5

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-42
OSPF Operation in a Point-to-Point
Point-to-Point Neighborship
Router dynamically detects its neighboring router using the Hello
protocol
No election: Adjacency is automatic as soon as the two routers
can communicate
OSPF packets are always sent as multicast 224.0.0.5

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-43
OSPF Operation in an NBMA
NBMA Topology
Single interface interconnects multiple sites
NBMA topologies support multiple routers but without
broadcasting capabilities
X.25
Frame Relay
ATM

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-44
SINGLE AREA OSPF
Configuration

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-45
Configuring Single-Area OSPF
network address wildcard-mask area area-id
Assigns networks to a specific OSPF area
router ospf process-id
Defines OSPF as the IP routing protocol
RouterX(config)#
RouterX(config-router)#

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-46
Verifying the OSPF Configuration
RouterX# show ip protocols
 Verifies that OSPF is configured
RouterX# show ip route
 Displays all the routes learned by the router
RouterX# show ip route
Codes: I - IGRP derived, R - RIP derived, O - OSPF derived,
C - connected, S - static, E - EGP derived, B - BGP derived,
E2 - OSPF external type 2 route, N1 - OSPF NSSA external type 1 route,
N2 - OSPF NSSA external type 2 route
Gateway of last resort is 10.119.254.240 to network 10.140.0.0
O 10.110.0.0 [110/5] via 10.119.254.6, 0:01:00, Ethernet2
O IA 10.67.10.0 [110/10] via 10.119.254.244, 0:02:22, Ethernet2
O 10.68.132.0 [110/5] via 10.119.254.6, 0:00:59, Ethernet2
O 10.130.0.0 [110/5] via 10.119.254.6, 0:00:59, Ethernet2
O E2 10.128.0.0 [170/10] via 10.119.254.244, 0:02:22, Ethernet2
. . .

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-47
Verifying the OSPF Configuration (Cont.)
RouterX# show ip ospf
Routing Process "ospf 50" with ID 10.64.0.2
<output omitted>
Number of areas in this router is 1. 1 normal 0 stub 0 nssa
Number of areas transit capable is 0
External flood list length 0
Area BACKBONE(0)
Area BACKBONE(0)
Area has no authentication
SPF algorithm last executed 00:01:25.028 ago
SPF algorithm executed 7 times
<output omitted>
 Displays the OSPF router ID, timers, and statistics
RouterX# show ip ospf

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-48
RouterX# show ip ospf interface ethernet 0
Ethernet 0 is up, line protocol is up
Internet Address 192.168.254.202, Mask 255.255.255.0, Area 0.0.0.0
AS 201, Router ID 192.168.99.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State OTHER, Priority 1
Designated Router id 192.168.254.10, Interface address 192.168.254.10
Backup Designated router id 192.168.254.28, Interface addr 192.168.254.28
Timer intervals configured, Hello 10, Dead 60, Wait 40, Retransmit 5
Hello due in 0:00:05
Neighbor Count is 8, Adjacent neighbor count is 2
 
 
Adjacent with neighbor 192.168.254.28 (Backup Designated Router)
 
 
Adjacent with neighbor 192.168.254.10 (Designated Router)
RouterX# show ip ospf interface
Verifying the OSPF Configuration (Cont.)
Displays the area ID and adjacency information

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-49
RouterX# show ip ospf neighbor
ID Pri State Dead Time Address Interface
10.199.199.137
 
1 FULL/DR 0:00:31 192.168.80.37 FastEthernet0/0
172.16.48.1 1 FULL/DROTHER 0:00:33 172.16.48.1
  FastEthernet0/1
172.16.48.200 1 FULL/DROTHER 0:00:33 172.16.48.200
 FastEthernet0/1
10.199.199.137
 
5 FULL/DR 0:00:33 172.16.48.189
 FastEthernet0/1
Verifying the OSPF Configuration (Cont.)
RouterX# show ip ospf neighbor
 Displays the OSPF neighbor information on a per-interface basis

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-50
RouterX#
 
show ip ospf neighbor 10.199.199.137
Neighbor 10.199.199.137, interface address 192.168.80.37
In the area 0.0.0.0 via interface Ethernet0
Neighbor priority is 1, State is FULL
Options 2
Dead timer due in 0:00:32
Link State retransmission due in 0:00:04
Neighbor 10.199.199.137, interface address 172.16.48.189
In the area 0.0.0.0 via interface Fddi0
Neighbor priority is 5, State is FULL
Options 2
Dead timer due in 0:00:32
Link State retransmission due in 0:00:03
Verifying the OSPF Configuration (Cont.)

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-51
RouterX# debug ip ospf events
OSPF:hello with invalid timers on interface Ethernet0
hello interval received 10 configured 10
net mask received 255.255.255.0 configured 255.255.255.0
dead interval received 40 configured 30
OSPF: rcv. v:2 t:1 l:48 rid:200.0.0.117
aid:0.0.0.0 chk:6AB2 aut:0 auk:

RouterX# debug ip ospf packet

OSPF: rcv. v:2 t:1 l:48 rid:200.0.0.116
aid:0.0.0.0 chk:0 aut:2 keyid:1 seq:0x0
OSPF debug Commands

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-52
Load Balancing with OSPF
OSPF load balancing:
Paths must be equal cost
By default, up to four equal-cost paths can be placed into the
routing table
With a configuration change, up to a maximum of 16 paths can be
configured:
–(config-router)# maximum-paths <value>
To ensure paths are equal cost for load balancing, you can
change the cost of a particular link:
–(config-if)# ip ospf cost <value>

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-53
Load Balancing with OSPF

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-54
OSPF Authentication
OSPF supports two types of authentication:
–Plaintext (or simple) password authentication
–MD5 authentication
The router generates and checks every OSPF packet.
The router authenticates the source of each routing update
packet that it receives.
Configure a “key” (password); each participating neighbor
must have the same key configured.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-55
Configuring OSPF Plaintext Password
Authentication
ip ospf authentication-key password
RouterX(config-if)#
Assigns a password to use with neighboring routers
RouterX(config-if)#
ip ospf authentication [message-digest | null]
Specifies the authentication type for an interface (as of Cisco
IOS Release 12.0)
RouterX(config-router)#
area area-id authentication [message-digest]
Specifies the authentication type for an area
OR

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-56
Plaintext Password Authentication
Configuration Example

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-57
Verifying Plaintext Password
Authentication
RouterX#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
10.2.2.2 0 FULL/ - 00:00:32 192.168.1.102 Serial0/0/1
RouterX#show ip route
<output omitted>
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O 10.2.2.2/32 [110/782] via 192.168.1.102, 00:01:17, Serial0/0/1
C 10.1.1.0/24 is directly connected, Loopback0
192.168.1.0/27 is subnetted, 1 subnets
C 192.168.1.96 is directly connected, Serial0/0/1
RouterX#ping 10.2.2.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.2.2.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/29/32 ms

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-58
Visual Objective 4-1: Implementing OSPF

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-59
Summary
OSPF is a classless, link-state routing protocol that uses an area hierarchy for fast
convergence.
OSPF exchanges hello packets to establish neighbor adjacencies between routers.
The SPF algorithm uses a cost metric to determine the best path. Lower costs indicate
a better path.
The router ospf process-id command is used to enable OSPF on the router.
Use a loopback interface to keep the OSPF router ID consistent.
The show ip ospf neighbor command displays OSPF neighbor information on a per-
interface basis.
The commands debug ip ospf events and debug ip ospf packets can be used to
troubleshoot OSPF problems.
OSPF will load-balance across up to four equal-cost metric paths by default.
There are two types of OSPF authentication: Plaintext and MD5.

© 2007 Cisco Systems, Inc. All rights reserved. ICND2 v1.0—4-60
Tags