You are on page 1of 9

Open Shortest Path First (OSPF)

C.M. Caringal, A.R. Ebreo, M.F.T. Marfa, D.J.S. Masangcay, A.J.H. Miranda

Students, Bachelor of Science in Electronics Engineering, Batangas State University

cherrielyn_caringal14@yahoo.com, ebreoangelika32@gmail.com, markmarfa90@gmail.com

djhay970@gmail.com, anne.jeline.miranda@gmail.com

April 6, 2019

Abstract

This paper defines the principles of Open Shortest Path First (OSPF). The OSPF is a link state protocol
that handles routing for IP traffic. Version 2 of OSPF, which is explained in RFC 2328, is an open standard, such
as RIP v1 and v2. This paper draws heavily on the concepts of OSPF. Besides the characteristics of OSPF,
information to undertake a basic routing configuration will be presented here.

I. Objectives significant advantages over RIP in that it offers


faster convergence and scales to much larger
1. Describe the background and basic
network implementations.
features of OSPF
2. Identify and apply the basic OSPF III. Review of Related Literature
configuration commands
 Redundancy - is an important part of
3. Describe, modify and calculate the
hierarchical design for preventing
metric used by OSPF
disruption of network services to users.
4. Describe the Designated
Redundant networks require adding
Router/Backup Designated Router
physical paths, but logical redundancy
(DR/BDR) election process in
must also be part of the design.
multiaccess networks
5. Describe the uses of additional  Layer 2 Switching Loop - When
configuration commands in OSPF switches are interconnected
6. How do CISCO IOS routers achieve for redundancy
convergence in an OSPF network?  Protocol – It categorized the nearest
7. How does OSPF use cost to determine open system interconnection (OSI
best path? model layers). This protocol are
8. What are the similarities and originally based on the internet
differences between OSPFv2 and suite(TCP/IP) and other models.
OSPFv3?  Broadcast Storms-When switches are
interconnected for redundancy as
II. Introduction shown above, a broadcast originating
Open Shortest Path First (OSPF) is a link-state from a device connected to any switch,
routing protocol that was developed as a can cause the circulation of broadcasts
replacement for the distance vector routing around the network and can saturate the
protocol, RIP. RIP was an acceptable routing network consuming all available
protocol in the early days of networking and the bandwidth.
Internet. However, RIP’s reliance on hop count  Root bridge (switch) - is a special
as the only metric for determining best route bridge at the top of the Spanning Tree
quickly became problematic. Using hop count (inverted tree)
does not scale well in larger networks with  Spanning Tree Path Cost value - can be
multiple paths of varying speeds. OSPF has defined as the accumulated port costs
from a Switch (other than the Root  In 1998, the OSPFv2 specification was
Bridge (Switch)) to reach the Root updated in RFC 2328, which remains
Switch. When a switch receives the current RFC for OSPF.
a Bridge Protocol Data Unit (BPDU) in  In 1999, OSPFv3 for IPv6 was
its port, it increments the path cost with published in RFC 2740. OSPF for IPv6,
the cost of the incoming port. created by John Moy, Rob Coltun, and
 Root Port - is a single selected port on Dennis Ferguson, is not only a new
a Switch, other than Root Switch, with protocol implementation for IPv6, but
least Path Cost to reach the Root also a major rewrite of the operation of
Bridge. the protocol.
 Designated Port - is the port that has the  In 2008, OSPFv3 was updated in RFC
lowest Spanning Tree Path Cost on a 5340 as OSPF for IPv6.
particular Local Area Network (LAN)
segment.
IV. Discussion
4.1 OSPF

 Evolution of OSPF

 The initial development of OSPF began


in 1987 by the Internet Engineering  Features of OSPF
Task Force (IETF) OSPF Working ■ Classless: It is classless by design; therefore,
Group. At that time, the Internet was it supports VLSM and CIDR.
largely an academic and research
networkfunded by the U.S. ■ Efficient: Routing changes trigger routing
government. updates (no periodic updates). It uses the SPF
 In 1989, the specification for OSPFvl algorithm to choose the best path.
was published in RFC 1131. Two ■ Fast convergence: It quickly propagates
implementations were written.One network changes.
implementation was developed to run
on routers and the other to run on UNIX ■ Scalable: It works well in small and large
workstations. The latter network sizes. Routers can be grouped into
implementation became a widespread areas to support a hierarchical system.
UNIX process known as GATED.
■ Secure: It supports Message Digest 5 (MD5)
OSPFv1 was an experimental routing
authentication. When enabled, OSPF routers
protocol and was never deployed.
accept only encrypted routing updates from
 In 1991, OSPFv2 was introduced in
peers with the same preshared password.
RFC 1247 by John Moy. OSPFv2
offered significant technical Administrative distance (AD) is the
improvements over OSPFv1. It is trustworthiness (or preference) of the route
classless by design; therefore, it source.
supports VLSM and CIDR. At the
same time the OSPF was introduced, OSPF has a default administrative distance of
ISO was working on a link-state 110. Because of this, OSPF is preferred over
routing protocol of itsown, ISIS
Intermediate System-to-Intermediate (AD 115) and RIP (AD 120).
System (IS-IS). IETF chose OSPF as
its recommended Interior Gateway  Components of OSPF
Protocol (IGP).
OSPF creates and maintains three databases:
1. Adjacency Database- creates the enabled interfaces to determine if
neighbor table. neighbors are present on those links. If
2. Link-State Database- creates the a neighbor is present, the OSPF-
topology table enabled router attempts to establish a
3. Forwarding Database-Creates the
routing table.

neighbor adjacency with that neighbor.


4.2 Routing Protocol Messages
OSPF exchanges messages to convey routing
information using five types of packets. These 2. Exchange Link-State Advertisements
packets are: (Figure 8-3). After adjacencies are
established, routers then exchange
1. Hello Packet
link-state advertisements (LSA). LSAs
2. Database description packet
contain the state and cost of each
3. Link-state request packet
directly connected link. Routers flood
4. Link-state update packet
their LSAs to adjacent neighbors.
5. Link-state acknowledgement packet
Adjacent neighbors receiving the LSA
They will be further discuss later. immediately flood the LSA to other
directly connected neighbors, until all
4.3 Algorithm routers in the area have all LSAs.
The CPU processes the neighbor and topology
tables using Dijkstra’s SPF algorithm. The SPF
algorithm is based on the cumulative cost to
reach a destination. The SPF algorithm creates
an SPF tree by placing each router at the root of
the tree and calculating the shortest path to each
node. The SPF tree is then used to calculate the
best routes. OSPF places the best routes into the
forwarding database, which is used to make the
routing table.

 Link-State Operation
1. Establish Neighbor Adjacencies (see
Figure 8-2). OSPF-enabled routers
must recognize each other on the 3. Build the Topology Table (Figure 8-4).
network before they can share After LSAs are received, OSPF-
information. An OSPF enabled router enabled routers build the topology table
sends Hello packets out all OSPF-
(LSDB) based on the received LSAs.
This database eventuallyholds all the
information about the topology of the network. An OSPF area is a group of routers that share
the same link-state information in their
LSDBs.
OSPF can be implemented in one of two ways:

1. Single-Area OSPF

4. Execute the SPF Algorithm (Figure 8-


5). Routers then execute the SPF
algorithm. The gears in the figure are
used to indicate the execution of the
SPF algorithm. The SPF algorithm
creates the SPF tree.
2. Multi-Area OSPF

The hierarchical-topology possibilities of


multiarea OSPF have these advantages:
From the SPF tree, the best paths are inserted
into the routing table. Routing decisions are ■ Smaller routing tables: Fewer routing table
made based on the entries in the routing table. entries because network addresses can be
summarized between areas. Route
summarization is not enabled by default.
■ Reduced link-state update overhead:
Minimizes processing and memory
requirements.
■ Reduced frequency of SPF calculations:
Localizes the impact of a topology change
within an area. For instance, it minimizes
routing update impact because LSA flooding
stops at the area boundary.

4.4
4.5 OSPF Messages
Single-Area and Multiarea OSPF
Types of OSPF Packets

 Data Link Ethernet Frame Header: OSPF uses link-state packets (LSP) to establish
Identifies the destination multicast and maintain neighbor adjacencies
MAC addresses 01-00-5E-00-00-05 or and exchange routing updates.
01-00-5E-00-00-06, as shown in
figure. There are five different types of LSPs used by
OSPF. Each packet serves a specific
purpose in the OSPF routing process:
■ Type 1: Hello packet: Used to establish and
maintain adjacency with other OSPF
 IP Packet Header: Identifies the IPv4 routers.
protocol field 89, which indicates that ■ Type 2: Database Description (DBD) packet:
this is an OSPF packet. It also Contains an abbreviated list of the sending
identifies one of two OSPF multicast router’s LSDB and is used by receiving routers
addresses, 224.0. 0.5 or 224.0.0.6, as to check against the local LSDB. The
shown in figure. LSDB must be identical on all link-state routers
within an area to construct an accurate
SPF tree.
■ Type 3: Link-State Request (LSR) packet:
Receiving routers can then request more
information about any entry in the DBD by
 OSPF Packet Header: Identifies the sending an LSR.
OSPF packet type, the router ID and the ■ Type 4: Link-State Update (LSU) packet:
area ID, as shown in figure. Used to reply to LSRs and to announce new
information. LSUs contain seven different
types of LSAs.
■ Type 5: Link-State Acknowledgment
(LSAck) packet: When an LSU is received, the
router sends an LSAck to confirm receipt of the
LSU. The LSAck data field is empty.

 OSPF Packet Type Specific Data:


Contains the OSPF packet type 4.6 OSPF Operational States
information. The content differs When an OSPF router is initially connected to
depending on the packet type. In this a network, it attempts to
case, it is an IPv4 Header, as shown in
figure. ■ Create adjacencies with neighbors.
■ Exchange routing information.
■ Calculate the best routes.
■ Reach convergence.
OSPF progresses through several states while
attempting to reach convergence:
■ Down state
■ Init state
■ Two-Way state R2 then sends a Hello packet to R1. The packet
contains the R2 Router ID and the R1 Router ID
■ ExStart state
in its list of neighbors on the same interface.
■ Exchange state
In Figure 8-19, R1 receives the Hello and adds
■ Loading state the R2 Router ID in its list of OSPF neighbors .

■ Full state
When OSPF is enabled on an interface, the
router must determine if there is another OSPF
neighbor on the link. To accomplish this, the
router forwards a Hello packet that contains its
router ID out all OSPF-enabled interfaces. The
OSPF router ID is used by the OSPF process to It also notices its own Router ID in the Hello
uniquely identify each router in the OSPF area. packet’s list of neighbors. When a router
A router ID is an IP address assigned to identify receives a Hello packet with its Router ID
a specific router among OSPF peers. When a listed in the list of neighbors, the router
neighboring OSPF-enabled router receives a transitions from the Init state to the Two-Way
Hello packet with a router ID that is not within state.
its neighbor list, the receiving router attempts to
establish an adjacency with the initiating router. The action performed in Two-Way state
depends on the type of interconnection
between the adjacent routers:
■ If the two adjacent neighbors are
interconnected over a point-to-point link, then
they immediately transition from the Two-
Way state to the database synchronization
phase.
■ If the routers are interconnected over a
When OSPF is enabled, the enabled Gigabit common Ethernet network, then a designated
Ethernet 0/0 interface transitions from the router DR and a BDR must be elected.
Down state to the Init state. R1 starts sending Because R1 and R2 are interconnected over an
Hello packets out all OSPF- enabled interfaces Ethernet network, a DR and BDR election
takes place. As shown in Figure 8-20, R2
to discover OSPF neighbors to develop
becomes the DR and R1 is the BDR. This
adjacencies with.
process occurs only on multiaccess networks
In Figure 8-18, R2 receives the Hello packet such as Ethernet LANs.
from R1 and adds the R1 router ID to its Hello packets are continually exchanged to
neighbor list. maintain router information.

Figure 8-20 Elect the DR and BDR


OSPF DR and BDR
Multiaccess networks can create two challenges
for OSPF regarding the flooding of LSAs:
■ Creation of multiple adjacencies: Ethernet
networks could potentially interconnect many
OSPF routers over a common link. Creating
adjacencies with every router is unnecessary
and undesirable. It would lead to an excessive
number of LSAs exchanged between routers on
the same network.
■ Extensive flooding of LSAs: Link-state After the Two-Way state, routers transition to
routers flood their LSAs any time OSPF is database synchronization states. Although the
initialized, or when there is a change in the Hello packet was used to establish neighbor
topology. This flooding can become excessive. adjacencies, the other four types of OSPF
packets are used during the process of
To understand the problem with multiple exchanging and synchronizing LSDBs. In the
adjacencies, you must study a formula: ExStart state, a master and slave relationship is
For any number of routers (designated as n) on created between each router and its adjacentDR
a multiaccess network, there are n (n - 1)/ 2 and BDR. The router with the higher router ID
adjacencies. acts as the master for the Exchange state. In
Figure 8-22, R2 becomes the master.
Figure 8-21 Creating Adjacencies with Every
Neighbor Without some type of mechanism to
reduce the number of adjacencies, collectively
these routers would form 10 adjacencies:
Figure 8-21 shows a simple topology of five
routers, all of which are attached to the
samemultiaccess Ethernet network. Figure 8-22 Decide Which Router Sends the
First DBD
In the Exchange state, the master and slave
routers exchange one or more DBD packets. A
DBD packet includes information about the
LSA entry header that appears in the router’s
LSDB. The entries can be about a link or about
a network. Each LSA entry header includes
information about the link-state type, the
address of the advertising router, the link’s cost,
and the sequence number. The router uses the
sequence number to determine the newness of
the received link-state information.
In Figure 8-23, R2 sends a DBD packet to R1.
4.6 Configuring Single-Area OSPFv2

Figure 8-23 Exchange DBD Packets


When R1 receives the DBD, it performs the
following actions:
1. It acknowledges the receipt of the DBD using
the LSAck packet.
2. R1 then sends DBD packets to R2.
3. R2 acknowledges R1.
R1 compares the information received with the
information it has in its own LSDB. If the DBD
packet has a more current link-state entry, the
router transitions to the Loading state.
For example, in Figure 8-24, R1 sends an LSR
regarding network 172.16.6.0 to R2. R2
responds with the complete information about
172.16.6.0 in an LSU packet. Again, when R1
receives an LSU, it sends an LSAck. R1 then
adds the new link-state entries into its LSDB.

Figure 8-24 Getting Additional Routing


Information

You might also like