You are on page 1of 51

OSPF Routing Protocol

Principle
Objectives

Through learning this course, you will:


• Master computing methods of OSPF routing protocol
• Master advanced applications of OSPF routing protocol
Contents

 OSPF Overview
 OSPF Concept
 OSPF Working Process
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
OSPF Overview

• Open Shortest Path First (OSPF)


• OSPF is Internal Gateway Protocol (IGP).

• OSPF is a kind of link-state protocol, it maintains complex


network topology database and then adopts SPF algorithm
to calculate the best route.

• The types of network supported by OSPF are classified into


multi-access network and point-to-point network.
OSPF Advantages

• No route loop
• Adapt to large-scale network
• High convergence rate of route
• Support area allocation
• Support equivalent route
• Support verification
• Support hierarchic management
• Transmit protocol messages in multicast address
Contents

 OSPF Overview
 OSPF Concept
 OSPF Working Process
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
OSPF Concept (1)

Router ID
• Definition:
32-bit binary to identify each router on OSPF network.
• Selection method:
Select the IP address of the interface which is activated firstly. If multiple interfaces are activated, the minimum IP
address of the router is selected on the ZTE router.
If loopback interface is configured on the router, router ID will be the minimum IP address of all loopback interfaces, in
spite of IP addresses of other physical interfaces or even when they are activated.
• Features:
Globally unique;
Once selected, it cannot be changed unless OSPF progress is restarted.

ZXR10# clear ip ospf process <process-id> Hi, I am router A and my


name is 192.132.1.3.
OSPF Concept (2)

• Interface
Interfaces run OSPF protocol;
transmit protocol messages periodically (Hello packet) to search and find neighbors.
• Designated Router (DR) and Backup Designated Router (BDR)
To reduce traffic of OSPF synchronous link state information, broadcast network can
be automatically represented as DR or BDR according to interface priority or router-id.
• Link State Database
Contains link state of all routers on the network and indicates the topology structure
of the whole network.
• Neighboring Routers
OSPF routers on the direct network become neighbors automatically after exchanging
hello packets.
• Adjacency
On the basis of neighbors, Link State Advertisement (LSA) is synchronized to form
adjacency.
OSPF Working Process (1)

• Run OSPF protocol and find neighbors;

• Exchange LSA, synchronize Link State Database (LSDB), and


form adjacency;

• Use SPF algorithm to establish the shortest path tree and


calculate the best route.
OSPF Working Process (2)
Autonomous system

Interfaces start OSPF

Neighbor table Topology database Route table


Contents
 OSPF Overview
 OSPF Concept
 OSPF Working Process
Finding Neighbors
Selecting DR or BDR
Forming Adjacency
Updating LSA
Computing Optimal Route
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Neighborhood
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
Interfaces run OSPF send periodically
*
Items with *which must be consistent to establish neighbors
Neighborhood—Hello Message
Process of Forming OSPF Neighbor List
Lo: 10.75.0.1 Lo: 10.75.0.2
10.75.32.1/30 10.75.32.2/30
A Int1 Int1 B
RA Neighbors List RB Neighbors List
10.75.0.2, int1 , 2-way 10.75.0.1,
10.75.0.1,int1,
int12-way
, init

Down State

Hello, my router ID is 10.75.0.1 and see no neighbors.

Init State

Hello, my router ID is 10.75.0.2 and my neighbor is 10.75.0.1.

Two-way

Hello, my router ID is 10.75.0.1 and my neighbor is 10.75.0.2.


Contents
 OSPF Overview
 OSPF Concept
 OSPF Working Process
Finding Neighbors
Selecting DR or BDR
Forming Adjacency
Updating LSA
Computing Optimal Route
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
LSA Synchronization on Broadcast Network

Neighbor,
receive my
LSA.

• On broadcast network or NBMA, resource will be wasted when each neighbor transmits LSA
(network bandwidth and CPU resources).
Functions of DR and BDR

DR BDR

• To reduce traffic of OSPF protocol messages, each network segment uses


DR or BDR to represent the network.
• Each router can synchronize LSA with DR and BDR to form adjacency.
Selection of DR and BDR
P=3 P=2

DR BDR

Hello

P=1 P=1 P=0


 The router that is started first on the network is selected as DR;
 When started simultaneously or reselected, the router with the
superior priority (0-255) is selected as DR;
 When started simultaneously or with the same priority, the router with
the highest ID is selected as DR;
 DR selection is not preemptive unless OSPF process is restarted.
Selection of DR and BDR—Hello Message
Contents
 OSPF Overview
 OSPF Concept
 OSPF Working Process
Finding Neighbors
Selecting DR or BDR
Forming Adjacency
Updating LSA
Computing Optimal Route
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Forming Adjacency of OSPF (1)
Lo: 10.75.0.1 Lo: 10.75.0.2
10.75.32.1/30 10.75.32.2/30
A Int1 DR Int1 B
RA Neighbors List RB Neighbors List
10.75.0.2,
10.75.0.2,int1,
10.75.0.2, int1,
int1 Exchange
,Exstart
2-way 10.75.0.1,
10.75.0.1,
10.75.0.1,int1,
int1,
int1Exchange
,2-way
init

afadjfjorqpoeru
39547439070713
Exstart

DBD DR, I will initiate interaction of LSA and I am the master sender (MS=1).
afadjfjorqpoeru
39547439070713

No, I am the master sender, because I have higher router ID. DBD
afadjfjorqpoeru

Exchange State 39547439070713

afadjfjorqpoeru
39547439070713
This is summary information about my LSDB. DBD
DBD This is summary information about my LSDB.
Forming Adjacency of OSPF (2)
lo : 10.75.0.1 lo : 10.75.0.2
10.75.32.1/30 10.75.32.2/30
A Int1 DR Int1 B
RA Neighbors List RB Neighbors List
10.75.0.2,
10.75.0.2,
10.75.0.2, int1,
int1,
int1,
10.75.0.1, Loading
,Full
Exchange
int1 init 10.75.0.1,
10.75.0.1,
int1,
10.75.0.1, int1,
Exchange
int1 , Full
init

afadjfjorqpoeru
39547439070713
Loading State

LSR I have no information about 172.16.6.0/24 and I need entire LSA.


afadjfjorqpoeru
39547439070713

This is LSA of 172.16.6.0/24.


LSU
afadjfjorqpoeru
39547439070713

LSAck Received, thanks!

Full State My LSDB is complete. No query is needed.


Contents
 OSPF Overview
 OSPF Concept
 OSPF Working Process
Finding Neighbors
Selecting DR or BDR
Forming Adjacency
Updating LSA
Computing Optimal Route
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Flooding Process (1)

Point-to-point link state changes

3 Update route table

1 LSU
2
x A B
LSU

• The router notifies changed topology information of neighbors in 224.0.0.5.


Flooding Process (2)
Broadcast link state changes 2
DR
LSU

4 Update route table

1 LSU

x
3
B
A
LSU

• Router A notifies DR in 224.0.0.6.


• DR notifies other routers in 224.0.0.5.
Contents
 OSPF Overview
 OSPF Concept
 OSPF Working Process
Finding Neighbors
Selecting DR or BDR
Forming Adjacency
Updating LSA
Computing Optimal Route
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Process
RTA
ofRTBComputing OSPF Protocol
1 1
LSDB A B

2 5 LSA of RTA 2 5
C
RTC LSA of RTB
3
3 LSA of RTC
D
LSA of RTD
RTD
(1) Network topology (2) LSDB of each router 3 Weighted digraph created by LSDB
structure

1 1 1 1
A B A B A B A B
2 2 2 2
C C C C
3 3 3 3

D D D D

(4) Each router computes the minimal spanning tree with itself as the root node.
Computing Minimal Spanning Tree
• Sum of COST from external ports in data forwarding direction

10.1.1.0/24 10.2.2.0/24 10.3.3.0/24


Cost=1 Cost=1 Cost=1

A Cost=5 B Cost=5 C

Ospf route Table Ospf route Table


Net Cost Net Cost
10.2.2.0 2 10.1.1.0 10
10.3.3.0 3
Contents

 OSPF Overview
 OSPF Concept
 OSPF Working Process
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Problems Large-Scale OSPF Network Meets

OSPF
Always computing route table, boring!

Only LSA is received, no data.

OSPF

OSPF OSPF OSPF

My route table is too large and my


memory is too small.
Solution: Allocate Areas
Area 0

Area 1 Area 2

Autonomous system

Rules for allocating areas:


 Each network segment must belong to an area, that is, each interface that runs OSPF
protocol must be designated to an area;
 Each area is identified by area ID, which is an integer ranging from 0 to 32;
 Backbone area (area 0) cannot be separated by non-backbone areas;
 Non-backbone areas (not area 0) must be connected to backbone area (virtual link is not
suggested).
Advantages for Allocating Areas

• Only LSDB of routers in the same area can be synchronized. The


changes of network topology structure are first updated within the
area..

• After areas are allocated, route aggregation can be performed on the


boundary router within the area to reduce the number of LSA
notified to other areas and minimize the influence caused by changes
of network topology.
Types of OSPF Routers
Backbone area 0
Area 1 Area 2
ABR and Backbone Router

Backbone/
Internal Router
Internal Router

Internal Router

ABR and Backbone Router


ASBR and Backbone Router

External AS
Contents

 OSPF Overview
 OSPF Concept
 OSPF Working Process
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Types of LSA
Transmission
Types of LSA Initiator Described Object
Range
LSA1: Each router in the Within the area Direct link state of the router
Router LSA area

LSA2: DR and BDR Within the area Directly connected routers


Network LSA within the network segment

LSA3: ABR Among areas Route of the area where ABR


Network Summary is located (LSA1 and LSA2)
LSA
LSA4: ABR Among areas Notify ASBR of the area
ASBR Summary where ABR is located
LSA
LSA5: ASBR Among areas Notify exterior route (non-ospf
Autonomous route, such as RIP or BGP)
system external
LSA
Types of LSA
Area 1 DR Area 0
External
Network
External
Router ABR ASBR AS

Summary
Flooding of LSA among Multiple Area
Network
RIP

Area 1 Area 0 Area 50

Internal ABR1 ABR2 Internal

BBone
afadjfjorqpoeru afadjfjorqpoeru afadjfjorqpoeru
39547439070713 39547439070713 39547439070713

Type 1 Type 3 Type 3

afadjfjorqpoeru
39547439070713

afadjfjorqpoeru
39547439070713

Type 4
Type 5
afadjfjorqpoeru
39547439070713

Type 5
Contents
 OSPF Overview
 OSPF Concept
 OSPF Working Process
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Stub Area

Route Summarization
Constitution of OSPF Route

Route table

Route within areas Area 1

Route among areas Area 1 Area 0

External route Area 1 RIP


(non-OSPF route)
Types of Areas
Stub Area 0 Totally Stub

Not receive redistributed route Receive all LSA Not receive route outside areas
ASBR Summary LSA Network Summary LSA
Autonomous system external LSA Not receive redistributed route
ASBR Summary LSA
Autonomous system external LSA
Stub and Totally Stubby
4.1.1.0
Area (1)
4.1.2.0

RIP
Area 50 Area 0 Area 1
2.1.2.0 ABR ABR
1.1.1.0 1.1.2.0 1.1.3.0 3.1.1.0

C D A B E F
2.1.1.0 ASBR 3.1.2.0

RC route table RD route table RE route table RF route table


1.1.1.0 int1 ospf 1.1.1.0 int1 direct 1.1.1.0 int1 ospf 1.1.1.0 int1 ospf
1.1.2.0 int1 ospf 1.1.2.0 int1 ospf 1.1.2.0 int1 ospf 1.1.2.0 int1 ospf
1.1.3.0 int1 ospf 1.1.3.0 int1 ospf 1.1.3.0 int1 direct 1.1.3.0 int1 ospf
2.1.1.0 int1 direct 2.1.1.0 int2 direct 2.1.1.0 int1 ospf 2.1.1.0 int1 ospf
2.1.2.0 int2 direct 2.1.2.0 int2 ospf 2.1.2.0 int1 ospf 2.1.2.0 int1 ospf
3.1.1.0 int1 ospf 3.1.1.0 int1 ospf 3.1.1.0 int2 direct 3.1.1.0 int1 direct
3.1.2.0 int1 ospf 3.1.2.0 int1 ospf 3.1.2.0 int2 ospf 3.1.2.0 int2 direct
4.1.1.0 int1 ospf 4.1.1.0 int1 ospf 4.1.1.0 int1 ospf 4.1.1.0 int1 ospf
4.1.2.0 int1 ospf 4.1.2.0 int1 ospf 4.1.2.0 int1 ospf 4.1.2.0 int1 ospf
Stub and Totally Stubby Area (2)

RIP
Area 50—Stub Area 0 Area 1—Totally Stubby

Internal ABR1 ASBR BBone ABR2 Internal

afadjfjorqpoeru
39547439070713

afadjfjorqpoeru afadjfjorqpoeru
afadjfjorqpoeru 39547439070713
39547439070713 39547439070713

Summary
Summary Summary Default

afadjfjorqpoeru afadjfjorqpoeru afadjfjorqpoeru afadjfjorqpoeru


39547439070713 39547439070713 39547439070713 39547439070713

Default External External Default


Stub and Totally Stubby
4.1.1.0
Area (3)
4.1.2.0

RIP
Area 50—Stub Area 0 Area 1—Totally Stubby
2.1.2.0 ABR ABR
1.1.1.0 1.1.2.0 1.1.3.0 3.1.1.0

C D A B E F
2.1.1.0 ASBR 3.1.2.0

RC route table RD route table RE route table RF route table


1.1.1.0 int1 direct 1.1.1.0 int1 ospf
1.1.1.0 int1 ospf
1.1.2.0 int1 ospf 1.1.2.0 int1 ospf
1.1.2.0 int1 ospf
1.1.3.0 int1 ospf 1.1.3.0 int1 direct
1.1.3.0 int1 ospf
2.1.1.0 int2 direct 2.1.1.0 int1 ospf
2.1.1.0 int1 direct 3.1.1.0 int1 direct
2.1.2.0 int2 ospf 2.1.2.0 int1 ospf
2.1.2.0 int2 direct 3.1.2.0 int2 direct
3.1.1.0 int1 ospf 3.1.1.0 int2 direct
3.1.1.0 int1 ospf 0.0.0.0 int1 ospf
3.1.2.0 int1 ospf 3.1.2.0 int2 ospf
3.1.2.0 int1 ospf
4.1.1.0 int1 ospf 4.1.1.0 int1 ospf
0.0.0.0 int1 ospf
4.1.2.0 int1 ospf 4.1.2.0 int1 ospf
Limitation of Stub and Totally Stubby Area
Area 2
0.0.0.0

R3 R4

Unique outlet
X
External
AS

•Only one outlet


•No ASBR within the area
•Can not be AREA 0 (Backbone)
•No Virtual links
NSSA
• Not So Stubby Area

Area 2
Area 0

R3
To Other Area R4
Type 5 Type 7 Typ
e 7
RI
P
External
AS
Contents
 OSPF Overview
 OSPF Concept
 OSPF Working Process
 Area Allocation
 LSA Transmission among Multiple Areas
 Route Optimization
Stub Area

Route Summarization
Support Route Summarization

Area 0 backbone area

Summarized route

ABRs

Area 1

x
• Reduce the size of route table
• Limit the influence of topology changes in the local area
• Reduce the number of LSAs and save CPU resource
Route Summarization

Area 1 ABR Area 0

A B C

Summarized route
Route table of router B
LSAs transmitted to route C
O 172.16.8.0 255.255.252.0
IA 172.16.8.0 255.255.248.0
O 172.16.12.0 255.255.252.0
O 172.16.16.0 255.255.252.0
O 172.16.20.0 255.255.252.0 IA 172.16.16.0 255.255.240.0
O 172.16.24.0 255.255.252.0
O 172.16.28.0 255.255.252.0

• A summarized route can represent multiple sub networks.


Review
• OSPF concept and features
• OSPF working principle
• OSPF area allocation
• Stub and Totally Stubby area
• Route summarization
Questions
• Can OSPF achieve load balance or equivalent load balance?

• How is OSPF Metric computed?

• How many types of LSA does OSPF have? Who creates theses types?

• Can you describe the working process of OSPF?

You might also like