Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

Wireless and Mobile Computing

Delivered
By
Hannan Bin Liaqat

Department of CS& IT
University of Gujrat
Lecture Agenda
 Routing Protocols:
 Distance Vector Routing Protocol
 Link state Routing Protocol
Distance Vector (DV) Routing
Distance Vector (DV) Routing
 DV: one-dimensional array containing distances (cost) to
all other nodes
 DVs initialized with costs of direct links and
communicated with (direct) neighbors
 When node x receives DV update from z, it checks if it
can improve its current cost to y using Bellman-Ford
equation
 dx(y) = minimum cost path between x and y
 c(x, z) = cost of link between x and z
DV Example - Network Graph

ch l in k ca n
C o st f or ea
be set
Network’s Graph Representation

G = (V,E)

dge
E

1 2 2

Node or
Vertice
Distance Vector Routing Example

Ini
t
inf ial
o
eac rmat
h n ion
o de at
Distance Vector Routing Example

Initial Table at
A
Distance Vector Routing Example

No
cha
nge

C tells A that it can


cha
reach B at cost 1 ng ed

C tells A that it can


reach D at cost 1 cha
ng ed

F tells A that it can


reach G at cost 1
Distance Vector Routing Example

Fin
inf al
orm
a t io
n
Dist Vector – Some more details
Routing updates: Periodic or Triggered

What happens when nodes/ links fail ?


I can
reach G
with cost
2

I can
I canG
reach
reach
with G
cost
with cost
1

Dist Vector – Count to Infinity problem
I
I can
can reach
reach EE
with cost 2
with cost 4
through
through AA
I can reach E
with cost 3
through B
I can reach
E directly
(cost 1)

This begins a count to infinity


Solution:
1) Smaller number representing ∞ (typically 16)
2) Don’t advertise back where you learnt from - Split Horizon
Link State Routing Protocol
Link State Routing Protocol
 Nodes know the state of directly connected links
 Flood link-state-packets (and not entire routing tables) to
entire network (and not just neighbors)
 Collection of link-states present entire network map
 Each node calculates shortest paths in these maps
 Link State Packet (LSP):
 Creating node’s ID; Cost to each (direct) neighbor;
SEQ no; TTL
Dijkstra’s Algorithm
This algorithm calculates the shortest path
tree given any graph
 Initialization:
 2 N’ = {u}
 3 for all nodes v
 4 if v adjacent to u {
 5 D(v) = c(u,v)
 6 else D(v) = ∞
 7 Loop
 9 find w not in N’ with the smallest D(w)
 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 until all nodes in N’
t hm
ori
A lg
a ’ s ise
s tr erc
ij k Ex
D

You might also like