1
Routing
Distance Vector and Link State Algorithms
krraju.in
2
What you’ll learn
Network layer: Network Layer Services, IPV4 Address, Subnetting, Super-netting, Classless addressing, Internet Protocol (IP, ARP, DHCP, ICMP), IPV6 Address format, Routing algorithms:Distance vector, Link state, Network Address Translation (NAT).
Unit-4
krraju.in
Why Routing?
In a large telephone network, when a call is placed, the network must devise a route (path) through the network from calling subscriber to called subscriber that passes through a number of switches and trunks.
3
B
D
C
E
A
F
krraju.in
What is Routing?
The determination of a path that a data unit will traverse from source to destination.
4
B
D
C
E
A
F
krraju.in
Flow Control
Objectives
As the routing algorithm is more successful in keeping delay low, the flow control algorithm allows more traffic into the network
5
Flow Control
Routing
Offered Load
Rejected Load
Delay
Delay
Throughput
krraju.in
Good routing
6
Throughput
Delay
Poor routing
Good routing
krraju.in
Approaches
Static routing:
The route can not be altered depending on current traffic conditions.
Dynamic routing:
Routing decisions are influenced by current traffic conditions.
7
krraju.in
8
| Static Routing | Dynamic Routing |
Path Selection | One preconfigured to destination | Multiple available routes to destination |
Route updates | Administrator must reconfigure to make route changes | Algorithms automatically update with preferred route changes |
Routing Tables | Smaller routing table with only one entry for each destination | Routers send out entire routing tables to identify route availability |
Protocols and Algorithms | Does not use protocols or algorithms for preconfigured route | Distance vector algorithms (RIP, IGRP) and link state algorithms (OSPF, IS-IS) adjust routes |
Computation and Bandwidth | Requires less computation and bandwidth | Requires more computation and bandwidth |
Security | Better security | Less security |
Use Cases | Used in smaller networks with fewer routers and unchanging network architecture | Used in larger networks and in networks that change frequently |
krraju.in
Approaches (Circuit switching networks)
Fixed routing:
Alternate routing:
9
krraju.in
Routing Characteristics
Strategies (Packet switched networks)
Requirements
10
krraju.in
Elements of routing techniques
11
krraju.in
Fixed Routing
12
krraju.in
Routing Table
13
krraju.in
Routers and Networks (Sample configuration)
14
B
D
C
E
A
F
G
H
Net 1
Host X
Net 2
Host Y
Net 3
Net 4
Net 5
10
1
5
2
9
7
3
1
9
1
8
6
2
3
1
1
4
1
| A | B | C | D | E | F | G | H | X |
1 | D | - | - | B | D | H | B | G | - |
2 | D | - | B | - | D | H | - | G | B |
3 | D | G | - | G | - | H | - | - | B |
4 | - | D | A | - | - | - | D | G | A |
5 | F | G | H | F | H | - | H | - | A |
krraju.in
Routing Tables
15
krraju.in
Fixed Routing
Advantage:
Disadvantage:
It will work well in a reliable network with a stable load.
16
krraju.in
Flooding
17
B
D
C
E
A
F
krraju.in
Flooding
18
krraju.in
Flooding
Advantages:
Disadvantages:
Applications:
19
krraju.in
Selective Flooding
20
B
D
C
E
A
F
krraju.in
Random Routing
Selects only one outgoing link randomly, excluding the input link.
Advantage:
Disadvantage:
21
B
D
C
E
A
F
B
D
C
E
A
F
krraju.in
Adaptive Routing
Routing decisions change as conditions on the network change.
Conditions that influence routing decisions:
Failure:
Congestion:
22
krraju.in
Adaptive Routing
Advantages:
23
krraju.in
Adaptive Routing
Disadvantages:
Trade Off: Quality of information vs Amount of overhead.
An adaptive strategy may react
24
krraju.in
Routing Algorithm
Given a set of nodes, with links connecting the nodes, a routing algorithm finds a least cost path from source to destination.
Responsible for deciding which output line an incoming packet should be transmitted on.
Non-adaptive (Static Routing)
Adaptive (Dynamic Routing)
25
krraju.in
Routing Algorithms
Load sensitive
Load insensitive
26
krraju.in
Routing Algorithms
Global (centralized)
Decentralized
27
krraju.in
Link State Algorithm
A dynamic routing algorithm (Dijkstra's algorithm) used to find the shortest path from one node to every other node in the network.
28
krraju.in
Distance Vector Algorithm
29
krraju.in
Least Cost Path
30
Routing decision is based on some form of least cost criterion to compute optimal routes.
Examples:
krraju.in
Dijkstra’s Algorithm
31
N = set of nodes in the network
s = source node
T = set of nodes so far incorporated by the algorithm
w(i,j) = link cost from node i to node j
w(i,i) = 0
w(i,j) = ∞ if the two nodes are not directly connected
w(i,j) ≥ 0 if the two nodes are directly connected
L(n) = cost of the least cost path from node s to node n that is currently known to the algorithm.
At termination, this is the cost of the least cost path in the graph from s to n
krraju.in
Dijkstra’s Algorithm Contd..
32
T = {s} (i.e., set of nodes so far incorporated consists of only the source node)
L(n) = w(s,n) for n ≠ s (i.e., the initial path costs to neighboring nodes are simply the link costs)
2. [Get Next Node]
krraju.in
Dijkstra’s Algorithm Contd..
33
3. [Update Least-Cost Paths]
L(n) = min [L(n), L(x)+w(x,n) for all n ∉ T (If the latter term is the minimum, the path from s to n is now the path from s to x concatenated with the edge from x to n)
Iteration:T | L(B):Path | L(C):Path | L(D):Path | L(E):Path | L(F):Path | Comments |
1: [A] | 1:A-B | ∞:--- | 2:A-D | ∞:--- | ∞:--- | |
2: [A,B] | 1:A-B | 2:A-B-C | 2:A-D | ∞:--- | ∞:--- | |
3: [A,B,D] | 1:A-B | 2:A-B-C | 2:A-D | 4:A-D-E | ∞:--- | 3:A-D-C: Didn’t make it |
4: [A,B,D,C] | 1:A-B | 2:A-B-C | 2:A-D | 3:A-B-C-E | ∞:--- | A-D-E: too long |
5:[A,B,D,C,E] | 1:A-B | 2:A-B-C | 2:A-D | 3:A-B-C-E | 6:A-B-C-E-F | |
6:[A,B,D,C,E,F] | 1:A-B | 2:A-B-C | 2:A-D | 3:A-B-C-E | 6:A-B-C-E-F | Stop |
A
B
C
E
D
F
1
1
1
2
3
1
2
krraju.in
Dijkstra’s Algorithm Contd..
34
Iteration 2
A
B
1
Iteration 3
A
B
D
1
2
Iteration 4
A
B
C
D
1
2
1
Iteration 5
A
B
C
E
D
1
1
2
1
Iteration 6
A
B
C
E
D
F
1
1
2
3
1
Iteration 1
A
A
B
C
E
D
F
1
1
1
2
3
1
2
krraju.in
Bellman-Ford Algorithm
35
s = source node
T = set of nodes so far incorporated by the algorithm
w(i,j) = link cost from node i to node j
w(i,i) = 0
w(i,j) = ∞ if the two nodes are not directly connected
w(i,j) ≥ 0 if the two nodes are directly connected
h = maximum number of links in a path at the current stage of the algorithm
Lh(n) = cost of the least cost path from node s to node n under the constraint of no more than h links.
krraju.in
Bellman-Ford Algorithm Contd..
36
h | L(B):Path | L(C):Path | L(D):Path | L(E):Path | L(F):Path |
0 | ∞:--- | ∞:--- | ∞:--- | ∞:--- | ∞:--- |
1 | 1:A-B | ∞:--- | 2:A-D | ∞:--- | ∞:--- |
2 | 1:A-B | 2:A-B-C | 2:A-D | 4:A-D-E | ∞:--- |
3 | 1:A-B | 2:A-B-C | 2:A-D | 3:A-B-C-E | 7:A-D-E-F |
4 | 1:A-B | 2:A-B-C | 2:A-D | 3:A-B-C-E | 6:A-B-C-E-F |
5 | 1:A-B | 2:A-B-C | 2:A-D | 3:A-B-C-E | 6:A-B-C-E-F |
A
B
C
E
D
F
1
1
1
2
3
1
2
krraju.in
Bellman-Ford Algorithm Contd..
37
h=0
A
A
B
C
E
D
F
1
1
1
2
3
1
2
h=1
A
B
C
E
D
F
1
1
1
2
3
1
2
h=2
A
B
C
E
D
F
1
1
1
2
3
1
2
h=3
A
B
C
E
D
F
1
1
1
2
3
1
2
h=4
A
B
C
E
D
F
1
1
1
2
3
1
2
h=5
A
B
C
E
D
F
1
1
1
2
3
1
2
krraju.in
Recap
38
krraju.in