Routing
4/5/2022 Karpagam Institute of Technology
⚫ Routing is a process which is performed by layer
3 (or network layer) devices in order to deliver
the packet by choosing an optimal path
from one network to another.
⚫ There are 3 types of routing:
1. Static routing –
Static routing is a process in which we have to
manually add routes in routing table.
Advantages –
⚫ No routing overhead for router CPU which means
a cheaper router can be used to do routing.
⚫ It adds security because only administrator
can allow routing to particular networks only.
⚫ No bandwidth usage between routers.
Disadvantage –
⚫For a large network, it is a hectic task for
administrator to manually add each route for
the network in the routing table on each
router.
⚫The administrator should have good
knowledge of the topology. If a new
administrator comes, then he has to manually
add each route so he should have very good
knowledge of the routes of the topology.
4/5/2022 Karpagam Institute of Technology
Default Routing
4/5/2022 Karpagam Institute of Technology
⚫This is the method where the router is
configured to send all packets towards a
single router (next hop).
⚫It doesn’t matter to which network the
packet belongs, it is forwarded out to
router which is configured for default
routing.
⚫It is generally used with stub routers. A
stub router is a router which has only one
route to reach all other networks.
Dynamic Routing
4/5/2022 Karpagam Institute of Technology
⚫ Dynamic routing makes automatic adjustment of the routes
according to the current state of the route in the routing table.
⚫ Dynamic routing uses protocols to discover network destinations
and the routes to reach it. RIP and OSPF are the best examples
of dynamic routing protocol. Automatic adjustment will be made
to reach the network destination if one route goes down.
⚫ A dynamic protocol have following features:
⚫ The routers should have the same dynamic protocol running
in order to exchange routes.
⚫ When a router finds a change in the topology then router advertises
it to all other routers.
Advantages –
⚫ Easy to configure.
⚫ More effective at selecting the best route to a
destination remote network and also for discovering
remote network.
Disadvantage –
⚫ Consumes more bandwidth for communicating with
other neighbors.
⚫ Less secure than static routing.
4/5/2022 Karpagam Institute of Technology
TYPES OF ROUTING PROTOCOLS
4/5/2022 Karpagam Institute of Technology
⚫ Two types of Routing Protocols are used
in the Internet:
1) Intradomain routing
⚫ Routing within a single autonomous
system
⚫ Routing Information Protocol (RIP) -
based on the distance-vector algorithm
⚫ Open Shortest Path First (OSPF) - based
on the link-state algorithm
2) Interdomain routing
⚫ Routing between autonomous systems.
⚫ Border Gateway Protocol (BGP) - based
on the path-vector algorithm
Unicast Routing Protocols
4/5/2022 Karpagam Institute of Technology
⚫ Unicast – Unicast means the transmission from a single
sender to a single receiver. It is a point to
point communication between sender and receiver.
There are various unicast protocols such as TCP, HTTP,
etc.
⚫ TCP is the most commonly used unicast protocol. It is a
connection oriented protocol that relay on
acknowledgement from the receiver side.
⚫ HTTP stands for Hyper Text Transfer Protocol. It is an object
oriented protocol for communication.
Unicast Routing
4/5/2022 Karpagam Institute of Technology
⚫There are three main classes
of routing protocols:
1) Distance Vector Routing
Algorithm
– Routing Information Protocol
2) Link State Routing
Algorithm –
Open Shortest Path First
Protocol
3) Path-Vector Routing
DISTANCE VECTOR ROUTING (DSR)
4/5/2022 Karpagam Institute of Technology
⚫ Distance vector routing is distributed,
i.e., algorithm is run on all nodes.
⚫ Each node knows the distance (cost)
to each of its directly connected
neighbors.
⚫ Nodes construct a vector
(Destination, Cost, NextHop) and
distributes to its neighbors.
⚫Nodes compute routing table of
minimum
distance to every other node via
⚫ NextHop using information obtained
Initial State
4/5/2022 Karpagam Institute of Technology
Initial State
4/5/2022 Karpagam Institute of Technology
⚫In given network, cost of each link
is 1 hop.
⚫Each node sets a distance of 1 (hop)
to its immediate neighbor and cost to
itself as 0.
⚫Distance for non-neighbors is
marked as
unreachable with value ∞ (infinity).
⚫For node A, nodes B, C, E and F are
reachable, whereas nodes D and G
are unreachable.
4/5/2022 Karpagam Institute of Technology
⚫The initial table for all the nodes
are given below
4/5/2022 Karpagam Institute of Technology
4/5/2022 Karpagam Institute of Technology
4/5/2022 Karpagam Institute of Technology
⚫System stabilizes when all nodes
have complete routing information,
i.e., convergence.
⚫Routing tables are exchanged
periodically or in case of triggered
update.
⚫The final distances stored at each node
is given below:
4/5/2022 Karpagam Institute of Technology
4/5/2022 Karpagam Institute of Technology
Updation of Routing Tables
4/5/2022 Karpagam Institute of Technology
⚫There are two different
circumstances under which a given
node decides to send a routing
update to its neighbors.
1.Periodic Update
2. Triggered Update
Periodic Update
⚫ In this case, each node automatically
sends an update message every so often,
even if nothing has changed.
⚫ The frequency of these periodic updates
varies from protocol to protocol, but it is
typically on the order of several seconds
to several minutes.
Triggered Update
⚫ In this case, whenever a node notices a
link failure or receives an update from one
of its neighbors that causes it to change
one of the routes in its routing table.
⚫ Whenever a node’s routing table changes,
it sends an update to its neighbors, which
may lead to a change in their tables,
causing them to send an update to their
neighbors.
4/5/2022 Karpagam Institute of Technology
Count-To-Infinity (or) Loop
Instability Problem
4/5/2022 Karpagam Institute of Technology
⚫Suppose link from node A to E
goes
down.
 Node A advertises a distance of ∞
to E to its neighbors
 Node B receives periodic update
from C before A’s update reaches B
Node B updated by C, concludes that
E
can be reached in 3 hops via C
 Node B advertises to A as 3
⚫Thus nodes update each other
until cost to E reaches infinity, i.e.,
no convergence.
⚫Routing table does not stabilize.
⚫This problem is called loop
instability
or count to infinity
4/5/2022 Karpagam Institute of Technology
ROUTING INFORMATION PROTOCOL (RIP)
⚫ RIP is an intra-domain routing
protocol based on distance-vector algorithm.
The Routing Information Protocol (RIP) is
designed to help routers determine the best
path for sending data packets across a network.
⚫ It uses hop count as its routing metric and is
primarily used in small to medium-sized
networks due to its scalability limitations.
⚫ Every 30 seconds, routers exchange their
complete routing tables with neighbors using
periodic updates.
⚫ The hop count metric defines the number of
routers a packet must pass through before
reaching the destination.
ROUTING INFORMATION PROTOCOL (RIP)
What is Hop Count?
• Hop count = number of routers between the source and the
destination.
• RIP selects the path with the lowest hop count as the best
route.
• Limiting the hop count to 15 prevents routing loops, but
also reduces RIP’s scalability.
How RIP Works
• Each router maintains a routing table with distances to all
known networks.
• Every 30 seconds, routers broadcast or multicast their
entire routing table.
• If a new shorter path is learned, the routing table is
updated.
• If a route isn’t refreshed within 180 seconds, it’s marked
invalid. After 240 seconds, it’s flushed.
ROUTING INFORMATION PROTOCOL (RIP)
RIP Timers
• Update Timer: Default 30 seconds (interval between
updates).
• Invalid Timer: 180 seconds (route not updated = marked
invalid).
• Hold-down Timer: 180 seconds (time to suppress unstable
routes).
• Flush Timer: 240 seconds (time before removing invalid
routes).
ROUTING INFORMATION PROTOCOL (RIP)
4/5/2022 Karpagam Institute of Technology
⚫ Routers advertise the cost of reaching
networks. Cost of reaching each link is 1hop.
⚫ For example, router C advertises to A that it
can
reach network 2, 3 at cost 0 (directly
connected),
networks 5, 6 at cost 1 and network 4 at cost
2.
⚫ Each router updates cost and next hop for
each network number.
⚫ Infinity is defined as 16, i.e., any route cannot
have more than 15 hops.
⚫ Therefore RIP can be implemented on small-
sized networks only.
THANK YOU
4/5/2022 Karpagam Institute of Technology

COMPUTER NETWORKS DISTANCE VECTOR ROUTING .pptx

  • 1.
    Routing 4/5/2022 Karpagam Instituteof Technology ⚫ Routing is a process which is performed by layer 3 (or network layer) devices in order to deliver the packet by choosing an optimal path from one network to another. ⚫ There are 3 types of routing: 1. Static routing – Static routing is a process in which we have to manually add routes in routing table. Advantages – ⚫ No routing overhead for router CPU which means a cheaper router can be used to do routing. ⚫ It adds security because only administrator can allow routing to particular networks only. ⚫ No bandwidth usage between routers.
  • 2.
    Disadvantage – ⚫For alarge network, it is a hectic task for administrator to manually add each route for the network in the routing table on each router. ⚫The administrator should have good knowledge of the topology. If a new administrator comes, then he has to manually add each route so he should have very good knowledge of the routes of the topology. 4/5/2022 Karpagam Institute of Technology
  • 3.
    Default Routing 4/5/2022 KarpagamInstitute of Technology ⚫This is the method where the router is configured to send all packets towards a single router (next hop). ⚫It doesn’t matter to which network the packet belongs, it is forwarded out to router which is configured for default routing. ⚫It is generally used with stub routers. A stub router is a router which has only one route to reach all other networks.
  • 4.
    Dynamic Routing 4/5/2022 KarpagamInstitute of Technology ⚫ Dynamic routing makes automatic adjustment of the routes according to the current state of the route in the routing table. ⚫ Dynamic routing uses protocols to discover network destinations and the routes to reach it. RIP and OSPF are the best examples of dynamic routing protocol. Automatic adjustment will be made to reach the network destination if one route goes down. ⚫ A dynamic protocol have following features: ⚫ The routers should have the same dynamic protocol running in order to exchange routes. ⚫ When a router finds a change in the topology then router advertises it to all other routers.
  • 5.
    Advantages – ⚫ Easyto configure. ⚫ More effective at selecting the best route to a destination remote network and also for discovering remote network. Disadvantage – ⚫ Consumes more bandwidth for communicating with other neighbors. ⚫ Less secure than static routing. 4/5/2022 Karpagam Institute of Technology
  • 6.
    TYPES OF ROUTINGPROTOCOLS 4/5/2022 Karpagam Institute of Technology ⚫ Two types of Routing Protocols are used in the Internet: 1) Intradomain routing ⚫ Routing within a single autonomous system ⚫ Routing Information Protocol (RIP) - based on the distance-vector algorithm ⚫ Open Shortest Path First (OSPF) - based on the link-state algorithm 2) Interdomain routing ⚫ Routing between autonomous systems. ⚫ Border Gateway Protocol (BGP) - based on the path-vector algorithm
  • 7.
    Unicast Routing Protocols 4/5/2022Karpagam Institute of Technology ⚫ Unicast – Unicast means the transmission from a single sender to a single receiver. It is a point to point communication between sender and receiver. There are various unicast protocols such as TCP, HTTP, etc. ⚫ TCP is the most commonly used unicast protocol. It is a connection oriented protocol that relay on acknowledgement from the receiver side. ⚫ HTTP stands for Hyper Text Transfer Protocol. It is an object oriented protocol for communication.
  • 8.
    Unicast Routing 4/5/2022 KarpagamInstitute of Technology ⚫There are three main classes of routing protocols: 1) Distance Vector Routing Algorithm – Routing Information Protocol 2) Link State Routing Algorithm – Open Shortest Path First Protocol 3) Path-Vector Routing
  • 9.
    DISTANCE VECTOR ROUTING(DSR) 4/5/2022 Karpagam Institute of Technology ⚫ Distance vector routing is distributed, i.e., algorithm is run on all nodes. ⚫ Each node knows the distance (cost) to each of its directly connected neighbors. ⚫ Nodes construct a vector (Destination, Cost, NextHop) and distributes to its neighbors. ⚫Nodes compute routing table of minimum distance to every other node via ⚫ NextHop using information obtained
  • 10.
    Initial State 4/5/2022 KarpagamInstitute of Technology
  • 11.
    Initial State 4/5/2022 KarpagamInstitute of Technology ⚫In given network, cost of each link is 1 hop. ⚫Each node sets a distance of 1 (hop) to its immediate neighbor and cost to itself as 0. ⚫Distance for non-neighbors is marked as unreachable with value ∞ (infinity). ⚫For node A, nodes B, C, E and F are reachable, whereas nodes D and G are unreachable.
  • 12.
  • 13.
    ⚫The initial tablefor all the nodes are given below 4/5/2022 Karpagam Institute of Technology
  • 14.
  • 15.
  • 16.
    ⚫System stabilizes whenall nodes have complete routing information, i.e., convergence. ⚫Routing tables are exchanged periodically or in case of triggered update. ⚫The final distances stored at each node is given below: 4/5/2022 Karpagam Institute of Technology
  • 17.
  • 18.
    Updation of RoutingTables 4/5/2022 Karpagam Institute of Technology ⚫There are two different circumstances under which a given node decides to send a routing update to its neighbors. 1.Periodic Update 2. Triggered Update
  • 19.
    Periodic Update ⚫ Inthis case, each node automatically sends an update message every so often, even if nothing has changed. ⚫ The frequency of these periodic updates varies from protocol to protocol, but it is typically on the order of several seconds to several minutes. Triggered Update ⚫ In this case, whenever a node notices a link failure or receives an update from one of its neighbors that causes it to change one of the routes in its routing table. ⚫ Whenever a node’s routing table changes, it sends an update to its neighbors, which may lead to a change in their tables, causing them to send an update to their neighbors. 4/5/2022 Karpagam Institute of Technology
  • 20.
    Count-To-Infinity (or) Loop InstabilityProblem 4/5/2022 Karpagam Institute of Technology ⚫Suppose link from node A to E goes down.  Node A advertises a distance of ∞ to E to its neighbors  Node B receives periodic update from C before A’s update reaches B Node B updated by C, concludes that E can be reached in 3 hops via C  Node B advertises to A as 3
  • 21.
    ⚫Thus nodes updateeach other until cost to E reaches infinity, i.e., no convergence. ⚫Routing table does not stabilize. ⚫This problem is called loop instability or count to infinity 4/5/2022 Karpagam Institute of Technology
  • 22.
    ROUTING INFORMATION PROTOCOL(RIP) ⚫ RIP is an intra-domain routing protocol based on distance-vector algorithm. The Routing Information Protocol (RIP) is designed to help routers determine the best path for sending data packets across a network. ⚫ It uses hop count as its routing metric and is primarily used in small to medium-sized networks due to its scalability limitations. ⚫ Every 30 seconds, routers exchange their complete routing tables with neighbors using periodic updates. ⚫ The hop count metric defines the number of routers a packet must pass through before reaching the destination.
  • 23.
    ROUTING INFORMATION PROTOCOL(RIP) What is Hop Count? • Hop count = number of routers between the source and the destination. • RIP selects the path with the lowest hop count as the best route. • Limiting the hop count to 15 prevents routing loops, but also reduces RIP’s scalability. How RIP Works • Each router maintains a routing table with distances to all known networks. • Every 30 seconds, routers broadcast or multicast their entire routing table. • If a new shorter path is learned, the routing table is updated. • If a route isn’t refreshed within 180 seconds, it’s marked invalid. After 240 seconds, it’s flushed.
  • 24.
    ROUTING INFORMATION PROTOCOL(RIP) RIP Timers • Update Timer: Default 30 seconds (interval between updates). • Invalid Timer: 180 seconds (route not updated = marked invalid). • Hold-down Timer: 180 seconds (time to suppress unstable routes). • Flush Timer: 240 seconds (time before removing invalid routes).
  • 25.
    ROUTING INFORMATION PROTOCOL(RIP) 4/5/2022 Karpagam Institute of Technology ⚫ Routers advertise the cost of reaching networks. Cost of reaching each link is 1hop. ⚫ For example, router C advertises to A that it can reach network 2, 3 at cost 0 (directly connected), networks 5, 6 at cost 1 and network 4 at cost 2. ⚫ Each router updates cost and next hop for each network number. ⚫ Infinity is defined as 16, i.e., any route cannot have more than 15 hops. ⚫ Therefore RIP can be implemented on small- sized networks only.
  • 26.
    THANK YOU 4/5/2022 KarpagamInstitute of Technology