Microsoft PowerPoint Presentation: 03_1_Network_Layer

prunelimitNetworking and Communications

Oct 23, 2013 (3 years and 5 months ago)



| 47

Communication Systems



Chair of Communication Systems

Department of Applied Sciences

University of Freiburg



| 47

Communication Systems

Last lecture

Message segmentation in packet switched networks advantage over
message switching

Different types of packet forwarding/routing in

Datagram networks (Internet, ...)

Virtual circuit networks (ISDN, ATM, ...)

Got taxonomy of different network types (circuit and packet switching
with respective subtypes)

Requirements for communication between so called end systems

Network access, different types (home, company, mobile)

depending on requirements of end users


| 47

Communication Systems

Last lecture

Physical representation of digital bit streams all kinds of
electromagnetic waves (electromagnetic spectrum)

Encoding, decoding of data for transport over different types of

Physical parameters: frequency, wavelength, (effective) bandwidth,
Nyquest formula for max. bandwidth of given medium

Copper wire (single twisted pair for telephone, higher quality for
ethernet, fiber optics), “air” (mobile phones, satellite links, WLAN, ...)

Guided and unguided media, propagation delay (speed of light)


| 47

Communication Systems

plan for this lecture

Standards and network layering models

OSI and IP

Need of an universal service

IP as layer 3 network protocol

Start with look at IP header


| 47

Communication Systems

network layer models

Talked of some base concepts of data communication and
bit transportation

But how to do that in an ordered and general way?

A structured composition of networks is needed for data
communication of very different machines and operating

There are several of these models, the ISO/OSI layering
model is one of them

ISO: International Standards Organization

OSI: Open Systems Interconnect

Reference model for implementation of network


| 47

Communication Systems

network layer models

OSI: “Academic model” which shows seven layers

It helps to illustrate and implement the core function of networks,
but no real networking architecture is modeled after it

More practical is the TCP/IP layering model with fewer layers

In general:

Layering breaks down very complex tasks into simpler ones

Implementation details in one layer are abstracted away from
the others

But: Can introduce overhead and need for intentional violation
of layering concepts


| 47

Communication Systems

network layer models

“academic” OSI model


| 47

Communication Systems

comparison of OSI and TCP/IP layers

OSI Layers

Application Layer

Presentation Layer

Session Layer

Transportation Layer

Network Layer

Data Link Layer

Physical Layer

TCP/IP Layers

Application Layer

Transportation Layer

Internet Layer

Physical Layer


| 47

Communication Systems

comparison of OSI and TCP/IP layers

OSI in comparison to TCP/IP (developed by ARPA)


| 47

Communication Systems

why talking about layer models?

There are quite a few layering models with different levels of

Some models reduce the OSI to five layers and move session and
presentation into application (Tanenbaum)

Some real live employment of networks will show that some layers
have to be split up

Tunneling of protocols

and protocol stacks through other layers
or protocols would introduce rather complex models, tunneling can
occur on various layers

ethernet in ATM

IP and others over PPP

IP over DNS

useful for many hotspots with blocked general IP but
open DNS, IP over HTTP/WAP ...


| 47

Communication Systems

why talking about layer models? Cont.

Network layering is not a strictly defined issue, you will find
sublayers, e.g. in Mobile networks like GSM or 802.11

Much combinations of layers and protocols are possible (and

“tunneling of stacks within layers”)


| 47

Communication Systems

why talking about layer models? Cont.

Further on the lecture will embroider some of the presented layers
and ignore others

But layering will help to understand complex problems and split
them into manageable units

general concept

of computer

The next part of this lecture will deal with the network layer (present
in nearly every network model)

The most important representative of this layer is the
protocol (IP)

IP used in every host
host connection

Many physical layer implementations

Many applications operating over IP

So we will start with IP now ...


| 47

Communication Systems

universal service connecting networks

We introduced some different kinds of physical networks

Modem, ISDN, DSL for connection of individuals

Technologies like Ethernet (over copper and fiber optics)

Wireless networks, ...

Many implementations for different networking purposes

Wide Area Networks (
) which may span countries (e.g.

for Germany or

for Europe) or even continents;
connecting infrastructure components like routers not end user

Local Area Networks (
) which implemented within buildings,
mostly bridging only short distances with many hosts connected

In the past distinction of networks by bandwidth offered


| 47

Communication Systems

universal service connecting networks

Each type of network structure may require or be
implemented with different low level protocols


| 47

Communication Systems

connecting networks

DSL as an example for dedicated point
point connection over a
two wire copper cable with a length up to 6km


packet orientated LAN protocol

Multilink (broadcast) network with no dedicated point

Different speeds over copper wire, coaxial cable and fiber


connection orientated LAN and WAN protocol

Virtual ptp connection through virtual channels and pathes

Modem, ISDN for WAN, FDDI, TokenRing, ... for LAN

Wireless links on GPRS, HSCSD, UMTS, WLAN, ...


| 47

Communication Systems

connecting networks cont.

Intermediate protocol with unified addressing scheme is needed


| 47

Communication Systems

connecting networks

Universal protocol needed is implemented in the network layer

Network layer is
third layer

in OSI model

Physical layer (first layer) implements

the real bit connection
over different media (e.g. Twisted pair or optical fiber with
Ethernet or “air” for UMTS or GSM)

Data Link Layer contains higher level protocols of Ethernet, GSM,
UMTS, ... not discussed in depth in this lecture

Each layer adds its header to a packet

Needed for packet handling and routing


| 47

Communication Systems

connecting networks

Helper protocols needed during packet processing

Inform senders on congestion or lost packets

Map different layers addresses on each other


| 47

Communication Systems

functions of an universal service

Define unified addressing scheme which is hardware/software

Realize datagram delivery between networks


end systems as defined in first lecture


touch two or more networks, forward network
datagrams between them (routers use layer 3)


execute routing protocols to learn how to reach

Universal service protocol should be an open standard without
fees and licenses to be paid to get acceptance

May implement/use helper protocols (


for IP,
introduced in practical or theoretical exercises)


| 47

Communication Systems

issues of an universal service

Network layer provides end
end delivery (routing)

Provides consistent datagram abstraction:

effort delivery

no error detection on data

consistent maximum datagram size

consistent global addressing scheme

Link layer (second in OSI) networks provides delivery within the
same network

Typically includes its own addressing format (e.g. Ethernet), and
maximum frame size (MTU)


| 47

Communication Systems

internet protocol details

IP version 4 is current

IPv6 forthcoming

Solution to the address space exhaustion of IPv4

Predicted for a while, but limit not reached yet

Solutions for preserving numbers in IPv4 (masquerading,
private networks ...)

At the moment nobody knows when it will be used other then
in backbone structures

3G/UMTS mobile telephone market may push IPv6

Defined for a while

we will spend a dedicated lecture on it


| 47

Communication Systems

internet protocol details

Protocol header includes:

Version field

Source and Destination addresses

Lengths (header, options, data)

Header checksum

Fragmentation control

TTL, and TOS info

But TOS info often ignored

Easy changeable along the path (so what for?)


| 47

Communication Systems

internet protocol header details

Version field (4 standard, 5 STII, 6 next gen IP) and IP header
length are of 4 byte

IP header normally consists of 20Byte, with options more

Length needed to compute where next header starts


| 47

Communication Systems

internet protocol header details cont.

IP options may sum up to 40Byte

Total length field is 16bit, maximum packet length therefore may
not exceed

Minimum is 20Byte (just the IP header)

MTU of standard physical networks much smaller (e.g.

16bit identification field for fragments

Set for every packet by original sender of datagram

Sender can not know if fragmentation may occur

Initial message segmentation may not small enough

Copied into each datagram during fragmentation


| 47

Communication Systems

internet protocol header


Content of 16bit identification field is computed by sender

Different OS use different computing schemes (tool “nmap” in
practical course)

Might give away information on OS, internal network structure

Masqueraded machines could be identified by their
fragmentation IDs

Counter on every machine will have different values (amount
of traffic generated, computing scheme ...)

A private network may give more information away than


| 47

Communication Systems

internet protocol header


Flags for fragmentation control

: more fragments (follow)

: dont fragment (some protocol implementation like DHCP
in Boot
ROMs are not able to reassemble fragmented
packets), feature may be used for MTU path discovery
(increment packet size until ICMP error message is generated
because auf fragmentation need)

Fragmentation offset

Offset of this fragment into the original datagram

Zero if no fragmentation used

why offset and not fragment number?

if further fragmentation
is needed


| 47

Communication Systems

ip header

protocol field

Protocol field

the payload with headers removed is passed
to a higher layer in the networking stack
> where?

There are different transportation layer protocols for different


discussed later this lecture

6: TCP

Transmission Control Protocol

17: UDP

User Datagram Protocol

50: ESP

Encapsulating Security Payload

51: AH

Authentication Header

All protocol names and corresponding numbers are listed in
(/etc/)protocols file (linux operating system

see practical course)


| 47

Communication Systems

ip header

protocol field

In general: each layer has to provide the information which
upper layer should process a given type of packets

Each protocol adds its own header to the packet


| 47

Communication Systems

ip header

address fields

Source address

32 bit length defines the IP address space

Should never be changed through ordinary routing (there are
some exceptions like network address translation (NAT))

Protocol does not force authentication of source (often
enforced by modern routers now)

Destination address

32 bit length defines the IP address space

Should never be changed through ordinary routing

Changes when source routing used (realised through IP
option header)


| 47

Communication Systems

internet protocol

header details

Source routing

Special handling for particular datagrams, sometimes don't
take router's "fast path"

Rarely used, but the more common are: Loose Source
Routing, Strict Source Routing and Record Route


Must copied on fragmentation

More on routing little bit later on


| 47

Communication Systems


fragmentation of packets

Gave short introduction already, but ...

Adapting datagram size one of the most important tasks of the
internetworking protocol:

IP datagrams itself cannot exceed 64kbyte

Lower protocol levels report MTU (max. transfer unit)

Linux loopback 16384byte

Ethernet frames offer max. payload of

ATM offers 48byte

slow modem
ppp connections 296byte packet length

The tool
ifconfig or ip

(first practical course) reports MTU of each


| 47

Communication Systems


fragmentation of packets

Fragmentation & Reassembly

divide network
layer datagram into multiple link
layer units, all
have to be equal or smaller then link MTU size

Further fragmentation may be needed if MTU is decreased
along the path again

Sometimes it is more clever to set MTU smaller at source to
avoid later fragmentation

Reconstruct datagram at final station

Each fragment otherwise acts as a complete, routeable datagram

Datagrams are identified by the (source, destination,
identification) triple

Concept of fragmentation changes with IP v6


| 47

Communication Systems


fragmentation of packets cont.

If fragmented, identification triple is copied into each resulting

Also contains (offset, length, more) triple


boolean indicates is last fragment


relative to original datagram

Relating fragments to original datagram provides:

Tolerance to re
ordering and duplication

Ability to fragment fragments (!)


| 47

Communication Systems


fragmentation of packets cont.

IP fragments are re
assembled at final destination before
datagram is passed up to transport layer

Routers do not reassemble fragmented datagrams

Allows for independent routing of fragments

Reduces complexity (need for CPU and memory) in routers

Problems with fragmenting:

Loss of 1 or more fragments implies loss of datagram at the IP

IP is best effort, provides no retransmission, will time
out if
frag(s) appear to be lost

May be interesting for DoS attacks


| 47

Communication Systems


fragmentation of packets cont.

Avoid fragmentation through computing path MTU

Problems if path changes (dynamic routing) and new path has
smaller MTU along its way

Adapting size of packets in the source machine according to the
“minimum MTU”:
Path MTU Discovery

IP v6 uses MTU discovery and assumes standard
minimum MTU

If datagram size is smaller then MTU, no fragmentation needed

How to do this?

Probe network for largest size that will fit

If possible, have network tell us this size

Operates through ICMP messaging (presented later on)


| 47

Communication Systems


addressing scheme

We saw that IP packet header reserved two 32 bit fields for
source and destination address

For computation for delivery decisions the binary form is used

Programs and operating systems implementing IP automatically
convert the addresses between the two representations

IP addresses are topologically sensitive

Interfaces on same network share prefix

Prefix is assigned via ISP/local network administrator

bit globally unique


| 47

Communication Systems


addressing scheme cont.

Address is split into two virtual parts: network and host part

See later how division is done

For better reading the binary representation could be split into
four octets, which are transferred into the decimal system


| 47

Communication Systems


addressing scheme cont.

The early IP standard defined five address classes: A, B, C, D
and E

An IP address should be
selfexplanatory, it should countain
information on the networking sub structures

History by now

In this view the address consists of a pattern of high order
bits, which shows their class, the network and the host

Machines in the same network share a common prefix (the
class definition and network component of IP) and must have
unique suffix (the host component of IP)


| 47

Communication Systems


(historic) address classes


| 47

Communication Systems


address classes cont.

: (high order bits: 0)

Large Organizations, few nets (127), huge number of hosts (16.7

Address range in decimal notation

: (high order bits: 10)

Medium sized organizations and firms, e.g. University of Freiburg,
some nets (16,384) and large number of hosts (65,536)

Address range

: (high order bits: 110)

Small organizations and firms, relatively large number of nets
(2,097,152) with a small number of hosts per net (256)

Ranging from


| 47

Communication Systems


address classes cont.

: (high order bits: 1110)

Multicast addresses, but service are not very often used

Address range

: (high order bits: 1111)

Declared for experimental use only

Address range

Theoretical address space is 4,294,967,296 (seems a lot :

population on earth is higher by now)

But the address space usable for the “internet” is limited to
addresses from 1.

up to 223.X.Y.Z


| 47

Communication Systems


addressing scheme

But you will loose some more addresses:

Special addresses like: defines the
default route (explained later, route for
the “whole internet”) or the start address of a host
searching for a dynamically provided IP local broadcast address (and destination
for hosts seeking an IP via DHCP) loop back network address (you will need only
one address within this range and use typically
This address is used by every host implementing IP
(software using IP for communication is usable without
internet connection)


| 47

Communication Systems


“private” addresses

Addresses reserved for “private” use

many organizations,
enterprises, flat
sharing communities need IP communication for
their applications without or restricted internet access (within the class A range) (16 class B networks) (65,536 class C networks)

University WLAN, private LAN is using 10.


Addresses within these ranges should be discarded on internet

Address classifying helped in the beginning for faster network
decicion computation, routers had limited memory and cpu power


| 47

Communication Systems

ip addressing

For addressing whole subnets or addressing all hosts within a
given subnet (possibility depends on the underlying physical
network) special IP addresses are introduced

Network number is the smallest IP address in a given
(sub)network. it does not address a single machine and
may not assigned to a host. It is used with routing tables
(explained later in detail)

Broadcast address is the largest possible IP in a network.
It should be not assigned to a host, but is the possibility
to reach all hosts in a network with just one packet

If we use the example class B address, this
machine is a member of a network with the network number and a broadcast address


| 47

Communication Systems

ip subnetting

Networks with huge number of hosts could be split into subnets
for better administration and considerations on physical topology
and global spanning net

The example class B network 172.16 with 65536 host ip numbers
in it, allows 256 subnetworks with 256 hosts in it if split on the
byte boundary

But: The resulting 256 “class C networks” have the same high
order bit like the original class B network


| 47

Communication Systems

literature list

Network Layering:

Kurose & Ross: Computer Networking (3rd), Section 1.7

Tanenbaum: Computer Networks (4th), Section 1.4

Internet Protocol 4

Kurose & Ross: Computer Networking (3rd), Section 4.4.1

Stevens: TCP/IP Illustrated Vol. 1, Section 3.2

Tanenbaum: Computer Networks (4th), Section 5.5.7, 5.6.1

IP Addressing

Kurose & Ross: Computer Networking (3rd): Section 4.4.2

Tanenbaum: Computer Networks (4th): Section 5.6.2

Stevens: TCP/IP Illustrated Vol.1, Section 1.4, Section 3.4


| 47

Communication Systems

literature list (cont.)


Kurose & Ross: Computer Networking (3rd): Section 5.4.1, Section 5.4.2

Tanenbaum: Computer Networks, 4th edition: Section 5.6.3

Stevens, TCP/IP Illustrated Vol. 1: Section 4.6, Section 5


Stevens, TCP/IP Illustrated Vol. 1: Section 6, Section 9.3

Tanenbaum, Computer Networks, 4th edition: Section 5.6.3


Kurose & Ross, Computer Networking (3rd): Section 5.4.3