0% found this document useful (0 votes)
29 views111 pages

Chapter 4a - Network Layer - The Data Plane

Chapter 4a - Network Layer - The Data Plane

Uploaded by

salsaheb4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views111 pages

Chapter 4a - Network Layer - The Data Plane

Chapter 4a - Network Layer - The Data Plane

Uploaded by

salsaheb4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 111

Chapter 4a

Network Layer:
The Data Plane

A note on the use of these Powerpoint slides:


We’re making these slides freely available to all (faculty, students, readers).
They’re in PowerPoint form so you see the animations; and can add, modify,
and delete slides (including this one) and slide content to suit your needs.
They obviously represent a lot of work on our part. In return for use, we only
ask the following: Computer
 If you use these slides (e.g., in a class) that you mention their source
(after all, we’d like people to use our book!)
Networking: A Top
 If you post any slides on a www site, that you note that they are adapted
from (or perhaps identical to) our slides, and note our copyright of this
Down Approach
material.
7th edition
Thanks and enjoy! JFK/KWR
Jim Kurose, Keith Ross
All material copyright 1996-2016 Pearson/Addison Wesley
J.F Kurose and K.W. Ross, All Rights Reserved April 2016
Network Layer: Data Plane 4-1
Chapter 4: outline
4.1 Overview of 4.4 Generalized
Network layer Forward and SDN
• data plane • match
• control plane • action
4.2 What’s inside a • OpenFlow
router examples of
4.3 IP: Internet Protocol match-plus-action
• datagram format in action
• fragmentation
• IPv4 addressing
• network address
translation
• IPv6
Network Layer: Data Plane 4-2
Network layer
 transport segment from
application
transport
network
sending to receiving data link
physical

host network
network
data link
network
data link

 on sending side
physical physical
data link
physical network network

encapsulates segments data link


physical
data link
physical

into datagrams (Packet)


network
 On receiving side,
network
data link data link
physical physical

delivers segments to
network
data link
physical
transport layer network
application
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-3
Routers and the Network Layer

4
Separate the Networks
Routers
Two key network-layer
functions
network-layer functions: analogy: taking a trip
forwarding: move  forwarding: process
packets from router’s of getting through
input to appropriate single interchange
router output
routing: determine
route taken by packets
 routing: process of
from source to planning trip from
destination source to
• routing algorithms destination

Network Layer: Data Plane 4-7


Network layer: data plane, control
plane
Data plane Control plane
local, per-router network-wide logic
function determines how datagram is
determines how routed among routers along
datagram arriving on end-end path from source
host to destination host
router input port is
two control-plane
forwarded to router
output port approaches:
forwarding • traditional routing
values in arriving
packet header
function algorithms: implemented
in routers
0111 1
2
• software-defined
3
networking (SDN):
implemented in (remote)
servers
Network Layer: Data Plane 4-8
Per-router control plane
Individual routing algorithm components in each and every
router interact in the control plane

Routing
Algorithm
control
plane

data
plane

values in arriving
packet header
0111 1
2
3

Network Layer: Control Plane 5-9


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

© 2004, Cisco Systems, Inc. All rights reserved. 12


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) operttes
in nanosecond
timeframe
high-seed
switching
fabric

router input ports router output ports

Network Layer: Data Plane 4-13


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
see chapter 5 output 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-14
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 00011001 00000000


through 2
11001000 00010111 00011111 11111111

otherwise 3

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


Network Layer: Data Plane 4-15
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-16
Router Routing Tables
Routing IP Packets

 A router’s goal is to forward a packet destined


outside the network to its correct destination!
 To do so, a router keeps track of local and
remote networks.
 This information is stored in a routing table.
18
Routing IP Packets

19
Routing IP Packets

20
Routing IP Packets

21
Routing IP Packets

22
Routing IP Packets

23
Routing Table Routes

24
Routing
Table
Routes

 The routing table of a router stores information about:


• Directly connected routes:
• These routes come from the active router interfaces.
• Routers Add a directly connected route when an interface is
configured with an IP address and is activated.
• Remote routes:
• These routes come from remote networks connected to other
routers.
• Routes to these networks can either be manually configured or
dynamically learned using a dynamic routing protocol.
25
IPv4 Router Routing Table
192.168.10.0/24 10.1.1.0/24
.10 G0/0 .10
PC1 209.165.200.224 /30
.1 .1
.225 .226
R1 S0/0/0 R2
.10 .1 .1 .10
PC2 G0/1

192.168.11.0/24 10.1.2.0/24
R1#show ip route ( Used to check the routing table of the router)
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks


D 10.1.1.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
D 10.1.2.0/24 [90/2170112] via 209.165.200.226, 00:00:05, Serial0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0
L 192.168.10.1/32 is directly connected, GigabitEthernet0/0
192.168.11.0/24 is variably subnetted, 2 subnets, 3 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/1
L 192.168.11.1/32 is directly connected, GigabitEthernet0/1
209.165.200.0/24 is variably subnetted, 2 subnets, 3 masks
C 209.165.200.224/30 is directly connected, Serial0/0/0
L 209.165.200.225/32 is directly connected, Serial0/0/0 26
A Quick Look at Routing
 Router interfaces can be grouped into two categories:
• Ethernet LAN interfaces: Requires an IP address and enabled.
• Serial WAN interfaces – Requires an IP address and enabled.

Serial interfaces

LAN interfaces
27
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-28


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-29


Switching via a bus
 datagram from input port
memory
to output port memory via
a shared bus
 bus contention: switching
speed limited by bus bus
bandwidth
 32 Gbps bus, Cisco 5600:
sufficient speed for access
and enterprise routers

Network Layer: Data Plane 4-30


Switching via interconnection
network
 overcome bus bandwidth
limitations
 banyan networks, crossbar,
other interconnection nets
initially developed to connect
processors in multiprocessor
 Cisco 12000: switches 60
crossbar
Gbps through the
interconnection network

Network Layer: Data Plane 4-31


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


only one red datagram can later: green
be transferred. packet
lower red packet is blocked experiences HOL
blocking
Network Layer: Data Plane 4-32
Output ports

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

 buffering required when datagrams arrive from fabric faster than the
transmission rate Datagram (packets) can be
 scheduling discipline chooses among queued datagrams for transmission
lost due to congestion, lack of
buffers
Priority scheduling – who gets best
performance, network neutrality
Network Layer: Data Plane 4-33
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-34


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-35


Scheduling policies:
priority
high priority queue
(waiting area)

priority scheduling: arrivals departures

send highest
priority queued classify link
(server)
packet low priority queue
(waiting area)
 multiple classes, 2
with different arrivals
1 3 4 5

priorities
packet
• real world in 1 3 2 4 5
example? service

departures
1 3 2 4 5

Network Layer: Data Plane 4-36


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

2
1 3 4 5
arrivals

packet
in 1 3 2 4 5
service

departures
1 3 3 4 5

Network Layer: Data Plane 4-37


Scheduling policies: still
more
Weighted Fair Queuing (WFQ):
 generalized Round Robin
 each class gets weighted amount of
service in each cycle
 real-world example?

Network Layer: Data Plane 4-38


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


IP datagram format
IP protocol version 32 bits
number total datagram
header length type of length (bytes)
ver head. length
(bytes) len service for
“type” of data fragment fragmentation/
16-bit identifier flgs
offset reassembly
max number time to upper header
remaining hops live layer checksum
(decremented at
32 bit source IP address
each router)
upper layer protocol 32 bit destination IP address
to deliver payload to
Example values are: options (if any) e.g. timestamp,
record route
• 01 ICMP, data
• 06 TCP, 17 UDP taken, specify
(variable length, list of routers
how much overhead? typically a TCP to visit.
 20 bytes of TCP or UDP segment)
 20 bytes of IP
 = 40 bytes + app
layer overhead Network Layer: Data Plane 4-41
IP fragmentation,
reassembly
 network links have MTU
(max.transfer size) -
largest possible link-
level frame fragmentation:


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-42
IP fragmentation, reassembly
 The Data Link layer passes the MTU upward to the network layer which
determines then how large to create the packets.

 In some cases, an intermediary device - usually a router - will need to


split up “fragment” a packet when forwarding it from one media to a
media with a smaller MTU. This process is called packet fragmentation.

•Copper Ethernet: MTU = 1,518 bytes.


•Copper Serial: Frame Relay MTU = 520 bytes.
•Optical Fiber: ATM MTU = 17,966 bytes.
•Wireless: 802.11 MTU = 2346bytes.

4-43
IP fragmentation,
reassembly
length ID fragflag offset
example: =4000 =x =0 =0
 4000 byte
datagram one large datagram becomes
several smaller datagrams
 MTU = 1500
bytes
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-44


Chapter 4: outline
4.1 Overview of 4.4 Generalized
Network layer Forward and SDN
• data plane • match
• control plane • action
4.2 What’s inside a • OpenFlow
router examples of
4.3 IP: Internet Protocol match-plus-action
• datagram format in action
• fragmentation
• IPv4 addressing
• network address
translation
• IPv6
Network Layer: Data Plane 4-45
IP addressing: introduction
223.1.1.1
 IP address: 32-bit
identifier for host, 223.1.2.1

router interface 223.1.1.2


 interface: 223.1.1.4 223.1.2.9

connection between
host/router and 223.1.1.3
223.1.3.27

physical link 223.1.2.2

• router’s typically have


multiple interfaces
• host typically has one 223.1.3.1 223.1.3.2
or two interfaces (e.g.,
wired Ethernet,
wireless 802.11)
 IP addresses 223.1.1.1 = 11011111 00000001 00000001 00000001
associated with each
interface 223 1 1 1

Network Layer: Data Plane 4-46


Cisco IP Addressing and Subnetting
(Classful Addressing)

© 2004, Cisco Systems, Inc. All rights reserved. 47


IP addressing: Format
Class A Address

© 2004, Cisco Systems, Inc. All rights reserved. 49


Class B Address

© 2004, Cisco Systems, Inc. All rights reserved. 50


Class C Address

© 2004, Cisco Systems, Inc. All rights reserved. 51


Class D Address
Architecture

© 2004, Cisco Systems, Inc. All rights reserved. 52


Class E Address
Architecture

© 2004, Cisco Systems, Inc. All rights reserved. 53


Network Address

© 2004, Cisco Systems, Inc. All rights reserved. 54


Broadcast Address

© 2004, Cisco Systems, Inc. All rights reserved. 55


IPv4 Address Allocation

© 2004, Cisco Systems, Inc. All rights reserved. 56


IP Address Range

© 2004, Cisco Systems, Inc. All rights reserved. 57


5
8 Host Can Send a Packet To
Itself
• The IP address 127.0.0.1 is a loopback interface that is automatically assigned to a
TCP/IP host.

Any IP address within the network 127.0.0.0/8 refers to the local host.
Used by the host different application to communicate with each other.
Useful for testing purposes.

C:\Users\Admin> ping 127.0.0.1

Pinging 127.0.0.1 with 32 bytes of data:


Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.0.0.1:


Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Users\Admin>

© 2004, Cisco Systems, Inc. All rights reserved. 58


5
9 Host Can Send a Packet To a Local
Host

Hosts are on the same network : sending host and receiving host share the same
network address.

•PC1 (192.168.10.10 /24) sends a packet to PC2 (192.168.10.11 /24)


Since they are both on the same network (192.168.10.x /24) the services of a
default gateway are not required.

.10
PC1 192.168.10.0/24
.1
.11 G0/0
PC2

R1
.10 G0/1
PC3 .1

.11 192.168.11.0/24
PC4

© 2004, Cisco Systems, Inc. All rights reserved. 59


Host Can Send a Packet To a Remote
6
0

Host

 When a host is on a remote network, the hosts do not share the same network
address.
A default gateway IP address is required.

 PC1 (192.168.10.10 /24) sends a packet to PC4 (192.168.11.11 /24)


Since they are on different networks (192.168.10.x /24 and 192.168.11.x /24)
the services of a default gateway are required.

.10
PC1 192.168.10.0/24
.1
.11 G0/0
PC2

R1
.10 G0/1
PC3 .1

.11 192.168.11.0/24
PC4

© 2004, Cisco Systems, Inc. All rights reserved. 60


6
1 Host Can Send a Packet To a Remote
Host
• The default gateway is the device (i.e, router) that routes traffic from the local
network to remote networks.

A host sending a packet to a remote host does not maintain routing


information beyond the local network.

The default gateway maintains a routing table containing directly connected


and remote network route information.

.10
PC1 192.168.10.0/24
.1
.11 G0/0
PC2

R1
.10 G0/1
PC3 .1

.11 192.168.11.0/24
PC4

© 2004, Cisco Systems, Inc. All rights reserved. 61


6
2
Subnet Mask

A host on the 192.168.1.0/24 network.”

• When the host is to send data , it uses the subnet mask to check if the destination packet is on
the same network.

• So, it knows whether to encapsulate the IP packet into an Ethernet frame with:

The Destination MAC Address of the default gateway


Must know the default gateway’s IP address , using ARP it will get the MAC

The Destination MAC Address of the host with the Destination IP address of the packet.

© 2004, Cisco Systems, Inc. All rights reserved. 62


6
3
IP Addresses – First
look
Network Address 172.16.0.0

172.16.10.100/16

Network Address
192.168.1.0/30
172.16.10.55/16
ISP
Internet
192.168.1.2/30
172.16.1.1/16
192.168.1.1/30 172.16.10.3/16

© 2004, Cisco Systems, Inc. All rights reserved. 63


6
4
IP Addresses – First look
Network Address 172.16.0.0

172.16.10.100/16 Gateway: 172.16.1.1

Network Address
192.168.1.0/30
172.16.10.55/16
ISP Gateway: 172.16.1.1

Internet
192.168.1.2/30
172.16.1.1/16
192.168.1.1/30 172.16.10.3/16 Gateway: 172.16.1.1

• All hosts in the same network will typically have the same default gateway IP
address.

• The ipconfig or ifconfig commands at the command line are used in windows and
Linux .

© 2004, Cisco Systems, Inc. All rights reserved. 64


6
5

Default Gateway

© 2004, Cisco Systems, Inc. All rights reserved. 65


Private IP Addresses

© 2004, Cisco Systems, Inc. All rights reserved. 66


Who assigns IP Network
6

Addresses?
7

• Internet Assigned Numbers Authority (IANA) (http://www.iana.net) is the master holder of the IP
addresses.

• Public addresses are required on the Internet and they must be unique.

• IANA allocated IP addresses to various other registries to manage for particular purposes or for
regional areas.

Regional Internet Registries (RIRs).


The ISP loans or rents these addresses to the organization.
ISP also provides DNS services, e-mail services, and a website.
© 2004, Cisco Systems, Inc. All rights reserved. 67
6
8
Regional Internet Registries
(RIR)

• The 5 RIR’s are:


AfriNIC (African Network Information Centre) - Africa Region .
APNIC (Asia Pacific Network Information Centre) - Asia/Pacific Region.
ARIN (American Registry for Internet Numbers) - North America Region.
LACNIC (Latin-American and Caribbean IP Address Registry) .
RIPE NCC (Europe, the Middle East, and Central Asia ). http://www.ripe.net
© 2004, Cisco Systems, Inc. All rights reserved. 68
IPv4 and IPv6

© 2004, Cisco Systems, Inc. All rights reserved. 69


Subnets
 IP address: 223.1.1.1
• subnet part - high
order bits 223.1.1.2 223.1.2.1
223.1.1.4 223.1.2.9
• host part - low
order bits 223.1.2.2
 what’s a subnet? 223.1.1.3 223.1.3.27

• device interfaces subnet


with same subnet
223.1.3.2
part of IP address 223.1.3.1
• can physically
reach each other
without intervening network consisting of 3 subnets
router

Network Layer: Data Plane 4-70


Subnets
223.1.1.0/24
223.1.2.0/24
recipe 223.1.1.1

 to determine the 223.1.1.2 223.1.2.1


subnets, detach 223.1.1.4 223.1.2.9

each interface 223.1.2.2


from its host or 223.1.1.3 223.1.3.27

router, creating subnet


islands of isolated
networks 223.1.3.1 223.1.3.2

 each isolated
network is called 223.1.3.0/24
a subnet
subnet mask: /24
Network Layer: Data Plane 4-71
Subnets 223.1.1.2

how many? 223.1.1.1 223.1.1.4

223.1.1.3

223.1.9.2 223.1.7.0

223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0

223.1.2.6 223.1.3.27

223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2

Network Layer: Data Plane 4-72


Subdividing the Host Octets of a Class C
Address

© 2004, Cisco Systems, Inc. All rights reserved. 73


Subdividing the Host Octets of a Class B
Address

© 2004, Cisco Systems, Inc. All rights reserved. 74


Subdividing the Host Octets of a Class A
Address

© 2004, Cisco Systems, Inc. All rights reserved. 75


Subdividing the Host Octets

© 2004, Cisco Systems, Inc. All rights reserved. 76


IP Addressing and Subnetting
Workbook

Please refer to :
IP Addressing and
Subnetting
Workbook

© 2004, Cisco Systems, Inc. All rights reserved. 77


Subnetting Chart

© 2004, Cisco Systems, Inc. All rights reserved. 78


Subnetting Scheme

© 2004, Cisco Systems, Inc. All rights reserved. 79


4-80
Example: A company has 6 departments as follows:
Department S1 has 14 users,
Department S2 has 14 users,
Department S3 has 14 users,
Department S4 has 14 users,
Department S5 has 62 users,
Department S6 has 126 users.

Design an addressing scheme for the above


company using the class C Network :
201.45.222.0

4-81
6 subnets needed : 201.45.222.000 00000

4-82
4-83
VLSM – Variable Length Subnet Mask
Workbook

Please refer to:


VLSM – Variable
Length Subnet
Mask Workbook

© 2004, Cisco Systems, Inc. All rights reserved. 84


IP addressing: CIDR
CIDR: Classless InterDomain Routing
• 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

Network Layer: Data Plane 4-85


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-86


IP addresses: how to get one?

 IP addresses and other information can be obtained:


• Statically: used for network devices such as gateways, switches, servers, and
printers.
• Dynamically By Dynamic Host Configuration Protocol (DHCP) service: The IP
addresses are dynamic (leased) assigned and when no longer in use are
automatically returned to the pool for reallocation.
4-87
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-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
• DHCP server responds with “DHCP offer” msg
• 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 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
DHCP server
yiaddr: 0.0.0.0out
transaction
there?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
transaction ID: 654
address you can use
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
Broadcast: OK. I’ll
yiaddrr: 223.1.2.4
take that IPID:address!
transaction 655
lifetime: 3600 secs

DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255,
Broadcast: 68
OK. You’ve
yiaddrr: 223.1.2.4
gottransaction
that IPID:address!
655
lifetime: 3600 secs
Network Layer: Data Plane 4-90
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-91


DHCP: example
DHCP DHCP  connecting laptop needs
DHCP UDP its IP address, addr of
DHCP IP first-hop router, addr of
DHCP Eth DNS server: use DHCP
Phy
DHCP
 DHCP request encapsulated
in UDP, encapsulated in IP,
DHCP
encapsulated in 802.1
DHCP 168.1.1.1
DHCP UDP Ethernet
DHCP IP  Ethernet frame
DHCP Eth router with DHCP
Phy server built into broadcast (dest:
router FFFFFFFFFFFF) on LAN,
received at router
running DHCP
 Ethernet server
demuxed to IP
demuxed, UDP
demuxed to DHCP

Network Layer: Data Plane 4-92


DHCP: example
 DCP server formulates
DHCP DHCP
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
DHCP UDP forwarded to client,
DHCP IP demuxing up to DHCP
DHCP Eth router with DHCP at client
DHCP
Phy server built into  client now knows its
router IP address, name
and IP address of
DSN server, IP
address of its first-
hop router

Network Layer: Data Plane 4-93


IP addresses: how to get
one?
Q: how does network get subnet part of IP
addr?
A: gets allocated portion of its provider
ISP’s address space

ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20

Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23


Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. ….
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23

Network Layer: Data Plane 4-94


Hierarchical addressing: route
aggregation
erarchical addressing allows efficient advertisement of routin
formation:

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-95


IP addressing: the last word...

Q: how does an ISP get block of


addresses?
A: ICANN: Internet Corporation for
Assigned
Names and Numbers
http://www.icann.org/
• allocates addresses
• manages DNS
• assigns domain names, resolves
disputes

Network Layer: Data Plane 4-96


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 datagrams with source or


local destination in this network
network have same have 10.0.0/24 address for
single source NAT IP source, destination (as usual)
address:
138.76.29.7,different Network Layer: Data Plane 4-97
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-98
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-99
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-100
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
• NAT traversal: what if client wants to
connect to server behind NAT?
Network Layer: Data Plane 4-101
IPv6: motivation
 initial motivation: 32-bit address space
soon to be completely allocated.
 additional motivation:
• header format helps speed
processing/forwarding
• header changes to facilitate QoS

IPv6 datagram format:


• fixed-length 40 byte header
• no fragmentation allowed

Network Layer: Data Plane 4-102


IPv4 IP address vs. IPv6 IP
address

© 2004, Cisco Systems, Inc. All rights reserved. 103


IPv4 and IPv6 Addresses

© 2004, Cisco Systems, Inc. All rights reserved. 104


IPv6 datagram format
riority: identify priority among datagrams in flow
ow Label: identify datagrams in same “flow.”
ver pri flow label
payload len next hdr
source address
(128 bits) Flow
FlowLabel
Label(20(20bits)
bits)
destination address –– Field
Field provides aaspecial
(128 bits) limit provides
hopservice for
special
real-time
service for real-time
applications.
applications.
–– ItItcan
canbe
beused
usedtotoinform
inform
data
routers
routers and switchesto
and switches to
maintain
maintain the same pathfor
the same path for
the packet flow so that
the packet flow so that
32 bits packets
packetsare
arenot
notreordered.
reordered.

Network Layer: Data Plane 4-105


IPv6 datagram format
ext header: identify upper layer protocol for data
ver pri flow label
payload len next hdr
source address
(128 bits)
destination address
(128 bits)

data Next
NextHeader
Header(8 (8bits)
bits)
–– Field
Fieldisisequivalent
equivalentto
tothe
theIPv4
IPv4Protocol
Protocol
field.
field.
32 bits –– ItItindicates
indicatesthethedata
datapayload
payloadtype typethatthatthethe
packet is carrying, enabling the
packet is carrying, enabling the network network
layer
layerto topass
passthe
thedata
datatotothe
theappropriate
appropriate
upper-layer protocol.
upper-layer protocol.
–– This
Thisfield
fieldisisalso
alsoused
usedififthere
thereare areoptional
optional
extension headers
extension headers addedadded to the
to the IPv6
Network Layer:IPv6
Data Plane 4-106
packet.
packet.
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-107


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
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-108
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-109


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: F
dest: E
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-110
IPv6:
adoption
 Google: 8% of clients access services via
IPv6
 NIST: 1/3 of all US government domains
are IPv6 capable

 Long (long!) time for deployment, use


•20 years and counting!
•think of application-level changes in last 20
years: WWW, Facebook, streaming media,
Skype, …
•Why?

Network Layer: Data Plane 4-111

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