0% found this document useful (0 votes)
15 views

Ospf

Pic

Uploaded by

tyagilalit88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Ospf

Pic

Uploaded by

tyagilalit88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 52

OSPF (Open Shortest Path First)

Protocol

© 2003, Cisco Systems, Inc. All rights reserved. 1


OSPF is a Link-State Routing
Protocols
– Link-state (LS) routers recognize much more information
about the network than their distance-vector
counterparts,Consequently LS routers tend to make more accurate
decisions.

– Link-state routers keep track of the following:


• Their neighbours
• All routers within the same area
• Best paths toward a destination
Link-State Data Structures

– Neighbor table:
• Also known as the adjacency database
(list of recognized neighbors)

– Topology table:
• Typically referred to as LSDB
(routers and links in the area or network)
• All routers within an area have an identical LSDB

– Routing table:
• Commonly named a forwarding database
(list of best paths to destinations)
OSPF vs. RIP
RIP is limited to 15 hops, it converges slowly, and it sometimes chooses
slow routes because it ignores critical factors such as bandwidth in route
determination. OSPF overcomes these limitations and proves to be a
robust and scalable routing protocol suitable for the networks of today.
OSPF Terminology
The next several slides explain various OSPF terms -
one per slide.
OSPF Term: Link
OSPF Term: Link State
OSPF Term: Area
OSPF Term: Link Cost
OSPF Term: Forwarding Database
OSPF Term: Adjacencies Database
OSPF Terms: DR & BDR
Link-State Data Structure:
Network Hierarchy

•Link-state routing requires a hierachical


network structure that is enforced by OSPF.
•This two-level hierarchy consists of the
following:
• Transit area (backbone or area 0)
• Regular areas (nonbackbone areas)
OSPF Areas
Area Terminology
LS Data Structures: Adjacency
Database

– Routers discover neighbors by exchanging


hello packets.
– Routers declare neighbors to be up after checking
certain parameters or options in the hello packet.
– Point-to-point WAN links:
• Both neighbors become fully adjacent.
– LAN links:
• Neighbors form an adjacency with the DR and BDR.
• Maintain two-way state with the other routers (DROTHERs).
– Routing updates and topology information are only passed
between adjacent routers.
OSPF Adjacencies

Routers build logical adjacencies between each other


using the Hello Protocol. Once an adjacency is formed:
• LS database packets are exchanged to synchronize
each other’s LS databases.
• LSAs are flooded reliably throughout the area or network
using these adjacencies.
Open Shortest Path First
Calculation
•Routers find the best paths to destinations by
applying Dijkstra’s SPF algorithm to the link-state
database as follows:
– Every router in an area has the identical
link-state database.
– Each router in the area places itself into
the root of the tree that is built.
– The best path is calculated with respect to the
lowest total cost of links to a specific destination.
– Best routes are put into the forwarding database.
OSPF Packet Types
OSPF Packet Header Format
Neighborship
Establishing Bidirectional
Communication
Establishing Bidirectional
Communication (Cont.)
Establishing Bidirectional
Communication (Cont.)
Establishing Bidirectional
Communication
Discovering the Network Routes
Discovering the Network Routes
Adding the Link-State Entries
Adding the Link-State Entries
(Cont.)
Adding the Link-State Entries
Maintaining Routing Information

• Router A notifies all OSPF DRs on 224.0.0.6


Maintaining Routing Information
(Cont.)

• Router A notifies all OSPF DRs on 224.0.0.6


• DR notifies others on 224.0.0.5
Maintaining Routing Information
(Cont.)

• Router A notifies all OSPF DRs on 224.0.0.6


• DR notifies others on 224.0.0.5
Maintaining Routing Information

• Router A notifies all OSPF DRs on 224.0.0.6


• DR notifies others on 224.0.0.5
Configuring Basic OSPF:
Single Area
Router(config)#
router ospf process-id

• Turns on one or more OSPF routing processes in


the IOS software.

Router(config-router)#
network address inverse-mask area [area-id]

• Router OSPF subordinate command that defines


the interfaces (by network number) that OSPF
will run on. Each network number must be
defined to a specific area.
Configuring OSPF on Internal
Routers of a Single Area
Verifying OSPF Operation
Router#
show ip protocols

• Verifies the configured IP routing protocol


processes, parameters and statistics
Router#
show ip route ospf

• Displays all OSPF routes learned by the router


Router#
show ip ospf interface

• Displays the OSPF router ID, area ID and


adjacency information
Verifying OSPF Operation
(Cont.)

Router#
show ip ospf

• Displays the OSPF router ID, timers, and statistics

Router#
show ip ospf neighbor [detail]

• Displays information about the OSPF neighbors,


including Designated Router (DR) and Backup
Designated Router (BDR) information on
broadcast networks
The show ip route ospf
Command
RouterA# show ip route ospf

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile,

B - BGP, D - EIGRP, EX - EIGRP external, O - OSPF,


IA - OSPF inter area, E1 - OSPF external type 1,
E2 - OSPF external type 2, E - EGP, i - IS-IS, L1 - IS-IS
level-1, L2 - IS-IS level-2, * - candidate default

Gateway of last resort is not set


10.0.0.0 255.255.255.0 is subnetted, 2 subnets
O 10.2.1.0 [110/10] via 10.64.0.2, 00:00:50, Ethernet0
The show ip ospf interface
Command
RouterA# show ip ospf interface e0

Ethernet0 is up, line protocol is up


Internet Address 10.64.0.1/24, Area 0
Process ID 1, Router ID 10.64.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID) 10.64.0.2, Interface address 10.64.0.2
Backup Designated router (ID) 10.64.0.1, Interface address 10.64.0.1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:04
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 10.64.0.2 (Designated Router)
Suppress hello for 0 neighbor(s)
The show ip ospf neighbor
Command
RouterB# show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface


10.64.1.1 1 FULL/BDR 00:00:31 10.64.1.1 Ethernet0
10.2.1.1 1 FULL/- 00:00:38 10.2.1.1 Serial0
show ip protocol

show ip route
show ip ospf neighbor detail

show ip ospf database


OSPF Network Types - 1
Point-to-Point Links

• Usually a serial interface running either PPP


or HDLC
• May also be a point-to-point subinterface
running Frame Relay or ATM
• No DR or BDR election required
• OSPF autodetects this interface type
• OSPF packets are sent using multicast 224.0.0.5
Multi-access Broadcast Network

• Generally LAN technologies like Ethernet and Token Ring


• DR and BDR selection required
• All neighbor routers form full adjacencies with the DR and
BDR only
• Packets to the DR use 224.0.0.6
• Packets from DR to all other routers use 224.0.0.5
Electing the DR and BDR

• Hello packets are exchanged via IP multicast.


• The router with the highest OSPF priority is
selected as the DR.
• Use the OSPF router ID as the tie breaker.
• The DR election is nonpreemptive.
Setting Priority for DR Election
Router(config-if)#
ip ospf priority number

• This interface configuration command assigns the


OSPF priority to an interface.
• Different interfaces on a router may be assigned
different values.
• The default priority is 1. The range is from 0 to 255.
• 0 means the router is a DROTHER; it can’t be the
DR or BDR.
OSPF Network Types - 2
Creation of Adjacencies
RouterA# debug ip ospf adj

Point-to-point interfaces coming up: No election


%LINK-3-UPDOWN: Interface Serial1, changed state to up
OSPF: Interface Serial1 going Up
OSPF: Rcv hello from 192.168.0.11 area 0 from Serial1 10.1.1.2
OSPF: End of hello processing
OSPF: Build router LSA for area 0, router ID 192.168.0.10
OSPF: Rcv DBD from 192.168.0.11 on Serial1 seq 0x20C4 opt 0x2 flag 0x7 len 32
state INIT
OSPF: 2 Way Communication to 192.168.0.11 on Serial1, state 2WAY
OSPF: Send DBD to 192.168.0.11 on Serial1 seq 0x167F opt 0x2 flag 0x7 len 32
OSPF: NBR Negotiation Done. We are the SLAVE
OSPF: Send DBD to 192.168.0.11 on Serial1 seq 0x20C4 opt 0x2 flag 0x2 len 72
Creation of Adjacencies (Cont.)
RouterA# debug ip ospf adj

Ethernet interface coming up: Election


OSPF: 2 Way Communication to 192.168.0.10 on Ethernet0, state 2WAY
OSPF: end of Wait on interface Ethernet0
OSPF: DR/BDR election on Ethernet0
OSPF: Elect BDR 192.168.0.12
OSPF: Elect DR 192.168.0.12
DR: 192.168.0.12 (Id) BDR: 192.168.0.12 (Id)
OSPF: Send DBD to 192.168.0.12 on Ethernet0 seq 0x546 opt 0x2 flag 0x7 len 32
<…>
OSPF: DR/BDR election on Ethernet0
OSPF: Elect BDR 192.168.0.11
OSPF: Elect DR 192.168.0.12
DR: 192.168.0.12 (Id) BDR: 192.168.0.11 (Id)

You might also like