0% found this document useful (0 votes)
26 views12 pages

SP22 Bcs 124

The document describes configuring OSPF routing between routers. It defines OSPF terminology and provides instructions to set up a network topology with multiple routers and PCs. Learners will configure OSPF routing and verify connectivity between the routers and subnets.

Uploaded by

zeeshan sohail
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)
26 views12 pages

SP22 Bcs 124

The document describes configuring OSPF routing between routers. It defines OSPF terminology and provides instructions to set up a network topology with multiple routers and PCs. Learners will configure OSPF routing and verify connectivity between the routers and subnets.

Uploaded by

zeeshan sohail
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/ 12

COMSATS University Islamabad, Sahiwal Campus Computer Network Lab

COMSATS University Islamabad

Sahiwal Campus

Computer Networks Lab

Student Name: Zeeshan sohail

Student ID: SP22-BCS-124

BS (Computer Science)
________________________________________________________

Engr. M. Kashif Rao


________________________________________________________

DEPARTMENT OF COMPUTER SCIENCE


COMSATS University Islamabad
Sahiwal Campus

Computer Networks Lab Page 1


LAB # 5: Open Shortest Path First (OSPF)
Objectives:
Upon completion of this lab, you will be able to know:
• What is OSPF
• Configure OSPF routing on all routers
• Configure OSPF router IDs
• Verify OSPF routing using show commands
• Configure a static default route
• Propagate default route to OSPF neighbours
• Configure OSPF Hello and Dead Timers
• Configure OSPF priority
• Understand the OSPF election process
• Document the OSPF configuration
Pre-Lab Exercise:
Read this experiment in its entirety to become familiar with objectives of this lab. Study
in detail and become familiar with the Link State Routing basics provided with this
laboratory experiment and in the chapter 4 of the reference book. You may record the
terms and sections that require more elaboration for reference. The instructor may
provide the class some time to reflect upon these beforeproceeding with the lab.
Open Shortest Path First (OSPF) Basics:
Open Shortest Path First (OSPF) is an open standard link state routing protocol that’s
been implemented by a wide variety of network vendors, including Cisco. And it’s that
open standard characteristic that’s the key to OSPF’s flexibility and popularity.
OSPF works by using the Dijkstra algorithm to initially construct a shortest path tree
and followsthat by populating the routing table with the resulting best paths. It is quickly
convergent. Another two great advantages OSPF offers are that it supports multiple,
equal-cost routes to the same destination, also supports both IP and IPv6 routed
protocols. OSPF’s best features are:
• Allows for the creation of areas and autonomous systems
• Minimizes routing update traffic
• Is highly flexible, versatile, and scalable
• Supports VLSM/CIDR
• Offers an unlimited hop count
• Is open standard and supports multi-vendor deployment
OSPF Terminology:
Imagine being given a map and compass with no prior concept of east, west, north or south—not
even what rivers, mountains, lakes, or deserts are. I’m guessing that without any ability to orient
yourself in a basic way, your cool, new tools wouldn’t help you get anywhere but completely
lost, right? This is exactly why we’re going to begin exploring OSPF by getting you solidly
acquainted with a fairly long list of terms before setting out from base camp into the great
unknown! Here are those vital terms to commit to memory now:
OSPF Metrics:
OSPF uses a metric referred to as cost. A cost is associated with every outgoing interface
included in an SPF tree. The cost of the entire path is the sum of the costs of the outgoing
interfaces along the path. Cisco uses a simple equation of 108/bandwidth, where bandwidth is the
configured bandwidth for the interface. Using this rule, a 100 Mbps Fast Ethernet interface
would have a default OSPF cost of 1.
Link:
A link is a network or router interface assigned to any given network. When an interface is added
to the OSPF process, it’s considered to be a link. This link, or interface, will have up or down
state information associated with it as well as one or more IP addresses.
Router ID:
The router ID (RID) is an IP address used to identify the router. Cisco chooses the router ID by
using the highest IP address of all configured loopback interfaces. If no loopback interfaces are
configured with addresses, OSPF will choose the highest IP address out of all active physical
interfaces. To OSPF, this is basically the “name” of each router.
Designated Router:
A designated router (DR) is elected whenever OSPF routers are connected to the same broadcast
network to minimize the number of adjacencies formed and to publicize received routing
information to and from the remaining routers on the broadcast network or link. Elections are
won based upon a router’s priority level, with the one having the highest priority becoming the
winner. If there’s a tie, the router ID will be used to break it.
Neighborship Database:
The neighborship database is a list of all OSPF routers for which Hello packets have been seen.
A variety of details, including the router ID and state, are maintained on each router in the
neighborship database.
Topological Database:
The topological database contains information from all of the Link State Advertisement packets
that have been received for an area. The router uses the information from the topology database
as input into the Dijkstra algorithm that computes the shortest path to every network.
Link State Advertisement:
A Link State Advertisement (LSA) is an OSPF data packet containing link-state and routing
information that’s shared among OSPF routers. An OSPF router will exchange LSA packets only
with routers to which it has established adjacencies.
Broadcast (multi-access):
Broadcast (multi-access) networks such as Ethernet allow multiple devices to connect to or
access the same network, enabling a broadcast ability in which a single packet is delivered to all
nodes on the network. In OSPF, a DR and BDR must be elected for each broadcast multi-access
network.
Non-Broadcast multi-access:
Non-Broadcast multi-access (NBMA) networks are networks such as Frame Relay, X.25, and
Asynchronous Transfer Mode (ATM). These types of networks allow for multi-access without
broadcast ability like Ethernet. NBMA networks require special OSPF configuration to function
properly.
Point-to-Point:
Point-to-point refers to a type of network topology made up of a direct connection between two
routers that provides a single communication path. The point-to-point connection can be
physical— for example, a serial cable that directly connects two routers—or logical, where two
routers thousands of miles apart are connected by a circuit in a Frame Relay network. Either
way, point-to- point configurations eliminate the need for DRs or BDRs.
Point-to-multipoint:
Point-to-multipoint refers to a type of network topology made up of a series of connections
between a single interface on one router and multiple destination routers. All interfaces on all
routers share the point-to-multipoint connection and belong to the same network. Point-to-
multipoint networks can be further classified according to whether they support broadcasts or
not.
In-Lab Exercise:
In this lab activity, you will create a network that is similar to the one shown in the Topology
Diagram. Begin by cabling the network as shown in the Figure 5.1. Assign Network_ID from
Class B i.e. 172.17.0.0/24 and fill in the table. The segments of the network have been subnetted
using VLSM. OSPF is a classless routing protocol that can be used to provide subnet mask
information in the routing updates.
Topology diagram:

Figure 1 topology diagram

Addressing table:

device interface IP address Subnet mask Default gateway


FA0/0 192.168.1.1 - -
R1 S0/0/0 192.168.4.1 - -
S0/0/1 192.168.6.1 - -
FA00/0 192.168.2.1 - -
R2 S0/0/0 192.168.5.1 - -
S0/0/1 192.168.6.2 - -
FA0/0 192.168.3.1 - -
R3 S0/0/0 192.168.4.2 - -
S0/0/1 192.168.5.2 - -
PC1 NIC 192.168.1.2 255.255.255.0 192.168.1.1

PC2 NIC 192.168.2.2 255.255.255.0 192.168.2.1

PC3 NIC 192.168.3.2 255.255.255.0 192.168.3.1


Procedure:
1. Add Routers, Switch, PCs to the Topology:
• Drag and drop two routers from the "Router" category in the device list onto the
workspace.
• Drag and drop two switches from the "Switches" category onto the workspace. Connect
one switch to each router.
• Drag and drop two PCs from the "End Devices" category onto each switch. Connect each
PC to its respective switch.

2. Cable Connections:
• Use the "Copper Straight-Through" cable type to connect the routers to the switches
and the switches to the PCs. Click and drag from one device's port to another to create
the connections.

3. Configure IP Addresses on Routers:


• Click on a router to select it.
• Go to the "Config" tab in the router's properties panel.
• Under "FastEthernet0/0" (or similar), click the "Edit" button to configure the IP
address. Assign an IP address like 192.168.1.1 with a subnet mask of 255.255.255.0.
• Repeat the same process for the second router, giving it an IP address like
192.168.2.1 with the same subnet mask.

4. Configure IP Addresses on PCs:


• Click on a PC to select it.
• Go to the "Config" tab in the PC's properties panel.
• Under "FastEthernet0" (or similar), click the "Edit" button to configure the IP
address. Assign an IP address in the same subnet as the router it's connected to. For
example, for the PC1 connected to Router 1, use 192.168.1.2 with the same subnet
mask (255.255.255.0) and PC2 connected to Router 1, use 192.168.1.3 with the same
subnet mask (255.255.255.0).
• Repeat the same process for the other PCs, giving them IP addresses in their
respective subnets.

5. Configure OSPF:
Router(config)#router ospf Process ID
Router(config-router)#network Network1 Wildcard mask area OSPF areas
Router(config-router)#network Network2 Wildcard mask area OSPF areas
.
.
Router(config-router)#network NetworkN Wildcard mask area OSPF areas
Process ID: A value in the range from 1 to 65,535 identifies the OSPF process ID. It’s a
unique number on this router that groups a series of OSPF configuration commands
under a specific running process. Different OSPF routers don’t have to use the same
process ID to communicate. It’s a purely local value that doesn’t mean a lot, but you
still need to remember that it cannot start at 0; it has to start at a minimum of 1.
Network – Network that is directly connected with that router. You have to enter each
directly connected network (range from 1 to N) separately using network command
Wildcard mask – Inverse of a subnet mask. For Example, the inverse of the subnet mask
255.255.255.0 is 0.0.0.255. To calculate the inverse of the subnet mask, subtract the
subnet mask from 255.255.255.255:

6. Configure OSPF on router R1:


Go in the command line interface of router r1 and enter the following commands:
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 1
Router(config-router)#network 192.168.1.0 0.0.0.255 area 0
Router(config-router)#network 192.168.4.0 0.0.0.255 area 0
Router(config-router)#network 192.168.6.0 0.0.0.255 area 0
Router(config-router)#exit

Figure 2 ospf configration on router 1


7. Configure OSPF on router R2:
Go in the command line interface of router r2 and enter the following commands:
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 1
Router(config-router)#network 192.168.2.0 0.0.0.255 area 0
Router(config-router)#network 192.168.5.0 0.0.0.255 area 0
Router(config-router)#network 192.168.6.0 0.0.0.255 area 0
Router(config-router)#exit

Figure 3 ospf configuration of router 2

8. Configure OSPF on router R1:


Go in the command line interface of router r1 and enter the following commands:
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 1
Router(config-router)#network 192.168.3.0 0.0.0.255 area 0
Router(config-router)#network 192.168.4.0 0.0.0.255 area 0
Router(config-router)#network 192.168.5.0 0.0.0.255 area 0
Router(config-router)#exit
Figure 4 ospf configuration of router 3

Examine the current router IDs in the topology:


Since no router IDs or loopback interfaces have been configured on the three routers, the router ID for
each router is determined by the highest IP address of any active interface. Run the following command
on each router to check router ID
Router#show ip protocols
What is the router ID for R1?
The router id is: 192.168.6.1

Figure 5 router id for R1


What is the router ID for R2?
Router id is: 192.168.6.2

Figure 6 Router id for R2

What is the router ID for R3?


Router id is: 192.168.6.2

Figure 7 router id for R3


Use loopback addresses to change the router IDs of the routers in the topology:
R1(config)#interface loopback 0
R1(config-if)#ip address 10.1.1.1 255.255.255.255
R2(config)#interface loopback 0
R2(config-if)#ip address 10.2.2.2 255.255.255.255
R3(config)#interface loopback 0
R3(config-if)#ip address 10.3.3.3 255.255.255.255
When the router is reloaded, what is the router ID for R1?
192.168.6.1
When the router is reloaded, what is the router ID for R2?
192.168.6.2
When the router is reloaded, what is the router ID for R3?
192.168.6.3

Verify OSPF Operation:


On the R1 router, Use the show ip ospf neighbor command and write your observations.
R1#show ip ospf neighbor

Figure 8 ospf neighbor of r1

On the R2 router, Use the show ip ospf neighbor command and write your observations.
R2#show ip ospf neighbor

Figure 9 ospf neighbor of r2


On the R3 router, Use the show ip ospf neighbor command and write your observations.
R3#show ip ospf neighbor

Figure 10 ospf neighbor of r3

Result:
With ping command, we pinged pc 0 of router 1 to pc 1 of router 2 and pc 2 of router 3. All ping
results were successful.

Figure 11 ping result

You might also like