Académique Documents
Professionnel 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
References
Kurose
&
Ross,
Computer
Networking
:
Top
down
Approach,
6th
Ed.,
Pearson/Addison,
2012.
Chapter
4
Network
Layer
#1 - Review of Networks
#1
Rou7ng
Algorithm
Routing & Forwarding
Graph Theory
Routing Algorithm
rou$ng algorithm
3
2
2
1
IP
des7na7on
address
in
arriving
packets
header
1
3
2
Network Layer
4-5
Graph
abstrac7on
5
1
graph:
G
=
(N,E)
v
2
3
3
1
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)
}
aside:
graph
abstrac7on
is
useful
in
other
network
contexts,
e.g.,
P2P,
where
N
is
set
of
peers
and
E
is
set
of
TCP
connec7ons
Network Layer
4-6
v
2
3
3
1
4-7
Q:
sta6c
or
dynamic?
sta6c:
routes
change
slowly
over
7me
dynamic:
routes
change
more
quickly
periodic
update
in
response
to
link
cost
changes
Network Layer
4-8
nota6on:
c(x,y):
link
cost
from
node
x
to
y;
=
if
not
direct
neighbors
D(v):
current
value
of
cost
of
path
from
source
to
dest.
v
p(v):
predecessor
node
along
path
from
source
to
v
N':
set
of
nodes
whose
least
cost
path
deni7vely
known
itera7ve:
aher
k
itera7ons,
know
least
cost
Network
Layer
path
to
k
dest.s
4-9
Dijsktras
Algorithm
1
Ini$aliza$on:
2
N'
=
{u}
3
for
all
nodes
v
4
if
v
adjacent
to
u
5
then
D(v)
=
c(u,v)
6
else
D(v)
=
7
8
Loop
9
nd
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
un$l
all
nodes
in
N'
Network
Layer
4-10
N'
u
uw
uwx
uwxv
uwxvy
uwxvyz
p(w)
p(x)
7,u
6,w
6,w
3,u
5,u
5,u
11,w
11,w
14,x
10,v
14,x
12,y
p(y)
p(z)
notes:
4
3
u
7
9
7
8
w
3
v
Network
Layer
4-11
N'
u
ux
uxy
uxyv
uxyvw
uxyvwz
D(v),p(v)
D(w),p(w)
2,u
5,u
2,u
4,x
2,u
3,y
3,y
D(x),p(x)
1,u
D(y),p(y)
2,x
D(z),p(z)
4,y
4,y
4,y
v
2
3
3
1
Network Layer
4-12
z
x
link
v
x
(u,v)
(u,x)
(u,x)
(u,x)
(u,x)
Network
Layer
4-13
oscilla6ons
possible:
e.g.,
support
link
cost
equals
amount
of
carried
trac:
D
1
C
e
1+e
ini7ally
2+e
1+e 1
2+e
0 0
1+e
2+e
1+e 1
cost to neighbor v
min taken over all neighbors v of x
Network
Layer
4-15
Bellman-Ford
example
5
v
2
3
3
1
4-16
node
x:
knows
cost
to
each
neighbor
v:
c(x,v)
maintains
its
neighbors
distance
vectors.
For
each
neighbor
v,
x
maintains
Dv
=
[Dv(y):
y
N
]
Network Layer
4-17
4-18
each node:
distributed:
each
node
no7es
neighbors
only
when
its
DV
changes
recompute
es7mates
if
DV
to
any
dest
has
changed,
no6fy
neighbors
4-19
from
node
y
table
x
y
z
from
node
z
table
x
y
z
cost to
cost to
x
y
z
0
2
7
x
y
z
from
from
node
x
table
x
y
z
Dx(z)
=
min{c(x,y)
+
Dy(z),
c(x,z)
+
Dz(z)}
=
min{2+1
,
7+0}
=
3
x
0
2
3
y
2
0
1
z
7
1
0
cost to
x
y
z
2
0
1
y
7
cost to
x y z
7
1
0
Network
Layer
7me
4-20
Dx(z)
=
min{c(x,y)
+
Dy(z),
c(x,z)
+
Dz(z)}
=
min{2+1
,
7+0}
=
3
x y z
x
y
z
7
1
0
from
cost to
x y z
x y z
x
0
2
7
y
2
0
1
z
7
1
0
x
0
2
3
y
2
0
1
z
3
1
0
cost to
cost to
x
0
2
3
y
2
0
1
z
3
1
0
cost to
cost to
2
0
1
x
0
2
3
y
2
0
1
z
7
1
0
x y z
from
from
0 2 7
cost to
x y z
y
7
cost to
x y z
x y z
x
0
2
7
y
2
0
1
z
3
1
0
x
0
2
3
y
2
0
1
z
3
1
0
from
from
node
z
table
x
y
z
x y z
from
from
node
y
table
x
y
z
cost to
cost to
from
from
node
x
table
x
y
z
Network Layer
7me
4-21
good
news
travels
fast
y
50
4-22
speed of convergence
msgs
may
have
oscilla7ons
DV:
convergence
7me
varies
may
be
rou7ng
loops
count-to-innity
problem
DV:
DV
node
can
adver7se
incorrect
path
cost
each
nodes
table
used
by
others
Network Layer
Hierarchical
rou7ng
our routing study thus far - idealization
all routers identical
network flat
not true in practice
scale:
with
600
million
des7na7ons:
cant
store
all
dests
in
rou7ng
tables!
rou7ng
table
exchange
would
swamp
links!
administra6ve
autonomy
internet
=
network
of
networks
each
network
admin
may
want
to
control
rou7ng
in
its
own
network
Network Layer
4-24
Hierarchical
rou7ng
aggregate
routers
into
regions,
autonomous
systems
(AS)
routers
in
same
AS
run
same
rou7ng
protocol
gateway
router:
at
edge
of
its
own
AS
has
link
to
router
in
another
AS
intra-AS
rou7ng
protocol
routers
in
dierent
AS
can
run
dierent
intra-
AS
rou7ng
protocol
Network
Layer
4-25
Interconnected
ASes
3c
3a
3b
AS3
1a
2a
1c
1d
1b AS1
2c
AS2
2b
forwarding
table
congured
by
both
intra-
and
inter-AS
rou7ng
Intra-AS
Inter-AS
Rou7ng
Rou7ng
algorithm
algorithm
algorithm
intra-AS
sets
entries
Forwarding
for
internal
dests
table
inter-AS
&
intra-AS
sets
entries
for
external
dests
Network
Layer
4-26
Inter-AS
tasks
suppose
router
in
AS1
receives
datagram
des7ned
outside
of
AS1:
router
should
forward
packet
to
gateway
router,
but
which
one?
3c
3b
other
networks
AS1
must:
1. learn
which
dests
are
reachable
through
AS2,
which
through
AS3
2. propagate
this
reachability
info
to
all
routers
in
AS1
job
of
inter-AS
rou6ng!
3a
AS3
1c
1a
1d
AS1
1b
Network Layer
2a
2c
AS2
2b
other
networks
4-27
3c
3b
other
networks
3a
AS3
1c
1a
1d
AS1
1b
Network Layer
2a
2c
AS2
2b
other
networks
4-28
3c
3b
other
networks
3a
AS3
1c
1a
1d
AS1
1b
?
Network
Layer
2a
2c
AS2
2b
other
networks
4-29
Network Layer
determine
from
forwarding
table
the
interface
I
that
leads
to
least-cost
gateway.
Enter
(x,I)
in
forwarding
table
4-30
Assignment
Prepare
a
discussion
group
5
Member
each
group
Slide 31