Module 3.2
Module 3.2
Module 3.2
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
networks.
Routers determine the most efficient or optimal path for packets based on
various destinations.
Routing:
There are two main forms of routing: static and dynamic.
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)
• 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.
• 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
• The total metric of a particular route is equal to the sum of the metrics of
networks that comprise the route.
• 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 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…
• 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.