Module 5
Configuring OSPF in a Single Area
2001, Cisco Systems, Inc. 5-1
Objectives
Upon completing this lesson, you will be able to:
Explain why OSPF is better than RIP in a large internetwork
Explain how OSPF discovers, chooses, and maintains routes
Explain how OSPF operates in a single-area NBMA environment Configure OSPF for proper operation in a single area
Verify OSPF operation in a single area
2001, Cisco Systems, Inc. BSCI v1.2 5-2
Objectives (cont.)
Configure a single-area OSPF environment and verify proper operation (within described guidelines) of your routers, given an addressing scheme and other laboratory parameters
Configure single-area OSPF in an NBMA environment and verify proper operation (within described guidelines) of your routers, given an addressing scheme and other laboratory parameters
2001, Cisco Systems, Inc. BSCI v1.2 5-3
OSPF Overview
2001, Cisco Systems, Inc.
5-4
What Is OSPF?
Has fast convergence Supports VLSM
Processes updates efficiently
Selects paths based on bandwidth Supports equal-cost multipath
2001, Cisco Systems, Inc.
BSCI v1.2 5-5
OSPF in IP Packets
89OSPF 6TCP 17UDP
Frame Payload
Frame Header
IP Header
Protocol Number
Packet Payload
C R C
OSPF is a link-state routing protocol
Relies on IP packets for delivery of routing information Uses protocol number 89
2001, Cisco Systems, Inc. BSCI v1.2 5-6
OSPF Terminology
2001, Cisco Systems, Inc.
5-7
OSPF Terminology (cont.)
Autonomous System
Neighbors
Interfaces
Area 1
Cost = 1785
Neighborship Database Lists Neighbors
Cost = 10
Area 0
Token Ring
Cost = 6
Topology Database Lists All Routes Routing Table Lists Best Routes
2001, Cisco Systems, Inc.
BSCI v1.2 5-8
OSPF Operation in a Broadcast Multiaccess Topology
2001, Cisco Systems, Inc.
5-9
Neighborship
D
E
Hello
afadjfjorqpoeru 39547439070713
Hello
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
2001, Cisco Systems, Inc. BSCI v1.2 5-10
Neighborship (cont.)
D
E
Hello
afadjfjorqpoeru 39547439070713
Hello
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
2001, Cisco Systems, Inc. BSCI v1.2 5-11
DR and BDR
DR
BDR
Hellos elect DR and BDR to represent segment Each router then forms adjacency with DR and BDR
2001, Cisco Systems, Inc. BSCI v1.2 5-12
Electing the DR and BDR
P=3
DR
P=2
BDR
Hello
P=1
P=1
P=0
Hello packets exchanged via IP multicast Router with highest OSPF priority elected
2001, Cisco Systems, Inc.
BSCI v1.2 5-13
Exchange Process
A
172.16.5.1/24 E0
172.16.5.2/24 E1
Down State
2001, Cisco Systems, Inc.
BSCI v1.2 5-14
Exchange Process
A
172.16.5.1/24 E0
172.16.5.2/24 E1
Down State
I am router ID 172.16.5.1 and I see no one.
Init State
Router B Neighbors List 172.16.5.1/24, int E1
2001, Cisco Systems, Inc.
BSCI v1.2 5-15
Exchange Process
A
172.16.5.1/24 E0
172.16.5.2/24 E1
Down State
I am router ID 172.16.5.1 and I see no one.
Init State
Router B Neighbors List 172.16.5.1/24, int E1
I am router ID 172.16.5.2, and I see 172.16.5.1.
2001, Cisco Systems, Inc.
BSCI v1.2 5-16
Exchange Process
A
172.16.5.1/24 E0
172.16.5.2/24 E1
Down State
I am router ID 172.16.5.1 and I see no one.
Init State
Router B Neighbors List 172.16.5.1/24, int E1
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
Two-Way State
2001, Cisco Systems, Inc.
BSCI v1.2 5-17
Discovering Routes
DR
E0
E0
172.16.5.1
afadjfjorqpoeru 39547439070713
172.16.5.3
Exstart State
Hello
I will start exchange because I have router ID 172.16.5.1.
afadjfjorqpoeru 39547439070713
No, I will start exchange because I have a higher router ID.
Hello
2001, Cisco Systems, Inc.
BSCI v1.2 5-18
Discovering Routes
DR
E0
E0
172.16.5.1
afadjfjorqpoeru 39547439070713
172.16.5.3
Exstart State
Hello
I will start exchange because I have router ID 172.16.5.1.
afadjfjorqpoeru 39547439070713
No, I will start exchange because I have a higher router ID.
Exchange State
Hello
afadjfjorqpoeru 39547439070713
Here is a summary of my link-state database.
afadjfjorqpoeru 39547439070713
DBD
DBD
2001, Cisco Systems, Inc.
Here is a summary of my link-state database.
BSCI v1.2 5-19
Discovering Routes (cont.)
DR
E0 172.16.5.1
afadjfjorqpoeru 39547439070713
E0 172.16.5.3
afadjfjorqpoeru 39547439070713
LSAck
Thanks for the information!
LSAck
2001, Cisco Systems, Inc.
BSCI v1.2 5-20
Discovering Routes (cont.)
DR
E0 172.16.5.1
afadjfjorqpoeru 39547439070713
E0 172.16.5.3
afadjfjorqpoeru 39547439070713
LSAck
afadjfjorqpoeru 39547439070713
Thanks for the information!
Loading State
LSAck
LSR
I need the complete entry for network 172.16.6.0/24.
afadjfjorqpoeru 39547439070713
Here is the entry for network 172.16.6.0/24.
afadjfjorqpoeru 39547439070713
LSU
LSAck Thanks for the information!
2001, Cisco Systems, Inc. BSCI v1.2 5-21
Discovering Routes (cont.)
DR
E0 172.16.5.1
afadjfjorqpoeru 39547439070713
E0 172.16.5.3
afadjfjorqpoeru 39547439070713
LSAck
afadjfjorqpoeru 39547439070713
Thanks for the information!
Loading State
LSAck
LSR
I need the complete entry for network 172.16.6.0/24.
afadjfjorqpoeru 39547439070713
Here is the entry for network 172.16.6.0/24.
afadjfjorqpoeru 39547439070713
LSU
LSAck Thanks for the information!
Full State
2001, Cisco Systems, Inc. BSCI v1.2 5-22
Choosing Routes
10.1.1.0/24
A
Token Ring
10.2.2.0/24
B
FDDI
10.3.3.0/24
C
Cost=6 Cost=1 Cost=10
10.4.4.0/24 Topology Table Net Cost Out Interface 10.2.2.0 7 To0 This is the best route to 10.3.3.0. 10.3.3.0 17 To0 10.3.3.0 20 E0
2001, Cisco Systems, Inc. BSCI v1.2 5-23
Cost=10
Maintaining Routing Information
Link-State Change
DR
1 LSU
B A
Router A notifies all OSPF DRs on 224.0.0.6
2001, Cisco Systems, Inc.
BSCI v1.2 5-24
Maintaining Routing Information (cont.)
Link-State Change
LSU
2
DR
1 LSU
B A
Router A notifies all OSPF DRs on 224.0.0.6 DR notifies others on 224.0.0.5
2001, Cisco Systems, Inc. BSCI v1.2 5-25
Maintaining Routing Information (cont.)
Link-State Change
LSU
2
DR
1 LSU
B A
3
LSU
Router A notifies all OSPF DRs on 224.0.0.6 DR notifies others on 224.0.0.5
2001, Cisco Systems, Inc. BSCI v1.2 5-26
Maintaining Routing Information (cont.)
Link-State Change
LSU
2
DR
4 I need to update my routing table.
1 LSU
B A
3
LSU
Router A notifies all OSPF DRs on 224.0.0.6 DR notifies others on 224.0.0.5
2001, Cisco Systems, Inc. BSCI v1.2 5-27
Configuring OSPF in a Single Area
2001, Cisco Systems, Inc. 5-28
Configuring OSPF on Internal Routers
Broadcast Network
E0
A
Point-to-Point Network
S0
B
10.64.0.2
10.64.0.1
E0
10.2.1.2
10. 2.1.1 S1
C
<Output Omitted>
interface Ethernet0 ip address 10.64.0.1 255.255.255.0 ! <Output Omitted>
router ospf 1 network 10.0.0.0 0.255.255.255 area 0
<Output Omitted> interface Ethernet0 ip address 10.64.0.2 255.255.255.0
!
interface Serial0 ip address 10.2.1.2 255.255.255.0 <Output Omitted> router ospf 50
network 10.2.1.2 0.0.0.0 area 0
network 10.64.0.2 0.0.0.0 area 0
Can assign network or interface address.
2001, Cisco Systems, Inc. BSCI v1.2 5-29
Configuring Optional Commands
Unadvertised Loopback Address Ex: 192.168.255.254 Not in OSPF table Saves address space Cannot use ping Advertised Loopback Address Ex: 172.16.17.5 In OSPF table Uses address space Can use ping
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
2001, Cisco Systems, Inc. BSCI v1.2 5-30
Configuring Optional Commands (cont.)
Traffic
Token Ring
Cisco
Router(config-if)#
Non-Cisco
ip ospf cost cost
Assigns a cost to an outgoing interface May be required for interoperability Uses default cost between Cisco devices
2001, Cisco Systems, Inc.
BSCI v1.2 5-31
Verifying OSPF Operation
2001, Cisco Systems, Inc. 5-32
Verifying OSPF Operation
Router#
show ip protocols
Verifies that OSPF is configured
Router#
show ip route
Displays all the routes learned by the router
Router#
show ip ospf interface
Displays area-ID and adjacency information
2001, Cisco Systems, Inc. BSCI v1.2 5-33