Professional Documents
Culture Documents
Chapter 4
Network Layer: Data Plane
Chapter 4
Network Layer:
Data Plane
Computer Networking: A
Top-Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
Network layer: our goals
▪understand principles ▪ instantiation, implementation
behind network layer in the Internet
services, focusing on data • IP protocol
plane: • NAT, middleboxes
• network layer service models
• forwarding versus routing
• how a router works
• addressing
• generalized forwarding
• Internet architecture
Network Layer: 4-3
Network layer: “data plane” roadmap
▪ Network layer: overview
• data plane
• control plane
▪ What’s inside a router
• input ports, switching, output ports
• buffer management, scheduling
▪ IP: the Internet Protocol ▪ Generalized Forwarding, SDN
• datagram format
• Match+action
• addressing
• OpenFlow: match+action in action
• network address translation
• IPv6 ▪ Middleboxes
Network Layer: 4-4
Network-layer services and protocols
▪ transport segment from sending mobile network
routing
Network Layer: 4-6
Network layer: data plane,
control plane
Data plane: Control plane
▪ local, per-router function ▪ network-wide logic
▪ determines how datagram ▪ determines how datagram is
arriving on router input port routed among routers along end-
is forwarded to router end path from source host to
output port destination host
values in arriving ▪ two control-plane approaches:
packet header
• traditional routing algorithms:
0111 1 implemented in routers
• software-defined networking (SDN):
2
3
Routing
Algorithm
control
plane
data
plane
values in arriving
packet header
0111 1
2
3
Remote Controller
control
plane
data
plane
CA
CA CA CA CA
values in arriving
packet header
0111 1
2
3
Internet i. successful
Intserv Guaranteeddatagram
yes delivery to
yesdestination
yes yes
ii. 1633
(RFC )
timing or order of delivery
Internet Diffserv (RFC 2475) available
iii. bandwidth to end-end
possible flow possibly
possibly no
physical layer:
bit-level reception
decentralized switching:
link layer:
e.g., Ethernet ▪ using header field values, lookup output port using
forwarding table in input port memory (“match plus action”)
(chapter 6)
▪ goal: complete input port processing at ‘line speed’
▪ input port queuing: if datagrams arrive faster than forwarding
rate into switch fabric
Network Layer: 4-16
Input port functions
lookup,
link
layer forwarding
line switch
termination protocol fabric
(receive)
queueing
physical layer:
bit-level reception
decentralized switching:
link layer:
e.g., Ethernet ▪ using header field values, lookup output port using
forwarding table in input port memory (“match plus action”)
(chapter 6)
▪ destination-based forwarding: forward based only on
destination IP address (traditional)
▪ generalized forwarding: forward based on any set of header
field values Network Layer: 4-17
Destination-based forwarding
otherwise 3
11001000 match!
00010111 00011*** ******** 2
otherwise 3
otherwise 3
match!
11001000 00010111 00010110 10100001 which interface?
examples:
11001000 00010111 00011000 10101010 which interface?
Network Layer: 4-21
Longest prefix matching
longest prefix match
when looking for forwarding table entry for given
destination address, use longest address prefix that
matches destination address.
otherwise 3
match!
11001000 00010111 00010110 10100001 which interface?
examples:
11001000 00010111 00011000 10101010 which interface?
Network Layer: 4-22
Longest prefix matching
▪ we’ll see why longest prefix matching is used shortly, when
we study addressing
▪ longest prefix matching: often performed using ternary
content addressable memories (TCAMs)
• content addressable: present address to TCAM: retrieve address in
one clock cycle, regardless of table size
• Cisco Catalyst: ~1M routing table entries in TCAM
R (rate: NR, R
ideally)
...
...
R R
memory
input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)
system bus
. . .. . .
fabric plane 2
. . .. . .
switching planes fabric plane 3
. . .. . .
fabric plane 4
. . .. . .
▪ each plane: 3-stage fabric plane 5
. . .. . .
fabric plane 6
. . .. . .
interconnection fabric plane 7
network
. . .. . .
. . .. . .
▪ up to 100’s Tbps
switching capacity
switch switch
fabric fabric
output port contention: only one red one packet time later: green
datagram can be transferred. lower red packet experiences HOL blocking
packet is blocked
Network Layer: 4-30
Output port queuing
datagram This is a really important slide
switch buffer link
layer line
fabric termination
protocol
(rate: NR) queueing (send) R
switch
switch
fabric
fabric
▪ buffering when arrival rate via switch exceeds output line speed
▪ queueing (delay) and loss due to output port buffer overflow!
Abstraction: queue
R packet
departures
packet
arrivals queue link
(waiting area) (server)
▪ minimum bandwidth
guarantee (per-traffic-class)
Network Layer: 4-38
Sidebar: Network Neutrality
What is network neutrality?
▪ technical: how an ISP should share/allocation its resources
• packet scheduling, buffer management are the mechanisms
▪ social, economic principles
• protecting free speech
• encouraging innovation, competition
▪ enforced legal rules and policies
IP protocol
Path-selection • datagram format
algorithms: • addressing
network implemented in • packet handling conventions
• routing protocols forwarding
layer (OSPF, BGP) table ICMP protocol
• SDN controller • error reporting
• router “signaling”
link layer
physical layer
223 1 1 1
Network Layer: 4-45
IP addressing: introduction
223.1.1.1
223 1 1 1
Network Layer: 4-46
IP addressing: introduction
223.1.1.1
223.1.3.1 223.1.3.2
For now: don’t need to worry
about how one interface is
connected to another (with no
intervening router) A: wireless WiFi interfaces
connected by WiFi base station
subnet 223.1.1/24
223.1.1.1
▪ where are the 223.1.1.4
subnets? 223.1.1.3
addresses?
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
DHCP overview:
▪ host broadcasts DHCP discover msg [optional]
▪ DHCP server responds with DHCP offer msg [optional]
▪ host requests IP address: DHCP request msg
▪ DHCP server sends address: DHCP ack msg
Network Layer: 4-53
DHCP client-server scenario
Typically, DHCP server will be co-
DHCP server located in router, serving all subnets
223.1.1.1
223.1.2.1
to which router is attached
223.1.2.5
223.1.1.2
223.1.1.4 223.1.2.9
223.1.1.3
223.1.3.27 arriving DHCP client needs
223.1.2.2 address in this network
223.1.3.1 223.1.3.2
DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server!
yiaddrr:Here’s an IP
223.1.2.4
address youID:can
transaction 654 use
The two steps above can
lifetime: 3600 secs
DHCP request be skipped “if a client
src: 0.0.0.0, 68 remembers and wishes to
Broadcast: OK. I would
dest:: 255.255.255.255, 67 reuse a previously
yiaddrr: 223.1.2.4 allocated network address”
like totransaction
use this ID:IP655
address!
lifetime: 3600 secs
[RFC 2131]
DHCP ACK
src: 223.1.2.5, 67
Broadcast:
dest: OK. You’ve
255.255.255.255, 68
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs
Network Layer: 4-55
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)
“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”
200.23.18.0/23 “or 200.23.18.0/23”
10.0.0.1
138.76.29.7 10.0.0.4
10.0.0.2
10.0.0.3
all datagrams leaving local network have datagrams with source or destination in
same source NAT IP address: 138.76.29.7, this network have 10.0.0/24 address for
but different source port numbers source, destination (as usual)
Network Layer: 4-65
NAT: network address translation
▪ all devices in local network have 32-bit addresses in a “private” IP
address space (10/8, 172.16/12, 192.168/16 prefixes) that can only
be used in local network
▪ advantages:
▪ just one IP address needed from provider ISP for all devices
▪ can change addresses of host in local network without notifying
outside world
▪ can change ISP without changing addresses of devices in local
network
▪ security: devices inside local net not directly addressable, visible
by outside world
payload (data)
IPv6 datagram
IPv4 datagram
Network Layer: 4-72
Tunneling and encapsulation
A B Ethernet connects two E F
Ethernet connecting IPv6 routers
two IPv6 routers: IPv6 IPv6 IPv6 IPv6
IPv6 datagram
Link-layer frame The usual: datagram as payload in link-layer frame
IPv4 network A B E F
connecting two
IPv6 routers IPv6 IPv6/v4 IPv6/v4 IPv6
IPv4 network
IPv6 datagram
Link-layer frame The usual: datagram as payload in link-layer frame
IPv6 datagram
IPv4 datagram tunneling: IPv6 datagram as payload in a IPv4 datagram
Network Layer: 4-74
Tunneling
A B IPv4 tunnel E F
connecting IPv6 routers
logical view:
IPv6 IPv6/v4 IPv6/v4 IPv6
A B C D E F
physical view:
IPv6 IPv6/v4 IPv4 IPv4 IPv6/v4 IPv6
A-to-B: E-to-F:
B-to-C: B-to-C: B-to-C:
IPv6 IPv6
IPv6 inside IPv6 inside IPv6 inside
IPv4 IPv4 IPv4
Network Layer: 4-75
IPv6: adoption
▪ Google1: ~ 30% of clients access services via IPv6
▪ NIST: 1/3 of all US government domains are IPv6 capable
https://www.google.com/intl
/en/ipv6/statistics.html
Network Layer: 4-76
IPv6: adoption
▪ Google1: ~ 30% of clients access services via IPv6
▪ NIST: 1/3 of all US government domains are IPv6 capable
▪ Long (long!) time for deployment, use
• 25 years and counting!
• think of application-level changes in last 25 years: WWW, social
media, streaming media, gaming, telepresence, …
• Why?
1 https://www.google.com/intl/en/ipv6/statistics.html
Network Layer: 4-77
Additional Chapter 4 slides
…
link-level frame in: one large datagram
• different link types, different MTUs out: 3 smaller datagrams
…
• IP header bits used to identify, order
related fragments