0% found this document useful (0 votes)
13 views154 pages

Network+layer Data

Uploaded by

tsuiii2010
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)
13 views154 pages

Network+layer Data

Uploaded by

tsuiii2010
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
You are on page 1/ 154

Chapter 4

Network Layer:
The Data Plane

Acknowledgments:
The contents in this file are based on the slides accompanying the
book Computer Networking: A Top Down Approach, 7th edition.

Computer
Networking: A Top
Down Approach
7th Edition, Global Edition
Jim Kurose, Keith Ross
Pearson
April 2016
Network Layer: Data Plane 4-1
Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• DHCP and network
address translation
• ICMP
• IPv6
Network Layer: Data Plane 4-2
Chapter 4: network layer
chapter goals:
§ understand principles behind network layer
services, focusing on data plane:
• network layer service models
• forwarding versus routing
• how a router works
• generalized forwarding
§ instantiation, implementation in the Internet

Network Layer: Data Plane 4-3


Why Internetworking?
§ To build a “network of networks” or internet
• operating over multiple, coexisting, different network
technologies
• providing ubiquitous connectivity through IP packet transfer
• achieving huge economies of scale
H

H
Net53
Net
Net51
Net G
G
G
G
Net55
Net
H G G
Net52
Net Net54
Net
H

Network Layer: Data Plane 4-4


Why Internetworking?
§ To provide universal communication services
• independent of underlying network technologies
• providing common interface to user applications

Reliable Stream Service


H
Net53
Net
Net51
Net G
G
G
G
Net55
Net
H G G
Net52
Net Net54
Net
H

Network Layer: Data Plane 4-5


Why Internetworking?
• To provide distributed applications
• Any application designed to operate based on Internet
communication services immediately operates across the
entire Internet
• Rapid deployment of new applications
Email, WWW, Peer-to-peer
• Applications independent of network technology
New networks can be introduced below
Old network technologies can be retired

Network Layer: Data Plane 4-6


TCP/IP Protocol Suite
HTTP SMTP DNS RTP
Distributed
applications
Reliable
TCP UDP
stream
service

Best-effort
IP (ICMP, ARP)
connectionless
packet transfer

Network Network Network


Interface 1 Interface 2 Interface 3

Diverse network technologiesNetwork Layer: Data Plane 4-7


Internet Protocol Approach
l IP packets transfer information across Internet
Host A IP → router→ router…→ router→ Host B IP
l IP layer in each router determines next hop (router)
l Network interfaces transfer IP packets across networks

Host A Router Host B


Router
Transport Internet Transport
Layer Layer Internet Layer
Layer
Internet Network Net51 Internet
Interface Net Network
Layer Layer
Interface
Network Network
Interface Interface
Router
Net54
Net Internet
Net52 Layer Net53
Net
Net
Network
Interface Network Layer: Data Plane 4-8
Encapsulation
TCP Header contains
source & destination HTTP Request
port numbers

IP Header contains
source and destination TCP
header HTTP Request
IP addresses;
transport protocol type

Ethernet Header contains


source & destination MAC IP TCP
header header HTTP Request
addresses;
network protocol type

Ethernet IP TCP
HTTP Request FCS
header header header
Network Layer: Data Plane 4-9
Network layer
application
§ transport segment from transport
network

sending to receiving host data link


physical
network
network

§ on sending side network


data link
data link
physical
data link
physical

encapsulates segments physical network


data link
network
data link

into datagrams physical physical

§ on receiving side, delivers network


data link
network
data link

segments to transport physical physical


network
data link

layer physical
application
network transport

§ network layer protocols network


data link
physical
network
data link
network
data link

in every host, router data link


physical
physical physical

§ router examines header


fields in all IP datagrams
passing through it
Network Layer: Data Plane 4-10
Two key network-layer functions

network-layer functions: analogy: taking a trip


§forwarding: move packets § forwarding: process of
from router’s input to getting through single
appropriate router output interchange
§routing: determine route
taken by packets from § routing: process of
source to destination planning trip from source
• routing algorithms to destination

Network Layer: Data Plane 4-11


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
§forwarding function §two control-plane approaches:
• traditional routing algorithms:
values in arriving
packet header implemented in routers
• software-defined networking
0111 1
(SDN): implemented in
2
3 (remote) servers

Network Layer: Data Plane 4-12


Per-router control plane traditional approach!

Individual routing algorithm components in each and every


router interact in the control plane

4.1 • OVERVIEW OF NETWORK LAYER 309

Routing
Algorithm
Routing algorithm control
Control plane plane
Data plane

Local forwarding data


table
header output
plane
0100 3
0110 2
0111 2
1001 1

Values in arriving
values in arriving
packet’s header
1
packet header 1101

2
3
0111 1
2
3

Figure 4.2 ♦ Routing algorithms determine values in forward tables


Network Layer: Control Plane 4-13
tables. In this example, a routing algorithm runs in each and every router and both
Logically centralized control plane new approach!

A distinct (typically remote) controller interacts with local


control agents (CAs)

Remote Controller

control
plane

data
plane

CA

CA CA CA CA
values in arriving
packet header

0111 1
2
3

Network Layer: Control Plane 4-14


Network service model
Q: What service model for “channel” transporting
datagrams from sender to receiver?
example services for example services for a flow
individual datagrams: of datagrams:
§ guaranteed delivery § in-order datagram
§ guaranteed delivery with delivery
less than 40 msec delay § guaranteed minimum
bandwidth to flow
§ restrictions on changes in
inter-packet spacing

Network Layer: Data Plane 4-15


Network layer service models:
Guarantees ?
Network Service Congestion
Architecture Model Bandwidth Loss Order Timing feedback

Internet best effort none no no no no (inferred


via loss)
ATM CBR constant yes yes yes no
rate congestion
ATM VBR guaranteed yes yes yes no
rate congestion
ATM ABR guaranteed no yes no yes
minimum
ATM UBR none no yes no no

ATM (Asynchronous Transfer Mode) networks are broadband integrated services


networks

Network Layer: Data Plane 4-16


Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• network address
translation
• ICMP
• IPv6
Network Layer: Data Plane 4-17
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-seed
switching
fabric

router input ports router output ports

Network Layer: Data Plane 4-18


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

physical layer:
bit-level reception
data link layer: decentralized switching:
e.g., Ethernet § using header field values, 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: Data Plane 4-19
Input port functions
lookup,
link forwarding
line layer switch
termination protocol fabric
(receive)
queueing

physical layer:
bit-level reception
decentralized switching:
data link layer: § using header field values, lookup output
e.g., Ethernet port using forwarding table in input port
see chapter 5 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: Data Plane 4-20
Destination-based forwarding
forwarding table

Destination Address Range Link Interface

11001000 00010111 00010000 00000000


through 0
11001000 00010111 00010111 11111111

11001000 00010111 00011000 00000000


through 1
11001000 00010111 00011000 11111111

11001000 00010111 00011000 00000000


through 2
11001000 00010111 00011111 11111111

otherwise 3

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


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

Destination Address Range Link interface

11001000 00010111 00010*** ********* 0

11001000 00010111 00011000 ********* 1

11001000 00010111 00011*** ********* 2

otherwise 3

examples:
DA: 11001000 00010111 00010110 10100001 which interface?
DA: 11001000 00010111 00011000 10101010 which interface?
Network Layer: Data Plane 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: can hold upwards ~1M routing table
entries in TCAM

Network Layer: Data Plane 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

memory bus crossbar

Network Layer: Data Plane 4-24


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 (2 bus crossings per
datagram)

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

system bus

Network Layer: Data Plane 4-25


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
§ 32 Gbps bus, Cisco 5600: sufficient bus
speed for access and enterprise
routers

Network Layer: Data Plane 4-26


Switching via interconnection network
§ overcome bus bandwidth limitations
§ Banyan networks, crossbar, other
interconnection nets initially
developed to connect processors in
multiprocessor
§ advanced design: fragmenting
datagram into fixed length cells, crossbar
switch cells through the fabric.
§ Cisco 12000: switches 60 Gbps
through the interconnection
network

Network Layer: Data Plane 4-27


Banyan Switch
§ A switch fabric has the ability to route packets to
proper output ports, based on the physical output
port addresses that are attached in the front of
each packet
§ Banyan switch is one of the switch fabrics that has
the self-routing property (see next slide)

Network Layer: Data Plane 4-28


An 8x8 Banyan Switch

010 010 010

Network Layer: Data Plane 4-29


Input port queuing
§ 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: one packet time later: lower


only one red datagram can be red packet is transferred, so
transferred. green packet experiences
lower red packet is blocked HOL blocking

Network Layer: Data Plane 4-30


Output ports

datagram
switch buffer link
fabric layer line
protocol termination
queueing (send)

§ buffering required when datagrams


Datagram arrive
(packets) can be lost
from fabric faster than the
due to transmission
congestion, lack of buffers
rate
§ scheduling discipline chooses
Priority among
scheduling – who queued
gets best
datagrams for transmission
performance, network neutrality

Network Layer: Data Plane 4-31


Output port queueing

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: Data Plane 4-32
How much buffering?
§ RFC 3439 rule of thumb: average buffering equal
to “typical” RTT (say 250 msec) times link
capacity C
• e.g., C = 10 Gpbs link: 2.5 Gbit buffer
§ recent recommendation: with N flows, buffering
equal to
RTT . C
N

Network Layer: Data Plane 4-33


Scheduling mechanisms
§ scheduling: choose next packet to send on link
§ FIFO (first in first out) scheduling: send in order of
arrival to queue
• real-world example?
• discard policy: if packet arrives to full queue: who to discard?
• tail drop: drop arriving packet
• priority: drop/remove on priority basis
• random: drop/remove randomly

packet packet
arrivals queue link departures
(waiting area) (server)

Network Layer: Data Plane 4-34


Scheduling policies: priority
high priority queue
priority scheduling: send (waiting area)
highest priority arrivals departures
queued packet
§ multiple classes, with classify link
different priorities low priority queue
(server)
(waiting area)
• class may depend on
2
marking or other
1 3 4 5
header info, e.g. IP arrivals
source/dest, port
numbers, etc. packet
in 1 3 2 4 5
• real world example? service

departures
1 3 2 4 5

Network Layer: Data Plane 4-35


Scheduling policies: still more
Round Robin (RR) scheduling:
§ multiple classes
§ cyclically scan class queues, sending one complete
packet from each class (if available)

2
1 3 4 5
arrivals

packet
in 1 3 2 4 5
service

departures
1 3 2 4 5

Network Layer: Data Plane 4-36


Scheduling policies: still more
Weighted Fair Queuing (WFQ):
§ generalized Round Robin
§ each class gets weighted amount of service in
each cycle

Network Layer: Data Plane 4-37


Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• DHCP and network
address translation
• ICMP
• IPv6
Network Layer: Data Plane 4-38
The Internet network layer
host, router network layer functions:

transport layer: TCP, UDP

routing protocols IP protocol


• path selection • addressing conventions
• RIP, OSPF, BGP • datagram format
network • packet handling conventions
layer forwarding
table ICMP protocol
• error reporting
• router
“signaling”
link layer

physical layer

Network Layer: Data Plane 4-39


IP datagram format
IP protocol version 32 bits
number total datagram
header length length (bytes)
ver head. type of length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset
max number time to upper reassembly
header
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
32 bit destination IP address
upper layer protocol
to deliver payload to options (if any) e.g. timestamp,
record route
how much overhead? data taken, specify
(variable length, list of routers
v 20 bytes of TCP
typically a TCP to visit.
v 20 bytes of IP
or UDP segment)
v = 40 bytes + app
layer overhead

Network Layer: Data Plane 4-40


IP fragmentation, reassembly
§ network links have MTU
(max.transfer size) -
largest possible link-level fragmentation:
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: Data Plane 4-41
IP fragmentation, reassembly
length ID fragflag offset
example: =4000 =x =0 =0
v 4000 byte datagram
one large datagram becomes
v MTU = 1500 bytes 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: Data Plane 4-42


Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• DHCP and network
address translation
• ICMP
• IPv6
Network Layer: Data Plane 4-43
Internet Names & Addresses
Internet Names Internet Addresses
§ Each host has a unique name § Each host has globally unique logical
• Independent of physical 32 bit IP address
location
§ Separate address for each physical
• Facilitate memorization by connection to a network
humans
• Domain Name § Routing decision is done based on
destination IP address
• Organization under single
administrative unit § IP address has two parts:
§ Host Name • netid and hostid
• Name given to host computer • netid unique
§ User Name • netid facilitates routing
• Name assigned to user § Dotted Decimal Notation:
int1.int2.int3.int4
leongarcia@comm.utoronto.ca
(intj = jth octet)
IP address of 10000000 10000111 01000100 00000101
is 128.135.68.5 in dotted-decimal notation
DNS resolves IP name to IP address Network Layer: Data Plane 4-44
Module 11: IPv4 Addressing

Note: the slides on IPv4 Addressing are from CCNA Introduction to Networks v7.0
(ITN), Module 11
11.1 IPv4 Address Structure

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 46
IPv4 Address Structure
Network and Host Portions
• An IPv4 address is a 32-bit hierarchical address that is made up of a network portion and a
host portion.

• When determining the network portion versus the host portion, you must look at the 32-bit
stream.
• A subnet mask is used to determine the network and host portions.
IPv4 Address Structure
The Subnet Mask
• To identify the network and host portions of an IPv4 address, the subnet mask is compared
to the IPv4 address bit for bit, from left to right.

• The actual process used to


identify the network and host
portions is called ANDing.
IPv4 Address Structure
The Prefix Length
• A prefix length is a less cumbersome method used to identify a subnet mask address.

Prefix
Subnet Mask 32-bit Address
• The prefix length is the number of Length
bits set to 1 in the subnet mask. 255.0.0.0 11111111.00000000.00000000.00000000 /8

255.255.0.0 11111111.11111111.00000000.00000000 /16


• It is written in “slash notation”
255.255.255.0 11111111.11111111.11111111.00000000 /24
therefore, count the number of
bits in the subnet mask and 255.255.255.128 11111111.11111111.11111111.10000000 /25

prepend it with a slash. 255.255.255.192 11111111.11111111.11111111.11000000 /26

255.255.255.224 11111111.11111111.11111111.11100000 /27

255.255.255.240 11111111.11111111.11111111.11110000 /28

255.255.255.248 11111111.11111111.11111111.11111000 /29

255.255.255.252 11111111.11111111.11111111.11111100 /30


IPv4 Address Structure
Network, Host, and Broadcast Addresses
• Within each network are three types of IP addresses:
• Network address
• Host addresses
• Broadcast address
Network Portion Host Portion Host Bits

Subnet mask 255 255 255 0


255.255.255.0 or /24 11111111 11111111 11111111 00000000
Network address 192 168 10 0
All 0s
192.168.10.0 or /24 11000000 10100000 00001010 00000000
First address 192 168 10 1
All 0s and a 1
192.168.10.1 or /24 11000000 10100000 00001010 00000001
Last address 192 168 10 254
All 1s and a 0
192.168.10.254 or /24 11000000 10100000 00001010 11111110
Broadcast address 192 168 10 255
All 1s
192.168.10.255 or /24 11000000 10100000 00001010 11111111
11.2 IPv4 Unicast, Broadcast,
and Multicast

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 51
IPv4 Unicast, Broadcast, and Multicast
Unicast
• Unicast transmission is sending a packet to one destination IP address.

• For example, the PC at 172.16.4.1 sends a unicast packet to the printer at 172.16.4.253.
IPv4 Unicast, Broadcast, and Multicast
Broadcast
• Broadcast transmission is sending a packet to all other destination IP addresses.

• For example, the PC at 172.16.4.1 sends a broadcast packet to all IPv4 hosts.
IPv4 Unicast, Broadcast, and Multicast
Multicast
• Multicast transmission is sending a packet to a multicast address group.

• For example, the PC at 172.16.4.1 sends a multicast packet to the multicast group address
224.10.10.5.
11.3 Types of IPv4 Addresses

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 55
Types of IPv4 Addresses
Public and Private IPv4 Addresses
• As defined in in RFC 1918, public IPv4 addresses are globally routed between internet service
provider (ISP) routers.

• Private addresses are common blocks of Network Address


RFC 1918 Private Address Range
addresses used by most organizations to and Prefix
assign IPv4 addresses to internal hosts. 10.0.0.0/8 10.0.0.0 - 10.255.255.255

172.16.0.0/12 172.16.0.0 - 172.31.255.255


• Private IPv4 addresses are not unique and
can be used internally within any network. 192.168.0.0/16 192.168.0.0 - 192.168.255.255

• However, private addresses are not globally routable.


Types of IPv4 Addresses
Routing to the Internet
• Network Address Translation (NAT) translates private IPv4 addresses to public IPv4
addresses.

• NAT is typically enabled on


the edge router connecting
to the internet.

• It translates the internal


private address to a public
global IP address.
Types of IPv4 Addresses
Special Use IPv4 Addresses
Loopback addresses
• 127.0.0.0 /8 (127.0.0.1 to 127.255.255.254)
• Commonly identified as only 127.0.0.1
• Used on a host to test if TCP/IP is operational.

Link-Local addresses
• 169.254.0.0 /16 (169.254.0.1 to 169.254.255.254)
• Commonly known as the Automatic Private IP Addressing (APIPA) addresses or self-assigned
addresses.
• Used by Windows DHCP clients to self-configure when no DHCP servers are available.
Types of IPv4 Addresses
Legacy Classful Addressing
RFC 790 (1981) allocated IPv4 addresses in
classes
• Class A (0.0.0.0/8 to 127.0.0.0/8)
• Class B (128.0.0.0 /16 – 191.255.0.0 /16)
• Class C (192.0.0.0 /24 – 223.255.255.0 /24)
• Class D (224.0.0.0 to 239.0.0.0)
• Class E (240.0.0.0 – 255.0.0.0)

• Classful addressing wasted many IPv4 addresses.

Classful address allocation was replaced with classless


addressing which ignores the rules of classes (A, B, C).
Types of IPv4 Addresses
Assignment of IP Addresses
• The Internet Assigned Numbers Authority (IANA) manages and allocates blocks of IPv4 and
IPv6 addresses to five Regional Internet Registries (RIRs).

• RIRs are responsible for allocating


IP addresses to ISPs who provide
IPv4 address blocks to smaller
ISPs and organizations.
11.4 Network Segmentation

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 61
Network Segmentation
Broadcast Domains and Segmentation
• Many protocols use broadcasts or multicasts (e.g., ARP use broadcasts to locate other
devices, hosts send DHCP discover broadcasts to locate a DHCP server.)
• Switches propagate broadcasts out all interfaces except the interface on which it was
received.

• The only device that stops


broadcasts is a router.
• Routers do not propagate
broadcasts.
• Each router interface connects to
a broadcast domain and
broadcasts are only propagated
within that specific broadcast
domain.
Network Segmentation
Problems with Large Broadcast Domains
• A problem with a large broadcast domain is that
these hosts can generate excessive broadcasts and
negatively affect the network.

• The solution is to reduce the size of the network


to create smaller broadcast domains in a process
called subnetting.

• Dividing the network address 172.16.0.0 /16 into


two subnets of 200 users each: 172.16.0.0 /24 and
172.16.1.0 /24.
• Broadcasts are only propagated within the smaller
broadcast domains.
Network Segmentation
Reasons for Segmenting Networks
• Subnetting reduces overall network traffic and improves network performance.
• It can be used to implement security policies between subnets.
• Subnetting reduces the number of devices affected by abnormal broadcast traffic.

• Subnets are used for a variety of reasons including by:

Location Group or Function Device Type


11.5 Subnet an IPv4 Network

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 65
Subnet an IPv4 Network
Subnet on an Octet Boundary
• Networks are most easily subnetted at the octet boundary of /8, /16, and /24.

• Notice that using longer prefix lengths decreases the number of hosts per subnet.

Prefix Length Subnet Mask Subnet Mask in Binary (n = network, h = host) # of hosts

nnnnnnnn.hhhhhhhh.hhhhhhhh.hhhhhhhh
/8 255.0.0.0 11111111.00000000.00000000.00000000
16,777,214

nnnnnnnn.nnnnnnnn.hhhhhhhh.hhhhhhhh
/16 255.255.0.0 65,534
11111111.11111111.00000000.00000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
/24 255.255.255.0 254
11111111.11111111.11111111.00000000
Subnet an IPv4 Network
Subnet on an Octet Boundary (Cont.)
• In the first table 10.0.0.0/8 is subnetted using /16 and in the second table, a /24 mask.
Subnet Address Host Range Subnet Address
Host Range
(256 Possible (65,534 possible hosts per Broadcast (65,536 Possible Broadcast
(254 possible hosts per subnet)
Subnets) subnet) Subnets)
10.0.0.0/16 10.0.0.1 - 10.0.255.254 10.0.255.255 10.0.0.0/24 10.0.0.1 - 10.0.0.254 10.0.0.255
10.0.1.0/24 10.0.1.1 - 10.0.1.254 10.0.1.255
10.1.0.0/16 10.1.0.1 - 10.1.255.254 10.1.255.255
10.0.2.0/24 10.0.2.1 - 10.0.2.254 10.0.2.255
10.2.0.0/16 10.2.0.1 - 10.2.255.254 10.2.255.255
… … …
10.3.0.0/16 10.3.0.1 - 10.3.255.254 10.3.255.255
10.0.255.0/24 10.0.255.1 - 10.0.255.254 10.0.255.255
10.4.0.0/16 10.4.0.1 - 10.4.255.254 10.4.255.255 10.1.0.0/24 10.1.0.1 - 10.1.0.254 10.1.0.255

10.5.0.0/16 10.5.0.1 - 10.5.255.254 10.5.255.255 10.1.1.0/24 10.1.1.1 - 10.1.1.254 10.1.1.255


10.1.2.0/24 10.1.2.1 - 10.1.2.254 10.1.2.255
10.6.0.0/16 10.6.0.1 - 10.6.255.254 10.6.255.255
… … …
10.7.0.0/16 10.7.0.1 - 10.7.255.254 10.7.255.255
10.100.0.0/24 10.100.0.1 - 10.100.0.254 10.100.0.255
... ... ... ... ... ...
10.255.0.0/16 10.255.0.1 - 10.255.255.254 10.255.255.255 10.255.255.0/24 10.255.255.1 - 10.2255.255.254 10.255.255.255
Subnet an IPv4 Network
Subnet within an Octet Boundary
• Refer to the table to see six ways to subnet a /24 network.

Subnet Mask in Binary


Prefix Length Subnet Mask # of subnets # of hosts
(n = network, h = host)
nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 2 126
11111111.11111111.11111111.10000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 4 62
11111111.11111111.11111111.11000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 8 30
11111111.11111111.11111111.11100000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 16 14
11111111.11111111.11111111.11110000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 32 6
11111111.11111111.11111111.11111000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 64 2
11111111.11111111.11111111.11111100
11.6 Subnet a Slash 16 and a
Slash 8 Prefix

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 69
Subnet a Slash 16 and a Slash 8 Prefix
Create Subnets with a Slash 16 prefix
Prefix Length Subnet Mask Network Address (n = network, h = host) # of subnets # of hosts
nnnnnnnn.nnnnnnnn.nhhhhhhh.hhhhhhhh
• The table highlights all the /17 255.255.128.0 11111111.11111111.10000000.00000000 2 32766

nnnnnnnn.nnnnnnnn.nnhhhhhh.hhhhhhhh
possible scenarios for /18 255.255.192.0 11111111.11111111.11000000.00000000 4 16382

subnetting a /16 prefix. /19 255.255.224.0


nnnnnnnn.nnnnnnnn.nnnhhhhh.hhhhhhhh
11111111.11111111.11100000.00000000
8 8190

nnnnnnnn.nnnnnnnn.nnnnhhhh.hhhhhhhh
/20 255.255.240.0 11111111.11111111.11110000.00000000 16 4094

nnnnnnnn.nnnnnnnn.nnnnnhhh.hhhhhhhh
/21 255.255.248.0 11111111.11111111.11111000.00000000 32 2046

nnnnnnnn.nnnnnnnn.nnnnnnhh.hhhhhhhh
/22 255.255.252.0 11111111.11111111.11111100.00000000 64 1022

nnnnnnnn.nnnnnnnn.nnnnnnnh.hhhhhhhh
/23 255.255.254.0 11111111.11111111.11111110.00000000 128 510

nnnnnnnn.nnnnnnnn.nnnnnnnn.hhhhhhhh
/24 255.255.255.0 256 254
11111111.11111111.11111111.00000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 11111111.11111111.11111111.10000000 512 126

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 11111111.11111111.11111111.11000000 1024 62

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 11111111.11111111.11111111.11100000 2048 30

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 11111111.11111111.11111111.11110000 4096 14

nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 8192 6
11111111.11111111.11111111.11111000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 11111111.11111111.11111111.11111100 16384 2
Subnet a Slash 16 and a Slash 8 Prefix
Create 100 Subnets with a Slash 16 prefix
Consider a large enterprise that requires at least 100 subnets
and has chosen the private address 172.16.0.0/16 as its internal
network address.

• The figure displays the number of subnets that can be


created when borrowing bits from the third octet and the
fourth octet.
• Notice there are now up to 14 host bits that can be
borrowed (i.e., last two bits cannot be borrowed).

To satisfy the requirement of 100 subnets for the enterprise, 7


bits (i.e., 27 = 128 subnets) would need to be borrowed (for a
total of 128 subnets).
Subnet a Slash 16 and a Slash 8 Prefix
Create 1000 Subnets with a Slash 8 prefix
Consider a small ISP that requires 1000 subnets for its
clients using network address 10.0.0.0/8 which means
there are 8 bits in the network portion and 24 host bits
available to borrow toward subnetting.
• The figure displays the number of subnets that can be
created when borrowing bits from the second and third.
• Notice there are now up to 22 host bits that can be
borrowed (i.e., last two bits cannot be borrowed).

To satisfy the requirement of 1000 subnets for the


enterprise, 10 bits (i.e., 210=1024 subnets) would need
to be borrowed (for a total of 128 subnets)
11.7 Subnet to Meet
Requirements

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 73
Subnet to Meet Requirements
Subnet Private versus Public IPv4 Address Space
Enterprise networks will have an:
• Intranet - A company’s internal network typically
using private IPv4 addresses.
• DMZ – A company’s internet facing servers. Devices
in the DMZ use public IPv4 addresses.

• A company could use the 10.0.0.0/8 and subnet on


the /16 or /24 network boundary.

• The DMZ devices would have to be configured with


public IP addresses.
Subnet to Meet Requirements
Minimize Unused Host IPv4 Addresses and Maximize Subnets

There are two considerations when planning subnets:


• The number of host addresses required for each network
• The number of individual subnets needed

Subnet Mask in Binary


Prefix Length Subnet Mask # of subnets # of hosts
(n = network, h = host)
nnnnnnnn.nnnnnnnn.nnnnnnnn.nhhhhhhh
/25 255.255.255.128 2 126
11111111.11111111.11111111.10000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnhhhhhh
/26 255.255.255.192 4 62
11111111.11111111.11111111.11000000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnhhhhh
/27 255.255.255.224 8 30
11111111.11111111.11111111.11100000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnhhhh
/28 255.255.255.240 16 14
11111111.11111111.11111111.11110000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnhhh
/29 255.255.255.248 32 6
11111111.11111111.11111111.11111000
nnnnnnnn.nnnnnnnn.nnnnnnnn.nnnnnnhh
/30 255.255.255.252 64 2
11111111.11111111.11111111.11111100
Subnet to Meet Requirements
Example: Efficient IPv4 Subnetting
• In this example, corporate headquarters has been
allocated a public network address of
172.16.0.0/22 (10 host bits) by its ISP providing
1,022 host addresses.

• There are five sites and therefore five internet


connections which means the organization
requires 10 subnets with the largest subnet
requires 40 addresses.

• It allocated 10 subnets with a /26 (i.e.,


255.255.255.192) subnet mask.
11.8 VLSM

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 77
VLSM
IPv4 Address Conservation
Given the topology, 7 subnets are required (i.e, four LANs and three WAN links) and the largest
number of host is in Building D with 28 hosts.

• A /27 mask would provide 8 subnets of 30 host IP addresses and therefore support this
topology.

For the last byte:


00000000 = 0
00100000 = 32
01000000 = 64
….
11000000 = 192
VLSM
IPv4 Address Conservation (Cont.)
However, the point-to-point WAN links only require two addresses
and therefore waste 28 addresses each for a total of 84 unused
addresses.

• Applying a traditional subnetting scheme to this scenario is not very efficient and is wasteful.

• VLSM was developed to avoid wasting addresses by enabling us to subnet a subnet.


VLSM
VLSM
• The left side displays the traditional subnetting scheme (i.e.,
the same subnet mask) while the right side illustrates how
VLSM can be used to subnet a subnet and divided the last
subnet into eight /30 subnets.

• When using VLSM, always begin by satisfying the host


requirements of the largest subnet and continue subnetting
until the host requirements of the smallest subnet are
satisfied.

• The resulting topology with VLSM applied.

For the subnet connecting two routers,


/30 is used:
11100000 = 224
11100100 = 228
11101100 = 232
VLSM
VLSM Topology Address Assignment
• Using VLSM subnets, the LAN and inter-router networks can be addressed without
unnecessary waste as shown in the logical topology diagram.
Supernetting
§ The idea of subnetting is generalized: the division between
prefix and suffix can occur on an arbitrary bit boundary
§ Besides allowing subnetting, networks can be aggregated to
form a supernet
§ Summarize a contiguous group of /24 networks
§ Example: 200.158.16.0/20
• IP add = 11001000 10011110 00010000 00000000
• Mask = 11111111 11111111 11110000 00000000
• Contains 16 smaller size /24 networks:
• From 11001000 10011110 00010000 00000000
• i.e. 200.158.16.0/24
• Up to 10010110 10011110 00011111 00000000
• i.e. 200.158.31.0/24

Network Layer: Data Plane 4-82


Classless Inter-Domain Routing (CIDR)
§ CIDR deals with Routing Table Explosion Problem
• Networks represented by prefix and mask
• Without CIDR: Network with range of 16 contiguous /24 networks
requires 16 entries in the routing table
• With CIDR: the same group of networks only requires 1 entry in
the routing table

Network Layer: Data Plane 4-83


Hierarchical addressing: route aggregation
hierarchical addressing allows efficient advertisement of routing
information:

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”

Network Layer: Data Plane 4-84


Hierarchical addressing: more specific routes

ISPs-R-Us has a more specific route to Organization 1

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

Network Layer: Data Plane 4-85


Longest Prefix Match
§ CIDR impacts routing & forwarding
§ Forwarding tables and routing protocols must carry IP
address and mask
§ Multiple entries may match a given IP destination address
§ Example: Routing table may contain
• 205.100.0.0/22 which corresponds to a given network
• 205.100.0.0/20 which results from aggregation of a larger
number of destinations into a supernet
• Packet must be routed using the more specific route, that is, the
longest prefix match

Network Layer: Data Plane 4-86


Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• DHCP and network
address translation
• ICMP
• IPv6
Network Layer: Data Plane 4-87
IP addresses: how to get one?
Q: How does a host get IP address?

§ hard-coded by system admin in a file


• Windows: control-panel->network->configuration-
>tcp/ip->properties
• UNIX: /etc/rc.config
§ DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
• “plug-and-play”

Network Layer: Data Plane 4-88


DHCP: Dynamic Host Configuration Protocol
goal: allow host to dynamically obtain its 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 want to join network (more
shortly)
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: Data Plane 4-89


DHCP client-server scenario

DHCP
223.1.1.0/24
server
223.1.1.1 223.1.2.1

223.1.1.2 arriving DHCP


223.1.1.4 223.1.2.9
client needs
address in this
223.1.3.27
223.1.2.2 network
223.1.1.3

223.1.2.0/24

223.1.3.1 223.1.3.2

223.1.3.0/24

Network Layer: Data Plane 4-90


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! Here’s an IP
yiaddrr: 223.1.2.4
address youID:can
transaction 654 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
dest: 255.255.255.255, 68
Broadcast: OK. You’ve
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs

Network Layer: Data Plane 4-91


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: Data Plane 4-92


DHCP: example
DHCP DHCP § connecting laptop needs
DHCP UDP its IP address, addr of
DHCP IP
DHCP Eth
first-hop router, addr of
Phy DNS server: use DHCP
§ DHCP request encapsulated
DHCP

in UDP, encapsulated in IP,


DHCP DHCP 168.1.1.1 encapsulated in 802.1
DHCP UDP Ethernet
DHCP IP
Eth § Ethernet frame broadcast
DHCP router with DHCP
Phy server built into (dest: FFFFFFFFFFFF) on LAN,
router received at router running
DHCP server
§ Ethernet demuxed to IP
demuxed, UDP demuxed to
DHCP

Network Layer: Data Plane 4-93


DHCP: example
DHCP DHCP § DHCP server formulates
DHCP UDP DHCP ACK containing
DHCP IP client’s IP address, IP
DHCP Eth address of first-hop
Phy router for client, name &
IP address of DNS server
§ encapsulation of DHCP
DHCP DHCP server, frame forwarded
DHCP UDP to client, demuxing up to
DHCP IP DHCP at client
DHCP Eth router with DHCP
DHCP
Phy server built into § client now knows its IP
router address, name and IP
address of DSN server, IP
address of its first-hop
router

Network Layer: Data Plane 4-94


DHCP: Wireshark Message type: Boot Reply (2)
reply
output (home LAN) Hardware type: Ethernet
Hardware address length: 6
Hops: 0
Transaction ID: 0x6b3a11b7
Seconds elapsed: 0
Message type: Boot Request (1) Bootp flags: 0x0000 (Unicast)
Hardware type: Ethernet Client IP address: 192.168.1.101 (192.168.1.101)
Hardware address length: 6 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
……

Network Layer: Data Plane 4-95


NAT: network address translation
rest of local network
Internet (e.g., home network)
10.0.0/24 10.0.0.1

10.0.0.4
10.0.0.2
138.76.29.7

10.0.0.3

all datagrams leaving local datagrams with source or


network have same single destination in this network
source NAT IP address: have 10.0.0/24 address for
138.76.29.7,different source source, destination (as usual)
port numbers
Network Layer: Data Plane 4-96
NAT: network address translation
motivation: local network uses just one IP address as far
as outside world is concerned:
§ range of addresses not needed from ISP: just one
IP address for all devices
§ can change addresses of devices in local network
without notifying outside world
§ can change ISP without changing addresses of
devices in local network
§ devices inside local net not explicitly addressable,
visible by outside world (a security plus)

Network Layer: Data Plane 4-97


NAT: network address translation
implementation: NAT router must:

§ 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 addr

§ 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


dest fields of every incoming datagram with corresponding
(source IP address, port #) stored in NAT table

Network Layer: Data Plane 4-98


NAT: network address translation
NAT translation table 1: host 10.0.0.1
2: NAT router WAN side addr LAN side addr
changes datagram sends datagram to
source addr from 138.76.29.7, 5001 10.0.0.1, 3345 128.119.40.186, 80
10.0.0.1, 3345 to …… ……
138.76.29.7, 5001,
updates table S: 10.0.0.1, 3345
D: 128.119.40.186, 80
10.0.0.1
1
S: 138.76.29.7, 5001
2 D: 128.119.40.186, 80 10.0.0.4
10.0.0.2
138.76.29.7 S: 128.119.40.186, 80
D: 10.0.0.1, 3345 4
S: 128.119.40.186, 80
D: 138.76.29.7, 5001 3 10.0.0.3
4: NAT router
3: reply arrives changes datagram
dest. address: dest addr from
138.76.29.7, 5001 138.76.29.7, 5001 to 10.0.0.1, 3345

* Check out the online interactive exercises for more


examples: http://gaia.cs.umass.edu/kurose_ross/interactive/ Network Layer: Data Plane 4-99
NAT: network address translation
§ 16-bit port-number field:
• 60,000 simultaneous connections with a single
LAN-side address!
§ NAT is controversial:
• routers should only process up to layer 3
• address shortage should be solved by IPv6
• violates end-to-end argument
• NAT possibility must be taken into account by app
designers, e.g., P2P applications

Network Layer: Data Plane 4-


100
Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• DHCP and network
address translation
• ICMP
• IPv6
Network Layer: Data Plane 4-
101
Internet Control Message Protocol (ICMP)

§ RFC 792; Encapsulated in IP packet (protocol type = 1)


§ Handles error and control messages
§ If router cannot deliver or forward a packet, it sends an
ICMP “host unreachable” message to the source
§ If router receives packet that should have been sent to
another router, it sends an ICMP “redirect” message to the
sender; Sender modifies its routing table
§ ICMP “router discovery” messages allow host to learn
about routers in its network and to initialize and update its
routing tables
§ ICMP echo request and reply facilitate diagnostic and used
in “ping”

Network Layer: Data Plane 4-


102
ICMP Basic Error Message Format
0 8 16 31

Type Code Checksum

Unused

IP header and 64 bits of original datagram

§ Type of message: e.g.: Type=3, Destination Unreachable


§ Code: purpose of message, e.g.: for Type=3
• 0 Network Unreachable; 3 Port Unreachable
• 1 Host Unreachable 4 Fragmentation needed
• 2 Protocol Unreachable 5 Source route failed
§ IP header & 64 bits of original datagram
• To match ICMP message with original data in IP packet

Network Layer: Data Plane 4-


103
Echo Request & Echo Reply Message Format
0 8 16 31

Type Code Checksum

Identifier Sequence number

Data

§ Echo request: type=8; Echo reply: type=0


• Destination replies with echo reply by copying data in request
onto reply message
§ Sequence number to match reply to request
§ ID to distinguish between different sessions using echo
services
§ Used in PING
Network Layer: Data Plane 4-
104
Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• DHCP and network
address translation
• ICMP
• IPv6
Network Layer: Data Plane 4-
105
IPv6: motivation
§ initial motivation: 32-bit address space is not enough
§ additional motivation:
• header format helps speed processing/forwarding
• header changes to facilitate QoS

IPv6 datagram format:


• fixed-length 40 byte header
• no fragmentation allowed

Network Layer: Data Plane 4-


106
IPv6 datagram format
priority: identify priority among datagrams in flow
flow Label: identify datagrams in same “flow.”
(concept of“flow” not well defined).
next header: identify upper layer protocol for data
ver pri flow label
payload len next hdr hop limit
source address
(128 bits)
destination address
(128 bits)

data

32 bits
Network Layer: Data Plane 4-
107
Extension Headers
Daisy chains of extension headers

Basic header
Next header = TCP segment
TCP

Basic header Routing header Fragment header Authentication header


Next header = Next header = Next header = Next header = TCP segment
routing fragment authentication TCP

§ Extension headers processed in order of appearance

Network Layer: Data Plane 4-


108
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

Network Layer: Data Plane 4-


109
12.2 IPv6 Address
Representation

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 110
IPv6 Address Representation
IPv6 Addressing Formats
• IPv6 addresses are 128 bits in length and written in hexadecimal.
• IPv6 addresses are not case-sensitive and can be written in either lowercase or
uppercase.
• The preferred format for writing an IPv6 address is x:x:x:x:x:x:x:x, with each “x”
consisting of four hexadecimal values.
• In IPv6, a hextet is the unofficial term used to refer to a segment of 16 bits, or four
hexadecimal values.
• Examples of IPv6 addresses in the preferred format:
2001:0db8:0000:1111:0000:0000:0000:0200
2001:0db8:0000:00a3:abcd:0000:0000:1234
IPv6 Address Representation
Rule 1 – Omit Leading Zero
The first rule to help reduce the notation of IPv6 addresses is to omit any leading 0s (zeros).
Examples:
• 01ab can be represented as 1ab
• 09f0 can be represented as 9f0
• 0a00 can be represented as a00
• 00ab can be represented as ab

Note: This rule only applies to leading 0s, NOT to trailing 0s, otherwise the address would
be ambiguous.

Type Format
Preferred 2001 : 0db8 : 0000 : 1111 : 0000 : 0000 : 0000 : 0200
No leading zeros 2001 : db8 : 0 : 1111 : 0 : 0 : 0 : 200
IPv6 Address Representation
Rule 2 – Double Colon
A double colon (::) can replace any single, contiguous string of one or more 16-bit
hextets consisting of all zeros.
Example:
• 2001:db8:cafe:1:0:0:0:1 (leading 0s omitted) could be represented as 2001:db8:cafe:1::1

Note: The double colon (::) can only be used once within an address, otherwise there would be more
than one possible resulting address.

Type Format
Preferred 2001 : 0db8 : 0000 : 1111 : 0000 : 0000 : 0000 : 0200
Compressed 2001:db8:0:1111::200
12.3 IPv6 Address Types

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 114
IPv6 Address Types
Unicast, Multicast, Anycast

There are three broad categories of IPv6 addresses:


• Unicast – Unicast uniquely identifies an interface on an IPv6-enabled device.
• Multicast – Multicast is used to send a single IPv6 packet to multiple destinations.
• Anycast – This is any IPv6 unicast address that can be assigned to multiple devices. A packet
sent to an anycast address is routed to the nearest device having that address.

Note: Unlike IPv4, IPv6 does not have a broadcast address. However, there is an IPv6 all-nodes
multicast address that essentially gives the same result.
IPv6 Address Types
IPv6 Prefix Length

Prefix length is represented in slash notation and is used to indicate the network portion of an
IPv6 address.
The IPv6 prefix length can range from 0 to 128. The recommended IPv6 prefix length for LANs
and most other types of networks is /64.

Note: It is strongly recommended to use a 64-bit Interface ID for most networks. This is because
stateless address autoconfiguration (SLAAC) uses 64 bits for the Interface ID. It also makes
subnetting easier to create and manage.
IPv6 Address Types
Types of IPv6 Unicast Addresses

Unlike IPv4 devices that have only a single address,


IPv6 addresses typically have two unicast addresses:

• Global Unicast Address (GUA) – This is similar to


a public IPv4 address. These are globally unique,
internet-routable addresses.
• Link-local Address (LLA) - Required for every
IPv6-enabled device and used to communicate
with other devices on the same local link. LLAs
are not routable and are confined to a single link.
IPv6 Address Types
A Note About the Unique Local Address
The IPv6 unique local addresses (range fc00::/7 to fdff::/7) have some similarity to
RFC 1918 private addresses for IPv4, but there are significant differences:
• Unique local addresses are used for local addressing within a site or between a limited
number of sites.
• Unique local addresses can be used for devices that will never need to access another
network.
• Unique local addresses are not globally routed or translated to a global IPv6 address.

Note: Many sites use the private nature of RFC 1918 addresses to attempt to
secure or hide their network from potential security risks. This was never the
intended use of ULAs.
IPv6 Address Types
IPv6 GUA

IPv6 global unicast addresses (GUAs) are globally unique and routable on the IPv6 internet.
• Currently, only GUAs with the first three bits of 001 or 2000::/3 are being assigned.

• Currently available GUAs begins with a hexadecimal 2 or a 3 (This is only 1/8th of the total available
IPv6 address space).
IPv6 Address Types
IPv6 GUA Structure
Global Routing Prefix:
• The global routing prefix is the prefix, or network, portion of the address that is
assigned by the provider, such as an ISP, to a customer or site. The global routing
prefix will vary depending on ISP policies.
Subnet ID:
• The Subnet ID field is the area between the Global Routing Prefix and the Interface
ID. The Subnet ID is used by an organization to identify subnets within its site.
Interface ID:
• The IPv6 interface ID is equivalent to the host portion of an IPv4 address. It is
strongly recommended that in most cases /64 subnets should be used, which creates
a 64-bit interface ID.

Note: IPv6 allows the all-0s and all-1s host addresses can be assigned to a device. The all-0s address is
reserved as a Subnet-Router anycast address, and should be assigned only to routers.
IPv6 Address Types
IPv6 LLA
An IPv6 link-local address (LLA) enables a device to communicate with other IPv6-enabled
devices on the same link and only on that link (subnet).
• Packets with a source or destination LLA cannot be routed.

• Every IPv6-enabled network interface must have an LLA.

• If an LLA is not configured manually on an interface, the device will automatically create one.

• IPv6 LLAs are in the fe80::/10 range.


12.5 Dynamic Addressing for IPv6
GUAs

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 122
Dynamic Addressing for IPv6 GUAs
RS and RA Messages
Devices obtain GUA addresses dynamically through Internet Control Message Protocol version
6 (ICMPv6) messages.
• Router Solicitation (RS) messages are sent by host devices to discover IPv6 routers
• Router Advertisement (RA) messages are sent by routers to inform hosts on how to
obtain an IPv6 GUA and provide useful network information such as:
• Network prefix and prefix length
• Default gateway address
• DNS addresses and domain name
• The RA can provide three methods for configuring an IPv6 GUA :
• SLAAC (StateLess Address Auto Configuration)
• SLAAC with stateless DHCPv6 server
• Stateful DHCPv6 (no SLAAC)
Dynamic Addressing for IPv6 GUAs
Method 1: SLAAC

• SLAAC allows a device to configure a GUA without the services of DHCPv6.

• Devices obtain the necessary information to configure a GUA from the ICMPv6 RA messages
of the local router.
• The prefix is provided by the RA and the device uses either the EUI-64 or random generation
method to create an interface ID.
Dynamic Addressing for IPv6 GUAs
Method 2: SLAAC and Stateless DHCP

An RA can instruct a device to use both SLAAC and stateless DHCPv6.

The RA message suggests devices use the following:


• SLAAC to create its own IPv6 GUA

• The router LLA, which is the RA source IPv6 address, as the default gateway address

• A stateless DHCPv6 server to obtain other information such as a DNS server address and a
domain name
Dynamic Addressing for IPv6 GUAs
Method 3: Stateful DHCPv6
An RA can instruct a device to use stateful DHCPv6 only.

Stateful DHCPv6 is similar to DHCP for IPv4. A device can automatically receive a GUA, prefix
length, and the addresses of DNS servers from a stateful DHCPv6 server.
The RA message suggests devices use the following:
• The router LLA, which is the RA source IPv6 address, for the default gateway address.

• A stateful DHCPv6 server to obtain a GUA, DNS server address, domain name and other
necessary information.
Dynamic Addressing for IPv6 GUAs
EUI-64 Process vs. Randomly Generated

• When the RA message is either


SLAAC or SLAAC with stateless
DHCPv6, the client must generate
its own interface ID.
• The interface ID can be created
using the EUI-64 process or a
randomly generated 64-bit number.
Dynamic Addressing for IPv6 GUAs
EUI-64 Process

The IEEE defined the Extended Unique Identifier (EUI) or modified EUI-64 process which
performs the following:
• A 16 bit value of fffe (in hexadecimal) is inserted into the middle of the 48-bit Ethernet
MAC address of the client.
• The 7th bit of the client MAC address is reversed from binary 0 to 1.
• Example:

48-bit MAC fc:99:47:75:ce:e0


EUI-64 Interface ID fe:99:47:ff:fe:75:ce:e0
Dynamic Addressing for IPv6 GUAs
Randomly Generated Interface IDs
Depending upon the operating system, a device may use a randomly generated interface ID
instead of using the MAC address and the EUI-64 process.
Beginning with Windows Vista, Windows uses a randomly generated interface ID instead of
one created with EUI-64.
C:\> ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2001:db8:acad:1:50a5:8a35:a5bb:66e1
Link-local IPv6 Address . . . . . : fe80::50a5:8a35:a5bb:66e1
Default Gateway . . . . . . . . . : fe80::1
C:\>

Note: To ensure the uniqueness of any IPv6 unicast address, the client may use a
process known as Duplicate Address Detection (DAD). This is similar to an ARP
request for its own address. If there is no reply, then the address is unique.
12.6 Dynamic Addressing for IPv6
LLAs

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 130
Dynamic Addressing for IPv6 LLAs
Dynamic LLAs

• All IPv6 interfaces must have an IPv6 LLA.

• Like IPv6 GUAs, LLAs can be configured dynamically.


• The figure shows the LLA is dynamically created using the fe80::/10 prefix and the
interface ID using the EUI-64 process, or a randomly generated 64-bit number.
Dynamic Addressing for IPv6 LLAs
Dynamic LLAs on Windows
Operating systems, such as Windows, will typically use the same method for both a SLAAC-
created GUA and a dynamically assigned LLA.
EUI-64 Generated Interface ID:
C:\> ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2001:db8:acad:1:fc99:47ff:fe75:cee0
Link-local IPv6 Address . . . . . : fe80::fc99:47ff:fe75:cee0
Default Gateway . . . . . . . . . : fe80::1
C:\>

Random 64-bit Generated Interface ID:


C:\> ipconfig
Windows IP Configuration
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IPv6 Address. . . . . . . . . . . : 2001:db8:acad:1:50a5:8a35:a5bb:66e1
Link-local IPv6 Address . . . . . : fe80::50a5:8a35:a5bb:66e1
Default Gateway . . . . . . . . . : fe80::1
C:\>
Dynamic Addressing for IPv6 LLAs
Dynamic LLAs on Cisco Routers

Cisco routers automatically create an IPv6 LLA whenever a GUA is assigned to the interface.
By default, Cisco IOS routers use EUI-64 to generate the interface ID for all LLAs on IPv6
interfaces.
Here is an example of a LLA dynamically configured on the G0/0/0 interface of R1:

R1# show interface gigabitEthernet 0/0/0


GigabitEthernet0/0/0 is up, line protocol is up
Hardware is ISR4221-2x1GE, address is 7079.b392.3640 (bia 7079.b392.3640)
(Output omitted)
R1# show ipv6 interface brief
GigabitEthernet0/0/0 [up/up]
FE80::7279:B3FF:FE92:3640
2001:DB8:ACAD:1::1
12.7 IPv6 Multicast Addresses

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 134
IPv6 Multicast Addresses
Assigned IPv6 Multicast Addresses

IPv6 multicast addresses have the prefix ff00::/8. There are two types of IPv6 multicast
addresses:
• Well-Known multicast addresses
• Solicited node multicast addresses

Note: Multicast addresses can only be destination addresses and not source addresses.
IPv6 Multicast Addresses
Well-Known IPv6 Multicast Addresses

Well-known IPv6 multicast addresses are assigned and are reserved for predefined groups of
devices.
There are two common IPv6 Assigned multicast groups:

• ff02::1 All-nodes multicast group - This is a multicast group


that all IPv6-enabled devices join. A packet sent to this
group is received and processed by all IPv6 interfaces on
the link or network.
• ff02::2 All-routers multicast group - This is a multicast
group that all IPv6 routers join. A router becomes a
member of this group when it is enabled as an IPv6 router
with the ipv6 unicast-routing global configuration
command.
IPv6 Multicast Addresses
Solicited-Node IPv6 Multicast

• A solicited-node multicast address is


similar to the all-nodes multicast
address.
• A solicited-node multicast address is
mapped to a special Ethernet
multicast address.

• The Ethernet NIC can filter the frame


by examining the destination MAC
address without sending it to the IPv6
process to see if the device is the
intended target of the IPv6 packet.
12.8 Subnet an IPv6 Network

© 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 138
Subnet an IPv6 Network
Subnet Using the Subnet ID

IPv6 was designed with subnetting in mind.


• A separate subnet ID field in the IPv6 GUA is used to create subnets.
• The subnet ID field is the area between the Global Routing Prefix and the interface ID.
Subnet an IPv6 Network
IPv6 Subnetting Example

Given the 2001:db8:acad::/48 global


routing prefix with a 16 bit subnet ID.
• Allows 65,536 /64 subnets
• The global routing prefix is the same
for all subnets.
• Only the subnet ID hextet is incremented in
hexadecimal for each subnet.
Subnet an IPv6 Network
IPv6 Subnet Allocation

The example topology requires five subnets, one for each LAN as well as for the serial link
between R1 and R2.

The five IPv6 subnets were allocated, with the subnet ID field 0001 through 0005. Each /64 subnet
will provide more addresses than will ever be needed.
IPv4 and IPv6 Coexistence

Both IPv4 and IPv6 will coexist in the near future and the transition will take several years.
The IETF has created various protocols and tools to help network administrators migrate
their networks to IPv6. These migration techniques can be divided into three categories:
• Dual stack -The devices run both IPv4 and IPv6 protocol
stacks simultaneously.
• Tunneling – A method of transporting an IPv6 packet over
an IPv4 network. The IPv6 packet is encapsulated inside an
IPv4 packet.
• Translation - Network Address Translation 64 (NAT64)
allows IPv6-enabled devices to communicate with IPv4-
enabled devices using a translation technique similar to
NAT for IPv4.
Note: Tunneling and translation are for transitioning to native IPv6 and should only be used where
needed. The goal should be native IPv6 communications from source to destination.
Tunneling
§ IPv6 datagram carried as payload in IPv4 datagram
among IPv4 routers

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: Data Plane 4-


143
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

Network Layer: Data Plane 4-


144
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

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


src: A dest: E src: A
dest: E
dest: F dest: F
Flow: X Flow: X
Src: A Src: A
data Dest: F Dest: F data

data data

A-to-B: E-to-F:
IPv6 B-to-C: B-to-C: IPv6
IPv6 inside IPv6 inside
IPv4 IPv4 Network Layer: Data Plane 4-
145
Chapter 4: outline
4.1 Overview of Network 4.4 Generalized Forward and
layer SDN
• data plane • match
• control plane • action
4.2 What’s inside a router • OpenFlow examples
4.3 IP: Internet Protocol of match-plus-action in
• datagram format action
• fragmentation
• IPv4 addressing
• DHCP and network
address translation
• ICMP
• IPv6
Network Layer: Data Plane 4-
146
Generalized Forwarding and SDN
Each router contains a flow table that is computed and
distributed by a logically centralized routing controller

logically-centralized routing controller

control plane

data plane
local flow table
headers counters actions

1
0100 1101

3 2
values in arriving
packet’s header
Network Layer: Data Plane 4-
147
OpenFlow data plane abstraction
§ flow: defined by header fields
§ generalized forwarding: simple packet-handling rules
• Pattern: match 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 table in a router (computed and distributed by


controller) define router’s match+action rules
Network Layer: Data Plane 4-
148
OpenFlow data plane abstraction
§ flow: defined by header fields
§ generalized forwarding: simple packet-handling rules
• Pattern: match 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

* : wildcard
1. src=1.2.*.*, dest=3.4.5.* à drop
2. src = *.*.*.*, dest=3.4.*.* à forward(2)
3. src=10.1.2.3, dest=*.*.*.* à send to controller
OpenFlow: Flow Table Entries

Rule Action Stats

Packet + byte counters


1. Forward packet to port(s)
2. Encapsulate and forward to controller
3. Drop packet
4. Send to normal processing pipeline
5. Modify Fields

Switch VLAN MAC MAC Eth IP IP IP TCP TCP


Port ID src dst type Src Dst Prot sport dport

Link layer Network layer Transport layer


Examples
Destination-based forwarding:
Switch MAC MAC Eth VLAN IP IP IP TCP TCP
Action
Port src dst type ID Src Dst Prot sport dport
* * * * * * 51.6.0.8 * * * port6
IP datagrams destined to IP address 51.6.0.8 should
be forwarded to router output port 6
Firewall:
Switch MAC MAC Eth VLAN IP IP IP TCP TCP
Forward
Port src dst type ID Src Dst Prot sport dport
* * * * * * * * * 22 drop
do not forward (block) all datagrams destined to TCP port 22

Switch MAC MAC Eth VLAN IP IP IP TCP TCP


Forward
Port src dst type ID Src Dst Prot sport dport
* * * * * 128.119.1.1
* * * * drop
do not forward (block) all datagrams sent by host 128.119.1.1
OpenFlow abstraction
§ match+action: unifies different kinds of devices
§ Router § Firewall
• match: longest • match: IP addresses
destination IP prefix and TCP/UDP port
• action: forward out numbers
a link • action: permit or
§ Switch deny
• match: destination § NAT
MAC address • match: IP address
• action: forward or and port
flood • action: rewrite
address and port

Network Layer: Data Plane 4-


152
OpenFlow example Example: datagrams from
hosts h5 and h6 should
be sent to h3 or h4, via s1
match action and from there to s2
IP Src = 10.3.*.* Host h6
forward(3)
IP Dst = 10.2.*.* 10.3.0.6
1 s3 controller
2

3 4

Host h5
10.3.0.5

1 s1 1 s2
2 Host h4
4 2 4 10.2.0.4
Host h1 3 3
10.1.0.1
Host h2
10.1.0.2 match action
match action Host h3 ingress port = 2
10.2.0.3 forward(3)
ingress port = 1 IP Dst = 10.2.0.3
IP Src = 10.3.*.* forward(4) ingress port = 2
forward(4)
IP Dst = 10.2.*.* IP Dst = 10.2.0.4
Chapter 4: done!
4.1 Overview of Network 4.4 Generalized Forward and
layer: data plane and SDN
control plane • match plus action
4.2 What’s inside a router • OpenFlow example
4.3 IP: Internet Protocol
• datagram format
• fragmentation Question: how do forwarding tables
• IPv4 addressing (destination-based forwarding) or
• DHCP and NAT flow tables (generalized
• ICMP forwarding) computed?
• IPv6 Answer: by the control plane
(EE3315)

Network Layer: Data Plane 4-


154

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy