Module 3.2

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 40

CSE3155 DATA COMMUNICATION AND

COMPUTER NETWORKS

Module-3.2
Network Layer:
Routing of Packets
1
What is Routing?
 Routing is the process of determining the best path for data to travel from

the source to the destination across a network or multiple interconnected

networks.
 Routers determine the most efficient or optimal path for packets based on

various metrics (e.g., distance, cost, bandwidth).


 Once the best path is determined, routers forward the packet to the next

hop (i.e., the next router or destination).


 Routers maintain routing tables that store information on how to reach

various destinations.
Routing:
There are two main forms of routing: static and dynamic.

What is Static Routing?


Static Routing is also known as non-adaptive routing which doesn’t change the
routing table unless the network administrator changes or modifies them manually.
Static routing does not use complex routing algorithms and It provides higher or
more security than dynamic routing.

What is Dynamic Routing?


Dynamic routing is also known as adaptive routing which changes the routing table
according to the change in topology.
It uses complex routing algorithms and it does not provide high security like static
routing. When the network change(topology) occurs, it sends the message to the
router to ensure that changes then the routes are recalculated for sending updated
routing information.
Routing algorithms
• Routing algorithms are used by routers to determine the best path for data to
travel through a network.
• Various routing algorithms are used for the purpose of deciding which route an
incoming data packet needs to be transmitted on to reach the destination
efficiently.
• Each has its own strengths and weaknesses depending on the network structure.

There are two main categories of routing algorithms:


Distance Vector and Link State.
Contd….

Routing Algorithm Classification:

1.Distance Vector Algorithms:


Router Knows Physically-connected neighbors, link costs to neighbors,
iterative process of computation, exchange of partial information with
neighbors.

2. Link State algorithms: All routers have complete topology, link cost
information.
Distance Vector Routing
The Distance Vector Corresponding to a Tree
Updating Distance
Vector
Bellman-Ford Algorithm
● Define distances at each node X
◆ dx(y) = cost of least-cost path from X to Y
● Update distances based on
neighbors
◆ dx(y) = min {c(x,v) + dv(y)} over all
neighbors V
Step-by-Step
● c(x,v) = cost for direct link from x to v
◆ Node x maintains costs of direct links c(x,v)

● Dx(y) = estimate of least cost from x to y


◆ Node x maintains distance vector Dx = [Dx(y): y є N ]

● Node x maintains its neighborsʼ distance


vectors
◆ For each neighbor v, x maintains Dv = [Dv(y): y є N ]

● Each node v periodically sends Dv to its


neighbors
◆ And neighbors update their own distance vectors
◆ Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N
Example: Initial State
Example: Initial State
D sends vector to E
B sends vector to A…
E sends vector to A
Handling Link Failure
Count to Infinity:

• Distance-vector routing has the drawback that while cost increases


(bad news) propagate slowly, cost decreases (positive news) propagate
quickly.

• Distance-vector routing takes some time for all other routers to become
aware of a broken connection (cost becomes infinity), which is
necessary for a routing protocol to function properly. Counting to
infinity is the name given to the issue.

• A broken link's cost may not always be registered as infinite by all


routers until numerous updates have passed.
Link State Routing
Formation of Least-Cost
Trees
• To create a least-cost tree for itself, using the shared LSDB, each node needs
to run the famous Dijkstra’s algorithm. This iterative algorithm uses the
following steps: 1. The node chooses itself as the root of the tree, creating a
tree with a single node, and sets the total cost of each node based on the
information in the LSDB.

• The node selects one node, among all nodes not in the tree, which is closest
to the root, and adds this to the tree. After this node is added to the tree, the
cost of all other nodes not in the tree needs to be updated because the paths
may have been changed. 3. The node repeats step 2 until all nodes are added
to the tree.
Dijkstra’s Algorithm
Least – Cost Tree
Difference Between Distance Vector Routing and Link State Rou

Distance Vector Routing –


•It is a dynamic routing algorithm in which each router computes a
distance between itself and each possible destination i.e. its immediate
neighbors.
•The router shares its knowledge about the whole network to its
neighbors and accordingly updates the table based on its neighbors.
•The sharing of information with the neighbors takes place at regular
intervals.
•It makes use of Bellman-Ford Algorithm for making routing tables.

•Problems – Count to infinity problem which can be solved by splitting


horizon.
– Good news spread fast and bad news spread slowly.
– Persistent looping problem i.e. loop will be there forever.
Link State Routing –
•It is a dynamic routing algorithm in which each router shares
knowledge of its neighbors with every other router in the network.
•A router sends its information about its neighbors only to all the
routers through flooding.
•Information sharing takes place only whenever there is a change.
•It makes use of Dijkstra’s Algorithm for making routing tables.

•Problems – Heavy traffic due to flooding of packets.


– Flooding can result in infinite looping which can be solved by using
the Time to live (TTL) field.
Routing Protocol

Metric of different Routing Protocols:

• Metric is the cost assigned for passing through a network.

• The total metric of a particular route is equal to the sum of the metrics of
networks that comprise the route.

• A router chooses the route with smallest metric


OSPF (Open Shortest
Path First):

• It is the popular and most widely used open standard protocol.


• It is one of the internal gateway protocols that use a link-state routing
algorithm or shortest path first algorithm that works within a single
routing domain.
• This algorithm was designed by an expert named Dijkstra, which is why it
is also known as Dijkstra Algorithm.
• It is developed to work with both IPv4 and IPv6 networks. It can divide a
larger internetwork into smaller internetwork called areas.
Contd….
• OSPF is a link-state routing protocol that sends information about directly
connected links to all the routers in the AS network. The protocol has a full
picture of the network topology, which is shared with all the routers in an
area of the AS to calculate the shortest path to each destination.

• Open Shortest Path First (OSPF) is a link-state routing protocol that is used
to find the best path between the source and the destination router using its
own Shortest Path First).

• One difference between OSPF and RIP is that, unlike RIP, OSPF does not
simply count the number of router hops between hosts on a network.
Instead, OSPF bases its path choices on "link states" that consider additional
network information. The information might include IT-assigned cost
metrics that give some paths higher assigned costs. For example, a satellite
link might be assigned higher cost than a wireless WAN link, which in turn
might be assigned a higher cost than a metro Ethernet link.
Routing Information
Protocol (RIP)
• Routing Information Protocol (RIP) is one of the oldest and most
straightforward interior gateway protocols (IGP) used in computer
networking. Initially developed in the 1980s, RIP has undergone several
revisions, with the most widely used version being RIP version 2 (RIPv2).

• RIP operates as a distance-vector routing protocol, which means that routers


exchange routing information with their neighbors, and each router makes
decisions based on the distance (metric) to reach a destination. The metric
used by RIP is typically the hop count – the number of routers that must be
traversed to reach a particular destination.

• RIP uses a simple hop count metric to determine the best path to a
destination. Each router in the network maintains a routing table that contains
information about the number of hops to reach each destination.
Contd…

RIP routers periodically broadcast routing updates to their neighboring routers.


These updates contain information about the network's topology, including
reachable destinations and their associated hop counts.

• To prevent routing loops, RIP uses a technique called split horizon. This means
that a router does not advertise routes back through the interface from which it
received the route information.

• When a route becomes unreachable, RIP uses route poisoning to inform other
routers about the change. The unreachable route is advertised with an infinite
metric, indicating that the route should not be used.
Contd….

• While RIP has been largely replaced by more advanced routing protocols like
OSPF (Open Shortest Path First) in large and complex networks, RIP is still
used in smaller networks or as a legacy protocol in certain environments. Its
simplicity makes it easy to configure and deploy, especially in scenarios where
more advanced routing protocols might be unnecessary.
BGP (Border Gateway
Protocol)
• Border Gateway Protocol (BGP) refers to a gateway protocol that enables the
internet to exchange routing information between autonomous systems (AS).
• It is an interdomain routing protocol, and it uses the path-vector routing. It is a
gateway protocol that is used to exchange routing information among the
autonomous system on the internet.

There are many versions of BGP, such as:


BGP version 1: This version was released in 1989 and is defined in RFC 1105.
BGP version 2: It was defined in RFC 1163.
BGP version 3: It was defined in RFC 1267.
BGP version 4: It is the current version of BGP defined in RFC 1771.
END OF MODULE 3.2

You might also like