Professional Documents
Culture Documents
segments to transport
physical physical
network
data link
layer network
physical
application
transport
network layer protocols in network
data link
physical
network
data link
network
data link
value in arriving
packet’s header
0111 1
3 2
application application
transport transport
network 1. send datagrams 2. receive datagrams network
data link data link
physical physical
IP destination address in
arriving packet’s header
1
3 2
otherwise 3
examples:
DA: 11001000 00010111 00010110 10100001 which interface?
DA: 11001000 00010111 00011000 10101010 which interface?
Network Layer 4-9
Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and link state
datagram networks distance vector
4.3 what’s inside a router hierarchical routing
4.4 IP: Internet Protocol 4.6 routing in the Internet
RIP
datagram format
OSPF
IPv4 addressing
BGP
ICMP
IPv6 4.7 broadcast and multicast
routing
layer forwarding
table
ICMP protocol
• error reporting
• router “signaling”
link layer
physical layer
…
frame 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-13
IP fragmentation, reassembly
length ID fragflag offset
example: =4000 =x =0 =0
4000 byte datagram
one large datagram becomes
MTU = 1500 bytes several smaller datagrams
223 1 1 1
that in chapter 5, 6.
223.1.3.27
223.1.1.3
223.1.2.2
to determine the
223.1.1.2 223.1.2.1
subnets, detach each 223.1.1.4 223.1.2.9
is called a subnet
223.1.3.0/24
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
subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
DHCP
223.1.1.0/24
server
223.1.1.1 223.1.2.1
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
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server! Here’s an IP
yiaddrr: 223.1.2.4
transaction ID: 654
address you can use
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
Broadcast: OK. I’ll take
yiaddrr: 223.1.2.4
that IP address!
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
Broadcast: OK. You’ve
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs
Network Layer 4-27
DHCP: more than IP addresses
DHCP can return more than just allocated IP address
on subnet:
address of first-hop router for client
name and IP address of DNS sever
network mask (indicating network versus host portion
of address)
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
2. connection to
relay initiated 1. connection to 10.0.0.1
by client relay initiated
by NATed host
3. relaying
client established
138.76.29.7 NAT
router
Network Layer
ICMP: internet control message protocol
Type Code description
0 0 echo reply (ping)
used by hosts & routers to 3 0 dest. network unreachable
communicate network- 3 1 dest host unreachable
level information 3 2 dest protocol unreachable
error reporting: unreachable 3 3 dest port unreachable
host, network, port, 3 6 dest network unknown
protocol 3 7 dest host unknown
echo request/reply (used by 4 0 source quench (congestion
ping) control - not used)
0 Redirect for network
network-layer “ above” 5
5 0 Redirect for host
IP: 5 0 Redirect for ToS & Network
ICMP msgs carried in IP 5 0 Redirect for ToS & host
datagrams 8 0 echo request (ping)
ICMP message: type, code 9 0 route advertisement
plus first 8 bytes of IP 10 0 router discovery
datagram causing error 11 0 TTL expired
12 0 bad IP header
13 0 Timestamp Network Layer 4-43
ICMP (ECHO) Header Format
IP Header (in blue):
protocol set to 1
(ICMP) and Type of
Service set to 0.
ICMP Header (in red):
Type (8 bits) Code (8
bits)
Checksum (16 bits)
Header Data (32 bits),
which in this case
(ICMP echo request
and replies), will be
composed of identifier
(16 bits) and sequence
number (16 bits).
ICMP Payload: payload
for the different kind of Source: Wikipedia
answers; can be an
arbitrary length, left to
implementation detail.
3 probes 3 probes
3 probes
Network Layer 4-45
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-47
IPv6 Address Format
128 bits 8 groups of 4 hexadecimal digits
(Each group represents 16 bits), separated by a :
IPv6 datagram
IPv4 datagram
Network Layer 4-51
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-53
IPv6: adoption
US National Institutes of Standards estimate [2013]:
~3% of industry IP routers
~11% of US gov’t routers
IP destination address in
arriving packet’s 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 7
4
construct shortest path tree by
tracing predecessor nodes 8
ties can exist (can be broken u
3 w y z
arbitrarily) 2
3
7 4
v
Network Layer 4-62
Dijkstra’s 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
let
dx(y) := cost of least-cost path from x to y
then
dx(y) = min
v {c(x,v) + dv(y) }
cost from neighbor v to destination y
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-70
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
node y cost to cost to cost to
table x y z x y z x y z y
2 1
x ∞ ∞ ∞ x 0 2 7 x 0 2 3 x z
from
from
y 2 0 1 y 2 0 1 7
from
y 2 0 1
z ∞∞ ∞ z 7 1 0 z 3 1 0
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y 2 0 1 y 2 0 1
from
y ∞∞ ∞
z 7 1 0 z 3 1 0 z 3 1 0
time
Network Layer 4-71
Chapter 4: outline
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and link state
datagram networks distance vector
4.3 what’s inside a router hierarchical routing
4.4 IP: Internet Protocol 4.6 routing in the Internet
RIP
datagram format
OSPF
IPv4 addressing
BGP
ICMP
IPv6 4.7 broadcast and multicast
routing
3c
3a 2c
3b 2a
AS3 2b
1c AS2
1a 1b AS1
1d forwarding table
configured by both intra-
and inter-AS routing
Intra-AS Inter-AS algorithm
Routing Routing
algorithm algorithm intra-AS sets entries
Forwarding
for internal dests
table inter-AS & intra-AS
sets entries for external
dests
Network Layer 4-75
Chapter 4: outline (Self Study)
4.1 introduction 4.5 routing algorithms
4.2 virtual circuit and link state
datagram networks distance vector
4.3 what’s inside a router hierarchical routing
4.4 IP: Internet Protocol 4.6 routing in the Internet
RIP
datagram format
OSPF
IPv4 addressing
BGP
ICMP
IPv6 4.7 broadcast and multicast
routing
Routing
Algorithm
control
plane
data
plane
Remote Controller
control
plane
data
plane
CA
CA CA CA CA
Ap Ap Ap Ap Ap Ap Ap Ap Ap Ap
App
p p p p p p p p p p
Specialized
Applications Open Interface
Specialized Window
Mac
Operating s or Linux or OS
(OS)
System
Open Interface
Specialized
Hardware
Microprocessor
u 2
3
1 z
1
2
x 1 y
u 2
3
1 z
1
2
x 1 y
zz
u 2 1
3
1
2
xx yy
1
control
plane
data
plane
CA 2. control,
data plane
CA CA CA CA separation
1: generalized“ flow-
based” forwarding
(e.g., OpenFlow)
Network Layer: Control Plane 5-86
SDN perspective: data plane switches
Data plane switches network-control
applications
fast, simple, commodity switches
routing
…
implementing generalized data-
plane forwarding in hardware access load
control balance
switch flow table computed,
control
installed by controller northbound API plane
API for table-based switch control
(e.g., OpenFlow) SDN Controller
defines what is controllable and (network operating system)
what is not
protocol for communicating with southbound API
controller (e.g., OpenFlow)
data
plane
SDN-controlled switches
Network Layer: Control Plane 5-87
SDN perspective: SDN controller
SDN controller (network network-control
OS): applications
…
routing
maintain network state
access load
information control balance
interacts with network control control
applications “above” via northbound API plane
northbound API
interacts with network switches SDN Controller
“below” via southbound API (network operating system)
implemented as distributed
southbound API
system for performance,
scalability, fault-tolerance,
robustness data
plane
SDN-controlled switches
Network Layer: Control Plane 5-88
SDN perspective: control applications
network-control apps: network-control
applications
“brains” of control: implement
routing
…
control functions using lower-
level services, API provided by access load
control balance
SND controller
unbundled: can be provided by northbound API
control
plane
3rd party: distinct from routing
vendor, or SDN controller SDN Controller
(network operating system)
southbound API
data
plane
SDN-controlled switches
Network Layer: Control Plane 5-89
OpenFlow protocol
operates between
OpenFlow Controller controller, switch
TCP used to exchange
messages
optional encryption
three classes of
OpenFlow messages:
controller-to-switch
asynchronous (switch
to controller)
symmetric (misc)
4 5
network
graph
RESTful
API
… intent 5 link state routing app interacts
with flow-table-computation
statistics
3
… flow tables
component in SDN controller,
which computes new flow
Link-state info host info … switch info
tables needed
6
1
s2
s1
s4
s3
Network Layer: Control Plane 5-92