Routing
Algorithm
Index
01. Routing ?
• What does a Router
Do?
• Routing vs
Forwarding
02. Adaptive Routing
Algorithm.
• Centralized
Algorithm
• Isolation Algorithm
• Distributed
Algorithm
03. Non-adaptive
Routing Algorithm
• Flooding
• Random Walks
04. Routing Scheme
• Unicast
• Broadcast
• Multicast
05. Routing Protocol
• OSPF
• BGP
• RIP
2 Routing Algorithm December 17, 2020
Routing ?
• What is Router?
-- The router is a physical or virtual internetworking device that is designed to receive, analyze and
forward data packets between computer networks.
• How Does Router Work?
-- Routers refer to internal routing tables to make decisions about how to route packets along network
paths. A routing table records the paths that packets should take to reach every destination that the router is
responsible for.
-- Routers work in the following way: when a router receives a packet, it reads the headers of the
packet to see its intended destination then determines where to route the packet based on information in its
routing tables.
December 17, 2020Routing Algorithm3
Routing Table
December 17, 2020Routing Algorithm4
• The routing table contains a list of specific routing destinations. When the router
receives a packet of data, it references the routing table to know where to send that
data.
• The routing table may also contain information on how far each destination is from
the router. In essence, a routing table is a map for the router.
• The routing table consists of at least three information fields:
1. Network Identifier
2. Cost
3. Next hop
How Router share information
December 17, 2020Routing Algorithm5
• In this figure, each cloud represents
the network, and the number inside
the cloud represents the network ID.
• All the LANS are connected by
routers, and they are represented in
boxes labeled as A, B, C, D, E, F.
How Router share
information
December 17, 2020Routing Algorithm6
• In this figure, we observe that the
router sends the knowledge to the
immediate neighbors.
• The neighbors add this knowledge
to their own knowledge and sends
the updated table to their own
neighbors.
• In this way, routers get its own
information plus the new
information about the neighbors.
Routing vs
Forwarding
Routing Forwarding
 building maps and giving directions.
 Routing is the process by which the forwarding
table is built and maintained using
1. One or more routing protocols (link state
routing or distance vector routing)
2. Procedures (algorithms) to convert routing
info to forwarding table.
 moving packets between interfaces according
to the “directions”
 Forwarding is the process of moving packets
from input to output using
1. The forwarding table
2. Information in the packet
December 17, 2020Routing Algorithm7
Routing
Algorithm
December 17, 2020Routing Algorithm8
• Routing is the process of selecting a path for traffic in a network or between
or across multiple networks.
• Routing is the process of forwarding the packets from source to the
destination but the best route to send the packets is determined by the
routing algorithm.
• The Routing algorithm is divided into two categories:
1. Adaptive Routing algorithm
2. Non-adaptive Routing algorithm
“Adaptive Routing Algorithm
• An adaptive routing algorithm is also known as dynamic routing
algorithm.
• This algorithm makes the routing decisions based on the
topology and network traffic.
• The main parameters related to this algorithm are hop count,
distance and estimated transit time.
• An adaptive routing algorithm can be classified into three parts:
1. Centralized Algorithm
2. Isolation Algorithm
3. Distributed Algorithm
Adaptive Routing Algorithm
• It is also known as global routing algorithm as it computes the least-cost path
between source and destination by using complete and global knowledge about
the network.
• This algorithm takes the connectivity between the nodes and link cost as input,
and this information is obtained before actually performing any calculation.
• Link state algorithm is referred to as a centralized algorithm since it is aware of
the cost of each link in the network.
Centralized Algorithm
• It is an algorithm that obtains the routing information by using local information
rather than gathering information from other nodes.
Isolation Algorithm
December 17, 2020Routing Algorithm10
Adaptive Routing Algorithm
• It is also known as decentralized algorithm as it computes the least-cost path
between source and destination in an iterative and distributed manner.
• In the decentralized algorithm, no node has the knowledge about the cost of all the
network links. In the beginning, a node contains the information only about its own
directly attached links and through an iterative process of calculation computes the
least-cost path to the destination.
• A Distance vector algorithm is a decentralized algorithm as it never knows the
complete path from source to the destination, instead it knows the direction through
which the packet is to be forwarded along with the least cost path.
December 17, 2020Routing Algorithm11
Distributed algorithm
Distance Vector Routing Algorithm
• The Distance vector algorithm is iterative, asynchronous and distributed.
• Distributed: It is distributed in that each node receives information from
one or more of its directly attached neighbors, performs calculation and
then distributes the result back to its neighbors.
• Iterative: It is iterative in that its process continues until no more
information is available to be exchanged between neighbors.
• Asynchronous: It does not require that all of its nodes operate in the lock
step with each other.
December 17, 2020Routing Algorithm12
Distance Vector Routing Algorithm
• The Distance vector algorithm is a dynamic algorithm.
• The term distance vector refers to the fact that the protocol manipulates vectors of
distances to other nodes in the network.
• It is mainly used in Advanced Research Projects Agency Network (ARPANET), and
Routing Information Protocol (RIP).
• Each router maintains a distance table known as Vector.
December 17, 2020Routing Algorithm13
Distance Vector Routing Algorithm
• Three Keys to understand the working of Distance Vector Routing Algorithm:
1. 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.
2. 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.
3. Information sharing at regular intervals: Within 30 seconds, the router sends the
information to the neighboring routers.
December 17, 2020Routing Algorithm14
Creating Routing Table
• Initially, the routing table is created for each router that
contains at least three types of information such as Network
ID, the cost and the next hop.
• NET ID : The Network ID defines the final destination of the
packet.
• Cost : The cost is the number of hops that packet must take
to get there.
• Next hop : It is the router to which the packet must be
delivered.
December 17, 2020Routing Algorithm15
Creating Routing Table
• In this figure, the original routing
tables are shown of all the routers.
In a routing table, the first column
represents the network ID, the
second column represents the cost
of the link, and the third column is
empty.
• These routing tables are sent to all
the neighbors.
• A sends its routing table to B, F & E.
• B sends its routing table to A & C.
• C sends its routing table to B & D.
• D sends its routing table to E & C.
• E sends its routing table to A & D.
• F sends its routing table to A.
December 17, 2020Routing Algorithm16
Updating Routing
Table
December 17, 2020Routing Algorithm17
Net Id Cost Next Hop
A 0 A
B 2 B
C ∞ -
D 1 D
Net Id Cost Next Hop
A 2 A
B 0 B
C 3 C
D 7 D
Net Id Cost Next Hop
A ∞ -
B 3 B
C 0 C
D 11 D
Net Id Cost Next Hop
A 1 A
B 7 B
C 11 C
D 0 D
A Routing Table B Routing Table
C Routing Table D Routing Table
Updating Routing Table
1. Each router exchanges its distance vector with its neighbors.
2. After exchanging the distance vectors, each router prepares a new routing
table.
3. Router A receives distance vectors from its neighbors B and D.
4. Router A prepares a new routing table.
December 17, 2020Routing Algorithm18
December 17, 2020Routing Algorithm19
• Cost of reaching destination B from router A = min { 2+0 , 1+7 } = 2
via B.
• Cost of reaching destination C from router A = min { 2+3 , 1+11 } = 5
via B.
• Cost of reaching destination D from router A = min { 2+7 , 1+0 } = 1
via D.
Updating Routing
Table
December 17, 2020Routing Algorithm20
Net Id Cost Next Hop
A 0 A
B 2 B
C ∞ -
D 1 D
A Routing Table
New A
Routing Table
Net Id Cost Next Hop
A 0 A
B 2 B
C 5 B
D 1 D
December 17, 2020Routing Algorithm21
• Router B receives distance vectors from its neighbors A, C and D.
• Router B prepares a new routing table
• Cost of reaching destination A
from router B = min { 2+0 , 3+∞ ,
7+1 } = 2 via A.
• Cost of reaching destination C
from router B = min { 2+∞ , 3+0 ,
7+11 } = 3 via C.
• Cost of reaching destination D
from router B = min { 2+1 , 3+11 ,
7+0 } = 3 via A.
Updating Routing
Table
December 17, 2020Routing Algorithm22
B Routing Table
New B
Routing Table
Net Id Cost Next Hop
A 2 A
B 0 B
C 3 C
D 7 D
Net Id Cost Next Hop
A 2 A
B 0 B
C 3 C
D 3 A
December 17, 2020Routing Algorithm23
• Router C receives distance vectors from its neighbors B and D.
• Router C prepares a new routing table
• Cost of reaching destination A
from router C = min { 3+2 , 11+1
} = 5 via B.
• Cost of reaching destination B
from router C = min { 3+0 , 11+7
} = 3 via B.
• Cost of reaching destination D
from router C = min { 3+7 , 11+0
} = 10 via B.
Updating Routing
Table
December 17, 2020Routing Algorithm24
C Routing Table
New C
Routing Table
Net Id Cost Next Hop
A ∞ -
B 3 B
C 0 C
D 11 D
Net Id Cost Next Hop
A 5 B
B 3 B
C 0 C
D 10 B
December 17, 2020Routing Algorithm25
• Router D receives distance vectors from its neighbors A, B and D.
• Router D prepares a new routing table
• Cost of reaching destination A
from router D = min { 1+0 ,
7+2 , 11+∞ } = 1 via A.
• Cost of reaching destination B
from router D = min { 1+2 ,
7+0 , 11+3 } = 3 via A.
• Cost of reaching destination C
from router D = min { 1+∞ ,
7+3 , 11+0 } = 10 via B.
Updating Routing
Table
December 17, 2020Routing Algorithm26
D Routing Table
New D
Routing Table
Net Id Cost Next Hop
A 1 A
B 7 B
C 11 C
D 0 D
Net Id Cost Next Hop
A 1 A
B 3 A
C 10 B
D 0 D
Updating Routing Table
1. Each router exchanges its distance vector with its neighbors.
2. After exchanging the distance vectors, each router prepares a new routing
table.
3. This step is repeated for (n-2) times if there are n routers in the network.
4. After this, routing tables converge / become stable.
December 17, 2020Routing Algorithm27
Updating Routing
Table
December 17, 2020Routing Algorithm28
A Routing Table B Routing Table
C Routing Table D Routing Table
Net Id Cost Next Hop
A 0 A
B 2 B
C 5 B
D 1 D
Net Id Cost Next Hop
A 2 A
B 0 B
C 3 C
D 3 A
Net Id Cost Next Hop
A 5 B
B 3 B
C 0 C
D 6 B
Net Id Cost Next Hop
A 1 A
B 3 A
C 6 A
D 0 D
Link State Routing Algorithm
• Link state routing is a technique in which each router shares the knowledge of its
neighborhood with every other router in the internetwork.
• The three keys to understand the Link State Routing algorithm:
• 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.
• 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 its neighbors. Finally, each and every router receives a copy
of the same information.
• Information sharing: A router sends the information to every other router only when
the change occurs in the information.
December 17, 2020Routing Algorithm29
Link State Routing Algorithm
• Features of link state routing protocols –
• Link state packet – A small packet that contains routing information.
• Link state database – A collection information gathered from link state packet.
• Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on
the database results into shortest path
• Routing table – A list of known paths and interfaces.
December 17, 2020Routing Algorithm30
Shortest Path Algorithm
• Shortest Path Routing
• Build a graph of network
• Each node represent a router
• Each arc represent a link
• Find shortest path between the two nodes
• Shortness may be defined by:
1. Number of hops
2. Geographic distance
3. Mean queuing/transmission delay
4. Bandwidth
5. Cost
December 17, 2020Routing Algorithm31
Dijkstra Algorithm (Shortest Path Algorithm)
• How Routers Decide Shortest Path Using dijkstra Algorithm ?
December 17, 2020Routing Algorithm32
December 17, 2020Routing Algorithm33
Step 1
December 17, 2020Routing Algorithm34
Step 2
December 17, 2020Routing Algorithm35
Step 3
December 17, 2020Routing Algorithm36
Step 4
December 17, 2020Routing Algorithm37
Step 5
December 17, 2020Routing Algorithm38
Step 6
December 17, 2020Routing Algorithm39
Step 7
December 17, 2020Routing Algorithm40
Step 8
December 17, 2020Routing Algorithm41
Step 9
“
Non- Adaptive Routing Algorithm
• Non Adaptive routing algorithm is also known as a static
routing algorithm.
• When booting up the network, the routing information stores
to the routers.
• Non Adaptive routing algorithms do not take the routing
decision based on the network topology or network traffic.
• Non-Adaptive routing algorithm can be classified into Two
parts:
1. Flooding
2. Random Walks
Non- Adaptive Routing
Algorithm
Flooding Random Walks
 In case of flooding, every incoming packet is
sent to all the outgoing links except the one
from it has been reached.
 The disadvantage of flooding is that node may
contain several copies of a particular packet.
 To overcome this problem, sequence numbers,
spanning tree & hop count are used.
 In this type of algorithm, data packets are
transmitted through the node by node or host
by host randomly to one of its neighbors.
 This method is extremely strong which is
frequently executed by transmitting data
packets over the network link which is queued
least.
December 17, 2020Routing Algorithm43
Flooding
December 17, 2020Routing Algorithm44
• Requires no network information like topology, load condition,
cost of diff. paths
• Every incoming packet to a node is sent out on every outgoing
like except the one it arrived on.
• For Example in above figure
• A incoming packet to (A) is sent out to (B),(D)
• from (B) is sent to (C),(D) and from (D) it is sent to (A),(C).
Limitations –
1. Flooding generates vast number of duplicate packets.
Differences b/w Adaptive and Non-Adaptive
Routing Algorithm
December 17, 2020Routing Algorithm45
Unicast
December 17, 2020Routing Algorithm46
• Unicast is a one-to-one transmission from
one point in the network to another point;
that is, one sender and one receiver, each
identified by a network address.
• Unicast is data transmission from a single
sender (red) to a single receiver (green).
Other devices on the network (yellow) do not
participate in the communication.
Multicast
• Multicasting, there is one source and a group of
destinations. The relationship is one to many.
• In this type of communication, the source address is a
unicast address, but the destination address is a group
address, a group of one or more destination networks
in which there is at least one member of the group that
is interested in receiving the multicast datagram.
• The group address defines the members of the group.
December 17, 2020Routing Algorithm47
Broadcast
December 17, 2020Routing Algorithm48
• Broadcast is a type of communication
where data is sent from one computer
once and a copy of that data will be
forwarded to all the devices.
• In Broadcast, there is only one sender and
the data is sent only once. But the
Broadcast data is delivered to all
connected devices.
Routing Protocols
• Routing protocols are used to discover available routes within a network and find the least costly
route to target router. The information from the routing discovery is used to build routing tables
for the connected routers, each router then uses its routing table when making routing
decisions.
• Routing tables are used to store the paths between routers, when sending data each router uses
the table to find the shortest or less costly path to the target router to ensure efficient data
transfer.
1. Border Gateway Protocol (BGP)
2. Routing Information Protocol (RIP)
3. Open Shortest Path First (OSPF)
December 17, 2020Routing Algorithm49
Border Gateway Protocol
December 17, 2020Routing Algorithm50
• What is an autonomous system?
• The Internet is a network of networks;
it’s broken up into hundreds of
thousands of smaller networks known
as autonomous systems (AS).
• Each of these networks is essentially a
large pool of routers run by a single
organization.
Border Gateway Protocol
• Border Gateway Protocol (BGP) is the postal service of the Internet. When someone drops a
letter into a mailbox, the postal service processes that piece of mail and chooses a fast, efficient
route to deliver that letter to its recipient.
• Similarly, when someone submits data across the Internet, BGP is responsible for looking at all
of the available paths that data could travel and picking the best route, which usually means
hopping between autonomous systems.
• BGP is the protocol that makes the Internet work. It does this by enabling data routing on the
Internet. When a user in Singapore loads a website with origin servers in Argentina, BGP is
the protocol that enables that communication to happen quickly and efficiently.
December 17, 2020Routing Algorithm51
BGP And AS
December 17, 2020Routing Algorithm52
• If we continue to think of BGP as the postal service of the Internet, AS’s are like
individual post office branches.
• A town may have hundreds of mailboxes, but the mail in those boxes must go through
the local postal branch before being routed to another destination.
• The internal routers within an AS are like mailboxes, they forward their outbound
transmissions to the AS, which then uses BGP routing to get these transmissions to
their destinations.
Routing Information Protocols (RIP)
• Routing Information Protocol (RIP) is a dynamic routing protocol which uses hop count as a
routing metric to find the best path between the source and the destination network.
• RIP uses a distance vector algorithm to decide which path to put a packet on to get to its
destination.
• Each RIP router maintains a routing table, which is a list of all the destinations the router knows
how to reach. Each router broadcasts its entire routing table to its closest neighbours every 30
seconds.
• In this context, neighbours are the other routers to which a router is connected directly -- that is,
the other routers on the same network segments as the selected router.
• The neighbours, in turn, pass the information on to their nearest neighbours, and so on, until all RIP
hosts within the network have the same knowledge of routing paths. This shared knowledge is
known as convergence.
December 17, 2020Routing Algorithm53
Routing Information Protocols (RIP)
December 17, 2020Routing Algorithm54
• If a router receives an update on a route, and the new path is shorter, it will
update its table entry with the length and next-hop address of the shorter path.
• If the new path is longer, it will wait through a "hold-down" period to see if later
updates reflect the higher value as well.
• It will only update the table entry if the new, longer path has been determined to
be stable.
• If a router crashes or a network connection is severed, the network discovers this
because that router stops sending updates to its neighbours, or stops sending
and receiving updates along the severed connection.
• If a given route in the routing table isn't updated across six successive update
cycles (that is, for 180 seconds) a RIP router will drop that route and let the rest
of the network know about the problem through its own periodic updates.
OSPF (Open Shortest Path First )
• Open Shortest Path First (OSPF) is a unicast routing protocol the Internet Engineering Task
Force (IETF).
• It is a intradomain routing protocol.
• It is an open source protocol.
• It is similar to Routing Information Protocol (RIP)
• OSPF is implemented as a program in the network layer using the services provided by the
Internet Protocol .
• IP datagram that carries the messages from OSPF sets the value of protocol field to 89
• OSPF is based on the SPF algorithm, which sometimes is referred to as the Dijkstra algorithm
• OSPF has two versions - version 1 and version 2. Version 2 is used mostly.
December 17, 2020Routing Algorithm55
Thank you

Routing algorithm

  • 1.
  • 2.
    Index 01. Routing ? •What does a Router Do? • Routing vs Forwarding 02. Adaptive Routing Algorithm. • Centralized Algorithm • Isolation Algorithm • Distributed Algorithm 03. Non-adaptive Routing Algorithm • Flooding • Random Walks 04. Routing Scheme • Unicast • Broadcast • Multicast 05. Routing Protocol • OSPF • BGP • RIP 2 Routing Algorithm December 17, 2020
  • 3.
    Routing ? • Whatis Router? -- The router is a physical or virtual internetworking device that is designed to receive, analyze and forward data packets between computer networks. • How Does Router Work? -- Routers refer to internal routing tables to make decisions about how to route packets along network paths. A routing table records the paths that packets should take to reach every destination that the router is responsible for. -- Routers work in the following way: when a router receives a packet, it reads the headers of the packet to see its intended destination then determines where to route the packet based on information in its routing tables. December 17, 2020Routing Algorithm3
  • 4.
    Routing Table December 17,2020Routing Algorithm4 • The routing table contains a list of specific routing destinations. When the router receives a packet of data, it references the routing table to know where to send that data. • The routing table may also contain information on how far each destination is from the router. In essence, a routing table is a map for the router. • The routing table consists of at least three information fields: 1. Network Identifier 2. Cost 3. Next hop
  • 5.
    How Router shareinformation December 17, 2020Routing Algorithm5 • In this figure, each cloud represents the network, and the number inside the cloud represents the network ID. • All the LANS are connected by routers, and they are represented in boxes labeled as A, B, C, D, E, F.
  • 6.
    How Router share information December17, 2020Routing Algorithm6 • In this figure, we observe that the router sends the knowledge to the immediate neighbors. • The neighbors add this knowledge to their own knowledge and sends the updated table to their own neighbors. • In this way, routers get its own information plus the new information about the neighbors.
  • 7.
    Routing vs Forwarding Routing Forwarding building maps and giving directions.  Routing is the process by which the forwarding table is built and maintained using 1. One or more routing protocols (link state routing or distance vector routing) 2. Procedures (algorithms) to convert routing info to forwarding table.  moving packets between interfaces according to the “directions”  Forwarding is the process of moving packets from input to output using 1. The forwarding table 2. Information in the packet December 17, 2020Routing Algorithm7
  • 8.
    Routing Algorithm December 17, 2020RoutingAlgorithm8 • Routing is the process of selecting a path for traffic in a network or between or across multiple networks. • Routing is the process of forwarding the packets from source to the destination but the best route to send the packets is determined by the routing algorithm. • The Routing algorithm is divided into two categories: 1. Adaptive Routing algorithm 2. Non-adaptive Routing algorithm
  • 9.
    “Adaptive Routing Algorithm •An adaptive routing algorithm is also known as dynamic routing algorithm. • This algorithm makes the routing decisions based on the topology and network traffic. • The main parameters related to this algorithm are hop count, distance and estimated transit time. • An adaptive routing algorithm can be classified into three parts: 1. Centralized Algorithm 2. Isolation Algorithm 3. Distributed Algorithm
  • 10.
    Adaptive Routing Algorithm •It is also known as global routing algorithm as it computes the least-cost path between source and destination by using complete and global knowledge about the network. • This algorithm takes the connectivity between the nodes and link cost as input, and this information is obtained before actually performing any calculation. • Link state algorithm is referred to as a centralized algorithm since it is aware of the cost of each link in the network. Centralized Algorithm • It is an algorithm that obtains the routing information by using local information rather than gathering information from other nodes. Isolation Algorithm December 17, 2020Routing Algorithm10
  • 11.
    Adaptive Routing Algorithm •It is also known as decentralized algorithm as it computes the least-cost path between source and destination in an iterative and distributed manner. • In the decentralized algorithm, no node has the knowledge about the cost of all the network links. In the beginning, a node contains the information only about its own directly attached links and through an iterative process of calculation computes the least-cost path to the destination. • A Distance vector algorithm is a decentralized algorithm as it never knows the complete path from source to the destination, instead it knows the direction through which the packet is to be forwarded along with the least cost path. December 17, 2020Routing Algorithm11 Distributed algorithm
  • 12.
    Distance Vector RoutingAlgorithm • The Distance vector algorithm is iterative, asynchronous and distributed. • Distributed: It is distributed in that each node receives information from one or more of its directly attached neighbors, performs calculation and then distributes the result back to its neighbors. • Iterative: It is iterative in that its process continues until no more information is available to be exchanged between neighbors. • Asynchronous: It does not require that all of its nodes operate in the lock step with each other. December 17, 2020Routing Algorithm12
  • 13.
    Distance Vector RoutingAlgorithm • The Distance vector algorithm is a dynamic algorithm. • The term distance vector refers to the fact that the protocol manipulates vectors of distances to other nodes in the network. • It is mainly used in Advanced Research Projects Agency Network (ARPANET), and Routing Information Protocol (RIP). • Each router maintains a distance table known as Vector. December 17, 2020Routing Algorithm13
  • 14.
    Distance Vector RoutingAlgorithm • Three Keys to understand the working of Distance Vector Routing Algorithm: 1. 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. 2. 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. 3. Information sharing at regular intervals: Within 30 seconds, the router sends the information to the neighboring routers. December 17, 2020Routing Algorithm14
  • 15.
    Creating Routing Table •Initially, the routing table is created for each router that contains at least three types of information such as Network ID, the cost and the next hop. • NET ID : The Network ID defines the final destination of the packet. • Cost : The cost is the number of hops that packet must take to get there. • Next hop : It is the router to which the packet must be delivered. December 17, 2020Routing Algorithm15
  • 16.
    Creating Routing Table •In this figure, the original routing tables are shown of all the routers. In a routing table, the first column represents the network ID, the second column represents the cost of the link, and the third column is empty. • These routing tables are sent to all the neighbors. • A sends its routing table to B, F & E. • B sends its routing table to A & C. • C sends its routing table to B & D. • D sends its routing table to E & C. • E sends its routing table to A & D. • F sends its routing table to A. December 17, 2020Routing Algorithm16
  • 17.
    Updating Routing Table December 17,2020Routing Algorithm17 Net Id Cost Next Hop A 0 A B 2 B C ∞ - D 1 D Net Id Cost Next Hop A 2 A B 0 B C 3 C D 7 D Net Id Cost Next Hop A ∞ - B 3 B C 0 C D 11 D Net Id Cost Next Hop A 1 A B 7 B C 11 C D 0 D A Routing Table B Routing Table C Routing Table D Routing Table
  • 18.
    Updating Routing Table 1.Each router exchanges its distance vector with its neighbors. 2. After exchanging the distance vectors, each router prepares a new routing table. 3. Router A receives distance vectors from its neighbors B and D. 4. Router A prepares a new routing table. December 17, 2020Routing Algorithm18
  • 19.
    December 17, 2020RoutingAlgorithm19 • Cost of reaching destination B from router A = min { 2+0 , 1+7 } = 2 via B. • Cost of reaching destination C from router A = min { 2+3 , 1+11 } = 5 via B. • Cost of reaching destination D from router A = min { 2+7 , 1+0 } = 1 via D.
  • 20.
    Updating Routing Table December 17,2020Routing Algorithm20 Net Id Cost Next Hop A 0 A B 2 B C ∞ - D 1 D A Routing Table New A Routing Table Net Id Cost Next Hop A 0 A B 2 B C 5 B D 1 D
  • 21.
    December 17, 2020RoutingAlgorithm21 • Router B receives distance vectors from its neighbors A, C and D. • Router B prepares a new routing table • Cost of reaching destination A from router B = min { 2+0 , 3+∞ , 7+1 } = 2 via A. • Cost of reaching destination C from router B = min { 2+∞ , 3+0 , 7+11 } = 3 via C. • Cost of reaching destination D from router B = min { 2+1 , 3+11 , 7+0 } = 3 via A.
  • 22.
    Updating Routing Table December 17,2020Routing Algorithm22 B Routing Table New B Routing Table Net Id Cost Next Hop A 2 A B 0 B C 3 C D 7 D Net Id Cost Next Hop A 2 A B 0 B C 3 C D 3 A
  • 23.
    December 17, 2020RoutingAlgorithm23 • Router C receives distance vectors from its neighbors B and D. • Router C prepares a new routing table • Cost of reaching destination A from router C = min { 3+2 , 11+1 } = 5 via B. • Cost of reaching destination B from router C = min { 3+0 , 11+7 } = 3 via B. • Cost of reaching destination D from router C = min { 3+7 , 11+0 } = 10 via B.
  • 24.
    Updating Routing Table December 17,2020Routing Algorithm24 C Routing Table New C Routing Table Net Id Cost Next Hop A ∞ - B 3 B C 0 C D 11 D Net Id Cost Next Hop A 5 B B 3 B C 0 C D 10 B
  • 25.
    December 17, 2020RoutingAlgorithm25 • Router D receives distance vectors from its neighbors A, B and D. • Router D prepares a new routing table • Cost of reaching destination A from router D = min { 1+0 , 7+2 , 11+∞ } = 1 via A. • Cost of reaching destination B from router D = min { 1+2 , 7+0 , 11+3 } = 3 via A. • Cost of reaching destination C from router D = min { 1+∞ , 7+3 , 11+0 } = 10 via B.
  • 26.
    Updating Routing Table December 17,2020Routing Algorithm26 D Routing Table New D Routing Table Net Id Cost Next Hop A 1 A B 7 B C 11 C D 0 D Net Id Cost Next Hop A 1 A B 3 A C 10 B D 0 D
  • 27.
    Updating Routing Table 1.Each router exchanges its distance vector with its neighbors. 2. After exchanging the distance vectors, each router prepares a new routing table. 3. This step is repeated for (n-2) times if there are n routers in the network. 4. After this, routing tables converge / become stable. December 17, 2020Routing Algorithm27
  • 28.
    Updating Routing Table December 17,2020Routing Algorithm28 A Routing Table B Routing Table C Routing Table D Routing Table Net Id Cost Next Hop A 0 A B 2 B C 5 B D 1 D Net Id Cost Next Hop A 2 A B 0 B C 3 C D 3 A Net Id Cost Next Hop A 5 B B 3 B C 0 C D 6 B Net Id Cost Next Hop A 1 A B 3 A C 6 A D 0 D
  • 29.
    Link State RoutingAlgorithm • Link state routing is a technique in which each router shares the knowledge of its neighborhood with every other router in the internetwork. • The three keys to understand the Link State Routing algorithm: • 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. • 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 its neighbors. Finally, each and every router receives a copy of the same information. • Information sharing: A router sends the information to every other router only when the change occurs in the information. December 17, 2020Routing Algorithm29
  • 30.
    Link State RoutingAlgorithm • Features of link state routing protocols – • Link state packet – A small packet that contains routing information. • Link state database – A collection information gathered from link state packet. • Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on the database results into shortest path • Routing table – A list of known paths and interfaces. December 17, 2020Routing Algorithm30
  • 31.
    Shortest Path Algorithm •Shortest Path Routing • Build a graph of network • Each node represent a router • Each arc represent a link • Find shortest path between the two nodes • Shortness may be defined by: 1. Number of hops 2. Geographic distance 3. Mean queuing/transmission delay 4. Bandwidth 5. Cost December 17, 2020Routing Algorithm31
  • 32.
    Dijkstra Algorithm (ShortestPath Algorithm) • How Routers Decide Shortest Path Using dijkstra Algorithm ? December 17, 2020Routing Algorithm32
  • 33.
    December 17, 2020RoutingAlgorithm33 Step 1
  • 34.
    December 17, 2020RoutingAlgorithm34 Step 2
  • 35.
    December 17, 2020RoutingAlgorithm35 Step 3
  • 36.
    December 17, 2020RoutingAlgorithm36 Step 4
  • 37.
    December 17, 2020RoutingAlgorithm37 Step 5
  • 38.
    December 17, 2020RoutingAlgorithm38 Step 6
  • 39.
    December 17, 2020RoutingAlgorithm39 Step 7
  • 40.
    December 17, 2020RoutingAlgorithm40 Step 8
  • 41.
    December 17, 2020RoutingAlgorithm41 Step 9
  • 42.
    “ Non- Adaptive RoutingAlgorithm • Non Adaptive routing algorithm is also known as a static routing algorithm. • When booting up the network, the routing information stores to the routers. • Non Adaptive routing algorithms do not take the routing decision based on the network topology or network traffic. • Non-Adaptive routing algorithm can be classified into Two parts: 1. Flooding 2. Random Walks
  • 43.
    Non- Adaptive Routing Algorithm FloodingRandom Walks  In case of flooding, every incoming packet is sent to all the outgoing links except the one from it has been reached.  The disadvantage of flooding is that node may contain several copies of a particular packet.  To overcome this problem, sequence numbers, spanning tree & hop count are used.  In this type of algorithm, data packets are transmitted through the node by node or host by host randomly to one of its neighbors.  This method is extremely strong which is frequently executed by transmitting data packets over the network link which is queued least. December 17, 2020Routing Algorithm43
  • 44.
    Flooding December 17, 2020RoutingAlgorithm44 • Requires no network information like topology, load condition, cost of diff. paths • Every incoming packet to a node is sent out on every outgoing like except the one it arrived on. • For Example in above figure • A incoming packet to (A) is sent out to (B),(D) • from (B) is sent to (C),(D) and from (D) it is sent to (A),(C). Limitations – 1. Flooding generates vast number of duplicate packets.
  • 45.
    Differences b/w Adaptiveand Non-Adaptive Routing Algorithm December 17, 2020Routing Algorithm45
  • 46.
    Unicast December 17, 2020RoutingAlgorithm46 • Unicast is a one-to-one transmission from one point in the network to another point; that is, one sender and one receiver, each identified by a network address. • Unicast is data transmission from a single sender (red) to a single receiver (green). Other devices on the network (yellow) do not participate in the communication.
  • 47.
    Multicast • Multicasting, thereis one source and a group of destinations. The relationship is one to many. • In this type of communication, the source address is a unicast address, but the destination address is a group address, a group of one or more destination networks in which there is at least one member of the group that is interested in receiving the multicast datagram. • The group address defines the members of the group. December 17, 2020Routing Algorithm47
  • 48.
    Broadcast December 17, 2020RoutingAlgorithm48 • Broadcast is a type of communication where data is sent from one computer once and a copy of that data will be forwarded to all the devices. • In Broadcast, there is only one sender and the data is sent only once. But the Broadcast data is delivered to all connected devices.
  • 49.
    Routing Protocols • Routingprotocols are used to discover available routes within a network and find the least costly route to target router. The information from the routing discovery is used to build routing tables for the connected routers, each router then uses its routing table when making routing decisions. • Routing tables are used to store the paths between routers, when sending data each router uses the table to find the shortest or less costly path to the target router to ensure efficient data transfer. 1. Border Gateway Protocol (BGP) 2. Routing Information Protocol (RIP) 3. Open Shortest Path First (OSPF) December 17, 2020Routing Algorithm49
  • 50.
    Border Gateway Protocol December17, 2020Routing Algorithm50 • What is an autonomous system? • The Internet is a network of networks; it’s broken up into hundreds of thousands of smaller networks known as autonomous systems (AS). • Each of these networks is essentially a large pool of routers run by a single organization.
  • 51.
    Border Gateway Protocol •Border Gateway Protocol (BGP) is the postal service of the Internet. When someone drops a letter into a mailbox, the postal service processes that piece of mail and chooses a fast, efficient route to deliver that letter to its recipient. • Similarly, when someone submits data across the Internet, BGP is responsible for looking at all of the available paths that data could travel and picking the best route, which usually means hopping between autonomous systems. • BGP is the protocol that makes the Internet work. It does this by enabling data routing on the Internet. When a user in Singapore loads a website with origin servers in Argentina, BGP is the protocol that enables that communication to happen quickly and efficiently. December 17, 2020Routing Algorithm51
  • 52.
    BGP And AS December17, 2020Routing Algorithm52 • If we continue to think of BGP as the postal service of the Internet, AS’s are like individual post office branches. • A town may have hundreds of mailboxes, but the mail in those boxes must go through the local postal branch before being routed to another destination. • The internal routers within an AS are like mailboxes, they forward their outbound transmissions to the AS, which then uses BGP routing to get these transmissions to their destinations.
  • 53.
    Routing Information Protocols(RIP) • Routing Information Protocol (RIP) is a dynamic routing protocol which uses hop count as a routing metric to find the best path between the source and the destination network. • RIP uses a distance vector algorithm to decide which path to put a packet on to get to its destination. • Each RIP router maintains a routing table, which is a list of all the destinations the router knows how to reach. Each router broadcasts its entire routing table to its closest neighbours every 30 seconds. • In this context, neighbours are the other routers to which a router is connected directly -- that is, the other routers on the same network segments as the selected router. • The neighbours, in turn, pass the information on to their nearest neighbours, and so on, until all RIP hosts within the network have the same knowledge of routing paths. This shared knowledge is known as convergence. December 17, 2020Routing Algorithm53
  • 54.
    Routing Information Protocols(RIP) December 17, 2020Routing Algorithm54 • If a router receives an update on a route, and the new path is shorter, it will update its table entry with the length and next-hop address of the shorter path. • If the new path is longer, it will wait through a "hold-down" period to see if later updates reflect the higher value as well. • It will only update the table entry if the new, longer path has been determined to be stable. • If a router crashes or a network connection is severed, the network discovers this because that router stops sending updates to its neighbours, or stops sending and receiving updates along the severed connection. • If a given route in the routing table isn't updated across six successive update cycles (that is, for 180 seconds) a RIP router will drop that route and let the rest of the network know about the problem through its own periodic updates.
  • 55.
    OSPF (Open ShortestPath First ) • Open Shortest Path First (OSPF) is a unicast routing protocol the Internet Engineering Task Force (IETF). • It is a intradomain routing protocol. • It is an open source protocol. • It is similar to Routing Information Protocol (RIP) • OSPF is implemented as a program in the network layer using the services provided by the Internet Protocol . • IP datagram that carries the messages from OSPF sets the value of protocol field to 89 • OSPF is based on the SPF algorithm, which sometimes is referred to as the Dijkstra algorithm • OSPF has two versions - version 1 and version 2. Version 2 is used mostly. December 17, 2020Routing Algorithm55
  • 56.