Module-4
Module-4
Routing Principles:
Routing refers to the process of directing a data packet from one node to another. It is an
autonomous process handled by the network devices to direct a data packet to its intended
destination. Note that, the node here refers to a network device called - 'Router'.
Routing is a crucial mechanism that transmits data from one location to another across a
network (Network type could be any like LAN, WAN, or MAN). The process of routing
involves making various routing decisions to ensure reliable & efficient delivery of the data
packet by finding the shortest path using various routing metrics
Routing of a data packet is done by analyzing the destination IP Address of the packet. Look at
the below image:
The Source Node (Sender) sends the data packet on the network, embedding the IP in the
header of the data packet.
The nearest router receives the data packet, and based on some metrics, further routes the
data packet to other routers.
Step 2 occurs recursively till the data packet reaches its intended destination.
Types of Routing?
Routing is typically of 3 types, each serving its purpose and offering different functionalities.
Static Routing
Static routing is also called as "non-adaptive routing". In this, routing configuration is done
manually by the network administrator. Let's say for example, we have 5 different routes to
transmit data from one node to another, so the network administrator will have to manually
enter the routing information by assessing all the routes.
A network administrator has full control over the network, routing the data packets to
their concerned destinations
Routers will route packets to the destination configured manually by the network
administrator.
Although this type of routing gives fine-grained control over the routes, it may not be
suitable for large-scale enterprise networks.
2. Dynamic Routing
Dynamic Routing is another type of routing in which routing is an autonomous procedure
without any human intervention. Packets are transmitted over a network using various shortest-
path algorithms and pre-determined metrics. This type of routing is majorly preferred in modern
networks as it offers more flexibility and versatile functionality.
It is also known as adaptive routing.
In this, the router adds new routes to the routing table based on any changes made in the
topology of the network.
The autonomous procedure of routing helps in automating every routing operation from
adding to removing a route upon updates or any changes made to the network.
3. Default Routing
Default Routing is a routing technique in which a router is configured to transmit packets to a
default route that is, a gateway or next-hop device if no specific path is defined or found. It is
commonly used when the network has a single exit point. The IP Router has the following
address as the default route: 0.0.0.0/0.
Principle of Routing?
Routing works by finding the shortest path from the source node to the destination node across a
network. Here's the step-by-step working of routing:
Step 1: Communication initiation
The first step that typically happens is, one node (client or server) initiates a communication
across a network using HTTP protocols.
Step 2: Data Packets
The source device now breaks a big chunk of information into small data packets for reliable
and efficient transmission. This process is called de-assembling and encapsulating the data
payload. Then each data packet is labelled with the destination node's IP address.
Step 3: Routing Table
The Routing table is a logical data structure used to store the IP addresses and relevant
information regarding the nearest routers. The source node then looks up the IP addresses of all
the nodes that can transmit the packet to its destination selects the shortest path using the
shortest path algorithm and then routes accordingly.
The Routing Table is stored in a router, a network device that determines the shortest path and
routes the data packet.
Step 4: Hopping procedure
In the procedure or routing, the data packet will undergo many hops across various nodes in a
network till it reaches its final destination node. Hop count is defined as the number of nodes
required to traverse through to finally reach the intended destination node.
This hopping procedure has certain criteria defined for every data packet, there's a limited
number of hops a packet can take if the packet exceeds that, then it's considered to be lost and is
retransmitted.
Step 5: Reaching the destination node
Once all the data packets reach their intended destination node, they re-assemble and transform
into complete information that was sent by the sender (source node). The receiver will perform
various error-checking mechanisms to verify the authenticity of the data packets.
Overall, the data packet will be transmitted over the least hop-count path as well as the path on
which there is less traffic to prevent packet loss.
o Knowledge about the whole network: Each router shares its knowledge through the entire
network. The Router sends its collected knowledge about the network to its neighbors.
o Routing only to neighbors: The router sends its knowledge about the network to only those
routers which have direct links. The router sends whatever it has about the network
through the ports. The information is received by the router and uses the information to
update its own routing table.
o Information sharing at regular intervals: Within 30 seconds, the router sends the
information to the neighboring routers.
With the Distance Vector Routing algorithm, the node x contains the following routing
information:
o For each neighbor v, the cost c(x,v) is the path cost from x to directly attached neighbor, v.
o The distance vector x, i.e., Dx = [ Dx(y) : y in N ], containing its cost to all destinations, y,
in N.
o The distance vector of each of its neighbors, i.e., D v = [ Dv(y) : y in N ] for each neighbor
v of x.
Distance vector routing is an asynchronous algorithm in which node x sends the copy of its
distance vector to all its neighbors. When node x receives the new distance vector from one of its
neighboring vector, v, it saves the distance vector of v and uses the Bellman-Ford equation to
update its own distance vector. The equation is given below:
Link state routing is the second family of routing protocols. While distance-vector routers use a
distributed algorithm to compute their routing tables, link-state routing uses link-state routers to
exchange messages that allow each router to learn the entire network topology. Based on this
learned topology, each router is then able to compute its routing table by using the shortest path
computation.
Link state routing is a technique in which each router shares the knowledge of its neighborhood
with every other router i.e. the internet work. The three keys to understand the link state routing
algorithm.
1. Knowledge about the neighborhood : Instead of sending its routing table, a router
sends the information about its neighborhood only. A router broadcast its identities and cost
of the directly attached links to other routers.
2. Flooding: Each router sends the information to every other router on the internetwork
except its neighbors. This process is known as flooding. Every router that receives the
packet sends the copies to all the neighbors. Finally each and every router receives a copy of
the same information.
3. Information Sharing : A router send the information to every other router only when
the change occurs in the information.
Link state routing has two phase:
1. Reliable Flooding: Initial state – Each node knows the cost of its neighbors. Final
state- Each node knows the entire graph.
2. Route Calculation : Each node uses Dijkstra’ s algorithm on the graph to calculate the
optimal routes to all nodes. The link state routing algorithm is also known as Dijkstra’s
algorithm which is used to find the shortest path from one node to every other node in the
network.
Features of Link State Routing Protocols
Link State Packet: A small packet that contains routing information.
Link-State Database: A collection of information gathered from the link-state packet.
Shortest Path First Algorithm (Dijkstra algorithm): A calculation performed on the
database results in the shortest path
Routing Table: A list of known paths and interfaces.
The Routing Information Protocol is a distance vector routing protocol that helps routers
determine the best path to transfer data packets across the network. RIP works on the Network
layer of the OSI model. It uses hop count as its metric for determining the best path, but the
maximum hop count allowed in the RIP is 15. Routing Information Protocol is mostly used in
small to medium-sized networks.
Hop count is the number of routers occurring between the source and destination network. The
path with the lowest hop count is considered the best route to reach a network and therefore
placed in the routing table. RIP prevents routing loops by limiting the hops allowed in a path
from source to destination. The maximum hop count allowed for RIP is 15 and a hop count of
16 is considered as network unreachable.
RIP v2 is known as Classless Routing Protocol because it sends information of subnet mask in
its routing update.
Features of RIP
Updates of the network are exchanged periodically.
Updates (routing information) are always broadcast.
Full routing tables are sent in updates.
Routers always trust routing information received from neighbor routers. This is also
known as Routing on rumors.
Use of RIP
Routing Information Protocol (RIP) is used to transfer data packets from source to destination
computer through the network with the help of routers.
These are the set of guidelines designed by computer scientists for an easy and effective way to
connect through the connection of routers.
Open Shortest Path First (OSPF) is a routing protocol for IP networks. It is used within a network or area.
OSPF is an interior gateway protocol designed for a single autonomous system.OSPF uses a link-state
routing algorithm. Each router has information about every link and router in the network. It finds the
shortest path to each destination. OSPF learns about all routers and subnets in the network to build a link-
state database (LSDB). Routers exchange link-state advertisements (LSAs) to share information about
routers, subnets, and more.
Basic Terms
Link-state Description of a link between two routers, including its characteristics.
SPF algorithm Computes shortest path from a source router to others.
OSPF cost Metric representing the cost of using a link or path.
Shortest path tree Shows the shortest path from a source router to all others.
Areas Logical subdivisions of an OSPF network with similar characteristics.
Border routers Connect different areas or external networks.
Link-state packets Contain link-state advertisements and are sent by routers.
OSPF Operation
OSPF operates in three steps neighbor discovery, database exchange, and route calculation.
Neighbor Discovery Routers find and communicate with neighbors on the same link.
Database Exchange Routers exchange LSAs to learn about network topology.
Route Calculation Routers use SPF algorithm to find the best paths.
OSPF Protocol
Version A number that shows the version of OSPF being used.
Type A number that tells the type of OSPF packet.
Message The length of the whole message, including the header.
Fields in the OSPF message
Source IP address The address from which the packets are sent.
Area identification The area where the routing happens.
Checksum Used to find and fix errors in the message.
Authentication type Two types - 0 means no authentication, 1 means password-based authentication.
Authentication The actual authentication data in the message.
Advantages of OSPF
OSPF has many advantages over RIP. It is another interior gateway protocol based on a distance-vector
routing algorithm. Advantages of OSPF are
OSPF can handle variable length subnet masks (VLSM). It can support subnets of different sizes and
optimize the use of IP address space.
OSPF can support up to 65535 hops, while RIP has a limit of 15 hops. This makes OSPF more scalable and
suitable for large networks.
OSPF can perform route summarization and redistribution. It can reduce routing overhead and improve
efficiency by aggregating routes and exchanging routes with other routing protocols.
OSPF can use authentication to secure routing updates and prevent unauthorized or malicious changes to
the network topology.
OSPF can divide the network into areas and use different types of areas to reduce routing complexity and
improve performance.
Internal BGP
Routes are exchanged, and traffic is transmitted over the Internet using external BGP or eBGP.
Autonomous systems can also use an internal BGP version to route through their internal
networks, known as internal BGP.
It should be noted that using internal BGP is NOT a requirement for using external BGP.
Autonomous systems can choose from several internal protocols to connect the routers on their
internal network.
External BGP
External BGP is like international shipping; some specific standards and guidelines need to be
followed when shipping a piece of mail internationally. Once that piece of mail reaches its
destination country, it has to go through its local mail service to reach its final destination.
Each country has its internal mail service that doesn’t necessarily follow the same guidelines as
other countries. Similarly, each autonomous system can have its internal routing protocol for
routing data within its network.
An autonomous system is a collection of networks that comes under the single common
administrative domain. Or we can say that it is a collection of routers under the single
administrative domain. For example, an organization can contain multiple routers having different
locations, but the single autonomous number system will recognize them. Within the same
autonomous system or same organization, we generally use IGP (Interior Gateway Protocol)
protocols like RIP, IGRP, EIGRP, OSPF. Suppose we want to communicate between two
autonomous systems. In that case, we use EGP (Exterior Gateway Protocols). The protocol that is
running on the internet or used to communicate between two different autonomous number
systems is known as BGP (Border Gateway Protocol). The BGP is the only protocol that is
running on the internet backbone or used to exchange the routes between two different
autonomous number systems. Internet service providers use the BGP protocol to control all the
routing information.
The most common version of the Internet Protocol currently is IPv6. The well-known IPv6
protocol is being used and deployed more often, especially in mobile phone markets. IP address
determines who and where you are in the network of billions of digital devices that are
connected to the Internet. It is a network layer protocol which allows communication to take
place over the network. IPv6 was designed by the Internet Engineering Task Force (IETF) in
December 1998 with the purpose of superseding IPv4 due to the global exponentially growing
internet of users. In this article we will see IPv6 protocol in detail.
The next generation Internet Protocol (IP) address standard, known as IPv6, is meant to work in
cooperation with IPv4. To communicate with other devices, a computer, smartphone, home
automation component, Internet of Things sensor, or any other Internet-connected device needs
a numerical IP address. Because so many connected devices are being used, the original IP
address scheme, known as IPv4, is running out of addresses. This new IP address version is
being deployed to fulfil the need for more Internet addresses. With 128-bit address space, it
allows 340 undecillion unique address space. IPv6 support a theoretical maximum of 340, 282,
366, 920, 938, 463, 463, 374, 607, 431, 768, 211, 456.
Features of IPV6
Larger address space: An IPV6 address is 128 bits long. It is compared with the 32-bit address
of IPV4. It will allow for unique IP-addresses up to 3.4 x 1038 whereas IPV4 allows up to 4.3 x
108 unique address.
Better Header format: New header form has been designed to reduce overhead. It is done by
moving both non-essential fields and optional fields to extension field header that are placed
after the IPV6 header.
More Functionality: It is designed with more options like priority of packet for control of
congestion, Authentication etc.
Allowance for Extension: It is designed to allow the extension of the protocol if required by
new technologies.
Support of resource allocation: In IPV6, the type of service fields has been removed, but a
new mechanism has been added to support traffic control or flow labels like real-time audio and
video.
Quality of Service (QoS) is an important concept, particularly when working with multimedia
applications. Multimedia applications, such as video conferencing, streaming services, and VoIP
(Voice over IP), require certain bandwidth, latency, jitter, and packet loss parameters. QoS
methods help ensure that these requirements are satisfied, allowing for seamless and reliable
communication.
Quality-of-service (QoS) refers to traffic control mechanisms that seek to differentiate
performance based on application or network-operator requirements or provide predictable or
guaranteed performance to applications, sessions, or traffic aggregates. The basic phenomenon
for QoS is in terms of packet delay and losses of various kinds.
QoS Specification
Delay
Delay Variation(Jitter)
Throughput
Error Rate
QoS Parameters
Packet loss: This occurs when network connections get congested, and routers
and switches begin losing packets.
Jitter: This is the result of network congestion, time drift, and routing changes. Too
much jitter can reduce the quality of voice and video communication.
Latency: This is how long it takes a packet to travel from its source to its destination.
The latency should be as near to zero as possible.
Bandwidth: This is a network communications link’s ability to transmit the majority of
data from one place to another in a specific amount of time.
Mean opinion score: This is a metric for rating voice quality that uses a five-point scale,
with five representing the highest quality.
Benefits of QoS
Improved Performance for Critical Applications
Enhanced User Experience
Efficient Bandwidth Utilization
Increased Network Reliability
Compliance with Service Level Agreements (SLAs)
Reduced Network Costs
Improved Security
Better Scalability
Implementing QoS
Planning: The organization should develop an awareness of each department’s service
needs and requirements, select an appropriate model, and build stakeholder support.
Design: The organization should then keep track of all key software and hardware
changes and modify the chosen QoS model to the characteristics of its network
infrastructure.
Testing: The organization should test QoS settings and policies in a secure, controlled
testing environment where faults can be identified.
Deployment: Policies should be implemented in phases. An organization can choose to
deploy rules by network segment or by QoS function (what each policy performs).
Monitoring and analyzing: Policies should be modified to increase performance based
on performance data.