0% found this document useful (0 votes)
14 views

Chapter 4 V7 01

Uploaded by

leticia
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)
14 views

Chapter 4 V7 01

Uploaded by

leticia
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/ 32

Chapter 4

Network Layer

Computer
Networking: A Top
Down Approach
7th edition
Jim Kurose, Keith Ross
Pearson/Addison Wesley
All material copyright 1996-2016 April 2016
J.F Kurose and K.W. Ross, All Rights Reserved Network Layer: Data Plane 4-1
Chapter 4: outline
4.1 Overview of Network layer
• data plane
• control plane

4.2 What’s inside a router

4.3 IP: Internet Protocol


• datagram format
• fragmentation
• IPv4 addressing
• network address translation
• IPv6

Network Layer: Data Plane 4-2


Network layer
application

▪ transport segment from transport


network
data link
sending to receiving host physical
network network

▪ on sending side encapsulates


data link data link
network physical
physical
data link
physical network network
segments into datagrams data link data link
physical physical

▪ on receiving side, delivers network network


segments to transport layer data link
physical
network
data link
physical

▪ network layer protocols in


data link
physical
application
every host, router network
data link network
transport
network
physical data link
▪ router examines header fields
network data link
data link physical physical
physical

in all IP datagrams passing


through it

Network Layer: Data Plane 4-3


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 ▪ routing: process of


taken by packets from planning trip from source
source to destination to destination
• routing algorithms

Network Layer: Data Plane 4-4


Network layer: data plane, control plane

Data plane Control plane


▪ local, per-router function ▪ network-wide logic
▪ determines how datagram ▪ determines how datagram is routed
arriving on router input port is among routers along end-end path
forwarded to router output port from source host to destination host
▪ forwarding function ▪ two control-plane approaches:
• traditional routing algorithms:
implemented in routers
values in arriving
packet header • software-defined networking
0111 1
(SDN): implemented in (remote)
2
servers
3

Network Layer: Data Plane 4-5


Chapter 4: outline
4.1 Overview of Network layer
• data plane
• control plane

4.2 What’s inside a router

4.3 IP: Internet Protocol


• datagram format
• fragmentation
• IPv4 addressing
• network address translation
• IPv6

Network Layer: Data Plane 4-6


Router architecture overview
▪ high-level view of generic router architecture:

routing, management control plane


routing (software) operates in millisecond time frame
processor

forwarding data plane


(hardware) operates in
nanosecond timeframe

high-speed
switching
fabric

router input ports router output ports

Network Layer: Data Plane 4-7


Input port functions

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

physical layer:
bit-level reception
data link layer: switching:
e.g., Ethernet ▪ using header field values, lookup output port using
forwarding table in input port memory
▪ queuing: if datagrams arrive faster than forwarding
rate into switch fabric
▪ destination-based forwarding: forward based only
on destination IP address (traditional)

Network Layer: Data Plane 4-8


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

Network Layer: Data Plane 4-9


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-10
Switching fabrics
▪ transfer packet from input buffer to appropriate output
buffer
▪ switching rate: rate at which packets can be transfer
from inputs to outputs

three types of switching fabrics

memory

memory bus crossbar

Network Layer: Data Plane 4-11


Output ports

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

Datagram (packets) can be lost due to congestion, lack of buffers


▪ buffering required when datagrams arrive from fabric faster
than the transmission rate
▪ scheduling discipline chooses among queued datagrams for
transmission
Priority scheduling – who gets best performance, network neutrality

Network Layer: Data Plane 4-12


Scheduling mechanisms

▪ scheduling: choose next packet to send on link


▪ FIFO (first in first out) scheduling: send in order of
arrival to queue
• 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-13


Chapter 4: outline
4.1 Overview of Network layer
• data plane
• control plane
4.2 What’s inside a router
4.3 IP: Internet Protocol
• datagram format
• fragmentation
• IPv4 addressing
• network address translation
• IPv6

Network Layer: Data Plane 4-14


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


IPv4 datagram format
IP protocol version
number 32 bits total datagram
length (bytes)
header length head. type of
(bytes) ver length
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
each router) 32 bit source IP address

32 bit destination IP address


upper layer protocol
to deliver payload to
options (if any)

how much overhead?


❖ 20 bytes of TCP data
❖ 20 bytes of IP (variable length,
❖ = 40 bytes + app layer typically a TCP
overhead or UDP segment)

Network Layer: Data Plane 4-16


IP fragmentation, reassembly
▪ network links have MTU
(max.transfer size) - largest
possible link-level frame
fragmentation:


• different link types,
in: one large datagram
different MTUs out: 3 smaller datagrams
▪ large IP datagram divided
(“fragmented”) within net
• one datagram becomes
several datagrams reassembly
• “reassembled” only at final
destination
• IP header bits used to …
identify, order related
fragments

Network Layer: Data Plane 4-17


Chapter 4: outline
4.1 Overview of Network layer
• data plane
• control plane
4.2 What’s inside a router
4.3 IP: Internet Protocol
• datagram format
• fragmentation
• IPv4 addressing
• network address translation
• IPv6

Network Layer: Data Plane 4-18


IP addressing: introduction
223.1.1.1

▪ IP address: 32-bit identifier 223.1.2.1


for host, router interface
▪ interface: connection 223.1.1.2
223.1.1.4 223.1.2.9
between host/router and
physical link
• router’s typically have multiple 223.1.1.3
223.1.3.27
interfaces 223.1.2.2
• host typically has one or two
interfaces (e.g., wired Ethernet,
wireless 802.11)
▪ IP addresses associated with 223.1.3.1 223.1.3.2

each interface

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 1 1

Network Layer: Data Plane 4-19


Subnets
▪ IP address: 223.1.1.1
•subnet part - high order
bits 223.1.1.2 223.1.2.1
•host part - low order bits 223.1.1.4 223.1.2.9

▪ what’s a subnet ?
223.1.2.2
223.1.1.3 223.1.3.27
•device interfaces with same
subnet
subnet part of IP address
•can physically reach each
223.1.3.2
other without intervening 223.1.3.1
router

network consisting of 3 subnets

Network Layer: Data Plane 4-20


Subnets
223.1.1.0/24
223.1.2.0/24
recipe 223.1.1.1

▪ to determine the subnets,


detach each interface from 223.1.1.2 223.1.2.1
223.1.1.4 223.1.2.9
its host or router, creating
islands of isolated networks 223.1.2.2
223.1.1.3 223.1.3.27
▪ each isolated network is subnet
called a subnet
223.1.3.1 223.1.3.2

223.1.3.0/24

subnet mask: /24

Network Layer: Data Plane 4-21


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


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


DHCP: Dynamic Host Configuration Protocol
goal: allow host to dynamically obtain its IP address from network server
when it joins network
• 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-24


DHCP client-server scenario
DHCP server DHCP discover arriving
client
src : 0.0.0.0, 68
Broadcast: is there a
dest.: 255.255.255.255,67
DHCPyiaddr:
server 0.0.0.0
out there?
transaction ID: 654

DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server!
yiaddrr:Here’s an IP
223.1.2.4
transaction
address youID:can
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,
Broadcast: 68
OK. You’ve
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs

Network Layer: Data Plane 4-25


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


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 source destination in this network
NAT IP address: 138.76.29.7,different have 10.0.0/24 address for
source port numbers source, destination (as usual)

Network Layer: Data Plane 4-27


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

▪ devices inside local net not explicitly addressable, visible by outside


world (a security plus)

Network Layer: Data Plane 4-28


Chapter 4: outline
4.1 Overview of Network layer
• data plane
• control plane
4.2 What’s inside a router
4.3 IP: Internet Protocol
• datagram format
• fragmentation
• IPv4 addressing
• network address translation
• IPv6

Network Layer: Data Plane 4-29


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


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-31
Other changes from IPv4

▪ checksum: removed entirely to reduce processing


time at each hop

▪ ICMPv6: new version of ICMP


• additional message types, e.g. “Packet Too Big”

Network Layer: Data Plane 4-32

You might also like