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

06 OSPF Basics

OSPF dasar
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

06 OSPF Basics

OSPF dasar
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 59

OSPF Basics

age 2 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Forewor
d

Static routes are manually configured. If a network topology changes, static
routes have to be manually adjusted, which restricts the large-scale
application of static routes on the live network.

Dynamic routing protocols are widely used on live networks because of their
high flexibility, high reliability, and easy scalability. The Open Shortest Path
First (OSPF) protocol is a widely used dynamic routing protocol.

This course describes basic concepts, working mechanism, and basic
configurations of OSPF.

age 3 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Objective
s

On completion of this course, you will be able to:

Describe the advantages and classification of dynamic routing protocols.

Describe basic OSPF concepts and usage scenarios.

Describe the working mechanism of OSPF.

Implement basic OSPF configurations.

age 4 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. OSPF Overview
2. OSPF Working Mechanism
3. Typical OSPF Configuration

age 5 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
Sumber :
s Kukuh Nugroho
Bapak

age 6 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Sumber :
Content
Bapak Kukuh Nugroho

age 7 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Sumber :
Content
Bapak Kukuh Nugroho KONSEP AREA DALAM OSPF
s

AREA 1 AREA 3

AREA
AREA 2
0 AREA 4

AREA UTAMABACKBONE

age 8 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Sumber :
Content Bagaimana dengan begini, kalua sin
Bapak Kukuh Nugroho

s Area ?

AREA 1 AREA 3

AREA
AREA 2
0 AREA 4
?
AREA 5
AREA UTAMABACKBONE

age 9 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Sumber :
Content
Bapak Kukuh Nugroho PROSES ADJACENCY
s

age 10 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Sumber :
Content
Bapak Kukuh Nugroho PROSES ADJACENCY
s

age 11 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Sumber :
Content
Bapak Kukuh Nugroho PROSES ADJACENCY
s

R3

20.20.20.0/24

age 12 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Sumber :
Content
Bapak Kukuh Nugroho
PROSES ADJACENCY R4

s R5

R3

20.20.20.0/24

age 13 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s

age 14 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content TAHAPAN PERHITUNGAN RUTE TERBAIK
s

age 15 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Why Are Dynamic Routing Protocol
Used?

Static routes are manually configured and maintained, and the command lines are simple and
clear. They apply to small-scale or stable networks. Static routes have the following
disadvantages:

Unable to adapt to large-scale networks: As the number of devices increases, the configuration
workload increases sharply.

Unable to dynamically respond to network changes: If the network topology changes, the network
cannot automatically converge, and static routes must be manually modified.
R R2 R R2
1 1
Link fault

R3 R3

R1-to-R2 static Manually configured static route R1-R3-


route R2
age 16 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Classification of Dynamic Routing
Protocols
By ASs

Interior Gateway Protocols (IGPs) Exterior Gateway Protocols (EGPs)

RIP OSP IS-IS BGP


F

By working mechanisms
and algorithms
Distance Vector Routing Protocols Link-State Routing Protocols

RIP OSP IS-IS


F

age 17 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Distance-Vector Routing Protocol

A router running a distance-vector routing protocol periodically floods routes. Through route
exchange, each router learns routes from neighboring routers and installs the routes into its
routing table.


Each router on a network is clear only about where the destination is and how far the
destination is, but unclear about the whole network topology. This is the essence of the
Routing Routing Routing
distance-vector algorithm.
table table table

3.3.3.
3
R1 R2 R3

Destined for 3.3.3.3, through


R2!

age 18 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Link-State Routing Protocol - LSA
Flooding

Different from a distance-vector routing protocol, a link-state routing protocol
advertises link status information rather than routes in the routing table. Routers
that run a link-state routing protocol establish a neighbor relationship and then
exchange Link State Advertisements (LSAs).
LSA LSA • LSAs, instead of routes, are
R2 1. 5 advertised.
44
Mb •
0 i t/ s An LSA describes a router
1 0 i t/ s interface's status information,
Mb
such as the cost of the
10 s
R1 it / R3 interface and a connected
Mb 0 b
i t/ 0 0M interface name.
s 10
LSA LSA

R4

age 19 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Link-State Routing Protocol - LSDB
Creation

Each router generates LSAs and adds the received LSAs to its own link state
database (LSDB). Routers learn the whole network topology through the LSDB.

LSDB • The router stores LSAs in the


LSDB.
LSA LSA • The LSDB contains the
1. 5 LSD
LSD
bit/s R2
Mb 44
description of all router
B 0 0M i t/ s B
interfaces on the network.
1
• The LSDB contains the
10 description of the entire
R1 0M R3
bit 00 s network topology.
/ s 0
1 it/
Mb
LSA LSA

R4
LSDB

age 20 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Link-State Routing Protocol - SPF
Calculation

Each router uses the Shortest Path First (SPF) algorithm and LSDB information to calculate
routes. Each router calculates a loop-free tree with itself as the root and the shortest path.
With this tree, a router determines the optimal path to each corner of a network.
LSDB
Each router calculates a loop-
free tree with itself as the root
1. 5 over the shortest path.
LSD R2 44 LSD
bit/s Mb
B
0 0M i t/ s B
1

10 s 2
0M bit /
R1 R3
bit
/ s 0 0M
10 1 3

R4 4
LSDB

age 21 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Link-State Routing Protocol - Routing
Table Generation

Ultimately, the router installs routes for the calculated preferred paths into
its routing table.
Based on SPF calculation results,
Routin each router installs routes into
LSDB
g table the routing table.

LSD R2 1. 5 LSD
it/s
Routin Routin
b Mb 44 Routing
g table
B g table
0 0M i t/ s B
table
1

s
10
0M bit /
R1 R3
bit 0 0M
/ s 10

R4
Routin
LSDB g table

age 22 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summary of Link-State Routing
Protocols
Neighbor LSDB Link status LSDB
relationship setup information
R1 R2 R1 R2

p
re Ne in ink

at tus
tu
p r
hi bo
fo s

n
se
la igh

rm ta
io
rm ta

ns gh
t

fo s
se ion bo at tus

tio ei

in ink
tu sh r

N
io

L
p ip n

la
R3 1 2 R3 LSDB
re
Path Path computation 3 4 RIB RIB
computation Route
R1 R2 R1 generation R2

1 2

RIB
Path R3 3 RIB: Routing Information R3
computation Base
age 23 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Introduction to OSPF

OSPF is a typical link-state routing protocol and one of the widely used IGPs in the industry.


OSPFv2, as defined in RFC 2328, is designed for IPv4. OSPFv3, as defined in RFC 2740, is designed for
IPv6. Unless otherwise specified, OSPF in this presentation refers to OSPFv2.


OSPF routers exchange link status information, but not routes. Link status information is key information
for OSPF to perform topology and route calculation.


An OSPF router collects link status information on a network and stores the information in the LSDB.
Routers are aware of the intra-area network topology and be able to calculate loop-free paths.


Each OSPF router uses the SPF algorithm to calculate the shortest path to a specific destination. Routers
generate routes based on these paths and install the routes to the routing table.


OSPF supports the variable length subnet mask (VLSM) mechanism and manual route summarization.


The multi-area design enables OSPF to support a larger network.

age 24 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Application on a Campus
Network
Internet Firewall

The core switch and aggregation Server cluster


switches run OSPF to implementCore
reachable routes switch
on the campus network.

Aggregatio Aggregatio Aggregatio


n switch n switch n switch

Office building 1 Office building 2 Office building 3

age 25 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Area Router ID Cost Value

Basic OSPF Concepts: Area



The OSPF area keyword identifies an OSPF area.

The area is considered as a logical group, and each group is identified by an
area ID.

R1 Area R2
0

R3

age 26 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Area Router ID Cost Value

Basic OSPF Concepts: Router ID



A router ID uniquely identifies a router in an OSPF area.

The router ID can be manually specified or automatically assigned by the
system.

Router ID: Area Router ID:


1.1.1.1 0 2.2.2.2
R1 R2
I'm
1.1.1.1.

R3

Router ID:
3.3.3.3
age 27 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Cost
Area Router-ID
Value

Basic OSPF Concepts: Cost Value



OSPF uses costs as route metric values. Each OSPF-enabled interface maintains a cost value. Default cost
value = , where, 100 Mbit/s is the default reference value specified by OSPF and is configurable.

Generally, the cost of an OSPF route is the sum of costs of all inbound interfaces along a path from the
destination network segment to the local router.

Cost Value of an OSPF Interface Accumulated Costs on an OSPF Path

Serial interface (1.544 1.1.1.0/2


Mbit/s) 4
Default cost = 64
Cost = 10

FE interface GE interface
Cost = 1 Cost = 64
Default cost = Default cost = 1
1 R1 R2 R3

• Each OSPF interface has a specific cost • In the routing table of R3, the cost of the OSPF route
because of the particular bandwidth to 1.1.1.0/24 is 75 (10 + 1 + 64).
value.
age 28 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Packet Types

There are five types of OSPF protocol packets and implement different
functions in interaction between OSPF routers.
Packet Name Function

Is periodically sent to discover and maintain OSPF neighbor


Hello
relationships.

Describes the summary of the local LSDB, which is used to


Database Description
synchronize the LSDBs of two devices.

Requests a needed LSA from a neighbor. LSRs are sent only after
Link State Request
DD packets have been successfully exchanged.

Link State Update Is sent to advertise a requested LSA to a neighbor.

Link State ACK Is used to acknowledge the receipt of an LSA.

age 29 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Neighbo LSDB OSPF Routing
r Table Table table

Three Types of OSPF Entries - Entries


in the Neighbor Table

OSPF provides entries in three important tables: OSPF neighbor table, LSDB table, and OSPF routing table.
For the OSPF neighbor table, you need to know:

Before OSPF transmits link status information, OSPF neighbor relationships must be established.

OSPF neighbor relationships are established by exchanging Hello packets.

The OSPF neighbor table describes the status of the neighbor relationship between OSPF routers. You
can run the display ospf peer command to view status information.

<R1> display ospf peer


[R1]display ospf OSPF Process 1 with Router ID 1.1.1.1
peer Neighbors
Area 0.0.0.0 interface 10.1.1.1(GigabitEthernet1/0/0)'s
Router ID: 1.1.1.1 Router ID: neighbors
2.2.2.2 Router ID: 2.2.2.2 Address: 10.1.1.2 GR State: Normal

GE 1/0/0 GE 1/0/0 State: Full Mode:Nbr is Master Priority: 1


R1 10.1.1.1/30 10.1.1.2/30 R2 DR: 10.1.1.1 BDR: 10.1.1.2 MTU: 0
Dead timer due in 35 sec
Retrans timer interval: 5
Neighbor is up for 00:00:05
Authentication Sequence: [ 0 ]

age 30 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Neighbor LSDB OSPF Routing
Table Table Table

Three Types OSPF Entries - Entries in


the LSDB Table

For the OSPF LSDB table, you need to know:

▫ An LSDB stores LSAs generated by a router itself and received from neighbors. In this example, the
LSDB of R1 contains three LSAs.

▫ The Type field indicates an LSA type, and the AdvRouter field indicates the router that sends the
LSA.

▫ Run the display ospf lsdb command to query the LSDB.


<R1> display ospf lsdb
[R1]display ospf lsdb
OSPF Process 1 with Router ID 1.1.1.1

Router ID: 1.1.1.1 Router ID:


Link State Database
2.2.2.2
Router ID: 0.0.0.0
GE 1/0/0 GE 1/0/0
R1 10.1.1.1/30 10.1.1.2/30 R2 Type LinkState ID AdvRouter Age Len Sequence
Metric
Router 2.2.2.2 2.2.2.2 98 36 8000000B
1

age 31 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Router 1.1.1.1 1.1.1.1 92 36 80000005
Neighbor LSDB OSPF Routing
Table Table Table

Three Types of OSPF Entries - Entries


in the OSPF Routing Table
• For the OSPF routing table, you need to know:
▫ The OSPF routing table and the router routing table are different. In this example, the OSPF routing
table contains three routes.
▫ An OSPF routing table contains information, such as the destination IP address, cost, and next-hop IP
address, which guides packet forwarding.
▫ Run the display ospf routing command to query the OSPF routing table.

<R1> display ospf routing


[R1]display ospf OSPF Process 1 with Router ID 1.1.1.1
routing Routing tables
Router ID: 1.1.1.1 Router ID: Routing for Network
2.2.2.2 Destination Cost Type NextHop AdvRouter
Area
1.1.1.1/32 0 stub 1.1.1.1 1.1.1.1
GE 1/0/0 GE 1/0/0
0.0.0.0
R1 10.1.1.1/30 10.1.1.2/30 R2
10.1.1.0/20 1 Transit 10.1.1.1 1.1.1.1
0.0.0.0
2.2.2.2/32 1 stub 10.1.1.2 2.2.2.2
0.0.0.0

Total Nets: 3
age 32 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Intra Area: 3 Inter Area: 0 ASE: 0 NSSA: 0
Content
s
1. OSPF Overview
2. OSPF Working Mechanism
3. Typical OSPF Configuration

age 33 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Relationships Between OSPF Routers

There are two important concepts about the relationship between OSPF
routers: neighbor relationship and adjacency.

On a simple network, two routers are directly connected. OSPF is enabled on
interconnected interfaces. The routers start to send and listen to Hello
packets. After the two routers discover each other through Hello packets,
they establish a neighbor relationship.

The establishment of a neighbor relationship is just the beginning. A series of
packets, such as DD, LSR, LSU, and LSAck packets, will be exchanged later.
When LSDB synchronization between two routers is complete and the two
routers start to calculate routes independently, the two routers establish an

age 34
adjacency.
Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Process of Establishing an OSPF
Adjacency Relationship

OSPF adjacency relationship establishment involves four steps: establishing a neighbor relationship,
negotiating the master/slave status, exchanging LSDB information, and synchronizing LSDBs.
R1 R2
1

Establish a bidirectional
neighbor relationship.
2

Negotiate the master/slave


status.
3

Mutually describe the LSDB


(summary information).
4

Update LSAs and


synchronize LSDBs of both
Calculates ends. Calculates
5 5
routes. routes.
Steps 1 to 4 involve interaction between both ends, and Step 5 is
performed separately on each device.

age 35 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Process of Establishing an OSPF
Adjacency - Step 1
Area 1.1.1.1 Area 2.2.2.2

R1 R2

Hello packets
I'm 1.1.1.1. I don't know who's on the
link. Init
R1 (1.1.1.1) is discovered and
Hello packets added to the neighbor list. The
I'm 2.2.2.2. I found my neighbor 1.1.1.1. status of R1 in the neighbor
2- table is Init.
way
R2 (2.2.2.2) is discovered
and added to the neighbor
Hello packets
list. Because R2
I'm 1.1.1.1. I found the neighbor 2.2.2.2.
discovered me, I set the 2-
status of R2 to 2-way in way
the neighbor table. Because R1 found me, I
change the status of
We're neighbors. 1.1.1.1 to 2-way in the
neighbor table.

age 36 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Process of Establishing an OSPF
Adjacency - Steps 2 and 3
Router ID: Router ID:
1.1.1.1 2.2.2.2
R1 R2

DD (The content is empty, and the sequence


number is X.)
Ex-start (Exchange Start) I'm the master and my router ID is 1.1.1.1. Ex-start
DD (The content is empty, and the sequence number
Exchange is Y.)
(R2 with a larger router ID I'm the master and my router ID is 2.2.2.2.
is preferred.) DD (sequence number Y)
This is the summary of LSAs in my LSDB.
Exchange
DD (Sequence number Y + 1 in ascending order)
This is the summary of LSAs in my LSDB. In the Exchange phase, both ends
exchange DD packets to describe
DD (sequence number Y+1) the summary of their own LSAs.
Confirms the DD packet sent by the master router.

I know what I know what


R2's LSDB R1's LSDB
contains. contains.
age 37 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Process of Establishing an OSPF
Adjacency - Step 4
Router ID: Router ID:
1.1.1.1 2.2.2.2
R1 R2
LSR
I want to request the complete
information about the xx LSA.
Loading Loading
LSU
This is the complete information about the requested
LSA.
LS ACK
Confirms the reception of the LSU and the xx
LSA carried in the LSU.

LSR
I want to request the complete
information about the yyy LSA.

Full Full

LSDBs of R1 and R2 LSDBs of R1 and R2


are synchronized. are synchronized.

age 38 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Review of the OSPF Neighbor Table
Router ID: Router ID:
1.1.1.1 2.2.2.2
R1 R2
GE1/0/0 GE1/0/0
10.1.1.1/30 10.1.1.2/30

<R1> display ospf peer


OSPF Process 1 with Router ID 1.1.1.1
Neighbors R1 discovers
neighbors in area 0
Router ID of the Area 0.0.0.0 interface 10.1.1.1(GigabitEthernet1/0/0)'s
on GE 1/0/0.
neighbor: 2.2.2.2 neighbors
The neighbor at
The neighbor Area 2.2.2.2 Address: 10.1.1.2 GR State: Normal
2.2.2.2 is the
status is Full. State: Full Mode:Nbr is Master Priority: 1 master.

DR: 10.1.1.1 BDR: 10.1.1.2 MTU: 0


Dead timer due in 35 sec
Retrans timer interval: 5 Quiz: What is the
DR/BDR in the neighbor
Neighbor is up for 00:00:05 table?
Authentication Sequence: [ 0 ]
age 39 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Network Types

Before learning concepts of the DR and BDR, understand OSPF network types.

The OSPF network type is a very important interface variable. This variable affects OSPF
operations on interfaces. For example, it determines how to send OSPF packets and whether
to elect a DR or BDR.

The default OSPF network type of an interface depends on the data link layer encapsulation
used by the interface.

As shown in the figure, OSPF has four network types: broadcast, NBMA, P2MP, and P2P.
Router ID: 1.1.1.1 Router ID: [R1-GigabitEthernet1/0/0] ospf network-type ?
2.2.2.2 broadcast Specify OSPF broadcast network
nbma Specify OSPF NBMA network
GE 1/0/0 GE 1/0/0
R1 10.1.1.1/30 10.1.1.2/30 R2 p2mp Specify OSPF point-to-multipoint
network
p2p Specify OSPF point-to-point network

age 40 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Network Types (1)

Generally, the network types of OSPF interfaces at both ends of a link must be the same. Otherwise, the
two interfaces cannot establish a neighbor relationship.

An OSPF network type can be manually changed on an interface to adapt to different network scenarios.
For example, you can change the BMA network type to P2P.

Point-to-Point (P2P) Broadcast Multiple Access (BMA)

/0
E0/ 0
Serial0/0/ Serial0/0/ G
0 0 GE0/0/0
PPP PPP
RTA RTB Ethernet
GE
0 /0 /
0
• P2P indicates that only two network devices can be • BMA is also called broadcast. It refers to an
connected on a link. environment that allows multiple devices to access and
• A typical example is a PPP link. When an interface uses supports broadcast.
PPP encapsulation, the default network type of the • A typical example is an Ethernet network. When an
OSPF interface is P2P. interface uses Ethernet encapsulation, the default
network type of the OSPF interface is BMA.

age 41 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Network Types (2)
Non-Broadcast Multiple Access (NBMA) Point-to-Multipoint (P2MP)

Frame
F
Relay
R

• NBMA refers to an environment that allows • A P2MP network is formed by bundling


multiple network devices to access but does not endpoints of multiple P2P links.
support broadcast. • No link layer protocol is considered as a
• A typical example is a Frame Relay (FR) network. P2MP network by default. This type must
be manually changed from another
network type.
• For example, a non-full-mesh NBMA
network can be changed to a P2MP
network.

age 42 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Background of DR and BDR

Multi-access (MA) networks are classified into BMA and NBMA networks. Ethernet is a typical broadcast
multi-access network.

On an MA network, if each OSPF router establishes OSPF adjacencies with all the other routers, excessive
OSPF adjacencies exist on the network, which increases the load on the devices and the number of OSPF
packets flooded on the network.

Once the network topology changes, LSA flooding on the network may waste bandwidth and device
resources.

Ethernet

Adjacenc
y

age 43 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
DR and BDR

To optimize OSPF neighbor relationships on an MA network, the OSPF protocol specifies three
types of OSPF routers: DR, BDR, and DRother.

Only the DR and BDR can establish adjacencies with other OSPF routers. DRothers do not
establish OSPF adjacencies with one another, and their relationship is in the 2-way state.

The BDR monitors the status of the DR and takes over the role of the DR if the existing DR
fails.
DR BDR

Ethernet

DRother DRother DRother Adjacenc


y

age 44 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Domain and Single Area

An OSPF domain is a network that consists of a series of
contiguous OSPF network devices that use the same policy.

An OSPF router floods LSAs in the same area. To ensure that
all routers have the same understanding of the network
topology, LSDBs need to be synchronized within an area.

If there is only one OSPF area, the number of OSPF routers
increases with the network scale. This causes the following
problems:
Area 0
▫ The LSDB becomes larger and larger, and the size of the OSPF
routing table increases. A large number of router resources are
consumed, device performance deteriorates, and data forwarding
is affected.

▫ It is difficult to calculate routes based on a large LSDB.

▫ When the network topology changes, LSA flooding and SPF

age 45 recalculation on the entire network bring heavy loads.


Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Multi-Area OSPF


OSPF introduces the concept of area. An
OSPF domain is divided into multiple
areas to support larger-scale networking.
Area 1

The OSPF multi-area design reduces the
flooding scope of LSAs and effectively
Area 0 controls the impact of topology changes
within an area, optimizing the network.

Routes can be summarized at the area
border to reduce the size of the routing

Area 2 table.

Multi-area improves network scalability
and facilitates large-scale network
age 46 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
construction.
Types of OSPF Routers

OSPF routers are classified into
IR
the following types based on
their locations or functions:
Area 1 
Internal router
BR

Area border router (ABR)

Backbone router

ABR/BR

AS boundary router (ASBR)

Another
Area 2 AS
ASBR
age 47 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Typical OSPF Single-Area and Multi-
Area Networking

OSPF Area
0

OSPF Area OSPF Area


1 2
OSPF Area
0
Small- and medium-sized Large enterprise network
enterprise network (single area) (multiple areas)

age 48 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Content
s
1. OSPF Overview
2. OSPF Working Mechanism
3. Typical OSPF Configuration

age 49 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic OSPF Configuration Commands
(1)
1. (System view) Create and run an OSPF process.

[Huawei] ospf [ process-id | router-id router-id ]


The process-id parameter specifies an OSPF process. The default process ID is 1. OSPF supports multiple processes. Multiple OSPF
processes can separately run on the same device. The router-id command is used to manually specify the ID of a device. If no ID is
specified, the system automatically selects the IP address of an interface as the device ID.

2. (OSPF view) Create an OSPF area and enter the OSPF area view.

[Huawei-ospf-1] area area-id


The area command creates an OSPF area and displays the OSPF area view.
The area-id value can be a decimal integer or in dotted decimal notation. If the value is an integer, it ranges from 0 to 4294967295.

3. (OSPF area view) Specify the interface that runs OSPF.

[Huawei-ospf-1-area-0.0.0.0] network network-address wildcard-mask


The network command specifies the interface that runs OSPF and the area to which the interface belongs. The network-address
parameter specifies the network segment address of the interface. The wildcard-mask parameter is the wildcard of an IP address, which
is equivalent to the reverse mask of the IP address (0 is converted to 1, and 1 to 0). For example, 0.0.0.255 indicates that the mask
length is 24 bits.

age 50 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Basic OSPF Configuration Commands
(2)
4. (Interface view) Set an OSPF interface cost.

[Huawei-GE1/0/1] ospf cost cost

The ospf cost command sets a cost for an OSPF interface. By default, OSPF automatically calculates
the cost of an interface based on the interface bandwidth. The cost value is an integer ranging from 1
to 65535.
5. (OSPF view) Set an OSPF bandwidth reference value.

[Huawei-ospf-1] bandwidth-reference value

The bandwidth-reference command sets a bandwidth reference value that is used to calculate
interface costs. The value ranges from 1 to 2147483648, in Mbit/s. The default value is 100 Mbit/s.

6. (Interface view) Set the priority of an interface for DR election.

[Huawei-GigabitEthernet0/0/0] ospf dr-priority priority

The ospf dr-priority command sets a priority for an interface that participates in DR election. A
larger value indicates a higher priority. The value ranges from 0 to 255.

age 51 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Configuration Example
Description:

• There are three routers, R1, R2, and R3. R1 and R3 are connected to networks 1.1.1.1/32 and
3.3.3.3/32 (simulated by Loopback 0), respectively. OSPF needs to be used to implement
interworking between the two networks. Detailed topology was as follows:

Area Area
0 1
1.1.1.1/3 3.3.3.3/3
2 GE0/0/0 GE0/0/0 GE0/0/1 GE0/0/1 2
R1 10.1.12.1/30 10.1.12.2/30 R2 10.1.23.1/30 10.1.23.2/30R3

Configure Configure Verify the


interfaces. OSPF. result.

• The configuration process consists of three steps: configuring device interfaces, configuring
OSPF, and verifying the result.

age 52 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Configuration Example -
Configuring Interfaces
Verify
Configure Configure
the
interfaces. OSPF.
result.

Area Area
0 1
1.1.1.1/3 3.3.3.3/3
2 GE0/0/0 GE0/0/0 GE0/0/1 GE0/0/1 2
R1 10.1.12.1/30 10.1.12.2/30 R2 10.1.23.1/30 10.1.23.2/30R3

• Set IP addresses for R1's, R2's, and R3's interfaces according to the plan.

# Configure interfaces of R1. # Configure interfaces of R3.


[R1] interface LoopBack 0 [R3] interface LoopBack 0
[R1-LoopBack0] ip address 1.1.1.1 32 [R3-LoopBack0] ip address 3.3.3.3 32
[R1-LoopBack0] interface GigabitEthernet [R3-LoopBack0] interface GigabitEthernet
0/0/0 0/0/1
[R1-GigabitEthernet0/0/0] ip address [R3-GigabitEthernet0/0/1] ip address
10.1.12.1 30 Assign IP addresses for GE0/0/0 and GE0/0/1 on R2.30For details, see comment in
10.1.23.2
this slide.
age 53 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Configuration Example -
Configuring OSPF (1)
Verify
Configure Configure
the
interfaces. OSPF. result.

Router ID Area Area


1.1.1.1 0 1
1.1.1.1/3 3.3.3.3/3
2 GE0/0/0 2
R1 10.1.12.1/30 R2 R3

• Planned OSPF parameters: The OSPF process ID is 1. Router IDs of R1, R2, and R3 are
1.1.1.1, 2.2.2.2, and 3.3.3.3 respectively.
# Configure OSPF on R1.
• Procedure:
[R1] ospf 1 router-id 1.1.1.1
▫ Create and run an OSPF process. [R1-ospf-1] area 0
[R1-ospf-1-area-0.0.0.0] network 1.1.1.1 An inverse mask
▫ Create an OSPF area and enter the
is specified
0.0.0.0 here.
OSPF area view.
[R1-ospf-1-area-0.0.0.0] network 10.1.12.0
▫ Specify the interface that runs OSPF.. 0.0.0.3
age 54 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Configuration Example -
Configuring OSPF (2)
Verify
Configure Configure
the
interfaces. OSPF. result.

Area Router ID Area Router ID


0 2.2.2.2 1 3.3.3.3
1.1.1.1/3 3.3.3.3/3
2 GE0/0/0 GE0/0/1 GE0/0/1 2
R1 10.1.12.2/30 R2 10.1.23.1/30 10.1.23.2/30R3

• When configuring OSPF multi-area, be sure to advertise the route destined for a
network segment that responds to a specified area.

# Configure OSPF on R2. # Configure OSPF on R3.


[R2] ospf 1 router-id 2.2.2.2 [R3] ospf 1 router-id 3.3.3.3
[R2-ospf-1] area 0 [R3-ospf-1] area 1
[R2-ospf-1-area-0.0.0.0] network 10.1.12.0 [R3-ospf-1-area-0.0.0.1] network 3.3.3.3
0.0.0.3 0.0.0.0
[R2-ospf-1-area-0.0.0.0] area 1 [R3-ospf-1-area-0.0.0.1] network 10.1.23.0
[R2-ospf-1-area-0.0.0.1] network 10.1.23.0 0.0.0.3

age 55 Copyright0.0.0.3
© 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Configuration Example -
Verification (1)
Verify
Configure Configure
interfaces. OSPF.
the
result.

Area Area
0 1
1.1.1.1/3 3.3.3.3/3
2 2
R1 R2 R3

• Check the OSPF neighbor table on R2.

<R2> display ospf peer brief


OSPF Process 1 with Router ID 2.2.2.2
Peer Statistic Information
---------------------------------------------------------------------------- Neighbor status
Area Id Interface Neighbor id State Verify that the neighbor
Area ID of status is Full, indicating
a 0.0.0.0 GigabitEthernet0/0/0 1.1.1.1 Full
that the adjacency has
neighbor been established
successfully.
0.0.0.1 GigabitEthernet0/0/1 3.3.3.3 Full

age 56 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
OSPF Configuration Example -
Verification (2)
• Check the routing table on R1 and ping 3.3.3.3 from 1.1.1.1.

<R1>display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing tables: Public
Destinations : 10 Routes : 10
Route to Destination/Mask Proto Pre Cost Flags NextHop Interface
3.3.3.3/32 1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
learned
using OSPF 3.3.3.3/32 OSPF 10 2 D 10.1.12.2 GigabitEthernet
0/0/0
10.1.12.0/30 Direct 0 0 D 10.1.12.1 GigabitEthernet
Set the
source IP 0/0/0
address to …
1.1.1.1 and
ping 3.3.3.3. <R1>ping -a 1.1.1.1 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes = 56 Sequence = 1 ttl = 254 time = 50 ms
age 57 Copyright © 2020 Huawei
… Technologies Co., Ltd. All rights reserved.
Quiz
1. (Multiple) In the process of establishing OSPF neighbor relationships and adjacencies, which
of the following states are stable? ( )
A. Exstart

B. Two-way

C. Exchange

D. Full

2. (Multiple) In which of the following situation will the establishment of adjacencies between
routers be triggered? ( )
A. Two routers on a point-to-point link

B. DR and BDR on a broadcast network

C. DRother and DRother on an NBMA network

D. BDR and DRother on a broadcast network


age 58 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Summar
y

OSPF is a widely used routing protocol on the live network. This presentation
describes basic concepts, application scenarios, and basic configurations of
OSPF.

The router ID, area, OSPF neighbor table, LSDB table, and OSPF routing table
are basic OSPF concepts. Describe the establishment of OSPF neighbor
relationships and adjacencies, which helps you better understand the link-
state routing protocol.

OSPF has more interesting details, such as LSA types, the SPF calculation
process, and the OSPF special area. For more OSPF information, please
continue your Huawei HCIP-Datacom certification courses.

age 59 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.
Thank You
www.huawei.com

age 60 Copyright © 2020 Huawei Technologies Co., Ltd. All rights reserved.

You might also like