0% found this document useful (0 votes)
2 views76 pages

Chapter 4 Dataplane

The document provides an overview of the network layer, focusing on the data plane and its functions, including forwarding, routing, and the architecture of routers. It discusses key components such as IP protocol, NAT, and generalized forwarding methods like Match+Action and OpenFlow. Additionally, it covers input/output port functions, queuing, scheduling policies, and the importance of longest prefix matching in packet forwarding.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views76 pages

Chapter 4 Dataplane

The document provides an overview of the network layer, focusing on the data plane and its functions, including forwarding, routing, and the architecture of routers. It discusses key components such as IP protocol, NAT, and generalized forwarding methods like Match+Action and OpenFlow. Additionally, it covers input/output port functions, queuing, scheduling policies, and the importance of longest prefix matching in packet forwarding.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Network Layer:

Data Plane
Network layer: our goals
▪understand principles ▪ instantiation, implementation
behind network layer in the Internet
services, focusing on data • IP protocol
plane: • NAT
• network layer service models
• forwarding versus routing
• how a router works
• addressing
• generalized forwarding
• Internet architecture
Network Layer: 4-2
Network layer: “data plane” roadmap
▪ Network layer: overview
• data plane
• control plane
▪ What’s inside a router
• input/output ports, switching
• buffer management
• scheduling ▪ Generalized Forwarding
• Match+action
▪ IP: the Internet Protocol • OpenFlow
• datagram format, addressing
• network address translation (NAT)
• IPv6
Network Layer: 4-3
Network-layer services and protocols
▪ transport segment from sending to mobile network

receiving host national or global ISP

• sender: encapsulates segments into


datagrams, passes to link layer application

• receiver: delivers segments to transport


network

transport layer protocol link


physical

▪ network layer protocols in every


network network
link link
physical physical

Internet device: hosts, routers network

▪ routers: link network


physical link
physical network
link datacenter
• examines header fields in all IP physical network

datagrams passing through it


application
• moves datagrams from input ports to transport
network
enterprise
output ports to transfer datagrams link
physical
network
along end-end path
Network Layer: 4-4
Two key network-layer functions
network-layer functions:
▪ forwarding: move packets from
a router’s input link to
appropriate router output link
▪ routing: determine route taken
by packets from source to
destination
• routing algorithms

Network Layer: 4-5


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
is forwarded to router end-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
2
3 • software-defined networking (SDN):
implemented in (remote) servers

Network Layer: 4-6


Per-router control plane
Individual routing algorithm components in each and every
router interact in the control plane

Routing
Algorith control
m plane
data
plan
e

values in arriving
packet header
0111 1
2
3

Network Layer: 4-7


Software-Defined Networking (SDN) control
plane
Remote controller computes, installs forwarding tables in routers

Remote Controller

control
plane

data
plan
e
C
A
CA CA CA CA
values in arriving
packet header

0111 1
2
3

Network Layer: 4-8


Network layer: “data plane” roadmap
▪ Network layer: overview
• data plane
• control plane
▪ What’s inside a router
• input/output ports, switching
• buffer management
• scheduling ▪ Generalized Forwarding
• Match+action
▪ IP: the Internet Protocol • OpenFlow
• datagram format, addressing
• network address translation (NAT)
• IPv6
Network Layer: 4-9
Router architecture overview
high-level view of generic router architecture:
routing, management
routing control plane (software)
processor operates in millisecond
time frame
forwarding data plane
(hardware) operates
in nanosecond
timeframe
high-speed
switching
fabric

router input ports router output ports

Network Layer: 4-10


Input port functions
link lookup,
layer forwarding
line protocol switch
termination (receive fabric
) queueing

physical layer:
bit-level reception
link layer:
decentralized switching:
e.g., Ethernet ▪ using header field values, lookup output port using
forwarding table in input port memory (“match plus action”)
▪ goal: complete input port processing at ‘line speed’
▪ input port queuing: if datagrams arrive faster than forwarding
rate into switch fabric
Network Layer: 4-11
Input port functions
link lookup,
layer forwarding
line protocol switch
termination (receive fabric
) queueing

physical layer:
bit-level reception
link layer:
decentralized switching:
e.g., Ethernet ▪ using header field values, lookup output port using
forwarding table in input port memory (“match plus action”)
▪ 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-12
Destination-based forwarding

Q: but what happens if ranges don’t divide up so nicely?


Network Layer: 4-13
Longest prefix matching
longest prefix match
when looking for forwarding table entry for given
destination address, use longest address prefix that
matches destination address.

Link interface
Destination Address Range
0
11001000 00010111 00010*** ********
1
11001000 00010111 00011000 ********
2
11001000 00010111 00011*** ********
3
otherwise

11001000 00010111 00010110 10100001 which interface?


examples:
11001000 00010111 00011000 10101010 which interface?
Network Layer: 4-14
Longest prefix matching
longest prefix match
when looking for forwarding table entry for given
destination address, use longest address prefix that
matches destination address.

Link interface
Destination Address Range
0
11001000 00010111 00010*** ********
1
11001000 00010111 00011000 ********
2
11001000 match!
00010111 00011*** ********
3
otherwise

11001000 00010111 00010110 10100001 which interface?


examples:
11001000 00010111 00011000 10101010 which interface?
Network Layer: 4-15
Longest prefix matching
longest prefix match
when looking for forwarding table entry for given
destination address, use longest address prefix that
matches destination address.

Link interface
Destination Address Range
0
11001000 00010111 00010*** ********
1
11001000 00010111 00011000 ********
2
11001000 00010111 00011*** ********
3
otherwise
match!
11001000 00010111 00010110 10100001 which interface?
examples:
11001000 00010111 00011000 10101010 which interface?
Network Layer: 4-16
Longest prefix matching
longest prefix match
when looking for forwarding table entry for given
destination address, use longest address prefix that
matches destination address.

Link interface
Destination Address Range
0
11001000 00010111 00010*** ********
1
11001000 00010111 00011000 ********
2
11001000 00010111 00011*** ********
3
otherwise
match!
11001000 00010111 00010110 10100001 which interface?
examples:
11001000 00010111 00011000 10101010 which interface?
Network Layer: 4-17
Longest prefix matching
▪ Longest prefix matching is used
▪ 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

Network Layer: 4-18


Switching fabrics
▪ transfer packet from input link to appropriate output link
▪ 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

R (rate: NR, R
ideally)

...
...

N input ports high-speed N output ports


switching
fabric

R R

Network Layer: 4-19


Switching fabrics
▪ transfer packet from input link to appropriate output link
▪ 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 major types of switching fabrics:

memory

memory bus interconnection


network
Network Layer: 4-20
Switching via memory
first generation routers:
▪ traditional computers with switching under direct control of CPU
▪ packet copied to system’s memory
▪ speed limited by memory bandwidth

input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)

system bus

Network Layer: 4-21


Switching via a bus
▪datagram from input port memory to output port memory
via a shared bus
▪ bus contention: switching speed limited by bus bandwidth

Network Layer: 4-22


Switching via interconnection network
▪ Crossbar networks, other
interconnection nets initially
developed to connect processors in
multiprocessor
▪ multistage switch: nxn switch from 3x3 crossbar
multiple stages of smaller switches
▪ exploiting parallelism:
• fragment datagram into fixed length cells on
entry
• switch cells through the fabric, reassemble
datagram at exit 8x8 multistage switch
built from smaller-sized switches
Network Layer: 4-23
Input port queuing
▪ If switch fabric slower than input ports combined -> queueing may
occur at input queues
• queueing delay and loss due to input buffer overflow!
▪ Head-of-the-Line (HOL) blocking: queued datagram at front of queue
prevents others in queue from moving forward

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-24
Output port queuing
datagram
switch
buffer link
fabric layer line
(rate: protocol termination
NR) queueing (send) R

▪ Buffering required when datagrams


arrive from fabric faster than link Datagrams can be lost
transmission rate. Drop policy: which due to congestion, lack of
datagrams to drop if no free buffers?
buffers
▪ Scheduling discipline chooses Priority scheduling – who
among queued datagrams for gets best performance,
transmission network neutrality
Network Layer: 4-25
Output port queuing

switch
switch
fabric
fabric

at t, packets more one packet time later


from input to output

▪ buffering when arrival rate via switch exceeds output line speed
▪ queueing (delay) and loss due to output port buffer overflow!

Network Layer: 4-26


Buffer Management
buffer management:
switch
datagram
buffer link ▪ drop: which packet to add,
fabric
layer line R drop when buffers are full
protoco terminatio
l
queueing (send)
n
• tail drop: drop arriving
scheduling packet
• priority: drop/remove on
priority basis
Abstraction: queue ▪ marking: which packets to
mark to signal congestion
R packet
departures
(ECN, RED)
packet
arrivals queue link
(waiting area) (server)

Network Layer: 4-27


Packet Scheduling: FCFS
packet scheduling: deciding FCFS: packets transmitted in
which packet to send next on order of arrival to output
link port
• first come, first served
• priority ▪ also known as:
• round robin First-in-first-out (FIFO)
• weighted fair queueing

Abstraction: queue
R packet
departures
packet
arrivals queue link
(waiting area) (server)

Network Layer: 4-28


Scheduling policies: priority
Priority scheduling: high priority queue

▪ arriving traffic classified,


arrivals

queued by class classify link departures

• any header fields can be low priority queue

used for classification 2

▪ send packet from highest arrivals


1 3 4 5

priority queue that has packet


buffered packets in
service
1 3 2 4 5

• FCFS within priority class departures


1 3 2 4 5

Network Layer: 4-29


Scheduling policies: round robin
Round Robin (RR) scheduling:
▪arriving traffic classified,
queued by class
• any header fields can be
used for classification
▪server cyclically, R
repeatedly scans class classify link departures
arrivals
queues, sending one
complete packet from
each class (if available) in
turn Network Layer: 4-30
Scheduling policies: weighted fair queueing

Weighted Fair Queuing (WFQ):


▪ generalized Round Robin
▪ each class, i, has weight, wi, w1
and gets weighted amount
of service in each cycle: w2 R
wi
classify link departures
Σjwj arrivals w3

▪ minimum bandwidth
guarantee (per-traffic-class)
Network Layer: 4-31
Network layer: “data plane” roadmap
▪ Network layer: overview
• data plane
• control plane
▪ What’s inside a router
• input/output ports, switching
• buffer management
• scheduling ▪ Generalized Forwarding
• Match+action
▪ IP: the Internet Protocol • OpenFlow
• datagram format, addressing
• network address translation (NAT)
• IPv6
Network Layer: 4-32
Network Layer: Internet
host, router network layer functions:

transport layer: TCP, UDP

Path-selection
IP protocol
• 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

Network Layer: 4-33


IP Datagram format
32 bits
IP protocol version number type of total datagram
ver head. length length (bytes)
header length(bytes) len service
fragment fragmentation/
“type” of service: 16-bit identifier flgs
▪ diffserv (0:5) offset reassembly
time to upper header
▪ ECN (6:7) header checksum
live layer checksum
TTL: remaining max hops source IP address 32-bit source IP address
(decremented at each router)
Maximum length: 64K bytes
destination IP address 32-bit destination IP address
upper layer protocol (e.g., TCP or UDP) Typically: 1500 bytes or less
options (if any) e.g., timestamp, record
overhead route taken
▪ 20 bytes of TCP payload data
▪ 20 bytes of IP (variable length,
▪ = 40 bytes + app typically a TCP
layer overhead for or UDP segment)
TCP+IP
Network Layer: 4-34
IP addressing: introduction
[Link]

▪ IP address: 32-bit identifier [Link]

associated with each host or [Link]


router interface [Link] [Link]

▪ interface: connection between [Link]


[Link]

host/router and physical link [Link]

• router’s typically have multiple


interfaces [Link] [Link]

• host typically has one or two


interfaces (e.g., wired Ethernet,
wireless 802.11) dotted-decimal IP address notation:
[Link] = 11011111 00000001 00000001 00000001

223 1 1 1
Network Layer: 4-35
IP addressing: introduction
[Link]

▪ IP address: 32-bit identifier [Link]

associated with each host or [Link]


router interface [Link] [Link]

▪ interface: connection between [Link]


[Link]

host/router and physical link [Link]

• router’s typically have multiple


interfaces [Link] [Link]

• host typically has one or two


interfaces (e.g., wired Ethernet,
wireless 802.11) dotted-decimal IP address notation:
[Link] = 11011111 00000001 00000001 00000001

223 1 1 1
Network Layer: 4-36
IP addressing: introduction
[Link]

Q: how are interfaces [Link]

actually connected? [Link]


[Link] [Link]
A: we’ll learn about A: wired
that in chapters 6, 7 Ethernet interfaces
connected by [Link]
[Link]
[Link]
Ethernet switches

[Link] [Link]

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

Network Layer: 4-37


Subnets
[Link]

▪ What’s a subnet ? [Link]

• device interfaces that can [Link]


[Link] [Link]
physically reach each other
without passing through an [Link]
[Link]

intervening router [Link]

▪IP addresses have structure:


[Link] [Link]
• subnet part: devices in same subnet
have common high order bits
• host part: remaining low order bits network consisting of 3 subnets

Network Layer: 4-38


Subnets subnet [Link]/24
[Link] subnet [Link]/24

Recipe for defining subnets: [Link]

▪detach each interface from its [Link]


[Link] [Link]

host or router, creating


“islands” of isolated networks [Link]
[Link]
[Link]

▪each isolated network is


subnet
called a subnet [Link]/24 [Link] [Link]

subnet mask: /24


(high-order 24 bits: subnet part of IP address)

Network Layer: 4-39


Subnets [Link]

subnet 223.1.1/24

▪ where are the


[Link]
[Link]

subnets? [Link]

▪ what are the [Link] [Link]


/24 subnet subnet 223.1.9/24
subnet 223.1.7/24

addresses?
[Link] [Link]
[Link] [Link]

subnet 223.1.2/24 [Link] subnet 223.1.8/24 [Link]


subnet 223.1.3/24
[Link] [Link] [Link] [Link]

Network Layer: 4-40


IP addressing: CIDR
CIDR: Classless InterDomain Routing (pronounced “cider”)
•subnet portion of address of arbitrary length
•address format: a.b.c.d/x, where x is # bits in subnet portion
of address
subnet host
part part
11001000 00010111 00010000 00000000
[Link]/23

Network Layer: 4-41


IP addresses: how to get one?
That’s actually two questions:
1. Q: How does a host get IP address within its network (host part of
address)?
2. Q: How does a network get IP address for itself (network part of
address)

How does host get IP address?


▪ hard-coded by sysadmin in config file (e.g., /etc/[Link] in UNIX)
▪ DHCP: Dynamic Host Configuration Protocol: dynamically get address
from as server
• “plug-and-play”
Network Layer: 4-42
DHCP: Dynamic Host Configuration Protocol
goal: host dynamically obtains IP address from network server when it
“joins” network
▪ can renew its lease on address in use
▪ allows reuse of addresses (only hold address while connected/on)
▪ support for mobile users who join/leave network

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-43
DHCP client-server scenario
Typically, DHCP server will be
DHCP server co-located in router, serving all
[Link]
[Link]
subnets to which router is attached

[Link]
[Link]
[Link] [Link]

[Link]
[Link] arriving DHCP client needs
[Link] address in this network

[Link] [Link]

Network Layer: 4-44


DHCP client-server scenario
DHCP server: [Link] DHCP discover Arriving client
src : [Link], 68
Broadcast: is there a
dest.: [Link],67
DHCPyiaddr:
server [Link]
out there?
transaction ID: 654

DHCP offer
src: [Link], 67
Broadcast: I’m a DHCP
dest: [Link], 68
server!
yiaddr:Here’s
223.1.2.4an IP
transaction ID: 654
address you can use
lifetime: 3600 secs
The two steps above can
DHCP request be skipped “if a client
src: [Link], 68 remembers and wishes to
dest:: [Link],
Broadcast: OK. I would67 reuse a previously
yiaddr: [Link] allocated network address”
like to transaction
use this ID:IP 655
address!
lifetime: 3600 secs
[RFC 2131]

DHCP ACK
src: [Link], 67
dest: [Link], 68
Broadcast: OK. You’ve
yiaddr: [Link]
got that IPID:
transaction address!
655
lifetime: 3600 secs
Network Layer: 4-45
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)

Network Layer: 4-46


DHCP: example
DHCP DHCP ▪ Connecting laptop will use DHCP
DHCP UDP
DHCP IP to get IP address, address of
DHCP Eth first-hop router, address of DNS
Phy server.
▪ DHCP REQUEST message encapsulated
DHCP

in UDP, encapsulated in IP,


DHCP DHCP [Link] encapsulated in Ethernet
DHCP UDP

▪ Ethernet frame broadcast (dest:


DHCP IP
DHCP Eth router with DHCP
Phy server built into FFFFFFFFFFFF) on LAN, received at router
router running DHCP server

▪ Ethernet de-mux’ed to IP de-mux’ed,


UDP de-mux’ed to DHCP
Network Layer: 4-47
DHCP: example
DHCP DHCP ▪ DCP server formulates DHCP ACK
DHCP UDP containing client’s IP address, IP
DHCP IP address of first-hop router for client,
DHCP Eth
Phy name & IP address of DNS server

▪ encapsulated DHCP server reply


DHCP DHCP forwarded to client, de-muxing up to
UDP
DHCP
DHCP IP
DHCP at client
DHCP Eth router with DHCP
DHCP
Phy server built into ▪ client now knows its IP address, name
router and IP address of DNS server, IP
address of its first-hop router

Network Layer: 4-48


Network layer: “data plane” roadmap
▪ Network layer: overview
• data plane
• control plane
▪ What’s inside a router
• input/output ports, switching
• buffer management
• scheduling ▪ Generalized Forwarding
• Match+action
▪ IP: the Internet Protocol • OpenFlow
• datagram format, addressing
• network address translation (NAT)
• IPv6
Network Layer: 4-49
NAT: network address translation
NAT: all devices in local network share just one IPv4 address as
far as outside world is concerned
rest of local network (e.g., home
Internet network) 10.0.0/24

[Link]
[Link] [Link]

[Link]

[Link]

all datagrams leaving local network have datagrams with source or destination in
same source NAT IP address: [Link], this network have 10.0.0/24 address for
but different source port numbers source, destination (as usual)
Network Layer: 4-50
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

Network Layer: 4-51


NAT: network address translation
implementation: NAT router must (transparently):
▪ outgoing datagrams: replace (source IP address, port #) of every
outgoing datagram to (NAT IP address, new port #)
• remote clients/servers will respond using (NAT IP address, new
port #) as destination address
▪ remember (in NAT translation table) every (source IP address, port #)
to (NAT IP address, new port #) translation pair
▪ incoming datagrams: replace (NAT IP address, new port #) in
destination fields of every incoming datagram with corresponding
(source IP address, port #) stored in NAT table
Network Layer: 4-52
NAT: network address translation
NAT translation table
2: NAT router changes 1: host [Link] sends
WAN side addr LAN side addr datagram to
datagram source address [Link], 5001 [Link], 3345
from [Link], 3345 to [Link], 80
…… ……
[Link], 5001,
updates table
S: [Link], 3345
D: [Link], 80
[Link]
1
S: [Link], 5001
2 D: [Link], 80 [Link]
[Link]
[Link] S: [Link], 80
D: [Link], 3345
4
S: [Link], 80 [Link]
D: [Link], 5001 3
3: reply arrives, destination
address: [Link], 5001

Network Layer: 4-53


IPv6: motivation
▪ initial motivation: 32-bit IPv4 address space would be
completely allocated
▪ additional motivation:
• speed processing/forwarding: 40-byte fixed length header
• enable different network-layer treatment of “flows”

Network Layer: 4-54


IPv6 datagram format
flow label: identify
32 bits datagrams in same
priority: identify
priority among
ver pri flow label "flow.” (concept of
datagrams in flow
payload len next hdr hop limit “flow” not well defined).
source address
128-bit (128 bits)
IPv6 addresses destination address
(128 bits)

payload (data)

What’s missing (compared with IPv4):


▪ no checksum (to speed processing at routers)
▪ no fragmentation/reassembly
▪ no options (available as upper-layer, next-header protocol at router)
Network Layer: 4-55
Transition from IPv4 to IPv6
▪ not all routers can be upgraded simultaneously
• no “flag days”
• how will network operate with mixed IPv4 and IPv6 routers?
▪ tunneling: IPv6 datagram carried as payload in IPv4 datagram among
IPv4 routers (“packet within a packet”)
• tunneling used extensively in other contexts (4G/5G)

IPv4 header fields IPv6 header fields


IPv4 payload
IPv4 source, dest addr IPv6 source dest addr
UDP/TCP payload

IPv6 datagram
IPv4 datagram
Network Layer: 4-56
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

Network Layer: 4-57


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 tunnel A B IPv4 tunnel E F


connecting IPv6 routers
connecting two
IPv6 routers IPv6 IPv6/v4 IPv6/v4 IPv6

IPv6 datagram
IPv4 datagram tunneling: IPv6 datagram as payload in a IPv4 datagram
Network Layer: 4-58
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

flow: X src:B src:B src:B flow: X


src: A dest: E dest: E src: A
dest: F
dest: E
dest: F
Flow: X Flow: X Flow: X
Src: A Src: A Src: A
Note source and data Dest: F Dest: F Dest: F data
destination
addresses! data data data

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-59
IPv6: adoption
▪ Google1: ~ 40% of clients access services via IPv6 (2023)
▪ NIST: 1/3 of all US government domains are IPv6 capable

Network Layer: 4-60


IPv6: adoption
▪ Google1: ~ 40% of clients access services via IPv6 (2023)
▪ NIST: 1/3 of all US government domains are IPv6 capable

1
[Link]
Network Layer: 4-61
Network layer: “data plane” roadmap
▪ Network layer: overview
• data plane
• control plane
▪ What’s inside a router
• input/output ports, switching
• buffer management
• scheduling ▪ Generalized Forwarding
• Match+action
▪ IP: the Internet Protocol • OpenFlow
• datagram format, addressing
• network address translation (NAT)
• IPv6
Network Layer: 4-62
Generalized forwarding: match plus action
Review: each router contains a forwarding table(aka: flow table)
▪ “match plus action” abstraction: match bits in arriving packet, take action
• destination-based
values in arriving
packet header
forwarding: forward based on dest. IP address
0111 1
• generalized forwarding: 2
3
• many header fields can determine action
• many action possible: drop/copy/modify/log packet

forwarding table
(aka: flow table)

Network Layer: 4-63


Flow table abstraction
▪ flow: defined by header field values (in link-, network-, transport-layer fields)
▪ generalized forwarding: simple packet-handling rules
• match: pattern values in packet header fields
• actions: for matched packet: drop, forward, modify, matched packet or send
matched packet to controller
• priority: disambiguate overlapping patterns
• counters: #bytes and #packets

Flow Router’s flow table define


table actio
matc router’s match+action rules
h n

Network Layer: 4-64


Flow table abstraction
▪ flow: defined by header fields
▪ generalized forwarding: simple packet-handling rules
• match: pattern values in packet header fields
• actions: for matched packet: drop, forward, modify, matched packet or send
matched packet to controller
• priority: disambiguate overlapping patterns
• counters: #bytes and #packets

Flow src = *.*.*.*, dest=3.4.*.* forward(2)


table actio
matc src=1.2.*.*, dest=*.*.*.* drop
h n src=[Link], dest=*.*.*.* send to controller
* : wildcard
1 4
3
2 Network Layer: 4-65
OpenFlow: flow table entries
Match Action Stats

Packet + byte
counters
1. Forward packet to port(s)
2. Drop packet
3. Modify fields in header(s)
4. Encapsulate and forward to controller

Header fields to match:


Ingress Src Dst Eth VLAN VLAN IP IP TCP/UDP TCP/UDP
IP Src IP Dst
Port MAC MAC Type ID Pri Proto ToS Src Port Dst Port

Link Network Transport layer


Network Layer: 4-66
layer layer
OpenFlow: examples
Destination-based forwarding:
Switch MAC MAC Eth VLAN VLAN IP IP IP IP TCP TCP
Port src dst type ID Pri Src Dst Prot ToS s-port d-port Action
* * * * * * * [Link] * * * * port6
IP datagrams destined to IP address [Link] should be forwarded to router output port 6

Firewall:
Switch MAC MAC Eth VLAN VLAN IP IP IP IP TCP TCP
Port src dst type ID Pri Src Dst Prot ToS s-port d-port Action
* * * * * * * * * * * 22 drop
Block (do not forward) all datagrams destined to TCP port 22 (ssh port #)

Switch MAC MAC Eth VLAN VLAN IP IP IP IP TCP TCP


Port src dst type ID Pri Src Dst Prot ToS s-port d-port Action
* * * * * * [Link] * * * * * drop
Block (do not forward) all datagrams sent by host [Link]
Network Layer: 4-67
OpenFlow: examples
Layer 2 destination-based forwarding:
Switch MAC MAC Eth VLAN VLAN IP IP IP IP TCP TCP
Port src dst type ID Pri Src Dst Prot ToS s-port d-port Action
22:A7:23:
* * 11:E1:02 * * * * * * * * * port3
layer 2 frames with destination MAC address 22:A7:23:11:E1:02 should be forwarded to
output port 3

Network Layer: 4-68


OpenFlow abstraction
▪ match+action: abstraction unifies different kinds of devices

Router Firewall
• match: longest • match: IP addresses and
destination IP prefix TCP/UDP port numbers
• action: forward out a • action: permit or deny
link
Switch NAT
• match: destination MAC • match: IP address and port
address • action: rewrite address and
• action: forward or flood port

Network Layer: 4-69


OpenFlow example
Host h6 Orchestrated tables can
[Link]
1 s3 controller
create network-wide behavior,
2
4
e.g.,:
▪ datagrams from hosts h5 and
3
Host h5
[Link] h6 should be sent to h3 or h4,
via s1 and from there to s2
1 s1 1 s2
Host h1 2 Host h4
[Link] 4 2 4
[Link]
3 3

Host h3
Host h2
[Link]
[Link]

Network Layer: 4-70


OpenFlow example
match action
IP Src = 10.3.*.*
forward(3)
Host h6 Orchestrated tables can
[Link]
IP Dst = 10.2.*.*
1 s3 controller
create network-wide behavior,
2
4
e.g.,:
▪ datagrams from hosts h5 and
3
Host h5
[Link] h6 should be sent to h3 or h4,
via s1 and from there to s2
1 s1 1 s2
Host h1 2 Host h4
[Link] 4 2 4
[Link]
3 3

match match action


action Host h3
Host h2 ingress port = 2
ingress port = 1 [Link]
[Link] forward(3)
IP Src = 10.3.*.* forward(4) IP Dst = [Link]
IP Dst = 10.2.*.* ingress port = 2
forward(4)
IP Dst = [Link]
Network Layer: 4-71
Generalized forwarding: summary
▪ “match plus action” abstraction: match bits in arriving packet header(s) in
any layers, take action
• matching over many fields (link-, network-, transport-layer)
• local actions: drop, forward, modify, or send matched packet to
controller
• “program” network-wide behaviors
▪ simple form of “network programmability”
• programmable, per-packet “processing”
• historical roots: active networking
• today: more generalized programming:
P4 (see [Link]).

Network Layer: 4-72


The end-end argument
▪ some network functionality (e.g., reliable data transfer, congestion)
can be implemented in network, or at network edge

application end-end implementation of reliable data transfer application


transport transport
network network
data link data link
physical physical

application
application
transport
transport
network hop-by-hop (in-network) implementation of reliable data transfer network
data link
data link
physical network
physical
network network network network network link
link link link link link physical
physical physical physical physical physical
The end-end argument
▪ some network functionality (e.g., reliable data transfer, congestion)
can be implemented in network, or at network edge

“The function in question can completely and correctly be implemented only


with the knowledge and help of the application standing at the end points of the
communication system. Therefore, providing that questioned function as a
feature of the communication system itself is not possible. (Sometimes an
incomplete version of the function provided by the communication system may
be useful as a performance enhancement.)

We call this line of reasoning against low-level function implementation the


“end-to-end argument.”
Saltzer, Reed, Clark 1981
IP fragmentation/reassembly
▪ network links have MTU (max.
transfer size) - largest possible
fragmentation:


link-level frame in: one large datagram
• different link types, different MTUs out: 3 smaller datagrams

▪ large IP datagram divided


(“fragmented”) within net reassembly
• one datagram becomes several
datagrams
• “reassembled” only at destination


• IP header bits used to identify, order
related fragments

Network Layer: 4-75


IP fragmentation/reassembly
example: length ID fragflag offset
=4000 =x
▪ 4000 byte datagram
=0 =0

▪ MTU = 1500 bytes one large datagram becomes


several smaller datagrams

1480 bytes in length ID fragflag offset


data field =1500 =x =1 =0

offset = length ID fragflag offset


1480/8 =1500 =x =1 =185

length ID fragflag offset


=1040 =x =0 =370

Network Layer: 4-76

You might also like