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

Lab 5 Jess

The document discusses OSPF routing and network topology. It describes OSPF objectives, theory, types of links, message format, packets, states, router attributes, and electing a designated router to minimize flooding in a broadcast network.

Uploaded by

019bim017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Lab 5 Jess

The document discusses OSPF routing and network topology. It describes OSPF objectives, theory, types of links, message format, packets, states, router attributes, and electing a designated router to minimize flooding in a broadcast network.

Uploaded by

019bim017
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

ST.

XAVIER’S COLLEGE
MAITIGHAR, KATHMANDU

Advanced Internetworking (AIW)

Lab Report 5: OSPF Routing

Submitted by
Jeshika Baniya
019BIM017

Submitted to
Er. Sanjay K. Yadav
Lecturer
Department of Computer Science
St. Xavier’s College
Objectives:

 To learn about the basic commands in Networking.


 To secure router configuration from unauthorized users.
 To add IP using OSPF and sending/receiving the message.
 To learn about OSPF.
 To establish a fully connected network.

Software Used:

 Cisco Packet Tracer 8.1.1

Devices Used:

 2911 Router
 Laptop-PT
 PC-PT
 Switch 2960-24TT
 Cross cable
 Copper Straight Through cable
Theory

The OSPF (Open Shortest Path First) protocol is one of a family of IP Routing protocols, and is an
Interior Gateway Protocol (IGP) for the Internet, used to distribute IP routing information
throughout a single Autonomous System (AS) in an IP network.
The OSPF protocol is a link-state routing protocol, which means that the routers exchange
topology information with their nearest neighbors. The topology information is flooded throughout
the AS, so that every router within the AS has a complete picture of the topology of the AS. This
picture is then used to calculate end-to-end paths through the AS, normally using a variant of the
Dijkstra algorithm. Therefore, in a link-state routing protocol, the next hop address to which data
is forwarded is determined by choosing the best end-to-end path to the eventual destination.
The main advantage of a link state routing protocol like OSPF is that the complete knowledge of
topology allows routers to calculate routes that satisfy particular criteria. This can be useful for
traffic engineering purposes, where routes can be constrained to meet particular quality of service
requirements. The main disadvantage of a link state routing protocol is that it does not scale well
as more routers are added to the routing domain. Increasing the number of routers increases the
size and frequency of the topology updates, and also the length of time it takes to calculate end-to-
end routes. This lack of scalability means that a link state routing protocol is unsuitable for routing
across the Internet at large, which is the reason why IGPs only route traffic within a single AS.
Each OSPF router distributes information about its local state (usable interfaces and reachable
neighbors, and the cost of using each interface) to other routers using a Link State Advertisement
(LSA) message. Each router uses the received messages to build up an identical database that
describes the topology of the AS.
From this database, each router calculates its own routing table using a Shortest Path First (SPF) or
Dijkstra algorithm. This routing table contains all the destinations the routing protocol knows
about, associated with a next hop IP address and outgoing interface.
 The protocol recalculates routes when network topology changes, using the Dijkstra
algorithm, and minimizes the routing protocol traffic that it generates.
 It provides support for multiple paths of equal cost.
 It provides a multi-level hierarchy (two-level for OSPF) called "area routing," so that
information about the topology within a defined area of the AS is hidden from routers
outside this area. This enables an additional level of routing protection and a reduction in
routing protocol traffic.
 All protocol exchanges can be authenticated so that only trusted routers can join in the
routing exchanges for the AS.

Types of links in OSPF


A link is basically a connection, so the connection between two routers is known as a link.
There are four types of links in OSPF:
1. Point-to-point link: The point-to-point link directly connects the two routers
without any host or router in between.
2. Transient link: When several routers are attached in a network, they are known as
a transient link.
The transient link has two different implementations:
Unrealistic topology: When all the routers are connected to each other, it is known
as an unrealistic topology.
Realistic topology: When some designated router exists in a network then it is
known as a realistic topology. Here designated router is a router to which all the
routers are connected. All the packets sent by the routers will be passed through the
designated router.
3. Stub link: It is a network that is connected to the single router. Data enters to the network
through the single router and leaves the network through the same router.
4. Virtual link: If the link between the two routers is broken, the administration creates the
virtual path between the routers, and that path could be a long one also.
OSPF Message Format
The following are the fields in an OSPF message format:

o Version: It is an 8-bit field that specifies the OSPF protocol version.


o Type: It is an 8-bit field. It specifies the type of the OSPF packet.
o Message: It is a 16-bit field that defines the total length of the message, including the
header. Therefore, the total length is equal to the sum of the length of the message and
header.
o Source IP address: It defines the address from which the packets are sent. It is a sending
routing IP address.
o Area identification: It defines the area within which the routing takes place.
o Checksum: It is used for error correction and error detection.
o Authentication type: There are two types of authentication, i.e., 0 and 1. Here, 0 means
for none that specifies no authentication is available and 1 means for pwd that specifies the
password-based authentication.
o Authentication: It is a 32-bit field that contains the actual value of the authentication data.
OSPF Packets
There are five different types of packets in OSPF:
o Hello
o Database Description
o Link state request
o Link state update
o Link state Acknowledgment
1. Hello packet
The Hello packet is used to create a neighborhood relationship and check the neighbor's
reachability. Therefore, the Hello packet is used when the connection between the routers need to
be established.
2. Database Description
After establishing a connection, if the neighbor router is communicating with the system first time,
it sends the database information about the network topology to the system so that the system can
update or modify accordingly.
3. Link state request
The link-state request is sent by the router to obtain the information of a specified route. Suppose
there are two routers, i.e., router 1 and router 2, and router 1 wants to know the information about
the router 2, so router 1 sends the link state request to the router 2. When router 2 receives the link
state request, then it sends the link-state information to router 1.
4. Link state update
The link-state update is used by the router to advertise the state of its links. If any router wants to
broadcast the state of its links, it uses the link-state update.
5. Link state acknowledgment
The link-state acknowledgment makes the routing more reliable by forcing each router to send the
acknowledgment on each link state update. For example, router A sends the link state update to the
router B and router C, then in return, the router B and C sends the link- state acknowledgment to
the router A, so that the router A gets to know that both the routers have received the link-state
update.
OSPF States
The device running the OSPF protocol undergoes the following states:
o Down: If the device is in a down state, it has not received the HELLO packet. Here, down
does not mean that the device is physically down; it means that the OSPF process has not
been started yet.
o Init: If the device comes in an init state, it means that the device has received the HELLO
packet from the other router.
o 2WAY: If the device is in a 2WAY state, which means that both the routers have received
the HELLO packet from the other router, and the connection gets established between the
routers.
o Exstart: Once the exchange between the routers get started, both the routers move to the
Exstart state. In this state, master and slave are selected based on the router's id. The
master controls the sequence of numbers, and starts the exchange process.
o Exchange: In the exchange state, both the routers send a list of LSAs to each other that
contain a database description.
o Loading: On the loading state, the LSR, LSU, and LSA are exchanged.
o Full: Once the exchange of the LSAs is completed, the routers move to the full state.
Router attributes
Before going to the Extract state, OSPF chooses one router as a Designated router and another
router as a backup designated router. These routers are not the type, but they are the attributes of a
router. In the case of broadcast networks, the router selects one router as a designated router and
another router as a backup designated router. The election of designated and the backup designated
router is done to avoid the flooding in a network and to minimize the number of adjacencies. They
serve as a central point for exchanging the routing information among all the routers. Since point-
to-point links are directly connected, so DR and BDR are not elected.
If DR and BDR are not elected, the router will send the update to all the adjacent neighbors,
leading to the flooding in a network. To avoid this problem, DR and BDR are elected. Each non-
DR and non-BDR send the update only to the DR and BDR instead of exchanging it with other
routers in a network segment. DR then distributes the network topology information to other
routers in the same area whereas the BDR serves a substitute for the DR. The BDR also receives
the routing information from all the router but it does not distribute the information. It distributes
the information only when the DR fails.
The multicast address 224.0.0.6 is used by the non-DR and non-BDR to send the routing
information to the DR and BDR. The DR and BDR send the routing information to the multicast
address 224.0.0.5.
Based on the following rules, the DR and BDR are elected:
o The router with the highest OSPF priority is chosen as the DR. By default, the highest
priority is set as 1.
o If there is no highest priority, then the router with the highest router Id is chosen as the
DR, and the router with the second-highest priority is chosen as the BDR.
Let's understand this scenario through an example.

In the above figure, R1 is chosen as the DR, while R2 is chosen as the BDR as R1 has the highest
router ID, whereas the R2 has the second-highest router ID. If the link fails between R4 and the
system, then R4 updates only R1 and R4 about its link failure. Then, DR updates all the non-DR
and non-BDR about the change, and in this case, except R4, only R3 is available as a non-DR and
non-BDR.
Procedure for authorization

1. Connecting the devices


We connect a 2911 router to the end devices such as PC and laptops through straight cables via
a switch. The routers are connected through cross cable.

Figure: Connecting routers to end devices

2. Assigning hostname and configuring the router


 Assigning hostname and configuring 1st router
 Assigning hostname and configuring to 2nd router

3. Assigning IP using gigabitEthernet


 In Router1(R1) post (gigabitEthernet 0/0)

 In Router2(R2) post (gigabitEthernet 0/0)


•In Router1 (R1) post (gigabitEthernet 0/1)

•In Router2 (R2) post (gigabitEthernet 0/1)


4. Assigning IP using GUI
 In the end device i.e. PC1

 In the end device i.e. Laptop0


After we perform all the above steps, the following network is formed;

Figure: Complete Network

5. Pinging end devices to the network


While pinging the devices in the same router, we get successful results whereas if we ping the
devices of different routers, the success rate is 0 and we get the following result.
6. OSPF Configuration
 In Router1 (R1)
Here we set the OSPF area with the help of network ID and wildcard subnet in router1
(R1).

 In Router2 (R2)
Here we set the OSPF area with the help of network ID and wildcard subnet in
Router2 (R2).
It shows the following route:

7. Using simulation to send and receive packets


Sending messages from PC0 to Laptop0 of same router using OSPF Routing protocol

The following successful message shows that the packets have been delivered from PC0 to
Laptop1 of different routers.
Conclusion

After completing this lab report, we have learned how to construct a connection between a router,
switch and end devices that is capable of monitoring the network. We have known how to assign
IP addresses through OSPF, the uses of it and many more. We learned to configure from
gigabitEthernet.

You might also like