You are on page 1of 29

Chapter 4

Network Layer:
Data Plane

Computer Networking: A
Top-Down Approach
8th edition
Jim Kurose, Keith Ross
Pearson, 2020
3
▪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
4
Network Layer: 4-4
▪ 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

5
Network Layer: 4-5
▪ 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
6
Network Layer: 4-6
first generation routers:
• traditional computers with switching under direct control of CPU
• packet copied to system’s memory
• speed limited by memory bandwidth (2 bus crossings per datagram)

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

system bus

7
Network Layer: 4-7
▪ datagram from input port memory to output port memory
via a shared bus
▪ bus contention: switching speed limited by bus bandwidth
▪ 32 Gbps bus, Cisco 5600: sufficient speed for access routers

8
Network Layer: 4-8
Switching via interconnection network
▪ Crossbar, Clos 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
9 built from smaller-sized switches
Network Layer: 4-9
Switching via interconnection network
▪ scaling, using multiple switching “planes” in parallel:
▪ speedup, scaleup via parallelism

▪ Cisco CRS router:


fabric plane 0
▪ basic unit: 8 fabric plane 1

. . .. . .
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
10
Network Layer: 4-10
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
11 packet is blocked
Network Layer: 4-11
Output port queuing
datagram This is a really important slide
switch buffer link
layer line
fabric termination
protocol
(rate: 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
12
Network Layer: 4-12
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!

13
Network Layer: 4-13
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 ▪ Middleboxes
• IPv6
14
Network Layer: 4-14
Network Layer: Internet
host, router network layer functions:

transport layer: TCP, UDP

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
15
Network Layer: 4-15
IP Datagram format
32 bits
IP protocol version number total datagram
ver head. type of 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)
16 TCP+IP
Network Layer: 4-16
IP addressing: introduction
223.1.1.1

• IP address: 32-bit identifier 223.1.2.1


associated with each host or router 223.1.1.2
interface 223.1.1.4 223.1.2.9

• interface: connection between 223.1.1.3


223.1.3.27

host/router and physical link 223.1.2.2

• router’s typically have multiple


interfaces 223.1.3.1 223.1.3.2

• host typically has one or two


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

17 223 1 1 1
Network Layer: 4-17
IP addressing: introduction
223.1.1.1

• IP address: 32-bit identifier 223.1.2.1


associated with each host or router 223.1.1.2
interface 223.1.1.4 223.1.2.9

• interface: connection between 223.1.1.3


223.1.3.27

host/router and physical link 223.1.2.2

• router’s typically have multiple


interfaces 223.1.3.1 223.1.3.2

• host typically has one or two


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

18 223 1 1 1
Network Layer: 4-18
IP addressing: introduction
223.1.1.1

Q: how are interfaces 223.1.2.1


actually connected? 223.1.1.2
223.1.1.4 223.1.2.9
A: we’ll learn about A: wired
that in chapters 6, 7 Ethernet interfaces
connected by 223.1.1.3
223.1.3.27
223.1.2.2
Ethernet switches

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
19
Network Layer: 4-19
Subnets
223.1.1.1

▪ What’s a subnet ? 223.1.2.1

• device interfaces that can 223.1.1.2


223.1.1.4 223.1.2.9
physically reach each other
without passing through an 223.1.1.3
223.1.3.27

intervening router 223.1.2.2

▪ IP addresses have structure:


• subnet part: devices in same subnet 223.1.3.1 223.1.3.2

have common high order bits


• host part: remaining low order bits network consisting of 3 subnets

20
Network Layer: 4-20
Subnets subnet 223.1.1.0/24
223.1.1.1 subnet 223.1.2.0/24

Recipe for defining subnets: 223.1.2.1

▪detach each interface from its 223.1.1.2


223.1.1.4 223.1.2.9

host or router, creating


“islands” of isolated networks 223.1.1.3
223.1.3.27
223.1.2.2

▪each isolated network is


subnet
called a subnet 223.1.3.0/24 223.1.3.1 223.1.3.2

subnet mask: /24


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

21
Network Layer: 4-21
Subnets 223.1.1.2

subnet 223.1.1/24
223.1.1.1
▪ where are the 223.1.1.4

subnets? 223.1.1.3

▪ what are the 223.1.9.2 223.1.7.0


/24 subnet subnet 223.1.9/24
subnet 223.1.7/24

addresses?
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0

subnet 223.1.2/24 223.1.2.6 subnet 223.1.8/24 223.1.3.27


subnet 223.1.3/24
223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

22
Network Layer: 4-22
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
200.23.16.0/23

23
Network Layer: 4-23
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/rc.config in UNIX)
▪ DHCP: Dynamic Host Configuration Protocol: dynamically get address
from as server
24
• “plug-and-play”
Network Layer: 4-24
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
25
Network Layer: 4-25
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

26
Network Layer: 4-26
DHCP client-server scenario
DHCP server: 223.1.2.5 DHCP discover Arriving client
src : 0.0.0.0, 68
Broadcast: is there a
dest.: 255.255.255.255,67
DHCPyiaddr:
server 0.0.0.0
out there?
transaction ID: 654

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!
[RFC 2131]
lifetime: 3600 secs

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
27 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)

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

in UDP, encapsulated in IP, encapsulated


DHCP DHCP 168.1.1.1 in Ethernet
DHCP UDP
IP
▪ Ethernet frame broadcast (dest:
DHCP

DHCP Eth router with DHCP


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

▪ Ethernet demux’ed to IP demux’ed,


UDP demux’ed to DHCP
29
Network Layer: 4-29
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, demuxing 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

30
Network Layer: 4-30

You might also like