Routing
Routing
Routing
Aqeel Zaffar
Enrollment# UW-19-CS-BS-001
Email: uw-19-cs-bs-001@student.uow.edu.pk
Computer Networks (CS-312)
Abstract
Routing protocols determine the best routes to transfer data from one node to another and
specify how routers communicate between each other in order to complete this task. There
are different classes of routing protocols, two of which are Exterior Gateway Protocol (EGP)
and Interior Gateway Routing (IGR). A routing protocol can be dynamic or static, as well as
distance-vector or link-state. There are different types of routing protocols RIP (Routing
Information Protocol), OSPF (Open Shortest Path First) and EIGRP (Enhanced Interior
Gateway Routing Protocol). These protocols are dynamic IGP’s, meaning that these protocols
route packets within one Autonomous System (AS). RIP is a distance-vector protocol;
EIGRP is an enhanced distance vector protocol developed by Cisco and OSPF is a link-state
routing protocol. In this report we discuss routing in detail and configure the basic two
routing protocols RIP and OSPF.
1. Introduction
A Routing Protocol is a protocol that specifies how routers communicate with each other,
disseminating information that enables them to select routes between any two nodes on a
computer network [1]. The most important terms in the routing process are the routing table,
routing protocols and routing algorithms. Routing algorithms are responsible for selecting
the best path for the communication a border way we can say that A routing protocol is
the language a router speaks with other routers in order to share information about the reach
ability and status of network [2].Routing table has the information about different routes and
based on routing protocols each node and router will decide which route to take which differs
based on different algorithms or steps. In the process of routing, router plays a main role. On
the network layer, achieving routing convergence, the process in which routing tables are
updated, is a crucial and complex process. At every topology change, including a link failure
or recovery, the routing tables need to be updated at which time the convergence process
takes place. The main goals of any routing protocol are to achieve fast convergence, while
remaining simple, flexible, accurate and robust [3]. In the upcoming sections we discuss
routing in details, analyze and configure RIP and OSPF.
2. Routing
Routing is the process of moving a packet of data from a source to a destination. Routing is
typically performed by a specialized device known as a router. It is a core feature of the
internet that the router selects the paths Internet Protocol (IP) packets take from their origin to
destination. Routing tables are used by routers to maintain a record of routes to various
network destinations, so that they can direct forwarding accordingly. These tables may be
specified by an administrator, learned by observing network traffic, or built with the
assistance of routing protocols [4].
Routers read the headers of packets they receive to determine their intended destination. After
that, it uses information from its routing table to decide where to send the packet. As a packet
reaches its destination, it may be routed multiple times by different routers. Routers perform
this process millions of times a second with millions of packets.
The routing is established by the configuration of routing tables in the routers .There are
two different way to configure routing tables in router. They are static routing and
dynamic routing.
The simplest form of routing is pre-programmed and, consequently, static routes. The tasks of
discovering routes and propagating them throughout a network are left to the inter-network’s
administrator(s).A router programmed for static routing forwards packets out of
predetermined ports. After the relationship between a destination address and a router port is
configured, there is no longer any need for routers to attempt route discovery or even
communicate information about routes.
There are many benefits to using static routes. For instance, statically programmed routes can
make for a more secure network. There can be only a single path into, and out of, a network
connected with a statically defined route. That is, of course, unless multiple static routes are
defined. Another benefit is that static routing is much more resource efficient. Static routing
uses far less bandwidth across the transmission facilities, doesn’t waste any router CPU
cycles trying to calculate routes, and requires far less memory [5].
Dynamic routing attempts to solve this problem by constructing routing tables automatically,
based on information carried by routing protocols, allowing the network to act nearly
autonomously in avoiding network failures and blockages. Dynamic routing dominates the
Internet [6].Examples of dynamic-routing protocols and algorithms include Routing
Information Protocol (RIP), Open Shortest Path First (OSPF) and Enhanced Interior Gateway
Routing Protocol (EIGRP) that is shown in the Figure 2.
Routers can route in a two basic ways. They can use preprogrammed static routes, or they can
dynamically calculate routes using any one of a number of dynamic routing protocols.
Dynamic routing protocols are used by routers to perform discover routes. Routers then
mechanically forward packets over those routes. Statically programmed routers cannot
discover routes; they lack any mechanism to communicate routing information with other
routers. Statically programmed routers can only forward packets using routes defined by a
network administrator.
An autonomous system (AS) is a group of networks and routers under the authority of a
single administration.
Intradomain Routing: Routing inside an autonomous system is referred to as intradomain
routing.
Interdomain Routing: Routing between autonomous systems is referred to as interdomain
routing.
Each autonomous system can choose one or more intradomain routing protocols to handle
routing inside the autonomous system. However, only one interdomain routing protocol
handles routing between autonomous systems [7]. Figure 1 shows that there are four
autonomous systems. Autonomous systems connected with each other form interdomain
routing protocol while the routing inside each autonomous system is intradomain.
A routing protocol is the software part in the routing process which is assigned to an
interface. It is part of the router‟s operating system which is used for creating routing tables
and updating them. Just as there are different traffic laws and regulations when a person
drives on different road (routes) anywhere, a router also has terms based on which it decides
the information it should keep and the routes it should take with the help of the routing table.
A routing protocol sets the standards for the exchange of information between nodes. It
determines how the errors should be checked and how the sender should show that it has
finished sending and for the receiver if it has received the message (packet). Basically, it is an
“agreed upon format for transmitting data” between two nodes or devices on a network.
Depending on being simple, reliable or faster, each routing protocol has its own advantages
and disadvantages [8]. Different routing protocols use different routing algorithms. The most
popular routing protocols are Distance Vector, Link State and Path Vector routing protocol
where the first two are intradomain and the last one is for inter-domain routing. Figure 2
shows the hierarchical form of classification of routing protocols. In this report our main
concern is on RIP and OSPF.
Figure 3 shows the RIP (Routing information Protocol) Topology. This topology consists of
three routers and two PCs. Three interfaces FastEthernet 0/0, Serial 0/0/0 and Serial 0/0/1 of
Router0 are used in this topology. By default interfaces on router are remain administratively
down during the start up.
Double click PC0 and click Desktop menu item and click IP Configuration. Assign IP
address 10.0.0.2/8 to PC0 as shown in Figure 4. Similarly we can assign the IP address to
PC1.
Figure 3.RIP Network Topology
Initial IP Configuration
Double click Router0 and click CLI and press Enter key to access the command prompt
of Router0.
We need to configure IP address and other parameters on interfaces before we could actually
use them for routing. Interface mode is used to assign IP address and other parameters.
Interface mode can be accessed from global configuration mode. Following commands are
used to access the global configuration mode
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
.From global configuration mode we can enter in interface mode. From there we can
configure the interface. Following commands will assign IP address on FastEthernet0/0.
Router1:
Following commands are used to assign the IP address on interface of the Router1.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.1.250 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.1.246 255.255.255.252
Router(config-if)#clock rate 64000
Router(config-if)#bandwidth 64
Router(config-if)#no shutdown
Router(config-if)#exit
Router2:
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 20.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.1.245 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.1.253 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Routers will not exchange this information between them on their own. We need to
implement RIP routing protocol that will insist them to share this information.
Configuration of RIP protocol is much easier than you think. It requires only two steps to
configure the RIP routing.
Enable RIP routing protocol from global configuration mode.
Tell RIP routing protocol which networks you want to advertise.
Let’s configure it in Router0
Router0:
Router0(config)#router rip
Router0(config-router)# network 10.0.0.0
Router0(config-router)# network 192.168.1.252
Router0(config-router)# network 192.168.1.248
That’s all we need to configure the RIP. Follow same steps on remaining routers.
Router1:
Router1(config)#router rip
Router1(config-router)# network 192.168.1.244
Router1(config-router)# network 192.168.1.248
Router2:
Router2(config)#router rip
Router2(config-router)# network 20.0.0.0
Router2(config-router)# network 192.168.1.252
Router2(config-router)# network 192.168.1.244
To verify the setup we will use ping command. ping command is used to test the connectivity
between two devices. Access the command prompt of PC1 and use ping command to test the
connectivity from PC0.
RIP protocol automatically manage all routes for us. If one route goes down, it automatically
switches to another available. By default RIP will use the route that has low hops counts
between source and destination. In our network route1 has low hops counts, so it will be
selected. We can use tracert command to verify it.
4. OSPF (Open Shortest Path First)
Open Shortest Path First (OSPF) is a link-state routing protocol and. It computes the shortest
path tree for each route using a method based on Dijkstra algorithm, a shortest path first
algorithm. This interior gateway protocol (IGP) is most popular in large enterprise networks.
OSPF is used to determine the best route for delivering the packets within an IP networks. It
gathers link state information from available routers and constructs a topology map of the
network. The topology determines the routing table presented to the Internet Layer
which makes routing decisions based solely on the destination IP address found in IP
packets. It exhibits faster routing compared to RIP. OSPF detects changes in the topology,
such as link failures and converges on a new loop-free routing structure within seconds [9].
Figure 5 shows the OSPF network topology. Four interfaces FastEthernet0/0, Fast
Ethernet0/1, Serial 0/0/0 and Serial0/0/1 of Router0 are used in this topology. By default
interfaces on router are remain administratively down during the start up.
Double click Server0 and click Desktop menu item and click IP Configuration. Assign IP
address 20.0.0.2/8 to Server0 as shown in Figure 6. Similarly we can assign the IP address to
PC0.
Figure 6.Assign IP Address to Server
Initial IP Configuration
Double click Router0 and click CLI and press Enter key to access the command prompt
of Router0.
We need to configure IP address and other parameters on interfaces before we could actually
use them for routing. Interface mode is used to assign the IP address and other parameters.
Interface mode can be accessed from global configuration mode. Following commands are
used to access the global configuration mode.
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
From global configuration mode we can enter in interface mode. From there we can
configure the interface. Following commands will assign IP address on FastEthernet0/0 and
FastEthernet0/1.
Router(config)#interface fastEthernet 0/0
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface fastEthernet 0/1
Router(config-if)#ip address 192.168.1.1 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#
Router1:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.0.2 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.0.5 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router2:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.0.9 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)# interface serial 0/0/1
Router(config-if)#ip address 192.168.0.6 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router5:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# interface fastethernet 0/0
Router(config-if)#ip address 192.168.1.5 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address 192.168.1.2 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router3:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.2.6 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.2.2 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router4:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface serial 0/0/0
Router(config-if)#ip address 192.168.0.10 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface serial 0/0/1
Router(config-if)#ip address 192.168.2.10 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)# interface fastethernet 0/0
Router(config-if)#ip address 192.168.1.6 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface fastethernet 0/1
Router(config-if)#ip address 20.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Now routers have information about the networks that they have on their own interfaces.
Routers will not exchange this information between them on their own. We need to
implement OSPF routing protocol that will insist them to share this information.
Router0:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 10
Router(config-router)#network 10.0.0.0 0.255.255.255 area 0
Router(config-router)#network 192.168.0.0.0 0.0.0.3 area 0
Router(config-router)#network 192.168.1.0 0.0.0.3 area 0
Router(config-router)#network 192.168.2.0 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router1:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 10
Router(config-router)#network 192.168.0.0 0.0.0.3 area 0
Router(config-router)#network 192.168.0.4 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router2:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 20
Router(config-router)#network 192.168.0.4 0.0.0.3 area 0
Router(config-router)#network 192.168.0.8 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router6:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 60
Router(config-router)#network 20.0.0.0 0.255.255.255 area 0
Router(config-router)#network 192.168.0.8 0.0.0.3 area 0
Router(config-router)#network 192.168.2.8 0.0.0.3 area 0
Router(config-router)#network 192.168.1.4 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router5:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 50
Router(config-router)#network 192.168.1.0 0.0.0.3 area 0
Router(config-router)#network 192.168.1.4 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router4:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 40
Router(config-router)#network 192.168.2.8 0.0.0.3 area 0
Router(config-router)#network 192.168.2.4 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
Router3:
Router>enable
Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router ospf 30
Router(config-router)#network 192.168.2.0 0.0.0.3 area 0
Router(config-router)#network 192.168.2.4 0.0.0.3 area 0
Router(config-router)#exit
Router(config)#
To verify the setup we will use ping command. ping command is used to test the connectivity
between two devices. We have two routes between source and destination. tracert command
is used to know the route which is used to get the destination. Access the command prompt of
PC1 and use ping command to test the connectivity from Server0. After that
use tracert command to print the taken path.
RIP OSPF
Router sends updated routing table to Router generate new LSP periodically (in 1-2
neighbors every 30 sec. hours)
Metric/Cost: number of hops. Max hop is 15. Metric/Cost: Minimum Delay, Maximum
Throughput. Administrator can assign the
cost.
Routing table is sent to neighbor nodes. Routing table is sent to all nodes (not just
neighbors)
Bellman ford Algorithm Dijkstra Algorithm
5. Conclusions
Routing protocols aim at finding the best path in the network to ensure its connectivity. Each
routing protocol has its own standards to judge a route quality by using metrics like next hop
count, bandwidth and delay. In this work the network is demonstrated using the simulator
Cisco packet Tracer, with various routing protocols. After comparison of RIP and OSPF
it is concluded that OSPF dominates RIP in terms of average throughput and instant delay in
different size of network. For the routing traffic the OSPF was the one with the most traffic
sent but RIP protocol had the least traffic as it sends only the number of hops. The Interior
routing protocol OSPF is widely being used in the computer networking.
6. References
[1] R.Devi, B.Sumathi, T.Gandhimathi, G.Alaiyarasi,Performance Metrics of MANET in
Multi-Hop Wireless Ad-Hoc Network Routing Protocols, International Journal of
Computational Engineering Research (IJCER) ISSN: 2250-3005
[2] Behrouz A.Forouzan.(2007).Data Communication and Networking(4 th ed.).NewYork:
Alan R, Apt
[3] 2021.Available online:
https://www.sfu.ca/~ljilja/ENSC427/Spring13/Projects/team5/Team5Report.pdf [Accessed 7
Dec 2021].
[4] 2021.Available online: https://www.webopedia.com/definitions/routing/
[Accessed 7 Dec 2021].
[5] 2021.Available online: https: https://www.ahirlabs.com/2017/08/14/routing-and-its-types/
[Accessed 08 Dec 2021].
[6] 2021.Available online:https://en.wikipedia.org/wiki/Routing [Accessed 08 Dec 2021].
[7] Behrouz A.Forouzan.(2007).Data Communication and Networking(4 th ed.).NewYork:
Alan R, Apt
[8] 2021.[Online].Available: https://www.researchgate.net/publication/281490293_Routing_
Internet_Routing_Protocols_and_Algorithms. [Accessed 09- Dec- 2021].
[9] "Analysis of RIPv2, OSPF, EIGRP Configuration on router Using CISCO Packet
tracer", International Journal of Engineering Science and Innovative Technology (IJESIT),
vol.4, no.2, p.range of page ,2015.Available: https://www.ijesit.com/Volume%204/
Issue%202/IJESIT201502_30.pdf. [Accessed 9 December 2021].