Chapter 6
Chapter 6
Chapter 6
By Lake F.
Outlines
2
By Lake F.
Review: Two Key Network-Layer Functions
3
Analogy:
Routing:
● Forwarding: process of
Determine route taken by
packets from source to getting through single
destination. interchange.
Forwarding: Passing thru A.A
By Lake F.
Cont’
5
By Lake F.
Cont’
6
By Lake F.
Cont’
7
packet destination.
By Lake F.
Graph theory: Defn.
9
1
3
2 5
4
Mathematically, we often write G = (V,E)
V: set of vertices, so |V| = number of vertices
E: set of edges, so |E| = number of edges
By Lake F.
Graph theory: The need
10
By Lake F.
Real-time example: Graph application
11
3 Hospital
4
Maraki
1 5
Arada
College
5
Azezo
7 1
Mesgid
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
Graph: G = (N,E)
♪ N = set of routers = { u, v, w, x, y, z }
♪ E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
By Lake F.
Graph abstraction: costs
14
5
c(A,A’) = cost of link (A,A’)
3
v w 5
2
u Example: c(w,z) = 5
2
3
1 z
1 2
x 1
y
By Lake F.
Routing protocols-classification
15
Routing protocols
Adaptive(dynamic) Non-Adaptive(static)
Most Important !
By Lake F.
Cont’
16
By Lake F.
Cont’
17
Note:
An autonomous system is a network or a collection of
By Lake F.
Distance-Vector (DV) routing
18
connected neighbors.
By Lake F.
Cont’
19
Basic idea:
From time-to-time, each node sends its own distance
B-F equation:
By Lake F.
How Distance vector routing works?
21
1 Initialization:
2 for all destinations y:
3 Dx (y) = c(x,y)
4 for all neighbors w: //for all destinations y: Dw(y) = infinity
6 for all neighbors w: // send Dx(y)
7
8 loop
9 wait (until I see a link cost change to neighbor w
10 or until I receive update from neighbor w)
11
12 for all destinations y:
13 Dx(y) = minv { c(x,v) + Dv(y) }
14
15 if we have a new Dx(Y) for any destination Y
24 send new values Dx(Y) to all neighbors
25
26 forever
By Lake F.
Example: Initialization of tables
22
22.22
By Lake F.
Example- Final Distance vector routing tables
23
22.23
By Lake F.
Example
24
5
Clearly, dv(z) = 5, dx(z) = 3,
dw(z) = 3 3
v w
2 5
u 2 1 z
3
B-F equation says: 1
2
x y
1
Cost between u&z
du(z)
= min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) }
= min {2 + 5, 1 + 3, 5 + 3}
=4
By Lake F.
Link-State (LS) Routing
25
By Lake F.
Cont’
26
By Lake F.
Cont’
27
The router then advertises this set of link costs to all other
today.
Dijkstra’s algorithm:
“Find the shortest path from a given source node to all other
nodes by developing the paths for increasing path length.”
By Lake F.
How Link state Routing works?
28
1 Initialization:
2 N = {S}
3 for all nodes v
4 if v adjacent to S
5 then D(v) = c(S,v)
6 else D(v) = infinity
7
8 Loop
9 find w not in N such that D(w) is a minimum
10 add w to N
11 update D(v) for all v adjacent to w and not in N:
12 D(v) = min( D(v), D(w) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N
By Lake F.
Example
29
5
3
B C 5
2
A 2 1 F
3
1 2
D E
1
By Lake F.
Example…
30
Resulting shortest-path tree from A:
B C
A F
D E
B (A,B)
D (A,D)
C (A,D,E,C)
E (A,D,E)
F (A,D,E,F)
By Lake F.
Comparisons
31
Complex to implement
By Lake F.
By Lake F.