Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Ch
Network Layer
Computer Networking:
A Top
T Down
D
Approach
A
h
5th edition.
Jim Kurose, Keith Ross
Addis W sl
Addison-Wesley,
April
A il
2009.
Network Layer
4-1
services:
network
4-2
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
Network Layer
4-3
Network layer
transport segment from
application
transport
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
network
t
k
data link
data link
physical
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
Network Layer
application
transport
network
data link
physical
4-4
routing: determine
route taken by
packets from source
to dest.
dest
routing
g
analogy:
routing: process of
forwarding
forwarding: process
of getting through
single interchange
algorithms
g
Network Layer
4-5
3
2
2
1
value in arriving
packets
k t h
header
d
0111
1
3 2
Network Layer
4-6
Connection setup
3rdd important
i
f
function
i iin
some network
k architectures:
hi
ATM,
Network Layer
4-7
Example
E
l services
i
for
f a
flow of datagrams:
in-order
in order datagram
delivery
guaranteed minimum
bandwidth to flow
restrictions on
changes in interpacket spacing
Network Layer
4-8
Service
Model
Guarantees ?
Congestion
Bandwidth Loss Order Timing feedback
b t effort
best
ff t none
ATM
CBR
ATM
VBR
ATM
ABR
ATM
UBR
constant
rate
guaranteed
rate
guaranteed
minimum
o e
none
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
no
no (inferred
(i f
d
via loss)
no
congestion
no
congestion
g
yes
o
no
yes
no
no
Network Layer
4-9
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
connectionless service
VC network provides network-layer
connection service
analogous to the transport-layer services,
but
but:
service:
host-to-host
no choice: network provides one or the other
implementation: in network core
Network Layer
4-11
Virtual circuits
source
source-to-dest
to dest path behaves much like telephone
circuit
performance wise
performance-wise
network actions along source-to-dest path
address)
dd
)
every router on source-dest path maintains state for
each p
passing
g connection
link, router resources (bandwidth, buffers) may be
allocated to VC (dedicated resources = predictable service)
Network Layer 4-12
VC implementation
a VC consists of:
f
1.
2.
3.
packet
k belonging
b l
i to VC carries
i VC number
b
Forwarding
g table
VC number
22
12
Forwarding
F
din ttable
bl in
northwest router:
I
Incoming
i iinterface
t f
1
2
3
1
32
interface
number
I
Incoming
i VC #
12
63
7
97
Outgoing
O t i interface
i t f
3
1
2
3
Outgoing
O t i VC #
22
18
17
87
application
5 Data flow begins
transport 5.
network 4. Call connected
data link 1. Initiate call
physical
h i l
pp
6 Receive data application
6.
3. Accept call
2. incoming call
transport
network
data link
physical
Datagram networks
no call setup at network layer
routers: no state about end-to-end
end to end connections
no network-level concept of connection
packets forwarded using destination host address
packets between same source-dest pair may take
different paths
application
transport
network
1 S
Send
dd
data
t
d t li
data
link
k 1.
physical
application
transport
network
2. Receive data
data link
physical
Network Layer 4-16
Forwarding table
Destination Address Range
4 billion
possible entries
Link Interface
otherwise
th i
3
Network Layer 4-17
Link Interface
0
1
2
3
Examples
D 11001000 00010111 00010110 10100001
DA:
DA: 11001000 00010111 00011000 10101010
Whi h interface?
Which
i t f
?
Which interface?
ATM (VC)
evolved from telephony
computers
human conversation:
elastic service, no strict
strict timing, reliability
timing req.
requirements
smart
smart end systems
need for guaranteed
(computers)
service
can adapt, perform
dumb
dumb end systems
control, error recovery
telephones
simple inside network,
complexity inside
complexity at edge
edge
network
many link types
different characteristics
uniform service difficult
Network Layer 4-19
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
forwarding
forward
ng datagrams from incoming
ncom ng to outgo
outgoing
ng llink
nk
Physical layer:
bit-level reception
Data link layer:
e g Ethernet
e.g.,
see chapter 5
Decentralized switching:
Three types
yp of switching
g fabrics
Memory
Output
Port
System Bus
Output Ports
output
t t li
line speed
d
buffering
g equal
q
to RTT. C
N flows,
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
Network
N
t
k
layer
IP protocol
addressing conventions
datagram
g
format
packet handling conventions
Routing protocols
path selection
RIP
RIP, OSPF
OSPF, BGP
forwarding
table
ICMP protocol
error reporting
router signaling
Link layer
physical layer
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
IP datagram format
IP protocol version
number
g
header length
(bytes)
type of data
max number
remaining hops
(decremented at
each router)
upper layer protocol
to deliver payload to
32 bits
yp of
f
head.
h
a . type
l
length
h
ver
len service
fragment
16-bit identifier flgs
offset
upper
ti
time
to
t
header
h
d
layer
live
checksum
total datagram
length (bytes)
for
fragmentation/
reassembly
data
(variable length,
typically
ll a TCP
P
or UDP segment)
E.g.
g timestamp,
p,
record route
taken, specify
list of routers
to visit.
((max.transfer
t
f size)
i ) - largest
l
t
possible link-level frame.
different link types,
diff
different
t MTU
MTUs
large IP datagram divided
(fragmented) within net
one datagram becomes
several datagrams
reassembled only
y at final
destination
IP header bits used to
fy, order related
identify,
fragments
fragmentation:
in: one large
l
datagram
d
out: 3 smaller datagrams
reassembly
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
IP Addressing: introduction
IP address: 32-bit
223.1.1.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.1
223.1.2.9
223.1.3.27
223.1.2.2
Subnets
IP address:
subnet part (high
order bits)
host
h t partt (low
(l
order
d
bits)
Whatss a subnet ?
What
223.1.1.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.1
223.1.2.9
223.1.3.27
223.1.2.2
subnet
223.1.3.1
223.1.3.2
network
k consisting of
f 3 subnets
b
Subnets
Recipe
R
cip
To determine the
subnets detach each
subnets,
interface from its
host or router,,
creating islands of
isolated networks.
E h isolated
Each
i l
d network
k
is called a subnet.
223.1.1.0/24
223.1.2.0/24
223.1.3.0/24
Subnets
223.1.1.2
How many?
y
223.1.1.1
223.1.1.4
223.1.1.3
223.1.9.2
223.1.7.0
223.1.9.1
223.1.7.1
223.1.8.1
223.1.8.0
223.1.2.6
223.1.2.1
223.1.3.27
223.1.2.2
223.1.3.1
223.1.3.2
IP addressing: CIDR
CIDR: Classless InterDomain Routing
subnet
subnet
part
host
part
DHCP overview:
host broadcasts DHCP discover msg [optional]
DHCP server responds with DHCP offer msg
[optional]
l
host requests IP address: DHCP request msg
DHCP server sends address: DHCP ack msg
Network Layer 4-44
DHCP client-server
li t
scenario
i
A 223.1.1.1
223.1.1.2
223.1.1.4
223.1.1.3
223.1.3.1
223.1.2.1
DHCP
server
223.1.2.9
223.1.3.27
223.1.2.2
223.1.3.2
arriving DHCP
client needs
address
dd
iin thi
this
network
DHCP discover
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
arriving
client
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
time
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
DHCP: example
connecting laptop needs its
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
168 1 1 1
168.1.1.1
router
(runs DHCP)
Ethernet demuxed
demux ed to IP
DHCP: example
DCP server formulates
DHCP
UDP
IP
Eth
Phy
DHCP
DHCP
DHCP
DHCP
encapsulation of DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
DHCP
UDP
IP
Eth
Phy
router
(runs DHCP)
DHCP: wireshark
output (home LAN)
Message type: Boot Request (1)
Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x6b3a11b7
Seconds elapsed: 0
B t flags:
Bootp
fl
0
0x0000
0000 (Unicast)
(U i
t)
Client IP address: 0.0.0.0 (0.0.0.0)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
Next server IP address: 0.0.0.0 (0.0.0.0)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Client MAC address: Wistron
Wistron_23:68:8a
23:68:8a (00:16:d3:23:68:8a)
Server host name not given
Boot file name not given
Magic cookie: (OK)
Option: (t=53,l=1) DHCP Message Type = DHCP Request
Option: (61) Client identifier
Length: 7; Value: 010016D323688A;
Hardware type: Ethernet
Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a)
Option: (t=50,l=4) Requested IP Address = 192.168.1.101
Option:
p
((t=12,l=5)
, ) Host Name = "nomad"
Option: (55) Parameter Request List
Length: 11; Value: 010F03062C2E2F1F21F92B
1 = Subnet Mask; 15 = Domain Name
3 = Router; 6 = Domain Name Server
44 = NetBIOS over TCP/IP Name Server
request
reply
py
200.23.16.0/20
Organization 0
Organization 1
Organization 2
...
200
200.23.16.0/23
23 16 0/23
200.23.18.0/23
200.23.20.0/23
.
Organization 7
200.23.30.0/23
200.23.16.0/23
Organization 1
200.23.18.0/23
Organization 2
200.23.20.0/23
Organization 7
.
.
.
.
.
.
Fly-By-Night-ISP
Send
Send me anything
with addresses
beginning
200.23.16.0/20
Internet
200.23.30.0/23
ISPs-R-Us
Send me anything
with addresses
beginning
199.31.0.0/16
199.31.0.0/16
Network Layer 4-52
H rar
Hierarchical
a a
addressing:
r
ng m
more
r specific
p f
routes
ISPs-R-Us has a more specific route to Organization 1
Organization 0
200.23.16.0/23
Organization 2
200.23.20.0/23
Organization 7
.
.
.
.
.
.
Fly-By-Night-ISP
Send me anything
with addresses
beginning
200.23.16.0/20
Internet
200.23.30.0/23
ISPs-R-Us
Organization 1
200.23.18.0/23
Send me anything
with addresses
beginning 199.31.0.0/16
or 200.23.18.0/23
local network
(e.g., home network)
10.0.0/24
10.0.0.4
10.0.0.1
10.0.0.2
138 76 29 7
138.76.29.7
10.0.0.3
#) of every
y outgoing
g g datagram
g
to (NAT IP address,
new port #)
. . . remote clients/servers will respond using (NAT
IP address, new port #) as destination addr.
remember
IP address,
address port #) to (NAT IP address
address, new port #)
translation pair
incoming
i
i
d
datagrams: replace
l
(NAT IP address,
dd
new
1: host 10.0.0.1
10 0 0 1
sends datagram to
128.119.40.186, 80
S: 10.0.0.1, 3345
D: 128.119.40.186, 80
S: 138.76.29.7, 5001
D: 128.119.40.186, 80
138.76.29.7
S: 128.119.40.186, 80
D: 138.76.29.7, 5001
3: Reply arrives
dest. address:
138.76.29.7, 5001
1
10.0.0.4
S: 128.119.40.186, 80
D: 10.0.0.1, 3345
10 0 0 1
10.0.0.1
10.0.0.2
10.0.0.3
. . .
4: NAT router
changes datagram
dest addr from
138 76 29 7 5001 to 10
138.76.29.7,
10.0.0.1,
0 0 1 3345
Network Layer 4-58
IPv6
shortage
sh t
should
sh uld instead
inst d be
b solved
s lv d by
b
solution 1: statically
configure
g
NAT to forward
incoming connection
requests at given port to
server
10.0.0.1
138.76.29.7
10.0.0.4
NAT
router
10.0.0.1
IGD
10.0.0.4
138.76.29.7
NAT
router
3. relaying
established
1. connection to
relay
l initiated
initi t d
by NATted host
138.76.29.7
10.0.0.1
NAT
router
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
communicate network-level
information
error reporting:
unreachable host, network,
port, protocol
echo request/reply (used
by ping)
network-layer
y above IP:
ICMP msgs carried in IP
datagrams
ICMP message
message: type, code plus
first 8 bytes of IP datagram
causing error
Type
0
3
3
3
3
3
3
4
Code
0
0
1
2
3
6
7
0
8
9
10
11
12
0
0
0
0
0
description
echo reply (ping)
dest. network unreachable
dest host unreachable
dest protocol unreachable
dest p
port unreachable
dest network unknown
dest host unknown
source quench (congestion
control - not used)
echo request (ping)
route advertisement
router discovery
TTL expired
bad IP header
Network Layer 4-64
to nth router:
When
Wh ICMP message
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
IPv6
Initial motivation: 32
32-bit
bit address space soon
to be completely allocated.
Additional motivation:
header
message types,
types e.g.
e g Packet
Packet Too Big
Big
multicast group management functions
Tunneling
Logical view:
Ph i l view:
Physical
i
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
IPv6
tunnel
IPv4
IPv4
Tunneling
Logical view:
Ph i l view:
Physical
i
IPv6
IPv6
IPv6
IPv6
IPv4
Flow: X
Src: A
Dest: F
data
A-to-B:
IPv6
IPv6
IPv6
IPv4
IPv6
IPv6
tunnel
Src:B
Dest: E
Src:B
Dest: E
Flow: X
Src: A
Dest: F
Flow: X
Src: A
Dest: F
data
data
B-to-C:
IPv6 inside
IPv4
B-to-C:
t
IPv6 inside
IPv4
Flow: X
Src: A
Dest: F
data
E-to-F:
IP 6
IPv6
Network Layer 4-72
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5 Routing
R
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
3
2
2
1
value in arriving
packets header
0111
1
3 2
Graph abstraction
5
2
2
1
Graph: G = (N
(N,E)
E)
w
3
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) }
Remark: Graph abstraction is useful in other network contexts
Example: P2P, where N is set of peers and E is set of TCP connections
Network Layer 4-75
v
2
w
3
- e.g., c(w,z) = 5
Routing
g algorithm:
g
algorithm
g
that finds least-cost p
path
Network Layer 4-76
Static or dynamic?
Static:
routes change slowly
over time
Dynamic:
routes change more
quickly
q
y
periodic update
in
n response to llink
nk
cost changes
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
A Link
Link-State
State Routing Algorithm
Dijk
Dijkstras
algorithm
l
i h
net topology, link costs
Notation:
N
i
c(x,y): link cost from node
x to y; = if not direct
neighbors
Dijsktrass Algorithm
Dijsktra
1 Initialization:
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 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
N'
Network Layer 4-80
N
N'
u
ux
uxy
uxyv
uxyvw
uxyvwz
D(v),p(v)
D(v)
p(v) D(w)
D(w),p(w)
p(w)
2,u
5,u
2,u
4,x
2
2,u
3
3,y
3,y
D(x),p(x)
D(x)
p(x)
1,u
D(y),p(y)
D(y)
p(y)
2,x
D(z) p(z)
D(z),p(z)
4,y
4
4,y
4,y
5
2
v
2
w
3
2
Network Layer 4-81
z
x
link
v
x
(u,v)
(u x)
(u,x)
(u,x)
((u,x)
, )
(u,x)
Dijkstrass algorithm,
Dijkstra
algorithm discussion
Algorithm
g
complexity:
p
y n nodes
each iteration: need to check all nodes, w, not in N
n(n+1)/2 comparisons: O(n2)
more efficient implementations possible: O(nlogn)
p
Oscillations possible:
e.g., link cost = amount of carried traffic
D
1
1
0
A
0 0
1+e
initially
2+e
0
1
A
1+e 1
recompute
p
routing
A
0 0
2+e
C 1+e
recompute
p
2+e
A
1+e 1
recompute
p
Network Layer 4-83
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
Bellman-Ford example
5
2
v
2
w
3
c(x,v)
Node x maintains distance vector Dx =
[Dx(y): y N ]
Node x also maintains its neighbors
neighbors
distance vectors
For
each neighbor v,
v x maintains
Dv = [Dv(y): y N ]
Network Layer 4-87
Dx(y) minv{{c(x,v)
( , ) + Dv(y)}
Distributed:
each node notifies
neighbors
i hb
only
l when
h its
i DV
changes
neighbors
g
then notify
y
their neighbors if
necessary
Each node
node:
wait for (change in local link
cost or msg from neighbor)
recompute estimates
if DV to any dest has
changed notify neighbors
changed,
node x table
cost to
x y z
= min{2+1 , 7+0} = 3
cost to
x y z
from
from
x 0 2 7
y
z
node y table
cost to
x y z
Dx(z) = min{c(x,y) +
Dy(z), c(x,z) + Dz(z)}
x 0 2 3
y 2 0 1
z 7 1 0
x
y 2 0 1
z
node z table
cost to
x y z
f
from
from
x
y
z 71 0
time
y
7
node x table
cost to
x y z
x
y
z 71 0
from
from
from
from
x 0 2 7
y 2 0 1
z 7 1 0
cost to
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
cost to
x y z
x 0 2 3
y 2 0 1
z 3 1 0
y
7
cost to
x y z
from
from
f
from
x
y 2 0 1
z
node z table
cost to
x y z
x 0 2 3
y 2 0 1
z 7 1 0
= min{2+1 , 7+0} = 3
cost to
x y z
cost to
x y z
from
from
x 0 2 7
y
z
node y table
cost to
x y z
cost to
x y z
Dx(z) = min{c(x,y) +
Dy(z), c(x,z) + Dz(z)}
x 0 2 3
y 2 0 1
z 3 1 0
time
distance vector
if DV changes, notify neighbors
good
news
travels
fast
fast
y
50
countt to
t iinfinity
fi it problem!
bl !
44 iterations before
algorithm
g
stabilizes: see
text
60
y
50
Poisoned reverse:
If Z routes through Y to
get to X :
Speed of Convergence
LS: O(n
( 2) algorithm
g
requires
q
O(nE) msgs
may have oscillations
DV:
DV convergence time
ti
varies
i
may be routing loops
count
count-to-infinity
to infinity problem
DV:
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5 Routing
R
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
Hierarchical Routing
Our routing study thus far - idealization
all routers identical
network flat
flat
not true in practice
scale: with 200 million
destinations:
cant store all dests in
routing tables!
routing table exchange
would swamp links!
administrative autonomy
internet = network of
networks
each network admin may
want to control routing in its
own network
Hierarchical Routing
aggregate routers into
regions, autonomous
systems
y t m (AS)
( )
routers in same AS run
same routing
g protocol
p
Gateway router
G
Direct link to router in
th AS
another
intra-AS routing
protocol
r ut rs in diff
routers
different
r nt AS
can run different intraAS routing protocol
Interconnected ASes
3c
3b
3a
AS3
1a
2a
1c
1d
d
1b
Intra-AS
Routing
algorithm
2c
AS2
AS1
Inter-AS
Routing
algorithm
Forwarding
table
2b
forwarding table
configured by both
intra- and inter-AS
routing algorithm
Inter-AS tasks
AS1 must
must:
1. learn which dests are
reachable through
AS2 which
AS2,
hi h through
h
h
AS3
2 propagate this
2.
reachability info to all
routers in AS1
Job of inter-AS routing!
receives datagram
d
destined
d outside
d of
f
AS1:
router should
forward packet to
gateway router, but
which one?
3c
3a
3b
AS3
1a
a
2a
1c
1d
1b
2c
AS2
2b
AS11
Network Layer 4-99
inter-AS p
protocol propagates
p p g
reachability
y info to all
internal routers.
router 1d determines from intra-AS routing info that
its interface I is on the least cost path to 1c.
installs forwarding table entry (x,I)
x
3c
3a
3
3b
AS3
1
1a
2a
1c
1d
1b AS1
2c
2b
AS2
Network Layer 4-100
3c
3a
3b
AS3
1a
2a
1
1c
1d
1b
2c
AS2
2b
AS1
Network Layer 4-101
Determine from
forwarding table the
interface I that leads
to least-cost gateway.
Enter (x,I) in
forwarding table
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
Intra-AS
Intra
AS Routing
also
l known
k
as Interior
I
i G
Gateway Protocols
P
l (IGP)
most common Intra-AS routing protocols:
RIP:
OSPF:
OSPF
Open
O
Shortest
Sh t t Path
P th First
Fi t
IGRP:
Interior Gateway
y Routing
g Protocol (Cisco
(
proprietary)
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
x
y
destination hops
u
1
v
2
w
2
x
3
y
3
z
2
RIP advertisements
distance
d
vectors: exchanged
h
d among
RIP: Example
z
w
C
Destination Network
w
y
z
x
Next Router
....
A
B
B
--
2
2
7
1
R ti /F
Routing/Forwarding
di ttable
bl iin D
Network Layer 4-108
RIP: Example
Dest
w
x
z
.
Next
C
hops
1
1
4
...
Advertisement
from A to D
f
z
x
Destination Network
w
y
z
x
Next Router
Num
Num. of hops to dest
dest.
....
A
B
B A
--
Routing/Forwarding table in D
2
2
7 5
1
routed
Transprt
(UDP)
network
(IP)
link
physical
Transprt
(UDP)
forwarding
t bl
table
forwarding
t bl
table
network
(IP)
link
physical
Network Layer 4-111
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
router
t
advertisements disseminated to entire AS (via
flooding)
OSPF advanced
advanced features (not in RIP)
security: all OSPF messages authenticated (to
Hi
Hierarchical
hi l OSPF
Hierarchical OSPF
two-level hierarchy: local area
area, backbone
backbone.
Link-state
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
Internet inter
inter-AS
AS routing: BGP
BGP (Border
(B d Gateway
G t
Protocol):
P t
l)
th de
the
d
facto standard
BGP provides
id each
h AS a means to:
t
1.
2.
3.
BGP basics
pairs of routers (BGP peers) exchange routing info
3c
3a
3b
AS3
1a
AS1
iBGP session
2a
1c
1d
1b
2c
AS2
2b
Distributing
g reachability
y info
using eBGP session between 3a and 1c, AS3 sends
3c
3a
3b
AS3
1a
AS1
iBGP session
2a
1c
1d
1b
2c
AS2
2b
two
t
iimportant
t t attributes:
tt ib t
AS-PATH: contains ASs through which prefix
advertisement has passed: e
e.g,
g AS 67
67, AS 17
NEXT-HOP: indicates specific internal-AS router
to next
next-hop
hop AS. (may be multiple links from
current AS to next-hop-AS)
when g
gateway
y router receives route
local p
preference value attribute: policy
p
y
decision
shortest AS-PATH
closest NEXT-HOP router: hot potato routing
additional criteria
BGP messages
BGP messages exchanged using TCP.
TCP
BGP messages:
OPEN:
B
W
p
provider
network
customer
network:
C
Y
B
W
p
provider
network
customer
network:
C
Y
A advertises path AW to B
B advertises path BAW to X
Should B advertise path BAW to C?
No
Scale:
hierarchical routing saves table size, reduced update
traffic
Performance:
Intra-AS: can focus on performance
Inter-AS: policy may dominate over performance
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing
Broadcast Routing
g
deliver packets from source to all other nodes
source duplication
d li ti is
i iinefficient:
ffi i t
duplicate
duplicate
creation/transmission
R1
duplicate
R2
R2
R3
R1
R4
source
duplication
R3
R4
in-network
duplication
determine recipient
p
addresses?
In-network duplication
flooding:
fl di
when
h node
d receives
i
b
brdcst
d t pckt,
kt
cycles
l s & broadcast
b
d st storm
st
if it hasn
hasntt brdcst same packet before
Node
spanning tree
No redundant p
packets received by
y any
y node
Spanning Tree
First
F
construct a spanning tree
Nodes forward copies
p
only
y along
g spanning
p
g
tree
A
B
c
D
F
G
D
G
Spanning
p
g Tree: Creation
Center node
Each node sends unicast join message to center
node
Message
M
ss
forwarded
f
d d until
ntil it arrives
i s att a node
n d already
l
d
belonging to spanning tree
A
A
3
c
4
c
D
Shared tree
Source-based trees
A
Approaches
h s for
f b
building
ildi mcast
st ttreess
Approaches:
h
source-based tree: one tree p
per source
shortest
path trees
reverse p
path forwarding
g
group-shared tree: group uses one tree
minimal spanning (Steiner)
center-based trees
algorithm
l
i h
S: source
LEGEND
R1
1
R4
R2
3
R3
5
4
R6
R5
6
R7
LEGEND
R1
R4
R2
R5
R3
R6
R7
group members
no need to forward datagrams down subtree
prune
p
msgs
ms s sent
s t upstream
pst
m by
b router
t with
ith no
downstream group members
LEGEND
S: source
R1
R4
R2
P
R5
R3
R6
P
R7
Shared-Tree:
Shared
Tree: Steiner Tree
Steiner Tree: minimum cost tree
complexity
information about entire network needed
monolithic: rerun whenever a router needs to
join/leave
Center-based trees
single
l d
delivery
l
tree shared
h
d by
b all
ll
one router identified as
center of tree
to join:
edge router sends unicast join
join-msg
msg addressed
to center router
j
join-msg
g processed
p
by
y intermediate routers
and forwarded towards center
j
join-msg
g either hits existing
g tree branch for
this center, or arrives at center
path taken by join-msg becomes new branch of
tree for this router
R4
3
R2
2
R5
R3
R6
R7
I t
Internet
t Multicasting
M lti
ti R
Routing:
ti
DVMRP
DVMRP:
D
P distance
d
vector multicast
l
routing
protocol, RFC1075
flood and prune: reverse path forwarding,
source-based tree
RPF
DVMRP: continued
continued
soft
Tunneling
Q: How to connect islands
islands of multicast
routers in a sea of unicast routers?
physical topology
logical topology
addressed)) datagram
g
normal IP datagram sent thru tunnel via regular IP unicast to
receiving mcast router
receiving
i i mcastt router
t unencapsulates
l t tto gett mcastt d
datagram
t
PIM Protocol
PIM:
P t
l Independent
I d
d t Multicast
M lti
t
not dependent on any specific underlying unicast
Dense:
Sparse:
group members
densely packed,
packed in
close proximity.
bandwidth more
plentiful
C
Consequences
of
f Sparse-Dense
S
D
Dichotomy:
Di h t
Dense
group membership by
Sparse:
no membership until
routers
t
assumed
d until
til
routers
t
explicitly
li itl jjoin
i
routers explicitly prune receiver- driven
data-driven
data driven construction construction of mcast
on mcast tree (e.g., RPF)
tree (e.g., center-based)
bandwidth and non
non bandwidth and non
non-groupgroup
group-router processing
router processing
profligate
conservative
PIM Dense
PIMD s Mode
M d
flood-and-prune RPF, similar to DVMRP but
underlying
y g unicast protocol
p
provides
p
RPF info
join msg
tto rendezvous
d
s point
i t
(RP)
R4
join
intermediate routers
update state and
forward join
after
f
joining via RP,
R1
R2
R3
join
R5
jjoin
R6
all
ll d
data
t multicast
lti
t
from rendezvous
point
R7
rendezvous
point
no one is listening!
R1
R4
join
R2
R3
join
R5
jjoin
R6
all
ll d
data
t multicast
lti
t
from rendezvous
point
R7
rendezvous
point
Chapter 4: summary
4.
4 1 Introduction
I
d
i
4.2 Virtual circuit and
datagram
d
t
networks
t
ks
4.3 Whats inside a
router
4.4 IP: Internet
Protocol
Datagram format
IPv4 addressing
g
ICMP
IPv6
4
4.5
5R
Routing
i algorithms
l
i h
Link state
Distance Vector
Hierarchical routing
4.6
4 6 Routing in the
Internet
RIP
OSPF
BGP
4.7
4 B
Broadcast
d
and
d
multicast routing