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

OSPF

The document discusses the concepts and terminology of the Open Shortest Path First (OSPF) routing protocol, including links, areas, link costs, databases, designated routers, and the five steps of OSPF operation which include establishing adjacencies, electing a designated router, discovering routes through exchange processes, selecting routes, and maintaining routing information. OSPF is a link-state routing protocol that uses link costs rather than hops to determine the best path and allows for hierarchical network design through the use of areas to reduce routing table size for large internetworks.

Uploaded by

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

OSPF

The document discusses the concepts and terminology of the Open Shortest Path First (OSPF) routing protocol, including links, areas, link costs, databases, designated routers, and the five steps of OSPF operation which include establishing adjacencies, electing a designated router, discovering routes through exchange processes, selecting routes, and maintaining routing information. OSPF is a link-state routing protocol that uses link costs rather than hops to determine the best path and allows for hierarchical network design through the use of areas to reduce routing table size for large internetworks.

Uploaded by

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

` Routing

Open Shortest Path First


(OSPF)
1
SINGLE AREA OSPF CONCEPTS
2
`OSPF overview

• Open Shortest Path First (OSPF) is a link-state


routing protocol based on open standards.
• The most recent description is RFC 2328. The Open
in OSPF means that it is open to the public and is
non-proprietary.
3
`OSPF terminology
4
`OSPF terminology: Links

• An interface on Router

Links

Token
Ring
5
`OSPF terminology: Link state
• The status of a link between two routers. Also a
router’s interface and its relationship to its
neighboring routers.

Neighbors
Links

Token
Ring
6
`OSPF terminology: 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

Area 1
Area 0
Token
Ring
7
`OSPF Areas—Example

Area 3

Area 0

Area 2

Area 1
8
`OSPF terminology: Link Cost

• The value assigned to a link. Rather than


hops, link-state protocols assign a cost to a
link that is based on the speed of the media.
• Interface Output Cost.
Neighbors
Interfaces
Cost = 10

Token
Ring
Cost = 1785 Cost = 6
9
`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

Neighbors

Token
Ring

Adjacency
database
10
`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

Adjacency Topological
database Database
11
`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

Token
Ring

Adjacency Topological Routing


Database Database Table
Lists neighbors Lists all routes Lists best routes
12
`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

DR

Token
Ring BDR
13
`Comparing OSPF with distance vector routing protocols

Distance vector OSPF


• View network topology from • Gets common view of
neighbors’ perspective entire network topology
• Adds distance vectors from • Calculates the shortest
router to router path to other routers
• Frequent, periodic update: • Event-triggered update:
Slow convergence Fast to convergence
• Passes copies routing tables • Passes link-state routing
to neighbor routers updates to other routers
• Use flat topology • Allow hierarchical design
for large internetworks
• Support for VLSM
14
`Shortest path algorithm

1 4
C B A
4

E F G
2 2

The best path is the lowest cost path.


15
`Shortest Path First Tree for node B

1 4
(1, B)
C A
(4, B)

2 2
D
(4, E)
1

E F G
2 2
(3, C) (5, E) (6, A)
16
`OSPF network types
17
`OSPF network types: Fourth type
18
`DR and BDR receive LSAs

•Hellos elect DR and BDR to present segment


•Each router then forms adjacency with DR and BDR
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.
20
`OSPF packet header

• For the hello packet the type field is set to 1.


21
`OSPF Hello Protocol - Hello header
22
`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.
23
`OSPF Topologies

Broadcast
Multiaccess

Point-to-Point

NBMA X.25
Frame Relay
24
`OSPF Operation in a
Broadcast Multiaccess Topology

Broadcast
Multiaccess
25

© 2000, Cisco Systems, Inc. www.cisco.com 4-25


`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)
26
`Step 1: Establish router adjacencies (cont.)
D E

Hello

Router ID
*
B A C
Hello/dead intervals
afadjfjorqpoeru
39547439070713 Neighbors
Area-ID*
Router priority
Hello DR IP address
BDR IP address
Authentication password *
*
Stub area flag

* Entry must match on neighboring routers


27
`Step 2: Electing the DR and BDR (if necessary).
P=3 P=2

DR BDR

Hello

P=1 P=1 P=0

• 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.
28
`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 in the exchange
process.
29
`Exchange Process

172.16.5.1/24 172.16.5.2/24
A E0 E1 B
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
30
`Step 3: Discover routes (cont.)

DR
E0 E0
172.16.5.1 172.16.5.3
afadjfjorqpoeru
39547439070713
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

Exchange State
afadjfjorqpoeru
39547439070713

Here is a summary of my link-state database.


DBD
afadjfjorqpoeru
39547439070713

DBD Here is a summary of my link-state database.


31
`Step 3: Discover routes (cont.)

DR
E0 E0
172.16.5.1 172.16.5.3
afadjfjorqpoeru
39547439070713
afadjfjorqpoeru
39547439070713

LSAck Thanks for the information!


LSAck

afadjfjorqpoeru
39547439070713
Loading State

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. LSU


afadjfjorqpoeru
39547439070713

LSAck Thanks for the information!


Full State
32
`Step 4: Choosing Routes

10.1.1.0/24 10.2.2.0/24 10.3.3.0/24


Token
A Ring B FDDI C
Cost=6
Cost=1

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
33
`Step 5: Maintaining Routing Information

Link-State Change
DR

1 LSU

x A
B

• Router A tells all OSPF DRs on 224.0.0.6


34
`Step 5: Maintaining Routing Information

2
Link-State Change
DR
LSU

1 LSU

x A
B

• Router A tells all OSPF DRs on 224.0.0.6


• DR tells all others on 224.0.0.5
35
`Step 5: Maintaining Routing Information

2
Link-State Change
DR
LSU

1 LSU
3
x A
B
LSU

• Router A tells all OSPF DRs on 224.0.0.6


• DR tells all others on 224.0.0.5
36
`Step 5: Maintaining Routing Information

2
Link-State Change
DR
LSU
4 I need to update
my routing table.
1 LSU
3
x A
B
LSU

• Router A tells all OSPF DRs on 224.0.0.6


• DR tells all others on 224.0.0.5
37
`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
38
`OSPF Operation in an NBMA

X.25
Frame Relay
ATM

• NBMA Topology
– Single interface interconnects multiple sites
– NBMA topologies support multiple routers but
without broadcasting capabilities
39
SINGLE AREA OSPF Configuration
40
`Basic OSPF Configuration

Broadcast Network Point-to-Point Network


E0 10.64.0.2 S0
10.2.1.2 10. 2.1.1
A 10.64.0.1 E0 B C
S1

<Output Omitted>
<Output Omitted> interface Ethernet0
interface Ethernet0 ip address 10.64.0.2 255.255.255.0
ip address 10.64.0.1 255.255.255.0 !
! interface Serial0
<Output Omitted> ip address 10.2.1.2 255.255.255.0
router ospf 1 <Output Omitted>
network 10.0.0.0 0.255.255.255 area 0 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.
41
`Configuring OSPF loopback address
•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
! Create the loopback 0 interface

Router(configf)#Interface loopback 0
Router(configf-if)#ip address 192.168.31.33 255.255.255.255
! Remove loopback 0 interface

Router(configf)#no Interface loopback 0


42
`Configuring OSPF router priority

• The router with the highest priority value is the DR.


• The default for the interface OSPF priority is 1. In
case of a tie, the router’s router ID is used.
! Setting OSPF Priority

Router(configf)#Interface Fastethernet 0/0


Router(configf-if)#ip ospf priority 50

• The priorities can be set to any value from 0 to 255


• The command show ip ospf interface will display
the interface priority value as well as other key
information.
43
`Modifying OSPF cost metric
Medium Cost
56 kbps serial link 1785
T1 (1.544 Mbps serial link) 64
E1 (2.048 Mbps serial link) 48
Ethernet 10
Fast Ethernet/FDDI 1

• Cost is calculated using the formula 108/bandwidth,


where bandwidth is expressed in bps.
• Bandwidth dividend is user configurable:
– Interface subcommand: bandwidth 64
– Interface subcommand: ip ospf cost <1-65535>
• Relevant going out an interface only
44
`Configuring OSPF timers

! To configure the hello and dead intervals on an interface

Router(config-if)#ip ospf hello-interval seconds


Router(config-if)#ip ospf dead-interval seconds

• OSPF networks, the default


• Hello interval is 10 seconds
• Dead interval is 40 seconds.
• On nonbroadcast networks, the default
• Hello interval is 30 seconds
• Dead interval is 120 seconds.
• These timers must be configured to match those of
any neighboring router.
45
`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


46
`Verifying OSPF Operation (cont.)

Router#

show ip ospf

Displays OSPF timers and statistics


Router#

show ip ospf neighbor detail


Displays information about DR, BDR and neighbors
Router#

show ip ospf database

Displays the link-state database


47
`Verifying OSPF Operation (cont.)

Router#

clear ip route *

Allows you to clear the IP routing table

Router#

debug ip ospf option

Displays router interaction during the hello,


exchange, and flooding processes
48
`show ip ospf interface

R2#sh ip ospf int e0


Ethernet0 is up, line protocol is up
Internet Address 192.168.0.12/24, Area 0
Process ID 1, Router ID 192.168.0.12, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State DROTHER, Priority 1
Designated Router (ID) 192.168.0.11, Interface address 192.168.0.11
Backup Designated router (ID) 192.168.0.13, Interface address
192.168.0.13
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
Hello due in 00:00:04
Neighbor Count is 3, Adjacent neighbor count is 2
Adjacent with neighbor 192.168.0.13 (Backup Designated Router)
Adjacent with neighbor 192.168.0.11 (Designated Router)
Suppress hello for 0 neighbor(s)
49
`show ip ospf neighbor

Neighbor ID Pri State Dead Time Address Interface


192.168.0.13 1 2WAY/DROTHER 00:00:31 192.168.0.13 Ethernet0
192.168.0.14 1 FULL/BDR 00:00:38 192.168.0.14 Ethernet0
192.168.0.11 1 2WAY/DROTHER 00:00:36 192.168.0.11 Ethernet0
192.168.0.12 1 FULL/DR 00:00:38 192.168.0.12 Ethernet0

OSPF over Ethernet - Multiaccess Network

Neighbor ID Pri State Dead Time Address Interface


192.168.0.11 1 FULL/ - 00:00:39 10.1.1.2 Serial1

OSPF over HDLC - Point-to-Point Network


50
`show ip ospf database

R2#show ip ospf database

OSPF Router with ID (192.168.0.12) (Process ID 1)

Router Link States (Area 0)

Link ID ADV Router Age Seq# Checksum Link count


192.168.0.10 192.168.0.10 817 0x80000003 0xFF56 1
192.168.0.11 192.168.0.11 817 0x80000003 0xFD55 1
192.168.0.12 192.168.0.12 816 0x80000003 0xFB54 1
192.168.0.13 192.168.0.13 816 0x80000003 0xF953 1
192.168.0.14 192.168.0.14 817 0x80000003 0xD990 1

Net Link States (Area 0)

Link ID ADV Router Age Seq# Checksum


192.168.0.14 192.168.0.14 812 0x80000002 0x4AC8
51

You might also like