Lab # 11: Open Shortest Path First: Link-State Routing
Lab # 11: Open Shortest Path First: Link-State Routing
Link-State Routing
Distance vector routing protocols are like road signs because routers must make preferred path
decisions based on a distance or metric to a network. Just as travelers trust a road sign to accurately
state the distance to the next town, a distance vector router trusts that another router is advertising
the true distance to the destination network. Link-state routing protocols take a different approach.
Link-state routing protocols are more like a road map because they create a topological map of the
network, and each router uses this map to determine the shortest path to each network. Just as you
refer to a map to find the route to another town, link-state routers use a map to determine the
preferred path to reach another destination.
Link-state routing protocols are also known as shortest path first protocols and are built around
Edsger Dijkstra’s SPF algorithm.
Open Shortest Path First (OSPF) is a routing protocol, it was created to fulfil the requirement
of enterprise size network. To scale a large size network, it uses area concept. Area concept is
similar to Sub netting. It allows us to separate the large internetwork into smaller networks
known as areas. Along with Area concept OSPF also supports Autonomous System (AS). Open
Shortest Path First (OSPF) is a link-state routing protocol that was developed as a replacement
for the distance vector Routing Information Protocol (RIP). OSPF is a classless routing protocol
that uses the concept of areas for scalability.
Each OSPF router maintains a link-state database containing the LSAs received from all other
routers. After a router has received all LSAs and built its local link-state database, OSPF uses
Dijkstra’s shortest path first (SPF) algorithm to create an SPF tree. The SPF tree is then used
to populate the IP routing table with the best paths to each network.
AREA CONCEPT
OSPF offers a very distinguishable feature named: Routing Areas. It means dividing routers
inside a single autonomous system running OSPF, into areas where each area consists of a
group of connected routers.
Areas are a logical collection of routers that carry the same Area ID or number inside of an
OSPF network, the OSPF network itself can contain multiple areas, the first and main Area is
called the backbone area “Area 0”, all other areas must connect to Area 0
Area concept is a feature of OSPF. It is limited only with OSPF. We cannot use it with other
routing protocol. OSPF implements two levels hierarchy with areas: backbone and area off
backbone.
Page 1 of 9
Figure 1. Area
• Backbone
Backbone is the central point of this implementation. Routers running in this area required to
maintain a complete database of entire network. All areas need to connect with this area through
a physical link or via a virtual link if physical link is not possible.
• Area off backbone
Area off backbone is the extension of backbone. Routes running in this area required to
maintain an area specific database instead of complete database. This is a cool feature. It will
speed-up the convergence time.
• ABR
Area Border Router (ABR) is a bridge between Backbone and Area off backbone. With correct
IP addressing we can summarize routes information on this router.
Page 2 of 9
Some terms to remember when using OSPF:
• Link
Link is an interface running OSPF routing protocol. When we add an interface in OSPF process,
it will be considered as a link.
• State
State is the information associated with a link (interface). A link (interface) contains several
information such as IP address, up/down status, subnet mask, type of interface, type of network,
bandwidth and delay. OSFP consider this information as state.
• LSA
Link state advertisement (LSA) is data packet. It contains link-state and routing information.
OSPF uses it to share and learn network information.
• LSDB
Every OSPF router maintains a Link state database (LSDB). LSDB is collection of all LSAs
received by a router. Every LSA has a unique sequence number. OSPF stores LSA in LADB
with this sequence number.
In order to become OSPF neighbor following values must be matched on both routers.
• Area ID
• Hello and Dead Intervals
The OSPF Hello interval indicates how often an OSPF router transmits its Hello packets. By
default, OSPF Hello packets are sent every 10 seconds.
The Dead interval is the period, expressed in seconds, that the router will wait to receive a Hello
packet before declaring the neighbor “down.” Cisco uses a default of four times the Hello
interval.
Area ID
OSPF uses area concept to scale an enterprise size network. OSPF areas create a logical
boundary for routing information. By default, routers do not share routing information beyond
the area. So, in order to become neighbors, two routers must belong to same area. Here one
confusing fact needs to clear. Area is associated with specific interface, not with entire router.
This allows us to configure the router in multiple areas.
For example, a router that has two interfaces; Serial interface and Fast Ethernet interface, can
run Serial interface in one area and Fast Ethernet in another area. It means link which connects
Page 3 of 9
two routers need be in same area including its both ends interface. Beside this interface should
have same network ID and subnet mask.
Following figure illustrate a simple OSPF network. In this network R1 is eligible to form
neighbor-ship with R4 and R2 respectively on S0/0 and F0/0.
Figure 2. Neighborhood
Page 4 of 9
May 08, 2018
Student Name: Roll No: Section:
2. CONFIGURE OSPF
Network number
Network number is network ID. We can use any particular host IP address or network IP
address. For example, we can use 192.168.1.1 (host IP address) or we can use 192.168.1.0
(Network IP address). While targeting a specific interface usually we use host IP address
(configured on that interface).
While targeting multiple interfaces, we use network IP address. So any interface that belongs to
specified network ID will be selected.
Wildcard mask
Wildcard mask are used with network ID to filter the interfaces. Wildcard mask is different
from subnet mask. Subnet mask is used to separate the network portion and host portion in IP
address. While wildcard mask is used to match corresponding octet in network portion.
Wildcard mask tells OSPF the part of network address that must be matched.
Page 5 of 9
Student Name: Roll No: Section:
Do it Yourself
1. Implement OSPF in the following network. Router configuration are given.
Page 6 of 9
Student Name: Roll No: Section:
:
Router 01
Router(config)#router ospf 1
Router(config-router)#network 10.1.1.0 0.0.0.3 %
Incomplete command.
Router(config-router)#network 10.1.1.0 0.0.0.3 area
0
Router(config-router)#network 192.168.15.0
0.0.0.255 area 0
Router(config-router)#exit
Router 02
Router(config)#router ospf %
Incomplete command.
Router(config)#router ospf 1
Router(config-router)#network 10.1.1.0 0.0.0.3 area
0
Router(config-router)#network 10.2.2.0 0.0.0.3 area
0
Router(config-router)#
00:10:54: %OSPF-5-ADJCHG: Process 1, Nbr
192.168.15.1 on Serial0/0/0 from LOADING to
FULL, Loading Done
Router(config-router)#network 192.168.25.0
0.0.0.255 area 0
Router(config-router)#exit
Router 03
Router(config)#router ospf 1
Router(config-router)#network 10.2.2.0 0.0.0.3 area
0
Router(config-router)#network 192.168.35.0
0.0.0.255 area 0
Router(config-router)#exit
Page 7 of 9
May 08, 2018
Student Name: Roll No: Section:
Exercise:
Page 8 of 9
May 08, 2018
Student Name: Roll No: Section:
Page 9 of 9