Professional Documents
Culture Documents
Computer Networks
#2
Rou7ng
Algorithm
Semester
Ganjil
2012
PTIIK
Universitas
Brawijaya
Todays
Lecture
This Course
Goals :
Understand Routing Algorithm
Distance Vector & Link State Routing
Outline/Schedule
Grading Policy
Dynamic Routing ( Link State vs
Distance Vector )
Dynamic Routing vs Static Routing ?
#1
-
Review
of
Networks
2
References
Kurose
&
Ross,
Computer
Networking
:
Top
down
Approach,
6th
Ed.,
Pearson/Addison,
2012.
Chapter
4
Network
Layer
#1
-
Review
of
Networks
3
#1
Rou7ng
Algorithm
IP
des7na7on
address
in
arriving
packets
header
1
3
2
N = set of routers = { u, v, w, x, y, z }
E = set of links ={ (u,v), (u,x),(u.w), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
5
7
notes: 4
construct shortest path tree by 8
tracing predecessor nodes 3
w
z
u
y
ties can exist (can be broken 2
arbitrarily) 3
7
4
v
Network
Layer
4-11
Dijkstras
algorithm:
another
example
Step
N'
D(v),p(v)
D(w),p(w)
D(x),p(x)
D(y),p(y)
D(z),p(z)
0
u
2,u
5,u
1,u
1
ux
2,u
4,x
2,x
2
uxy
2,u
3,y
4,y
3
uxyv
3,y
4,y
4
uxyvw
4,y
5
uxyvwz
5
3
v
w
5
2
u
2
1
z
3
1
2
x
1
y
v
w
u
z
x
y
1
A
1+e
A
A
A
2+e
0
0
2+e
2+e
0
D
0
0
B
D
1+e
1
B
D
B
D
1+e
1
B
0
0
0
e
0
1
C
C
0
1
C
1+e
0
C
0
1
e
ini7ally
given these costs, given these costs, given these costs,
find new routing. find new routing. find new routing.
resulting in new costs resulting in new costs resulting in new costs
Network
Layer
4-14
Distance
vector
algorithm
Bellman-Ford
equa6on
(dynamic
programming)
let
dx(y)
:=
cost
of
least-cost
path
from
x
to
y
then
dx(y)
=
min
{c(x,v)
+
dv(y)
}
v
cost from neighbor v to destination y
cost to neighbor v
min taken over all neighbors v of x
Network
Layer
4-15
Bellman-Ford
example
5
3
clearly,
dv(z)
=
5,
dx(z)
=
3,
dw(z)
=
3
v
w
5
2
u
2
1
z
B-F
equa7on
says:
3
1
2
du(z)
=
min
{
c(u,v)
+
dv(z),
x
1
y
c(u,x)
+
dx(z),
c(u,w)
+
dw(z)
}
=
min
{2
+
5,
1
+
3,
5
+
3}
=
4
from
from
y
y
2
0
1
z
z
7
1
0
node
y
cost
to
table
x
y
z
y
2
1
x
x
z
7
from
y
2
0
1
z
node
z
cost
to
table
x
y
z
x
from
y
z
7
1
0
7me
Network
Layer
4-20
Dx(y)
=
min{c(x,y)
+
Dy(y),
c(x,z)
+
Dz(y)}
Dx(z)
=
min{c(x,y)
+
=
min{2+0
,
7+1}
=
2
Dy(z),
c(x,z)
+
Dz(z)}
=
min{2+1
,
7+0}
=
3
node
x
cost
to
cost
to
cost
to
table
x
y
z
x
y
z
x
y
z
x
0
2
7
x
0
2
3
x
0
2
3
from
from
y y 2 0 1 y 2 0 1
from
z
z
7
1
0
z
3
1
0
from
y 2 0 1 y 2 0 1
from
y
2
0
1
z
z
7
1
0
z
3
1
0
cost
to
cost
to
node
z
cost
to
x
y
z
x
y
z
table
x
y
z
x
x
0
2
7
x
0
2
3
from
from
y
2
0
1
y
2
0
1
from
y
z
z
3
1
0
z
3
1
0
7
1
0
7me
Network
Layer
4-21
Distance
vector:
link
cost
changes
good t0
:
y
detects
link-cost
change,
updates
its
DV,
informs
its
neighbors.
news
travels t1
:
z
receives
update
from
y,
updates
its
table,
computes
new
least
fast cost
to
x
,
sends
its
neighbors
its
DV.
3c
3a
2c
3b
2a
AS3
2b
1c
AS2
1a
1b
AS1
1d
forwarding
table
congured
by
both
intra-
Intra-AS
Inter-AS
and
inter-AS
rou7ng
Rou7ng
algorithm
Rou7ng
algorithm
algorithm
intra-AS
sets
entries
Forwarding
table
for
internal
dests
inter-AS
&
intra-AS
sets
entries
for
external
Network
Layer
dests
4-26
Inter-AS
tasks
suppose
router
in
AS1
AS1
must:
receives
datagram
1. learn
which
dests
are
des7ned
outside
of
AS1:
reachable
through
AS2,
router
should
forward
which
through
AS3
packet
to
gateway
2. propagate
this
router,
but
which
one?
reachability
info
to
all
routers
in
AS1
job
of
inter-AS
rou6ng!
3c
3a
3b
AS3
2c
other
1c
2a
networks
other
1a
2b
networks
1b
AS2
AS1
1d
Network
Layer
4-27
Example:
seyng
forwarding
table
in
router
1d
3c
x
3a
3b
AS3
2c
other
1c
2a
networks
other
1a
2b
networks
1b
AS2
AS1
1d
?
Network
Layer
4-29
Example:
choosing
among
mul7ple
ASes
now
suppose
AS1
learns
from
inter-AS
protocol
that
subnet
x
is
reachable
from
AS3
and
from
AS2.
to
congure
forwarding
table,
router
1d
must
determine
towards
which
gateway
it
should
forward
packets
for
dest
x
this
is
also
job
of
inter-AS
rou7ng
protocol!
hot
potato
rou6ng:
send
packet
towards
closest
of
two
routers.