Você está na página 1de 90

1

Network Layer
2
Network Layer: Goals & Overview
Goals:

understand principles behind


network layer services:
routing (path selection)
dealing with scale
how a router works
advanced topics: !v"#
$obility

instantiation and
i$ple$entation in the nternet
Overview:

network layer services

routing principle: path selection

hierarchical routing

nternet routing protocols


reliable trans%er
intra&do$ain
inter&do$ain

what's inside a router(

!v"

$obility
)
Network layer %unctions

transport packet %ro$ sending to


receiving hosts

network layer protocols in every host#


router
*our i$portant %unctions:

Routing Protocol: Path determination


and Switching: route taken by packets
%ro$ source to dest+ Routing
algorithms and switching to $ove
packets %ro$ router's input to
appropriate router output

Call setup: so$e network


architectures re,uire router call setup
along path be%ore data %lows (-irtual
.ircuit /witching)

nternet .ontrol 0essage: 1rror


reporting# .ontrol $essage between
routers# etc+

nternet !rotocol (! !rotocol):


addressing convention# 2atagra$
%or$at# !acket handling convention
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
3
Network service $odel
4: 5hat service model %or
6channel7 transporting
packets %ro$ sender to
receiver(

guaranteed bandwidth(

preservation o% inter&packet
ti$ing (no 8itter)(

loss&%ree delivery(

in&order delivery(

congestion %eedback to
sender(
(
(
(
virtual circuit
or
datagram?
The most important
abstraction provided
by network layer:
s
e
r
v
i
c
e

a
b
s
t
r
a
c
t
i
o
n
9
-irtual circuits

call setup %or each call before data can %low# teardown to end the call

each packet carries -. (-irtual .ircuit) identi%ier (not destination


host 2)

every router on source&dest path $aintains 6state7 %or each passing


connection

link# router resources (bandwidth# bu%%ers) $ay be allocated to -.


to get circuit&like per%or$ance+
6source&to&dest path behaves $uch like telephone circuit7
per%or$ance&wise
network actions along source&to&dest path
"
-irtual circuits: signaling protocols

used to setup# $aintain teardown -.

used in :;0# %ra$e&relay# <+29

not used in today's nternet


application
transport
network
data link
physical
application
transport
network
data link
physical
1. Initiate call
2. incoming call
3. Accept call
. !all connected
". #ata $low begins
%. &eceive data
=
2atagra$ networks: the nternet $odel

no call setup at network layer

routers: no state about end&to&end connections


no network&level concept o% 6connection7

packets typically routed using destination host 2


packets between sa$e source&dest pair $ay take di%%erent paths
application
transport
network
data link
physical
application
transport
network
data link
physical
1. 'end data
2. &eceive data
>
2atagra$ or -. network: why(
nternet

data e?change a$ong co$puters


6elastic7 service# no strict
ti$ing re,+

6s$art7 end syste$s (co$puters)


can adapt# per%or$ control#
error recovery
si$ple inside network#
co$ple?ity at 6edge7

$any link types


di%%erent characteristics
uni%or$ service di%%icult
:;0 (:synchronous
;rans%er 0ode)

evolved %ro$ telephony: -irtual


.ircuit /witching

hu$an conversation:
strict ti$ing# reliability
re,uire$ents
need %or guaranteed service

6du$b7 end syste$s


telephones
co$ple?ity inside network
@
Aouting
Graph abstraction %or routing
algorith$s:

graph nodes are routers

graph edges are physical


links
link cost: delay# B cost# or
congestion level
(oal: determine )good* path
+se,uence o$ routers- thru
network $rom source to dest.
&outing protocol
A
. #
! /
0
2
2
1
3
1
1
2
"
3
"

6good7 path:
typically $eans $ini$u$
cost path
other de%'s possible
1C
Aouting :lgorith$ classi%ication
Global or decentraliDed
in%or$ation(
Global:

all routers have co$plete


topology# link cost in%o

6link state7 algorith$s


2ecentraliDed:

router knows physically&


connected neighbors# link costs
to neighbors

iterative process o% co$putation#


e?change o% in%o with neighbors

6distance vector7 algorith$s


/tatic or dyna$ic(
/tatic:

routes change slowly over


ti$e
2yna$ic:

routes change $ore


,uickly
periodic update
in response to link cost
changes
11
: Link&/tate Aouting :lgorith$
2i8kstra's algorith$

net topology# link costs known


to all nodes
acco$plished via 6link state
broadcast7
all nodes have sa$e in%o

co$putes least cost paths %ro$


one node (Esource7) to all other
nodes
gives routing table %or that
node

iterative: a%ter k iterations#


know least cost path to k dest+'s
Notation:

c(i,j): link cost %ro$ node i to


8+ cost in%inite i% not direct
neighbors

D(v): current value o% cost o%


path %ro$ source to dest+ -

p(v): predecessor node along


path %ro$ source to v# that is
ne?t v

N: set o% nodes whose least


cost path de%initively known
12
2i8sktra's :lgorith$
1 Initialization:
2 N = {A}
3 for all nodes v
4 if v adjacent to A
5 ten D(v) = c(A,v)
! else D(v) = infinit"
#
$ Loop
% find & not in N s'c tat D(&) is a (ini('(
1) add & to N
11 'pdate D(v) for all v adjacent to & and not in N:
12 D(v) = (in( D(v), D(&) * c(&,v) )
13 +, ne& cost to v is eiter old cost to v or -no&n
14 sortest pat cost to & pl's cost fro( & to v ,+
15 until all nodes in N
1)
2i8kstra's algorith$: e?a$ple
.tep
)
1
2
3
4
5
start N
A
AD
AD/
AD/0
AD/01
AD/012
D(0),p(0)
2,A
2,A
2,A
D(1),p(1)
5,A
4,D
3,/
3,/
D(D),p(D)
1,A
D(/),p(/)
infinit"
2,D
D(2),p(2)
infinit"
infinit"
4,/
4,/
4,/
A
. #
! /
0
2
2
1
3
1
1
2
"
3
"
13
2istance -ector Aouting :lgorith$
iterative:

continues until no nodes


e?change in%o+

self-terminating: no
6signal7 to stop
asynchronous:

nodes need not e?change


in%oFiterate in lock stepG
distributed:

each node co$$unicates


only with directly&attached
neighbors
2istance ;able data structure

each node has its own routing table

row %or each possible destination

colu$n %or each directly&attached


neighbor to node

e?a$ple: in node <# %or dest+ H via


neighbor I:
D (3,4)
5
distance from 5 to
3, via 4 as ne6t op
c(5,4) * (in {D (3,&)}
4
&
=
=
19
2istance ;able: e?a$ple
A
.
#
! /
1
2
1
2
1
2
D ()
A
0
1
D
A
1
#
!
4
0
14
$
%
11
D
5
5
4
2
/
cost to destination via
d
e
s
t
i
n
a
t
i
o
n
D (1,D)
/
c(/,D) * (in {D (1,&)}
D
&
=
= 2*2 = 4
D (A,D)
/
c(/,D) * (in {D (A,&)}
D
&
=
= 2*3 = 5
D (A,0)
/
c(/,0) * (in {D (A,&)}
0
&
=
= $*! = 14
loop3
loop3
1"
2istance table gives routing table
D ()
A
0
1
D
A
1
#
!
4
0
14
$
%
11
D
5
5
4
2
/
cost to destination via
d
e
s
t
i
n
a
t
i
o
n

A
0
1
D

A,1
D,5
D,4
D,4
7't8oin8 lin-
to 'se, cost
d
e
s
t
i
n
a
t
i
o
n
#istance table
&outing table
1=
2istance -ector Aouting: overview
terative# asynchronous: each
local iteration caused by:

local link cost change

$essage %ro$ neighbor: its


least cost path change %ro$
neighbor
2istributed:

each node noti%ies neighbors


only when its least cost path to
any destination changes
neighbors then noti%y their
neighbors i% necessary
wait for (can8e in local lin-
cost of (s8 fro( nei89or)
recompute distance ta9le
if least cost pat to an" dest
as can8ed, notify
nei89ors
.ach node:
1>
2istance -ector :lgorith$:
1 :nitiali;ation:
2 for all adjacent nodes v:
3 D (,,v) = infinit" +, te , operator (eans <for all ro&s< ,+
4 D (v,v) = c(5,v)
5 for all destinations, "
! send (in D (",&) to eac nei89or +, & over all 5=s nei89ors ,+
5
5
5
&
At all nodes4 5:
1@
2istance -ector :lgorith$ (cont+):
$ loop
% wait ('ntil : see a lin- cost can8e to nei89or >
1) or 'ntil : receive 'pdate fro( nei89or >)
11
12 if (c(5,>) can8es 9" d)
13 +, can8e cost to all dest=s via nei89or v 9" d ,+
14 +, note: d co'ld 9e positive or ne8ative ,+
15 for all destinations ": D (",>) = D (",>) * d
1!
1# else if ('pdate received fro( > &rt destination 3)
1$ +, sortest pat fro( > to so(e 3 as can8ed ,+
1% +, > as sent a ne& val'e for its (in D>(3,&) ,+
2) +, call tis received ne& val'e is <ne&val< ,+
21 for te sin8le destination ": D (3,>) = c(5,>) * ne&val
22
23 if &e ave a ne& (in D (3,&)for an" destination 3
24 send ne& val'e of (in D (3,&) to all nei89ors
25
2! forever
&
5 5
5
5
5
&
&
2C
2istance -ector :lgorith$: e?a$ple
5
6
1 2
1
7
21
2istance -ector :lgorith$: e?a$ple
5
6
1 2
1
7
D (3,4)
5
c(5,4) * (in {D (3,&)}
&
=
= #*1 = $
4
D (4,3)
5
c(5,3) * (in {D (4,&)}
&
=
= 2*1 = 3
3
22
2istance -ector: link cost changes
Link cost changes:

node detects local link cost change

updates distance table (line 19)

i% cost change in least cost path# noti%y


neighbors (lines 2)#23)
5
6
1
"8
7
1
algorithm
terminates
)good
news
travels
$ast*
2)
.o$parison o% L/ and 2- algorith$s
0essage co$ple?ity

L/: with n nodes# 1 links# O(n1)


$sgs sent each

2-: e?change between neighbors


only
convergence ti$e varies
/peed o% .onvergence

L/: O(nJJ2) algorith$ re,uires


O(n1) $sgs
$ay have oscillations

2-: convergence ti$e varies


$ay be routing loops
count&to&in%inity proble$
Aobustness: what happens i%
router $al%unctions(
L/:
node can advertise incorrect
link cost
each node co$putes only its
own table
2-:
2- node can advertise
incorrect path cost
each node's table used by
others
K error propagate thru network
23
Lierarchical Aouting
scale: with 2CC $illion
destinations:

can't store all dest's in routing


tablesG

routing table e?change would


swa$p linksG
ad$inistrative autono$y

internet M network o% networks

each network ad$in $ay want to


control routing in its own
network
Our routing study thus %ar & idealiDation

all routers identical

network 6%lat7
not true in practice
29
Lierarchical Aouting

aggregate routers into


regions# 6autono$ous
syste$s7 (:/)

routers in sa$e :/ run


sa$e routing protocol
6intra&:/7 routing protocol
routers in di%%erent :/ can
run di%%erent intra&:/
routing protocol

special routers in :/

run intra&:/ routing


protocol with all other
routers in :/

also responsible %or routing


to destinations outside :/
run inter-AS routing
protocol with other
gateway routers
gateway routers
2"
ntra&:/ and nter&:/ routing
(ateways:
9per$orm inter:A'
routing amongst
themselves
9per$orm intra:A'
routers with other
routers in their
A'
inter:A'4 intra:A'
routing in
gateway A.c
network layer
link layer
physical layer
a
b
b
a
a
!
A
/
d
A.a
A.c
!.b
/.a
c
b
c
2=
ntra&:/ and nter&:/ routing
;ost
h2
a
b
b
a
a
!
A
/
d
c
A.a
A.c
!.b
/.a
c
b
;ost
h1
Intra:A' routing
within A' A
Inter:A'
routing
between
A and /
Intra:A' routing
within A' /

5e'll e?a$ine speci%ic inter&:/ and intra&:/ nternet


routing protocols shortly
2>
;he nternet Network layer
routing
table
Lost# router network layer %unctions:
&outing protocols
9path selection
9&I<4 ='<04 /(<
I< protocol
9addressing conventions
9datagram $ormat
9packet handling conventions
I!>< protocol
9error reporting
9router )signaling*
Transport layer: T!<4 ?#<
@ink layer
physical layer
Aetwork
layer
2@
! :ddressing: introduction

! address: )2&bit
identi%ier %or host# router
interface

interface: connection
between host# router and
physical link
router's typically have
$ultiple inter%aces
host $ay have $ultiple
inter%aces
! addresses associated
with inter%ace# not host#
router
223?1?1?1
223?1?1?2
223?1?1?3
223?1?1?4 223?1?2?%
223?1?2?2
223?1?2?1
223?1?3?2
223?1?3?1
223?1?3?2#
223?1?1?1 = 11)11111 )))))))1 )))))))1 )))))))1
223 1 1 1
)C
! :ddressing

! address:
network part (high order
bits)
host part (low order bits)

hat!s a network " (%ro$


! address perspective)
device inter%aces with
sa$e network part o% !
address
can physically reach each
other without intervening
router
223?1?1?1
223?1?1?2
223?1?1?3
223?1?1?4 223?1?2?%
223?1?2?2
223?1?2?1
223?1?3?2
223?1?3?1
223?1?3?2#
network consisting o$ 3 I< networks
+$or I< addresses starting with 2234
$irst 2 bits are network address-
@AA
)1
! :ddressing
Low to %ind the networks(

2etach each inter%ace


%ro$ router# host

create 6islands o% isolated


networks
223?1?1?1
223?1?1?3
223?1?1?4
223?1?2?2 223?1?2?1
223?1?2?!
223?1?3?2 223?1?3?1
223?1?3?2#
223?1?1?2
223?1?#?)
223?1?#?1
223?1?$?) 223?1?$?1
223?1?%?1
223?1?%?2
Interconnected
system consisting
o$ siB networks
)2
! :ddresses
8
network
host
18
network
host
118 network host
1118
multicast address
A
/
!
#
class
1.8.8.8 to
121.2"".2"".2""
122.8.8.8 to
1C1.2"".2"".2""
1C2.8.8.8 to
223.2"".2"".2""
22.8.8.8 to
23C.2"".2"".2""
32 bits
given notion o% 6network7# let's re&e?a$ine ! addresses:
)class:$ull* addressing:
))
! addressing: .2A

.lass%ul addressing:
ine%%icient use o% address space# address space e?haustion
e+g+# class N net allocated enough addresses %or "9O hosts# even i%
only 2O hosts in that network

.2A: .lassless nter2o$ain Aouting


network portion o% address o% arbitrary length
address %or$at: a+b+c+dF?# where ? is P bits in network portion o%
address
11))1))) )))1)111 )))1)))) ))))))))
network
part
host
part
288.23.1%.8D23
)3
! addresses: how to get one(
4: Low does host get ! address(

hard&coded by syste$ ad$in in a %ile


5intel: control&panel&Qnetwork&Qcon%iguration&QtcpFip&Qproperties
RN<: FetcFrc+con%ig

2L.!: 2yna$ic Lost .on%iguration !rotocol:


dyna$ically get address: 6plug&and&play7
host broadcasts 62L.! discover7 $sg
2L.! server responds with 62L.! o%%er7 $sg
host re,uests ! address: 62L.! re,uest7 $sg
2L.! server sends address: 62L.! ack7 $sg
)9
2L.! client&server scenario

D@1A
server
arrivin8
D@1A
client
223?1?2?5
Figure 4.4.2-N1: 2L.! client&server scenario
)"
2L.! client&server scenario
#;!< server: 223.1.2."
arriving
client
time
D@1A discover
src : )?)?)?), !$ dest?: 255?255?255?255,!#
D@1AD:.17>/B
"iaddr: )?)?)?)
transaction :D: !54
D@1A offer
src: 223?1?2?5, !# dest: 223?1?2?4, !$
D@1A722/B
"iaddrr: 223?1?2?4
transaction :D: !54
D@1A server :D: 223?1?2?5
Cifeti(e: 3!)) secs
D@1A reD'est
src: )?)?)?), !$ dest:: 255?255?255?255, !#
D@1AB/EF/.G
"iaddrr: 223?1?2?4
transaction :D: !55
D@1A server :D: 223?1?2?5
Cifeti(e: 3!)) secs
D@1A A1H
src: 223?1?2?5, !# dest: 223?1?2?4, !$
D@1AA1H
"iaddrr: 223?1?2?4
transaction :D: !55
D@1A server :D: 223?1?2?5
Cifeti(e: 3!)) secs
)=
! addresses: how to get one(
Network (network portion):

get allocated portion o% /!'s address space:


:.A=s 9loc- 11))1))) )))1)111 )))1)))) )))))))) 2))?23?1!?)+2)
7r8ani;ation ) 11))1))) )))1)111 )))1)))) )))))))) 2))?23?1!?)+23
7r8ani;ation 1 11))1))) )))1)111 )))1))1) )))))))) 2))?23?1$?)+23
7r8ani;ation 2 11))1))) )))1)111 )))1)1)) )))))))) 2))?23?2)?)+23
??? I?? I? I?
7r8ani;ation # 11))1))) )))1)111 )))1111) )))))))) 2))?23?3)?)+23
)>
Lierarchical addressing: route aggregation
)'end me anything
with addresses
beginning
288.23.1%.8D23*
288.23.1%.8D23
288.23.12.8D23
288.23.38.8D23
0ly:/y:Aight:I'<
=rganiEation 8
=rganiEation 1
Internet
=rganiEation 1
I'<s:&:?s
)'end me anything
with addresses
beginning
1CC.31.8.8D1%*
288.23.28.8D23
=rganiEation 2
.
.
.
.
.
.
;ierarchical addressing allows e$$icient advertisement o$ routing
in$ormation:
)@
! addressing: the last word+++
4: Low does an /! get block o% addresses(
:: .:NN: nternet .orporation %or :ssigned
Na$es and Nu$bers
allocates addresses
$anages 2N/
assigns do$ain na$es# resolves disputes
3C
Getting a datagra$ %ro$ source to dest+
! datagra$:
223?1?1?1
223?1?1?2
223?1?1?3
223?1?1?4 223?1?2?%
223?1?2?2
223?1?2?1
223?1?3?2
223?1?3?1
223?1?3?2#
A
/
.
misc
$ields
source
I< addr
dest
I< addr
data

datagra$ re$ains unchanged#


as it travels source to
destination

addr %ields o% interest here



Dest? Net? ne6t ro'ter Nops
223?1?1 1
223?1?2 223?1?1?4 2
223?1?3 223?1?1?4 2
routing table in :
31
Getting a datagra$ %ro$ source to dest+
/tarting at :# given ! datagra$
addressed to N:

look up net+ address o% N

%ind N is on sa$e net+ as :

link layer will send datagra$ directly


to N inside link&layer %ra$e
N and : are directly connected

Dest? Net? ne6t ro'ter Nops
223?1?1 1
223?1?2 223?1?1?4 2
223?1?3 223?1?1?4 2
misc
$ields
223.1.1.1 223.1.1.3 data
223?1?1?1
223?1?1?2
223?1?1?3
223?1?1?4 223?1?2?%
223?1?2?2
223?1?2?1
223?1?3?2
223?1?3?1
223?1?3?2#
A
/
.
32
Getting a datagra$ %ro$ source to dest+
Dest? Net? ne6t ro'ter Nops
223?1?1 1
223?1?2 223?1?1?4 2
223?1?3 223?1?1?4 2
/tarting at :# dest+ 1:

look up network address o% 1

1 on different network
:# 1 not directly attached

routing table: ne?t hop router to 1


is 22)+1+1+3

link layer sends datagra$ to router


22)+1+1+3 inside link&layer %ra$e

datagra$ arrives at 22)+1+1+3

continuedS++
misc
$ields
223.1.1.1 223.1.2.2 data
223?1?1?1
223?1?1?2
223?1?1?3
223?1?1?4 223?1?2?%
223?1?2?2
223?1?2?1
223?1?3?2
223?1?3?1
223?1?3?2#
A
/
.
3)
Getting a datagra$ %ro$ source to dest+
:rriving at 22)+1+1+3# destined
%or 22)+1+2+2

look up network address o% 1

1 on same network as router's


inter%ace 22)+1+2+@
router# 1 directly attached

link layer sends datagra$ to


22)+1+2+2 inside link&layer %ra$e
via inter%ace 22)+1+2+@

datagra$ arrives at 22)+1+2+2G


misc
$ields
223.1.1.1 223.1.2.2 data
net&or- ro'ter Nops interface
223?1?1 J 1 223?1?1?4
223?1?2 J 1 223?1?2?%
223?1?3 J 1 223?1?3?2#
Dest? ne6t
223?1?1?1
223?1?1?2
223?1?1?3
223?1?1?4 223?1?2?%
223?1?2?2
223?1?2?1
223?1?3?2
223?1?3?1
223?1?3?2#
A
/
.
33
! datagra$ %or$at
ver
length
32 bits
data
+variable length4
typically a T!<
or ?#< segment-
1%:bit identi$ier
Internet
checksum
time to
live
32 bit source I< address
I< protocol version
number
header length
+bytes-
maB number
remaining hops
+decremented at
each router-
$or
$ragmentationD
reassembly
total datagram
length +bytes-
upper layer protocol
to deliver payload to
head.
len
type o$
service
)type* o$ data
$lgs
$ragment
o$$set
upper
layer
32 bit destination I< address
=ptions +i$ any-
..g. timestamp4
record route
taken4 speci$y
list o$ routers
to visit.
39
! *rag$entation & Aeasse$bly

network links have 0;R


($a?+trans%er siDe) & largest
possible link&level %ra$e+
di%%erent link types# di%%erent
0;Rs

large ! datagra$ divided


(6%rag$ented7) within net
one datagra$ beco$es several
datagra$s
6reasse$bled7 only at %inal
destination
! header bits used to identi%y#
order related %rag$ents
$ragmentation:
in: one large datagram
out: 3 smaller datagrams
reassembly
3"
! *rag$entation and Aeasse$bly
I#
FB
o$$set
F8
$rag$lag
F8
length
F888
I#
FB
o$$set
F8
$rag$lag
F1
length
F1"88
I#
FB
o$$set
F128
$rag$lag
F1
length
F1"88
I#
FB
o$$set
F2C%8
$rag$lag
F8
length
F188
=ne large datagram becomes
several smaller datagrams
3=
.0!: nternet .ontrol 0essage !rotocol

used by hosts# routers# gateways to


co$$unication network&level
in%or$ation
error reporting: unreachable
host# network# port# protocol
echo re,uestFreply (used by
ping)

network&layer 6above7 !:
.0! $sgs carried in !
datagra$s

.0! $essage: type# code plus


%irst > bytes o% ! datagra$ causing
error
G"pe 1ode description
) ) eco repl" (pin8)
3 ) dest? net&or- 'nreaca9le
3 1 dest ost 'nreaca9le
3 2 dest protocol 'nreaca9le
3 3 dest port 'nreaca9le
3 ! dest net&or- 'n-no&n
3 # dest ost 'n-no&n
4 ) so'rce D'enc (con8estion
control J not 'sed)
$ ) eco reD'est (pin8)
% ) ro'te advertise(ent
1) ) ro'ter discover"
11 ) GGC e6pired
12 ) 9ad :A eader
3>
Aouting in the nternet

;he Global nternet consists o% :utono$ous /yste$s (:/) interconnected with


each other:
Stub AS: s$all corporation: one connection to other :/'s
Multihomed AS: large corporation (no transit): $ultiple connections to other :/'s
Transit AS: provider# hooking $any :/'s together

;wo&level routing:
Intra-AS: ad$inistrator responsible %or choice o% routing algorith$ within network
Inter-AS: uni,ue standard %or inter&:/ routing: NG!
3@
nternet :/ Lierarchy
Inter:A' border +eBterior gateway- routers
Intra:A': interior +gateway- routers
9C
ntra&:/ Aouting

:lso known as nterior Gateway !rotocols (G!)

0ost co$$on ntra&:/ routing protocols:


A!: Aouting n%or$ation !rotocol
O/!*: Open /hortest !ath *irst
GA!: nterior Gateway Aouting !rotocol (.isco
proprietary)
91
A! ( Aouting n%or$ation !rotocol)

2istance vector algorith$

ncluded in N/2&RN< 2istribution in 1@>2

2istance $etric: P o% hops ($a? M 19 hops)

2istance vectors: e?changed every )C sec via Aesponse


0essage (also called advertisement)

1ach advertise$ent: route up to 29 destination nets


92
A! (Aouting n%or$ation !rotocol)
Destination Network Next Router Num. of hops to dest.
w A 2
y B 2
z B 7
x -- 1
. . ....
w
B y
E
A
!
#
/
&outing table in #
9)
A!: Link *ailure and Aecovery
% no advertise$ent heard a%ter 1>C sec &&Q neighborFlink
declared dead
routes via neighbor invalidated
new advertise$ents sent to neighbors
neighbors in turn send out new advertise$ents (i% tables
changed)
link %ailure in%o ,uickly propagates to entire net
poison reverse used to prevent ping&pong loops (in%inite
distance M 1" hops)
93
A! ;able processing

A! routing tables $anaged by appliation-level process


called route&d (dae$on)

advertise$ents sent in R2! packets# periodically repeated


99
O/!* (Open /hortest !ath *irst)

6open7: publicly available (as opposed to ./.O's GA!)

Rses Link /tate algorith$


L/ packet disse$ination
;opology $ap at each node
Aoute co$putation using 2i8kstra's algorith$

O/!* advertise$ent carries one entry per neighbor router

:dvertise$ents disse$inated to entire :/ (via %looding)


.arried in O/!* $essages directly over ! (rather than ;.! or R2!)
9"
O/!* 6advanced7 %eatures (not in A!)

/ecurity: all O/!* $essages authenticated (to prevent


$alicious intrusion)

0ultiple sa$e&cost paths allowed (only one path in A!)

*or each link# $ultiple cost $etrics %or di%%erent ;O/ (e+g+#
satellite link cost set 6low7 %or best e%%ortT high %or real ti$e)

ntegrated uni& and $ulticast support:


0ulticast O/!* (0O/!*) uses sa$e topology data base as
O/!*

Lierarchical O/!* in large do$ains+


9=
Lierarchical O/!*
9>
Lierarchical O/!*

;wo&level hierarchy: local area# backbone+


Link&state advertise$ents only in area
each nodes has detailed area topologyT only know
direction (shortest path) to nets in other areas+

Area border routers: 6su$$ariDe7 distances to nets


in own area# advertise to other :rea Norder routers+

!a"bone routers: run O/!* routing li$ited to


backbone+

!oundar# routers: connect to other :/'s+


9@
nter&:/ routing in the nternet: NG!

Figure 4.$.2-ne%2: NG! use %or inter&do$ain routing

A'2
+='<0
intra:A'
routing-

A'1
+&I< intra:A'
routing-
/(<


A'3
+='<0 intra:A'
routing-
/(<



&1
&2
&3
&
&"
"C
nternet inter&:/ routing: NG!

NG! (Norder Gateway !rotocol): the de %acto standard

&ath 'etor protocol:


si$ilar to 2istance -ector protocol
each Norder Gateway broadcast to neighbors (peers)
entire path (i+e+# se,uence o% :/'s) to destination
NG! routes to networks (:/s)# not individual hosts
1+g+# Gateway < $ay send its path to dest+ I:
!ath (<#I) M <#H1#H2#H)#S#I
"1
nternet inter&:/ routing: NG!
Suppose: gateway < send its path to peer gateway 5

5 $ay or $ay not select path o%%ered by <


cost# policy (don't route via co$petitors :/)# loop
prevention reasons+

% 5 selects path advertised by <# then:


!ath (5#I) M w# !ath (<#I)

Note: < can control inco$ing tra%%ic by controlling it route


advertise$ents to peers:
e+g+# don't want to route tra%%ic to I &Q don't advertise any
routes to I
"2
NG!: controlling who routes to you

Figure 4.$-!(&ne%: a si$ple NG! scenario
A
/
!
G
5
7
legend:
custo$er
network:
provider
network

:#N#. are provider networks

<#5#H are custo$er (o% provider networks)

< is dual&ho$ed: attached to two networks


< does not want to route %ro$ N via < to .
++ so < will not advertise to N a route to .
")
NG!: controlling who routes to you

Figure 4.$-!(&ne%: a si$ple NG! scenario
A
/
!
G
5
7
legend:
custo$er
network:
provider
network

: advertises to N the path :5

N advertises to 5 the path N:5

/hould N advertise to . the path N:5(


No wayG N gets no 6revenue7 %or routing .N:5 since neither 5 nor .
are N's custo$ers
N wants to %orce . to route to w via :
N wants to route only toF%ro$ its custo$ersG
"3
NG! operation
4: 5hat does a NG! router do(

Aeceiving and %iltering route advertise$ents %ro$ directly


attached neighbor(s)+

Aoute selection+
;o route to destination <# which path )o% several
advertised) will be taken(

/ending route advertise$ents to neighbors+


"9
NG! $essages

NG! $essages e?changed using ;.!+

NG! $essages:
O!1N: opens ;.! connection to peer and authenticates
sender
R!2:;1: advertises new path (or withdraws old)
O11!:L-1 keeps connection alive in absence o%
R!2:;1/T also :.Os O!1N re,uest
NO;*.:;ON: reports errors in previous $sgT also used
to close connection
""
5hy di%%erent ntra& and nter&:/ routing (
!olicy:

nter&:/: ad$in wants control over how its tra%%ic routed# who
routes through its net+

ntra&:/: single ad$in# so no policy decisions needed


/cale:

hierarchical routing saves table siDe# reduced update tra%%ic


&er)ormane:

ntra&:/: can %ocus on per%or$ance

nter&:/: policy $ay do$inate over per%or$ance


"=
Aouter :rchitecture Overview
;wo key router %unctions:

run routing algorith$sFprotocol (A!# O/!*# NG!)

switching datagra$s %ro$ inco$ing to outgoing link


">
nput !ort *unctions
*eentrali+ed s%ithing:

given datagra$ dest+# lookup output port using


routing table in input port $e$ory

goal: co$plete input port processing at Eline


speed'

,ueuing: i% datagra$s arrive %aster than


%orwarding rate into switch %abric
<hysical layer:
bit:level reception
#ata link layer:
e.g.4 .thernet
"@
nput !ort 4ueuing

*abric slower that input ports co$bined &Q ,ueueing $ay


occur at input ,ueues

Lead&o%&the&Line (LOL) blocking: ,ueued datagra$ at %ront


o% ,ueue prevents others in ,ueue %ro$ $oving %orward

#ueueing delay and loss due to input buffer overflow$


=C
;hree types o% switching %abrics
=1
/witching -ia 0e$ory
*irst generation routers:

packet copied by syste$'s (single) .!R

speed li$ited by $e$ory bandwidth (2 bus crossings per


datagra$)
nput
!ort
Output
!ort
0e$ory
/yste$ Nus
0odern routers:

input port processor per%or$s lookup# copy into $e$ory

.isco .atalyst >9CC


=2
/witching -ia Nus

datagra$ %ro$ input port $e$ory


to output port $e$ory via a shared
bus

bus contention: switching speed


li$ited by bus bandwidth

1 Gbps bus# .isco 1@CC: su%%icient


speed %or access and enterprise
routers (not regional or backbone)
=)
/witching -ia :n nterconnection Network

overco$e bus bandwidth li$itations

Nanyan networks# other interconnection nets initially


developed to connect processors in $ultiprocessor

:dvanced design: %rag$enting datagra$ into %i?ed length


cells# switch cells through the %abric+

.isco 12CCC: switches Gbps through the interconnection


network
=3
Output !orts

%uffering re,uired when datagra$s arrive %ro$ %abric


%aster than the trans$ission rate

Scheduling discipline chooses a$ong ,ueued datagra$s


%or trans$ission
=9
Output port ,ueueing

bu%%ering when arrival rate via switch e?ceeds output line


speed

#ueueing &delay' and loss due to output port buffer


overflow$
="
!v"

nitial $otivation: )2&bit address space co$pletely


allocated within couple o% yearsG

:dditional $otivation:
header %or$at helps speed processingF%orwarding
header changes to %acilitate 4o/
new 6anycast7 address: route to 6best7 o% several replicated
servers

!v" datagra$ %or$at:


%i?ed&length 3C byte header
no %rag$entation allowed
==
!v" Leader (.ont)
<riority: identi$y priority among datagrams in $low
0low @abel: identi$y datagrams in same )$low.*
+ )$low* yet to be standardiEed-.
AeBt header: identi$y upper layer protocol $or data
=>
Other .hanges %ro$ !v3

Checksum: re$oved entirely to reduce processing


ti$e at each hop

(ptions: allowed# but outside o% header# indicated


by 6Ne?t Leader7 %ield

)C*Pv+: new version o% .0!


additional $essage types# e+g+ 6!acket ;oo Nig7
$ulticast group $anage$ent %unctions
=@
;ransition *ro$ !v3 ;o !v"

Not all routers can be upgraded si$ultaneous


no 6%lag days7
Low will the network operate with $i?ed !v3 and
!v" routers(

;wo proposed approaches:


,ual Stack: so$e routers with dual stack (v"# v3) can
6translate7 between %or$ats
-unneling: !v" carried as payload in !v3 datagra$
a$ong !v3 routers
>C
2ual /tack :pproach
>1
;unneling
I<v% inside I<v where needed
>2
Network Layer :ctivities && 0obility

;ypes o% 0obility
& 0oving under sa$e network while syste$ is ON
& 0oving through di%%erent networks while syste$
is ON
& /witching O** the syste$ while $oving %ro$
one network to other network

!er$anent ! address or te$porary ! address &&


$ainly depends on types o% application: ;.!
service pre%ers per$anent addressS+

5hat is ad-hoc networking(


>)
0obility 0anage$ent
Home Network
128.119.40/24
Correspondent
>3
0obility 0anage$ent: (.ontd+)

Lo$e network

Lo$e agent

*oreign network U visited network

*oreign agent

:ddressing:
& !er$anent address
& *oreign :ddress: .are&o% address (.O:)

;ypes o% Aouting to 0obile Node


& ndirect routing
& 2irect Aouting
>9
ndirect Aouting to a 0obile Node
@o(e Net&or-
12$?11%?4)+24
Aer(anent Address
12$?11%?4)?1$!
@o(e A8ent
>isited Net&or-:
#%?12%?13+24
Ko9ile node
Aer(anent Address
12$?11%?4)?1$!
Lide Area
Net&or-
1orrespondent
2
1
3
4
2orei8n a8ent
1are of
address
#%?12%?13?2
>"
ndirect Aouting: (.ontd+)

0obile node&to&%oreign agent protocol

*oreign agent&to&ho$e agent registration protocol

Lo$e&agent 2atagra$ encapsulation protocolU


;unneling o% datagra$

*oreign&agent decapsulation protocol

ndirect routing results in triangular routing


proble$s 2irect routing ($ore co$ple?G)
>=
1ncapsulation and 2ecapsulation in
$obile network
Aer(anent Address
12$?11%?4)?1$!
@o(e A8ent
Ko9ile node
Aer(anent Address
12$?11%?4)?1$!
1orrespondent
Dest: 12$?11%?4)?1$!
Dest: 12$?11%?4)?1$!
Dest: 12$?11%?4)?1$! dest: #%?12%?13?2
2orei8n a8ent
1are of address
#%?12%?13?2
Encapsulation and ecapsulation
>>
2irect Aouting to a $obile node
@o(e Net&or-
12$?11%?4)+24
Aer(anent Address
12$?11%?4)?1$!
@o(e A8ent
>isited Net&or-:
#%?12%?13+24
Ko9ile node
Aer(anent Address
12$?11%?4)?1$!
Lide Area
Net&or-
1orrespondent
1
2
1orrespondent A8ent
3
2orei8n A8ent
4
irect !outin" to a #o$ile user
>@
0obile !

:gent 2iscovery U agent advertise$ent# agent


solicitation

Aegistration with Lo$e Network U done by


%oreign agent or $obile node

ndirect routing o% 2atagra$


@C
Network Layer: su$$ary
5hat we've covered:

network layer services

routing principles: link state and


distance vector

hierarchical routing

nternet routing protocols reliable


trans%er
intra&do$ain: A!# O/!*
inter&do$ain: NG!

!v"

Aouting o% $obile node

Você também pode gostar