Professional Documents
Culture Documents
Network Layer
value in arriving
packets header
0111 1
3 2
call setup, teardown for each call before data can flow
each packet carries VC identifier (not destination host
address)
every router on source-dest path maintains state for
each passing connection
link, router resources (bandwidth, buffers) may be
allocated to VC (dedicated resources = predictable service)
1 3
2
VC number
interface
forwarding table in number
northwest router:
Incoming interface Incoming VC # Outgoing interface Outgoing VC #
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
application
6. receive data application
transport 5. data flow begins transport
network 4. call connected 3. accept call
network
data link 1. initiate call 2. incoming call
data link
physical physical
application application
transport transport
network 1. send datagrams 2. receive datagrams network
data link data link
physical physical
IP destination address in
arriving packets header
1
3 2
otherwise 3
otherwise 3
examples:
DA: 11001000 00010111 00010110 10100001 which interface?
DA: 11001000 00010111 00011000 10101010 which interface?
Network Layer 4-19
Datagram or VC network:
why?
Internet (datagram) ATM (VC)
data exchange among evolved from
computers telephony
elastic service, no strict human conversation:
timing req. strict timing, reliability
many link types requirements
different characteristics need for guaranteed
service
uniform service difficult dumb end systems
smart end systems telephones
(computers) complexity inside
can adapt, perform network
control, error recovery
simple inside network,
complexity at edge
forwarding data
plane (hardware)
high-seed
switching
fabric
physical layer:
bit-level reception
data link layer: decentralized switching:
e.g., Ethernet given datagram dest., lookup output
see chapter 5 port using forwarding table in input
port memory (match plus action)
goal: complete input port processing
at line speed
queuing: if datagrams arrive faster
than forwarding rate into switch fabric
Network Layer 4-23
Switching fabrics
transfer packet from input buffer to
appropriate output buffer
switching rate: rate at which packets
can be transfer from inputs to outputs
often measured as multiple of input/output line rate
N inputs: switching rate N times line rate desirable
three types of switching fabrics
memory
input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)
system bus
datagram
switch buffer link
fabric layer line
protocol termination
(send)
queueing
buffering required when datagrams arrive from fabric faster than the
transmission rate
scheduling discipline chooses among queued datagrams for transmission
switch
switch
fabric
fabric
switch switch
fabric fabric
physical layer
in: one large datagram
different link types, out: 3 smaller datagrams
different MTUs
large IP datagram
divided (fragmented)
within net reassembly
one datagram
becomes several
datagrams
reassembled only
at final destination
IP header bits used to
identify, order related
fragments
Network Layer 4-35
IP fragmentation,
reassembly
length ID fragflag offset
=4000 =x
example: =0 =0
4000 byte one large datagram becomes
datagram several smaller datagrams
MTU = 1500
bytes
1480 bytes in length ID fragflag offset
data field =1500 =x =1 =0
each isolated
network is called 223.1.3.0/24
a subnet
subnet mask: /24
Network Layer 4-41
Subnets 223.1.1.2
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.3.27
223.1.1.2
223.1.1.4 223.1.2.9
arriving DHCP
client needs
address in this
223.1.1.3 223.1.3.27
223.1.2.2 network
223.1.2.0/24
223.1.3.1 223.1.3.2
223.1.3.0/24
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
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
encapsulation of
DHCP DHCP DHCP server, frame
DHCP UDP forwarded to client,
DHCP IP
DHCP Eth router with DHCP
demuxing up to
Phy DHCP at client
DHCP server built into client now knows its
router IP address, name
and IP address of
DSN server, IP
address of its first-
hop router
LAN)
Message type: Boot Request (1)
Hardware type: Ethernet
Hardware address length: 6
Bootp flags: 0x0000 (Unicast)
Client IP address: 192.168.1.101 (192.168.1.101)
Your (client) IP address: 0.0.0.0 (0.0.0.0)
Hops: 0
Transaction ID: 0x6b3a11b7
request Next server IP address: 192.168.1.1 (192.168.1.1)
Relay agent IP address: 0.0.0.0 (0.0.0.0)
Seconds elapsed: 0 Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a)
Bootp flags: 0x0000 (Unicast) Server host name not given
Client IP address: 0.0.0.0 (0.0.0.0) Boot file name not given
Your (client) IP address: 0.0.0.0 (0.0.0.0) Magic cookie: (OK)
Next server IP address: 0.0.0.0 (0.0.0.0) Option: (t=53,l=1) DHCP Message Type = DHCP ACK
Relay agent IP address: 0.0.0.0 (0.0.0.0) Option: (t=54,l=4) Server Identifier = 192.168.1.1
Client MAC address: Wistron_23:68:8a (00:16:d3:23:68:8a) Option: (t=1,l=4) Subnet Mask = 255.255.255.0
Server host name not given Option: (t=3,l=4) Router = 192.168.1.1
Boot file name not given Option: (6) Domain Name Server
Magic cookie: (OK) Length: 12; Value: 445747E2445749F244574092;
Option: (t=53,l=1) DHCP Message Type = DHCP Request IP Address: 68.87.71.226;
Option: (61) Client identifier IP Address: 68.87.73.242;
Length: 7; Value: 010016D323688A; IP Address: 68.87.64.146
Hardware type: Ethernet Option: (t=15,l=20) Domain Name = "hsd1.ma.comcast.net."
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: (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
Organization 0
200.23.16.0/23
Organization 1
Send me anything
200.23.18.0/23 with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20
.
. . Internet
.
Organization 7 .
200.23.30.0/23
Send me anything
ISPs-R-Us
with addresses
beginning
199.31.0.0/16
Organization 0
200.23.16.0/23
Send me anything
with addresses
Organization 2 beginning
200.23.20.0/23 . Fly-By-Night-ISP 200.23.16.0/20
.
. . Internet
.
Organization 7 .
200.23.30.0/23
Send me anything
ISPs-R-Us
with addresses
Organization 1 beginning 199.31.0.0/16
or 200.23.18.0/23
200.23.18.0/23
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
2. connection
to 10.0.0.1
1. connection
relay initiated to
by client relay initiated
3. relaying by NATed host
client established
138.76.29.7 NAT
router
3 probes
Network Layer 4-66
IPv6: motivation
initial motivation: 32-bit address space
soon to be completely allocated.
additional motivation:
header format helps speed
processing/forwarding
header changes to facilitate QoS
data
32 bits
Network Layer 4-68
Other changes from IPv4
checksum: removed entirely to reduce
processing time at each hop
options: allowed, but outside of header,
indicated by Next Header field
ICMPv6: new version of ICMP
additional message types, e.g. Packet Too
Big
multicast group management functions
IPv6 datagram
IPv4 datagram
Network Layer 4-70
Tunneling
A B IPv4 tunnel E F
connecting IPv6 routers
logical view:
IPv6 IPv6 IPv6 IPv6
A B C D E F
physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
A B C D E F
physical view:
IPv6 IPv6 IPv4 IPv4 IPv6 IPv6
data data
A-to-B: E-to-F:
IPv6 B-to-C: B-to-C: IPv6
IPv6 inside IPv6 inside
IPv4 IPv4 Network Layer 4-72
Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and link state
datagram networks distance vector
4.3 whats inside a hierarchical routing
router 4.6 routing in the
4.4 IP: Internet Protocol Internet
datagram format RIP
IPv4 addressing OSPF
ICMP BGP
IPv6 4.7 broadcast and
multicast routing
IP destination 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), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
notes: 5
4
7
construct shortest path
8
tree by tracing
predecessor nodes u
3 w y z
ties can exist (can be 2
broken arbitrarily) 3
7 4
v
Network Layer 4-81
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 0
1
C C 0 1
C 1+e C 0
1
e
given these costs, given these costs, given these costs,
initially find new routing. find new routing.find new routing.
resulting in new costs resulting in new cost
resulting in new costs
Network Layer 4-84
Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and link state
datagram networks distance vector
4.3 whats inside a hierarchical routing
router 4.6 routing in the
4.4 IP: Internet Protocol Internet
datagram format RIP
IPv4 addressing OSPF
ICMP BGP
IPv6 4.7 broadcast and
multicast routing
let
dx(y) := cost of least-cost path from x to
y
v
then
dx(y) = min {c(x,v) + dvneighbor
cost from (y) } v to destinati
cost to neighbor v
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
from
y 2 0 1 7
z
node z cost to
table x y z
x
from
y
z 7 1 0
time
Network Layer 4-91
Dx(z) = min{c(x,y) +
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(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 7
from
y 2 0 1
z z 7 1 0 z 3 1 0
from
y 2 0 1 y 2 0 1
from
y
z z 3 1 0 z 3 1 0
7 1 0
time
Network Layer 4-92
Distance vector: link cost
changes
link cost changes: 1
node detects local link cost y
4 1
change x z
updates routing info, 50
recalculates
distance vector
if DV tchanges, notify
0 : y detects link-cost change, updates its DV, informs its
good
newsneighbors
neighbors.
travels t1 : z receives update from y, updates its table, computes new
fast least cost to x , sends its neighbors its DV.
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d forwarding table
configured by both
intra- and inter-AS
Intra-AS
Routing
Inter-AS
Routing
routing algorithm
algorithm algorithm intra-AS sets
Forwarding entries for internal
table dests
inter-AS & intra-AS
sets entries for
external dests
Network Layer 4-99
Inter-AS tasks
suppose router in AS1 must:
AS1 receives 1. learn which dests
datagram destined are reachable
outside of AS1: through AS2, which
router should through AS3
forward packet to 2. propagate this
gateway router, reachability info to
but which one? all routers in AS1
job of inter-AS routing!
3c
3a
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
3c x
3a
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
3c x
3b
3a
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
?
Network Layer 4-102
Example: choosing among multiple
ASes
now suppose AS1 learns from inter-AS protocol
that subnet x is reachable from AS3 and from AS2.
to configure forwarding table, router 1d must
determine towards which gateway it should
forward packets for dest x
this is also job of inter-AS routing protocol!
hot potato routing: send packet towards closest of
two routers.
Protocol)
included in BSD-UNIX distribution in 1982
distance vector algorithm
distance metric: # hops (max = 15 hops), each link has cost 1
DVs exchanged with neighbors every 30 sec in response message (aka
advertisement)
each advertisement: list of up to 25 destination subnets (in IP addressing sense)
z
w x y
A D B
C
routing table in router D
destination subnet next router # hops to dest
w A 2
y B 2
z B 7
x -- 1
. . ....
Network Layer 4-107
RIP: example
A-to-D advertisement
dest next hops
w - 1
x - 1
z C 4
. ... z
w x y
A D B
C
routing table in router D
destination subnet next router # hops to dest
w A 2
y B 2
A 5
z B 7
x -- 1
. . ....
Network Layer 4-108
RIP: link failure, recovery
if no advertisement heard after 180 sec -->
neighbor/link declared dead
routes via neighbor invalidated
new advertisements sent to neighbors
neighbors in turn send out new advertisements
(if tables changed)
link failure info quickly (?) propagates to entire
net
poison reverse used to prevent ping-pong
loops (infinite distance = 16 hops)
transport transprt
(UDP) (UDP)
network forwarding forwarding network
(IP) table table (IP)
link link
physical physical
backbone
area
border
routers
area 3
internal
area 1 routers
area 2
3c
3a BGP
3b message
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
eBGP session
3a iBGP session
3b
AS3 2c other
1c 2a networks
other 1a 2b
networks 1b AS2
AS1 1d
A advertises path AW to B
B advertises path BAW to X
Should B advertise path BAW to C?
No way! B gets no revenue for routing CBAW since
neither W nor C are Bs customers
B wants to force C to route to w via A
B wants to route only to/from its customers!
R3 R4 R3 R4
source in-network
duplication duplication
B B
c c
D D
F E F E
G G
(a) broadcast initiated at A (b) broadcast initiated at D
s: source LEGEND
R1 2 router with attached
1 R4
group member
R2 5 router with no attached
3 4 group member
R5
i link used for forwarding,
R3 6
i indicates order link
R6 R7 added by algorithm
LEGEND
dense: sparse:
group members # networks with group
densely packed, in members small wrt #
close proximity. interconnected
networks
bandwidth more
plentiful group members widely
dispersed
bandwidth not plentiful
Network Layer 4-141
Consequences of sparse-dense
dichotomy:
dense sparse:
group membership by no membership until
routers assumed until routers explicitly join
routers explicitly prune receiver- driven
data-driven construction of mcast
construction on mcast tree (e.g., center-
tree (e.g., RPF) based)
bandwidth and non- bandwidth and non-
group-router group-router processing
processing profligate conservative