Vous êtes sur la page 1sur 213

1

HPN Fundamentals
Fundamentals of Communication Systems
1. Layering and the Internet
2. Application Layer in a Nutshell
3. Transport Layer in a Nutshell
4. IP and Routing in a Nutshell
5. Link Layer in a Nutshell
6. Physical Layer in a Nutshell
This section summarizes and harmonizes material which basically should be
known from Bachelor courses (or similar).
Copyright 2011/2012 Computer Science 4, University of Bonn
2
HPN Fundamentals
1. Layering and the Internet
Copyright 2011/2012 Computer Science 4, University of Bonn
1.1 What is the Internet?
1.2 How does the Internet work?
1.4 Delays, Losses, etc.
1.3 Layers
1.5. Protocol Architecture in Real Life: Introducing WireShark
3
HPN Fundamentals
1.1 What is the Internet?
Copyright 2011/2012 Computer Science 4, University of Bonn
4
HPN Fundamentals
The first Internet
Router
Router
The first internetwork became reality in October 1977:
Packet Radio Network in San Francisco
ARPANET across the USA
SATNET via satellite across the Atlantic to London.
Packet Radio
Network
SATNET
ARPANET
Packet Switching may be used for forwarding packets across
... a specific network
a network of networks (internetwork, internet).
Copyright 2011/2012 Computer Science 4, University of Bonn
5
HPN Fundamentals
A nuts and bolts view
Copyright 2011/2012 Computer Science 4, University of Bonn
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
millions of connected computing devices:
hosts (end systems)
running network apps
Web, VoIP, email, games, e-commerce,
file sharing
communication links
- fiber, copper, radio, satellite
- different transmission rates and
properties
routers
- forward packets (chunks of data)
6
HPN Fundamentals
A closer look at network structure
Copyright 2011/2012 Computer Science 4, University of Bonn
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
network edge: applications and hosts
access networks
network core:
interconnected routers
network of networks
7
HPN Fundamentals
Network edge and services
Copyright 2011/2012 Computer Science 4, University of Bonn
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
end systems (hosts):
run application programs
e.g. Web, email
at edge of network
communication services provided to
apps:
reliable data delivery from source to
destination
best effort (unreliable) data delivery
client/server model
client host requests and receives
service from always-on server
e.g. Web browser/server; email
client/server
peer-peer model:
minimal (or no) use of dedicated
servers
e.g. Skype, BitTorrent
client / ser ver
peer -peer
8
HPN Fundamentals
Access networks and physical media
Copyright 2011/2012 Computer Science 4, University of Bonn
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
How to connect end systems to edge router?
residential access nets
institutional access networks (school,
company)
mobile access networks
9
HPN Fundamentals
Dial-up Modem and Digital Subscriber Line (DSL)
Copyright 2011/2012 Computer Science 4, University of Bonn
telephone
network
Internet
home
dial-up
modem
ISP
modem
home
PC
central
office
Dial-up Modem
uses existing telephony infrastructure
home is connected to central office
up to 56Kbps direct access to router
cant surf and phone at same time:
not always on
telephone
network
DSL
modem
home
PC
home
phone
Internet
DSLAM
Existing phone line:
0-4KHz phone; 4-50KHz
upstream data; 50KHz-
1MHz downstream data
splitter
central
office
Digital Subscriber Line (DSL)
also uses existing telephone infrastructure
up to 1 Mbps upstream
up to 8 Mbps downstream
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
10
HPN Fundamentals
Internet Access via (Wireless) Local Area Networks
Copyright 2011/2012 Computer Science 4, University of Bonn
Local Area Networks
typically used in companies, universities,
etc
10 Mbs, 100Mbps, 1Gbps, 10Gbps
Ethernet
Wireless access networks
shared wireless access network connects
end system to router
via base station aka access point
100 Mbps
100 Mbps
100 Mbps
1 Gbps
server
Ethernet
switch
Institutional
router
To Institutions
ISP
base
st at ion
mobile
host s
r out er
11
HPN Fundamentals
Typical home network components
Copyright 2011/2012 Computer Science 4, University of Bonn
wir eless
access
point
wir eless
lapt ops
r out er /
f ir ewall
cable
modem
t o/ f r om
cable
headend
Et her net
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
12
HPN Fundamentals
Element of a wireless network
Copyright 2011/2012 Computer Science 4, University of Bonn
network
infrastructure
wireless hosts
r laptop, PDA, IP phone
r run applications
r may be stationary (non-
mobile) or mobile
m wireless does not
always mean mobility
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
13
HPN Fundamentals
Element of a wireless network (2)
Copyright 2011/2012 Computer Science 4, University of Bonn
network
infrastructure
base station
r typically connected to wired
network
r relay - responsible for
sending packets between
wired network and wireless
host(s) in its area
m e.g., cell towers, 802.11
access points
m handoff: mobile changes
base station providing
connection into wired
network
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
14
HPN Fundamentals
Element of a wireless network (3)
Copyright 2011/2012 Computer Science 4, University of Bonn
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
network
infrastructure
wireless link
r typically used to connect
mobile(s) to base station
r also used as backbone
link
r multiple access protocol
coordinates link access
r various data rates,
transmission distance
15
HPN Fundamentals
Characteristics of selected wireless link standards
Copyright 2011/2012 Computer Science 4, University of Bonn
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
Indoor
10-30m
Outdoor
50-200m
Mid-range
outdoor
200m 4 Km
Long-range
outdoor
5Km 20 Km
.056
.384
1
4
5-11
54
IS-95, CDMA, GSM
2G
UMTS/WCDMA, CDMA2000
3G
802.15
802.11b
802.11a,g
UMTS/WCDMA-HSPDA, CDMA2000-1xEVDO
3G cellular
enhanced
802.16 (WiMAX)
802.11a,g point-to-point
200
802.11n
D
a
t
a

r
a
t
e

(
M
b
p
s
)
data
16
HPN Fundamentals
Other Wireless Links Spectrum Map US
Copyright 2011/2012 Computer Science 4, University of Bonn
www.fas.org/spp/military/program/sigint/allochrt.pdf
17
HPN Fundamentals
Alternative Ad-hoc mode / Mesh networks
Copyright 2011/2012 Computer Science 4, University of Bonn
ad hoc mode
r no base stations
r nodes can only
transmit to other nodes
within link coverage
r nodes organize
themselves into a
network: route among
themselves
18
HPN Fundamentals
Wireless network taxonomy
Copyright 2011/2012 Computer Science 4, University of Bonn
single hop multiple hops
infrastructure
(e.g., APs)
no
infrastructure
host connects to
base station (WiFi,
WiMAX, cellular)
which connects to
larger Internet
no base station, no
connection to larger
Internet (Bluetooth,
ad hoc nets)
host may have to
relay through several
wireless nodes to
connect to larger
Internet: mesh net
no base station, no
connection to larger
Internet. May have to
relay to reach other
a given wireless node
MANET, VANET
19
HPN Fundamentals
letter mail
network
abstract network cloud
1.2 How does the Internet work?
Analogy: letter mail
Originator:
- name
- street + number
- ZIP code + city
(several components)
Destination address:
- name
- street + number
- ZIP code + city
(several components)
Max Mustermann
Rmerstr. 164
D-53117 Bonn
Copyright 2011/2012 Computer Science 4, University of Bonn
20
HPN Fundamentals
Internet
Internet cloud
How does the Internet work?
Originator:
- IP address
- Protocol ID
- Port Number
(several components)
Destination:
- IP address
- Protocol ID
- Port Number
(several components)
Data
Protocol Control
Information
IP Datagram (IP = Internet Protocol)
Router
Copyright 2011/2012 Computer Science 4, University of Bonn
21
HPN Fundamentals
Packet Switching
In the Internet, the information units (packets, datagrams) travel across a
store-and-forward network of redundant connections:
Packets are stored until they have been forwarded to the next-hop station.
Copyright 2011/2012 Computer Science 4, University of Bonn
22
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
1.3 Layers
different layer models are used for the specification of communication
protocols.
layered reference model for discussion
modularization eases maintenance, updating of system
change of implementation of layers service transparent to rest of
system
Why layering?
23
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
layer n layer n
The Hierarchy Principle
According to the hierarchy principle
each layer solves specific problems. (protocol of this layer)
layer n directly communicates with layer n + 1 (offers service to layer n + 1)
layer n directly communicates with layer n - 1 (uses service provided by layer n - 1)
A layer n
indirectly communicates with the layer n of the peer instance
exchanges data units with a well-defined format with the peer
(Protocol Data Units PDUs).
protocol
services provided by lower layers
station A station B
service access point
(SAP)
(layer n)
service access point
(SAP)
PDUs
24
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Important Properties of the Hierarchy Principle
Layer n only knows
the service access point (SAP) of layer n - 1
the basic characteristics of the service provided by layer n - 1
Layer n is not aware of the internal structure of layer n 1 (at least should not be aware).
Advantage of the hierarchy principle:
Clear structure
Flexibility resulting from modularity
Thus:
Internal change of layer n - 1 has no impact on layer n (in general),
layers may be divided into sublayers,
layers may be omitted.
Disadvantage of the hierarchy principle:
a lot of overhead (each layer adds control information)
25
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
The ISO Reference Model for Open Systems Interconnection
The International Standards Organization (ISO)
has standardized the ISO reference model for open systems as a firm basis for the
standardization of protocols:
Goals of the OSI model:
standardized nomenclature,
structuring,
framework for standards (of protocols).
Remarks:
The OSI model does not standardize protocols. Instead, it is a framework for the
standardization of protocols.
The OSI - model does not specific any implementation.
Both, the OSI structure and the protocols specified within this structure are independent from
any specific implementation.
Reference Model for Open Systems Interconnection (OSI)
26
HPN Fundamentals
The Seven Layers of the ISO/OSI Reference Model
1
Physical Layer
2
Data Link Layer
3
Network Layer
4
Transport Layer
Session Layer
5
Presentation Layer
6
Application Layer
7
application oriented: layers 5 to 7
transport oriented: layers 3 and 4
technology oriented: layers 1 and 2
physical representation of 0 and 1
(in addition: synchronization)
error protection, flow control
(ensures secure transmission)
addressing, routing
(How to find the destination host?)
reliable end-to-end connection
(error recognition and correction)
structuring of information exchange
(e.g. reset to well defined state after error)
adaptation of the information presentation
(interpreter, consistent language inside the network)
functionality for special applications
(e.g. file access)
Copyright 2011/2012 Computer Science 4, University of Bonn
27
HPN Fundamentals
1
Physical Layer
2
Data Link Layer
(Leitungs- und Sicherungsebene)
The Layer Model of the IEEE LMSC (IEEE 802)
2
Data Link Layer
3
Network Layer
4
Transport Layer
Session Layer
5
Presentation Layer
6
Application Layer
7
OSI-Modell:
Upper Layers
LAN/MAN Standards Committee der IEEE
(IEEE 802)
MAC
(Media Access Control)
LLC
(Logical Link Control)
How to control the access to the media?
Copyright 2011/2012 Computer Science 4, University of Bonn
28
HPN Fundamentals
The Layer Model of the IEEE LMSC (IEEE 802) (2)
1
Physical Layer
2
Data Link Layer
(Leitungs- und Sicherungsebene)
3
4
5
6
7
Upper Layers
MAC
(Media Access Control)
LLC
(Logical Link Control)
2a
2b
3
4
5
6
7
Upper Layers
The LAN/MAN Standards Committee of the
IEEE (better known as IEEE 802)
standardizes protocols for
layer 1,
layer 2a and
layer 2b
of the OSI model.
Well known protocols are
Ethernet (IEEE 802.3),
Token Ring (IEEE 802.5)
Wireless LAN (IEEE 802.11)
Wireless PAN, Bluetooth (IEEE 802.15)
Copyright 2011/2012 Computer Science 4, University of Bonn
29
HPN Fundamentals
1
2
1
2
Physical Layer
Data Link Layer
3
Network Layer
OSI model:
Internet Engineering Task Force
Network
Technology
3
Internetwork
4
Transport Layer
4
Transport
5
6
7
Session Layer
Presentation Layer
Application Layer
Application
The IETF standardizes protocols for
layer 3 and
layer 4
of the OSI model.
Well known protocols are
Internet Protocol (IP),
Transmission Control Protocol (TCP) and
User Data Protocol (UDP)
In addition, the IETF works on applications
like e-mail, file transfer and remote login.
5
6
7
router
router
The Layer Model of the IETF
Copyright 2011/2012 Computer Science 4, University of Bonn
30
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Terms
(N)-layer
(N)-service
specifies the service provided by the (N)-layer to higher layers
(N)-service provider
abstract machine offering the (N)-service
(N)-service user
a (N+1)-protocol entity, communicating with one or more (N+1) peer entity/entities using the
(N)-service
(N)-service access point (SAP)
exchange point where (N)-service primitives are used
(N)-service primitive (N)-SP
implementation independent representation of an interaction between (N)-service
provider and (N)-service user
(N)-service data unit (SDU)
(N)-SDUs are parameters of (N)-SPs, they carry information
The OSI model played a tremendous role in the specification of wording.
Important terms include:
31
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Terms (2)
(N)-protocol
controls the (indirect) communication of the (N)-peer entity
(N)-protocol entity
independent entity of the (N)-layer, is able to communicate with (N)-peer entities
(N)-peer entity
entity of layer (N)
(N)-protocol data unit (PDU)
consists of (N)-SDU and (N)-PCI, is sent from (N)-entity to (N)-peer entity
(N)-protocol control information (N)-PCI
control information (e.g. for error recognition and -correction), added by an (N)-entity to
an (N)-SDU.
32
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
(N+1)-Service and (N+1)-Protocol
(N)-service
(N)-SAP
(N)-SPs;
where required
with (N)-SDUs
(N+1)-protocol
exchange of (N+1)-PDUs (virtual)
(N+1)-service user
(N+1)-
Protokoll-
-anz
(N)-SAP
(N)-SPs;
where required
with (N)-SDUs
(
N
+
1
)
-
l
a
y
e
r
(N+1)-SPs
(N+1)-service user
(N+1)-SPs
(N+1)-service
(N+1)-
protocol-
entity
(N+1)-
protocol-
entity
33
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
layer (N)
layer (N-1)
layer (N+1)
Simplified Model of a Communication System
(N+1)-PDU
(N)-SDU (N)-PCI
(N)-PDU
(N+1)-PDU
(N)-SDU (N)-PCI
(N)-PDU
Important note:
An implementation with queues between the layers is neither mandatory nor desirable.
The OSI model does not specify this kind of implementation detail.
34
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
layer (N)
layer (N-1)
layer (N+1)
Sending a (N+1)-PDU to layer (N)
(N+1)-PDU
Wait for
processing!
35
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
A PDU becomes a SDU
(N+1)-PDU
Enter now!
The (N+1)-PDU
becomes a
(N)-SDU
(N)-SDU
layer (N)
layer (N-1)
layer (N+1)
(N+1)-PDU
36
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Layer (N) forms a (N)-PDU from a (N)-SDU
(N)-PCI
(N)-PDU
Adding the
(N)-PCI
results in the
(N)-PDU.
(N)-SDU
layer (N)
layer (N-1)
layer (N+1)
37
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Transfer to Layer (N-1) and Transmission
(N)-PDU
(N)-PDU
(N)-PDU
layer (N)
layer (N-1)
layer (N+1)
The PDU
is forwarded
to
layer N-1
38
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Forward to Layer (N) and Process
(N)-PDU
(N)-PDU
(N)-PCI (N)-SDU
layer (N)
layer (N-1)
layer (N+1)
layer N
receives
the message.
39
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
layer (N+1)
Processing by Layer (N)
(N)-PCI (N)-SDU
Lets see what
is written here...
layer (N)
layer (N-1)
40
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
layer (N+1)
Forward to Layer (N+1)
(N)-SDU
layer (N)
layer (N-1)
(N+1)-PDU
41
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Wrapping of Data
Zo0vo
Nrtcopxo
Zo0vo
Nrtcopxo
audio
compact
disc
jewel box
storage case
display
package
shipping box
Each layer wraps data with an additional envelope (header and/or trailer), before
transferring the data to the lower layer:
For the protocol of layer (N) only (N)-PCI is relevant.
The protocol just works on the wrapping.
But:
The size of a (N+1)-PDU has to obey certain rules.
(The postal service does not accept packets of 30 tons)
The transfer of the PDU has to be done in a proper manner.
42
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Basic Principle Encapsulation
sour ce
applicat ion
t r anspor t
net wor k
link
physical
H
t
H
n
M
segment H
t
dat agr am
dest inat ion
applicat ion
t r anspor t
net wor k
link
physical
H
t
H
n
H
l
M
H
t
H
n
M
H
t
M
M
net wor k
link
physical
link
physical
H
t
H
n
H
l
M
H
t
H
n
M
H
t
H
n
M
H
t
H
n
H
l
M
r out er
swit ch
message M
H
t
M
H
n
f r ame
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
43
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
From Ethernet to HTML
DA SA Type Data Checksum Preamble SF
Ethernet Frame
Data
IP Datagram
Data
TCP Segment
Data
HTTP Slice
HTTP/1.0 200 OK\r\nServer: PAWS ElB-1.42\r\nContent-Type: text/html\r\nDate: Tue, 3
Network
Technology
Internetwork
Transport
Application
44
HPN Fundamentals
TCP/IP allows stations to communicate across totally different networks !
The TCP/IP-Internet
Copyright 2011/2012 Computer Science 4, University of Bonn
45
HPN Fundamentals
The Transmission Control Protocol (TCP)
Networks are unreliable.
End systems take care of error detection / correction.
The Internet Philosophy
The Transmission Control Protocol (TCP)
makes sure that all damaged and lost packets are retransmitted and that
duplicates are removed,
re-orders the messages at the receiver (ordering preservation),
splits large information units into flows of small, numbered packets,
decides how fast packets are sent to the network, subject to capabilities of
the sender, the receiver and the network in-between.
Copyright 2011/2012 Computer Science 4, University of Bonn
46
HPN Fundamentals
The Internet Protocol (IP)
The Internet Protocol
defines ................ ................
tries ......... .........
does not guarantee anything.
un-ambiguous, standardized, network-independent addresses,
to take the messages to the receiver somehow,
Net 1
IP
TCP
Application
Login,
File Transfer,
e-mail, ...
Net 1 Net 2
IP
TCP
Application
Net 1 Router
Net 2
IP
Identical
for all
applications
Net 2
The Internet Protocol (IP)
specifies what all packets must look like to allow for routing
(based on hierarchic addresses: network-ID, subnetwork-ID, ..., host-ID).
Copyright 2011/2012 Computer Science 4, University of Bonn
47
HPN Fundamentals
The Slim Waist
FTP mail remote login WWW access
...
TCP UDP TP4
...
IP
Ethernet Token Ring ISDN DSL Satellite
banking
Wireless LAN
...
Copyright 2011/2012 Computer Science 4, University of Bonn
48
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Summary: Names, T-, N- and MAC-Addresses
(in case of networks within the Internet)
Transport Protocol: TCP, UDP
(Layer 4)
Network Protocol: IP
(Layer 3)
Medium Access, Network Technology
(Layers 2 and 1)
Applications
File Transfer (ftp) WWW browser (http)
Names
Port Number
IP Addresses
MAC Addresses
Statically assigned
to applications
+ dynamically
assigned by the OS
DNS
ARP/
RARP
49
HPN Fundamentals
1.4 Delays, Losses, etc.
Copyright 2011/2012 Computer Science 4, University of Bonn
www.n24.de
photothek.net
Analogy: Road Traffic
Delay Loss
www.colber-forster.de www.bmvbs.de
50
HPN Fundamentals
How do loss and delay occur?
Copyright 2011/2012 Computer Science 4, University of Bonn
A
B
packet being t r ansmit t ed (delay)
packet s queueing (delay)
f r ee (available) buf f er s: ar r iving packet s
dr opped (loss) if no f r ee buf f er s
packets queue in router buffers
packet arrival rate to link exceeds output link capacity
packets queue, wait for turn
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
51
HPN Fundamentals
Four sources of packet delay
Copyright 2011/2012 Computer Science 4, University of Bonn
1. nodal processing
check bit errors
determine output link
2. queueing
time waiting at output link for transmission
depends on congestion level of router
3. transmission delay
R=link datarate (bps), L=packet length (bits)
time to send bits into link = L/R
4. propagation delay
d = length of physical link, s = propagation speed in medium
propagation delay = d/s
A
B
pr opagat ion
t r ansmission
nodal
pr ocessing
queueing
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
52
HPN Fundamentals
Nodal delay
Copyright 2011/2012 Computer Science 4, University of Bonn
dproc = processing delay
typically a few microsecs or less
dqueue = queuing delay
depends on congestion
dtrans = transmission delay
= L/R, significant for low-speed links
dprop = propagation delay
a few microsecs to hundreds of msecs
A
B
pr opagat ion
t r ansmission
nodal
pr ocessing
queueing
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
prop trans queue proc nodal
d d d d d - - -
53
HPN Fundamentals
Queueing delay (revisited)
Copyright 2011/2012 Computer Science 4, University of Bonn
R=link datarate (bps)
L=packet length (bits)
a=average packet arrival rate
traffic intensity = La/R
La/R ~ 0: average queueing delay small
La/R 1: delays become large
La/R > 1: more work arriving than can be serviced, average delay infinite!
54
HPN Fundamentals
Packet Loss
Copyright 2011/2012 Computer Science 4, University of Bonn
queue (aka buffer) preceding link in buffer has finite capacity
packet arriving to full queue dropped (aka lost)
lost packet may be retransmitted by previous node, by source
end system, or not at all
A
B
packet being t r ansmit t ed
packet ar r iving t o
f ull buf f er is lost
buf f er
(wait ing ar ea)
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
55
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
1.5. Protocol Architecture in Real Life: Introducing WireShark
WireShark is not the only open source tool available for protocol analysis:
tcpdump / windump (command line tool with textual output),
ngrep (filters and displays network connections),
netstat (command line tool to view open connections),
ettercap
A nice starting point for more tools is http://www.insecure.org/tools.html
WireShark is an open source (GNU GPL) tool for
software and protocol development,
troubleshooting,
analysis,
education,
(from http://www.wireshark.org/, accessed October 2007)
WireShark basically is of a successor of Ethereal!
56
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Getting Connected WireShark Perspective
ARP
TCP/HTTP
DNS
Packet List
Packet Details
Data on the wire
57
HPN Fundamentals
Traffic in a wireless campus network
Copyright 2011/2012 Computer Science 4, University of Bonn
T
.

H
e
n
d
e
r
s
o
n
,

D
.

K
o
t
z
,

I
.

A
b
y
z
o
v

T
h
e

c
h
a
n
g
i
n
g

u
s
a
g
e

o
f

a

m
a
t
u
r
e

c
a
m
p
u
s
-
w
i
d
e

w
i
r
e
l
e
s
s

n
e
t
w
o
r
k

-
P
r
o
c
e
e
d
i
n
g
s

M
o
b
i
C
o
m

2
0
0
4
Measurements in WiFi-network of Dartmouth Campus Hanover, USA (121 Access Points measured).
Inbound: Traffic sent by the AP to the card. Outbound: Traffic sent by the card to the AP.
Ports & TCP-Header information were analyzed
58
HPN Fundamentals
2. Application Layer in a Nutshell
Copyright 2011/2012 Computer Science 4, University of Bonn
2.1 Conventional data communication
2.2 Multimedia communication
2.4. Skype
2.3 What is SIP?
59
HPN Fundamentals
2.1. Conventional data communication
"Classical" data communication results in bursty traffic.
In general, we find the following requirements:
Error free transmission (or error detection and correction),
As much bandwidth (throughput) as possible,
Delays as small as possible,
(maybe) support of Broadcasting (One-to-all),
(maybe) support of Multicasting (One-to-many),
(maybe) characteristics similar to LANs, e.g. connectionless communication
(many applications were originally developed for LANs).
Copyright 2011/2012 Computer Science 4, University of Bonn
60
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
The Domain Name System (DNS)
Instead of using numerical addresses in "Dotted Decimal Notation" a human user would
prefer to have alphanumerical Internet names, e.g. "www.uni-bonn.de".
Therefore, we need a "DNS server" implemented as a distributed database which is
able to map Internet names to Internet addresses.
DNS uses a hierarchical structure of names. This allows for a decentralized assignment of
names within the specific "Domain".
( nameless root)
jp us de
uni-bonn rwth-aachen dtag
informatik
va
reston
National
mil edu gov com org
sun
eng
yale
cs eng
IEEE ACM
Generic
net int
The complete name of the domain results from the path up towards the root of the name tree.
Names can be mapped to IP addresses by asking the DNS server of the domain responsible.
Caching of name/address mappings increases the efficiency considerably.
Top-Level-
Domains
But how long should those name/address mappings reside within the cache?
61
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Example: Using Names when Surfing the Internet
62
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Name Server
Name Space
The whole DNS name space is subdivided into so-called "zones". Each zone has one or
several name servers.
mil edu gov com org jp us de
uni-bonn rwth-aachen dtag va
reston
sun
eng
yale
cs eng
IEEE ACM
net int
ai linda
robot
cnri
pharmazie informatik
1 4 2 3 5 6
The decision whether (and how) to structure zones into sub zones is responsibility of the
"owner" of a specific zone.
This allows for high flexibility in the naming hierarchy.
63
HPN Fundamentals
Implementation of Name Resolution iterative
Copyright 2011/2012 Computer Science 4, University of Bonn
A client's name resolver contacts a name server.
This name server passes back a reference to the next responsible name server.
The resolver contacts this server, ...
S
o
u
r
c
e
:
A
.
S
.

T
a
n
e
n
b
a
u
m
,

M
.

v
a
n

S
t
e
e
n
:

D
i
s
t
r
i
b
u
t
e
d

S
y
s
t
e
m
s

-
P
r
i
n
c
i
p
l
e
s

a
n
d

P
a
r
a
d
i
g
m
s
.

2
n
d

E
d
.
,

P
r
e
n
t
i
c
e
-
H
a
l
l
,

2
0
0
6
64
HPN Fundamentals
Implementation of Name Resolution recursive
Copyright 2011/2012 Computer Science 4, University of Bonn
A client's name resolver only contacts the next name server.
Finding the responsible name server and thus the address now
is made by the involved name servers.
Recursive compared to iterative name resolution:
Con: higher performance demands for name server
Pro: caching is easier
may reduce communication costs at edge
S
o
u
r
c
e
:
A
.
S
.

T
a
n
e
n
b
a
u
m
,

M
.

v
a
n

S
t
e
e
n
:

D
i
s
t
r
i
b
u
t
e
d

S
y
s
t
e
m
s

-
P
r
i
n
c
i
p
l
e
s

a
n
d

P
a
r
a
d
i
g
m
s
.

2
n
d

E
d
.
,

P
r
e
n
t
i
c
e
-
H
a
l
l
,

2
0
0
6
65
HPN Fundamentals
DNS Query
Copyright 2011/2012 Computer Science 4, University of Bonn
S
o
u
r
c
e
:

B
e
c
k
y

G
r
a
n
g
e
r
:

S
l
i
d
e
s

-
D
N
S
S
E
C

f
o
r

t
h
e

.
e
d
u

D
o
m
a
i
n
,

2
0
1
0
I
l
l
u
s
t
r
a
t
i
o
n

o
f

N
i
r
a
n
j
a
n

K
u
n
w
a
r

/

N
i
r
l
o
g
.
c
o
m
66
HPN Fundamentals
2.2. Multimedia communication
In case of multimedia communication we often find
predictable load profiles,
elastic applications (e.g. coding subject to the current condition inside the network),
minimum throughput,
maximum delay,
maximum jitter ("Schwankungen der Verzgerung"),
maximum message loss rate
(In case of appropriate coding a certain loss rate is acceptable).
Copyright 2011/2012 Computer Science 4, University of Bonn
67
HPN Fundamentals
Specification of requirements
The application can specify the acceptable delay in different ways. In general, the
specification refers to
information units at application layer (pictures, samples, ...),
the local clock.
i , D D
max i
V s
( )
min max i
Z D D Prob s
i , J D - D = J
max i i
V s
( )
min max i
U J J Prob s
Deterministic delay limits:
D
i
the delay of message number i,
D
max
the upper limit selected by the application
Statistical delay limit:
D
i
, D
max
as above. Z
min
is the lower probability bound
for successful and in-time reception of message number i.
Deterministic jitter limit:
D
i
as above. D is the "perfect" delay.
J
i
is the jitter of message number i,
J
max
the upper jitter limit selected by the application.
Statistical jitter limit:
J
i
, J
max
as above. U
min
is the lower probability bound
for successful reception within the specified
jitter limits.
Copyright 2011/2012 Computer Science 4, University of Bonn
68
HPN Fundamentals
Total delay in case of "multimedia"
Digitization
Pixels
Coding
Macro blocks
Packetization
Transmission buffer
Network access
Network
receive packet, de-packetize
check delay
buffer or drop
Playback buffer
De-coding
Pixels
Macro blocks
Packets
S
e
n
d
e
r
R
e
c
e
i
v
e
r
D
dig
D
encode
D
pack
D
network
D
playback
D
decode
D
display
Receive buffer Packets
Copyright 2011/2012 Computer Science 4, University of Bonn
69
HPN Fundamentals
1 2 3 4 5 6 1 3 5 4 6
Packet Loss
Inversion
Jitter
I
P

N
e
t
w
o
r
k
Network Delay
Sender
Network
Receiver
Sender Delay:
Coding delay
Packeting delay
Transmission delay

Receiver Delay:
Decoding delay
DePacketing delay
Receiver delay

VoIP QoS
100 200 300 400 500
0
4
3
5
2
1
7
6
Operational
Target for
Voice
Possibly
Tolerable for
Voice
Unacceptable for
Voice or Fax
ITU G.114
Utility
Recommendation
Delay (ms)
Packet loss (%)
VoIP Issues Solutions
Packetizing delay Small packets for VoIP
Serial delay Priorities and jitter buffers
High bit-rate video Video compression
Constant-bit-rate voice
Silence suppression and comfort
noise
Resend due to errors Real-time Transport Protocol
Copyright 2011/2012 Computer Science 4, University of Bonn
70
HPN Fundamentals
2.3. What is SIP?
SIP* is an application layer control (signaling) protocol for creating,
modifying and terminating multimedia sessions with one or more
participants.
* SIP is the Session Initiation Protocol, specified in RFC 3261
What Can You Do Wi t h SI P?
SIP is a peer-to-peer protocol where end-devices initiate sessions
SIP sessions include Internet Multimedia conferences, Internet telephone calls, and multimedia
distribution
SIP is suitable for applications having a notion of session, e.g. network games, video conferences
SIP is designed for scalability, simplicity, mobility, and service creation
SIP is text-based for easy
implementation and debugging
SIP is a simple, extensible protocol
SIP is text-based for easy
implementation and debugging
SIP is a simple, extensible protocol
Copyright 2011/2012 Computer Science 4, University of Bonn
71
HPN Fundamentals
Setting up a call to a known IP address
Alices SIP invite message
indicates her port number, IP
address, encoding she prefers to
receive (PCM ulaw)
Bobs 200 OK message indicates
his port number, IP address,
preferred encoding (GSM)
SIP messages can be sent over
TCP or UDP; here sent over
RTP/UDP.
default SIP port number is 5060.
time time
Bob's
terminal rings
Alice
167.180.112.24
Bob
193.64.210.89
port 5060
port 38060

Law audio
GSM
port 48753
INVITE bob@
193.64.210.89 c=IN IP4 167.180.112.24
m=audio 38060 RTP/AVP 0
port 5060
200 OK
c=IN IP4 193.64.210.89
m=audio 48753 RTP/AVP 3
ACK
port 5060
Source: Jim Kurose, Keith Ross: Computer Networking: A Top
Down Approach - 5th edition, Addison-Wesley, April 2009.
Copyright 2011/2012 Computer Science 4, University of Bonn
72
HPN Fundamentals
2.4. Skype
Copyright 2011/2012 Computer Science 4, University of Bonn
73
HPN Fundamentals
Skype Details ?Research?
Copyright 2011/2012 Computer Science 4, University of Bonn
74
HPN Fundamentals
Skype Details
Copyright 2011/2012 Computer Science 4, University of Bonn
S
o
u
r
c
e
:

T
r
a
c
k
i
n
g

d
o
w
n

S
k
y
p
e

t
r
a
f
f
i
c

b
y

D
a
r
i
o

B
o
n
f
i
g
l
i
o
,

M
a
r
c
o

M
e
l
l
i
a
,

M
i
c
h
e
l
a

M
e
o
,

N
i
c
o
l
o

R
i
t
a
c
c
a

a
n
d

D
a
r
i
o

R
o
s
s
i

[
I
N
F
O
C
O
M
'
0
8
]
uses a proprietary solution (no SIP, H323, )
difficult to reverse engineer due to extensive use of both cryptography and
obfuscation techniques
may rely on either TCP or UDP at the transport layer
both signaling and communication data are preferentially carried over UDP
a single random port is selected during application installation
never changed (unless forced by the user)
when a UDP communication is impossible, Skype falls back to TCP
listening to the same random port whenever possible, or using port 80 and 443
can select between different Codecs according to an unknown algorithm
75
HPN Fundamentals
Skype Adaptive Voice Coding
Copyright 2011/2012 Computer Science 4, University of Bonn
S
o
u
r
c
e
:

T
r
a
c
k
i
n
g

d
o
w
n

S
k
y
p
e

t
r
a
f
f
i
c

b
y

D
a
r
i
o

B
o
n
f
i
g
l
i
o
,

M
a
r
c
o

M
e
l
l
i
a
,

M
i
c
h
e
l
a

M
e
o
,

N
i
c
o
l
o

R
i
t
a
c
c
a

a
n
d

D
a
r
i
o

R
o
s
s
i

[
I
N
F
O
C
O
M
'
0
8
]
Average Bitrate (B): the average amount of bits generated at application layer in a
time interval of 1 second.
Inter-Packet-Gap (IPG): the time elapsed between two consecutive packets
belonging to the same flow.
Payload length (L): the number of bytes carried by TCP or UDP.
76
HPN Fundamentals
Skype Features
Copyright 2011/2012 Computer Science 4, University of Bonn
http://www.blackhat.com/presentations/bh-europe-06/bh-eu-06-biondi/bh-eu-06-biondi-up.pdf
77
HPN Fundamentals
3. Transport Layer in a Nutshell
Copyright 2011/2012 Computer Science 4, University of Bonn
3.1 Transport services and protocols
3.2 TCP - Error Control
3.3 TCP - Connection Management
3.4 TCP - Retransmission Timer
3.5 TCP - Flow Control and Congestion Control
78
HPN Fundamentals
3.1 Transport services and protocols
provide logical communication
between app processes running
on different hosts
transport protocols run in end
systems
sender side: breaks app
messages into segments,
passes to network layer
receiver side: reassembles
segments into messages,
passes to app layer
more than one transport protocol
available to apps
Internet: TCP and UDP
application
transport
network
data link
physical
application
transport
network
data link
physical
l
o
g
i
c
a
l

e
n
d
-
e
n
d

t
r
a
n
s
p
o
r
t
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

Copyright 2011/2012 Computer Science 4, University of Bonn
79
HPN Fundamentals
Internet transport-layer protocols
reliable, in-order delivery
(TCP)
congestion control
flow control
connection setup
unreliable, unordered delivery:
UDP
no-frills extension of best-
effort IP
services not available:
delay guarantees
bandwidth guarantees
application
transport
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
application
transport
network
data link
physical
l
o
g
i
c
a
l

e
n
d
-
e
n
d

t
r
a
n
s
p
o
r
t
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

Copyright 2011/2012 Computer Science 4, University of Bonn
80
HPN Fundamentals
Internet transport protocols services
TCP service:
connection-oriented: setup required between
client and server processes
reliable transport between sending and
receiving process
flow control: sender wont overwhelm receiver
congestion control: throttle sender when
network overloaded
does not provide: timing, minimum
throughput guarantees, security
UDP service:
unreliable data transfer between
sending and receiving process
does not provide: connection
setup, reliability, flow control,
congestion control, timing,
throughput guarantee, or security
Application
Application layer
protocol
Underlying transport protocol
e-mail SMTP [RFC 2821] TCP
remote terminal access Telnet [RFC 854] TCP
Web HTTP [RFC 2616] TCP
file transfer FTP [RFC 959] TCP
streaming multimedia
HTTP (eg Youtube),
RTP [RFC 1889]
TCP or UDP
Internet telephony
SIP, RTP,
proprietary (e.g., Skype)
typically UDP
Copyright 2011/2012 Computer Science 4, University of Bonn
81
HPN Fundamentals
Transport service requirements of common apps
Copyright 2011/2012 Computer Science 4, University of Bonn
Application Data loss Throughput Time Sensitive
file transfer no loss elastic no
e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5kbps-1Mbps;
video:10kbps-5Mbps
yes, 100s msec
stored audio/video loss-tolerant same as above yes, few secs
interactive games loss-tolerant few kbps up yes, 100s msec
instant messaging no loss elastic yes and no
Data loss
some apps (e.g., audio) can tolerate some loss
other apps (e.g., file transfer, telnet) require 100% reliable data transfer
Throughput
some apps (e.g., multimedia) require minimum amount of throughput to be effective
other apps (elastic apps) make use of whatever throughput they get
Timing
some apps (e.g., Internet telephony, interactive games) require low delay to be effective
Security
Encryption, data integrity,
82
HPN Fundamentals
UDP
no frills, bare bones Internet
transport protocol
best effort service, UDP segments
may be:
lost
delivered out of order to app
connectionless:
no handshaking between UDP
sender, receiver
each UDP segment handled
independently of others
Why is there a UDP?
no connection establishment
(which can add delay)
simple: no connection state at
sender, receiver
small segment header
no congestion control: UDP can
blast away as fast as desired
UDP: User Datagram Protocol [RFC 768]
Checksum Datagram Length
Data
....
Source Port Destination Port
0 8 16 24 31
often used for streaming multimedia
apps
loss tolerant
rate sensitive
other UDP uses
DNS
SNMP
reliable transfer over UDP: add
reliability at application layer
application-specific error
recovery!
Copyright 2010/2011 Computer Science 4, University of Bonn
83
HPN Fundamentals
UDP PDUs
Copyright 2011/2012 Computer Science 4, University of Bonn
Checksum Datagram Length
Data
....
Source Port Destination Port
0 8 16 24 31
Source Port (16 bit)
(Optional) Identification of sender process for mapping of replies.
Destination Port (16 bit)
Identification of destination process.
Datagram Length (16 bit)
Total TPDU length (in byte) incl. UDP overhead.
Checksum (16 bit)
(Optional) Error detection; mandatory for UDP with IPv6.
Note:
Without UDP checksum, there is no error detection for the data field: IPv4 error control
is limited to the IP header.
The service provided by the User Data Protocol (UDP) is a best effort service. UDP is used for
connectionless data transmission. The PDUs have the following structure:
84
HPN Fundamentals
TCP PDUs
Copyright 2011/2012 Computer Science 4, University of Bonn
Sequence Number
Acknowledgement Number
HLEN Reserved Code bits Window
Urgent Pointer Checksum
Options (if any) Padding
Data
....
Source Port Destination Port
0 8 16 24 31
Source Port, Destination Port (16 bit each)
Addresses of specific processes; also used for connection identification.
Sequence Number (32 bit)
Position of a data segment within the byte stream (for window mechanism).
Acknowledgement Number (32 bit)
Number of the next expected byte in the opposite direction.
Cumulative acknowledgement; for this reason: robust against loss of ACKs.
HLEN (4 bit)
Header length (in multiples of 32 bit); also: Offset for the data field in the TPDU.
The Transmission Control Protocol
(TCP) makes communication reliable.
TCP adds to the IP address a
16 bit TSAP address.
With TCP, a TSAP is called Port.
85
HPN Fundamentals
TCP PDUs (2)
Copyright 2011/2012 Computer Science 4, University of Bonn
Reserved (6 bit)
Reserved for future use.
Code Bits (6 bit)
Purpose and contents of the TPDU. From left to right:
URG Urgent pointer field is valid
ACK Acknowledgement field is valid; flag reset in the connection setup packet
PSH This segment requests a push (Immediate delivery to the receiver)
RST Reset the connection
SYN Synchronize sequence numbers (Used during connection establishment)
FIN End of data stream
Window (16 bit)
The receiver controls the transmission window size, cf. chapter on flow control.
Checksum (16 bit)
Checksum for the whole TPDU and a pseudo header which includes the IP
addresses of sender and receiver.
Urgent Pointer (16 bit)
Marks the end of urgent data included in the data stream.
Options
TCP specifies additional options, e.g. window scaling (multiply the window value by 2
n
; n
between 0 and 14).
86
HPN Fundamentals
TCP Packet
TCP Message Format
TCP provides a connection-oriented, reliable, byte-stream service
which cares for network resources
Sequence Number
Acknowledgement Number
HLEN Reserved Code bits Window
Urgent Pointer Checksum
Options (if any) Padding
Data
....
Source Port Destination Port
0 8 16 24 31
Copyright 2011/2012 Computer Science 4, University of Bonn
87
HPN Fundamentals
TCP Connections
TCP provides a connection-oriented, reliable, byte-stream service
which cares for network resources
TCP connects applications across networks
Multiple applications on the same host are distinguished by their ports
Unlike UDP, a TCP port is not simply a queue!
TCP connections are full-duplex
TCP uses the connection, not the protocol port, as its fundamental abstraction.
Connections are identified by a pair of endpoint identifiers.
Copyright 2011/2012 Computer Science 4, University of Bonn
88
HPN Fundamentals
TCP Packet
0 8 16 24 31
TCP Connections (2)
A TCP endpoint is a pair of
integers
(host id, port number)
Source Port Destination Port
10.1.5.3
10.5.2.3
A given TCP port number can be shared by multiple connections.
Copyright 2011/2012 Computer Science 4, University of Bonn
89
HPN Fundamentals
TCP Byte Stream
TCP provides a connection-oriented, reliable, byte-stream service
which cares for network resources
TCP is byte-oriented, not packet oriented
TCP streams are unstructured
The application has (nearly) no means to control the TCP flow
TCP transmits data in units called segments
a segment may be as small as 1 byte!
typical segment size is 1024 (plus header overhead)
Copyright 2011/2012 Computer Science 4, University of Bonn
90
HPN Fundamentals
Reliable Stream Transport Service
TCP provides a connection-oriented, reliable, byte-stream service
which cares for network resources
TCP is reliable:
TCP delivers data correctly or not at all
TCP delivers data completely
TCP eliminates duplicates
TCP delivers data in the correct order
Copyright 2011/2012 Computer Science 4, University of Bonn
91
HPN Fundamentals
TCP Packet
3.2. TCP Error Control
Copyright 2011/2012 Computer Science 4, University of Bonn
Potential errors:
Corruption of bits
Loss of entire messages
Duplicates
Packet misordering
Huge delays
Potential errors:
Corruption of bits
Loss of entire messages
Duplicates
Packet misordering
Huge delays
Detection:
Checksum
missing acknowledgement
sequence number
sequence number
congestion control
Detection:
Checksum
missing acknowledgement
sequence number
sequence number
congestion control
Sequence Number
Acknowledgement Number
Checksum
Source Port Destination Port
0 8 16 24 31
A
92
HPN Fundamentals
Automatic Repeat Request
Copyright 2011/2012 Computer Science 4, University of Bonn
Idea: After sending a message, the sender waits for a positive acknowledgement.
If the acknowledgement does not arrive before a timer expires,
the message is repeated and
the sender waits for a positive acknowledgement again.
This strategy is called stop-and-wait.
The most important strategy for the detection (and correction) of the loss of entire
messages is called ARQ (Automatic Repeat reQuest).
A new message is only transmitted after the acknowledgement for the previous
message has been received by the sender.
93
HPN Fundamentals
The Alternating Bit Protocol
Copyright 2011/2012 Computer Science 4, University of Bonn
DT.1
ACK.1
successful
transmission
successful
transmission
data lost
DT.0
ACK.0
DT.1
DT.1
ACK.1
DT.0
retransmission
after timeout; correct
acknowledgement
Business as
usual
Sender Receiver
DT.0
ACK.0
acknowledgement
lost
retransmission
after timeout; receiver
ignores duplicate but
sends ACK
DT.0
ACK.0
DT.1
ACK.1
Sender Receiver
successful
transmission
The alternating bit protocol is a straightforward way of realizing stop-and-wait:
Obviously, message numbering is based on 1 bit only.
In real life, this approach is used in short-range networks such as Bluetooth.
When sending data in both directions, the acknowledgement may be carried
together with the data in the opposite direction (piggybacking).
94
HPN Fundamentals
Sliding Windows
Copyright 2011/2012 Computer Science 4, University of Bonn
Stop-and-Wait is inefficient with short messages and/or large signal
propagation delay:
DT.1
ACK.1
Receive + check message 1,
send ACK
DT.0
ACK.0
Sender Receiver
Receive + check message 2,
send ACK
Send message 1
Send message 2
DT.1
ACK.1
Receive + check message 3,
send ACK
Send message 3
Wait
Wait
Wait
Efficiency may be improved by allowing the sender to transmit several PDUs
before stopping and waiting for ACKs.
The mechanism used in this case is called
Sliding Window Protocol
95
HPN Fundamentals
Sender Window and Receiver Window
Copyright 2011/2012 Computer Science 4, University of Bonn
Sender and receiver negotiate a window size W before starting transmission:
1 <= W < m, with m = 2
n
= modulus
The sender window:
tells which PDUs may currently be sent,
changes (slides upwards) when receiving correct ACKs.
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
16 1 2 3 4 5 6 7 8 9 101112131415 Overall number of the message:
Sequence number of the PDU: 0 1 2
19 1718
The receiver window:
tells which PDUs are currently accepted at the destination,
changes (slides upwards) when receiving correct (new) PDUs
The PDUs are numbered modulo m (using a n-bit field).
Example:
96
HPN Fundamentals
Example: sender window size = 3; receiver window size = 1
Copyright 2011/2012 Computer Science 4, University of Bonn
Start:
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sequence no of PDU: 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sender window: 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Receiver window: 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sequence no of PDU: 0 1 2
Sender window :
Receiver window :
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sequence no of PDU: 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sender window : 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Receiver window : 0 1 2 1
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sequence no of PDU: 0 1 2
0 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Sender window : 0 1 2
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Receiver window : 0 1 2 1
1
Transmission of PDUs 0, 1 and 2: Both windows remain unchanged
PDU 0 received: Change at receiver window
ACK for PDU 0 received: Change at sender window
2 3 1
0 0 3 0 0
97
HPN Fundamentals
Strategies at the Receiver
Copyright 2011/2012 Computer Science 4, University of Bonn
With sliding window protocols, the receiver has several options of how to react to PDU
loss:
Ask for a retransmission of those PDUs which were lost (specific selection)
Ask for retransmission of all PDUs beginning with the first one which was lost
Hybrid solutions of both options
For the retransmission of specific PDUs, negative acknowledgements (NACK) may
be used: These carry the sequence number(s) of PDUs to be retransmitted.
Go back n
All PDUs beginning with the first one lost are retransmitted.
(Receiver window with size 1)
Pro: - Simple implementation of the protocol
Con: - Channel capacity is wasted by retransmitting PDUs correctly delivered
to the destination.
Remark: The receiver only accepts PDUs in the correct order.
98
HPN Fundamentals
Selective Repeat and Selective Reject
Copyright 2011/2012 Computer Science 4, University of Bonn
Selective Repeat
The receiver
buffers all PDUs received correctly
acknowledges the sequence of
packets received without a gap
Pro: - Improved efficiency
Con: - More complex implementation
(out-of-order packets buffered
at destination)
Selective Reject
Retransmit lost PDUs only
(requested by NACKs).
The retransmission is initiated by some
kind of NACK.
Pro: - Excellent efficiency
Con: - No gain when loosing sequence
of PDUs (several or even many
PDUs have to be retransmitted anyway)
Question: What is the impact of the receiver strategy on the size of the sender buffer?
99
HPN Fundamentals
Comparison of Receiver Strategies
Copyright 2011/2012 Computer Science 4, University of Bonn
1
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
1
-
-
-
-
-
-
-
-
-
2
3
4
5
6
7
8
9
10
2
1
2
3
4
5
6
7
8
9
2
10
11
12
13
14
15
16
17
18
19
1
3
4
5
6
7
8
9
2
10
11
12
13
14
15
16
17
18
19
T
i
m
e
o
u
t

I
n
t
e
r
v
a
l
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
12
13
1
3
4
5
6
7
8
9
10
11
2
-
-
-
-
-
-
12
13
T
i
m
e
o
u
t

I
n
t
e
r
v
a
l
T
i
m
e
o
u
t

I
n
t
e
r
v
a
l
Data:
ACK:
NACK:
A
C
K

1
A
C
K

2
A
C
K

3
A
C
K

1
1
A
C
K

1
A
C
K

1
N
A
C
K

2
A
C
K

9
Go back n
Sender Receiver
Selective Repeat
Sender Receiver
Selective Reject
Sender Receiver
100
HPN Fundamentals
Sliding Window with TCP
Copyright 2011/2012 Computer Science 4, University of Bonn
The sliding window scheme of TCP works byte by byte.
Therefore, 3 pointers are in use:
- Left border of the sending window
(border between ACKnowledged and not yet ACKnowledged data)
- Right border of the sending window
(all bytes up to this border may be sent without waiting for any ACKs)
- Marker of current sending position
(border between data already sent and data waiting to be sent)
1 2 3 4 5 6 7 8 9 10 11 12 13 ...
current sender window
All bytes waiting to be sent are being sent as soon as possible. Therefore, the
marker of the sending position usually moves pretty fast towards the right border.
TCP ACKs indicate which byte is expected next by the receiver:
All bytes up to the one given in the ACK are acknowledged.
101
HPN Fundamentals
3.3. TCP Connection Management
Copyright 2011/2012 Computer Science 4, University of Bonn
For connection establishment, TCP uses the concept of a Three Way Handshake.
The following bit flags of the TCP header are important:
SYN bit (synchronize sequence numbers):
Is set to 1, if the sequence number of the TCP PDU carries its initial value. The SYN
PDU is the very first PDU of a TCP connection.
ACK bit (acknowledgement):
Is set to 1, if the PDU carries a valid acknowledgement number.
A sends SYN seq=x
B receives SYN
B sends SYN seq=y, ACK x+1
Host A Host B
A receives SYN+ACK
A sends ACK y+1
B receives ACK
(Application needs transport connection)
Server allocates resources
for connection management.
102
HPN Fundamentals
SYN-Flooding - an Denial-of-Service-Attack
Copyright 2011/2012 Computer Science 4, University of Bonn
Client Server
send SYN
Server receives SYN
Server sends SYN+ACK
send SYN
Server receives SYN
Server sends SYN+ACK
send SYN
Server receives SYN
Server sends SYN+ACK
send SYN
Server receives SYN
Server sends SYN+ACK
send SYN
Server receives SYN
Server sends SYN+ACK
send SYN
Server receives SYN
Server sends SYN+ACK
103
HPN Fundamentals
Connection Release with TCP
Copyright 2011/2012 Computer Science 4, University of Bonn
TCP establishes full duplex connections. Therefore, both end points have to agree
on the release.
Connection release is based on a modified Three Way Handshake.
Another bit flag of the TCP header is used for connection release:
FIN bit:
Is set to 1, if the sender has no more data to transmit.
The first FIN-PDU will be issued when the sender has send all of its data and
additionally has received all outstanding ACKnowledgements.
A sends FIN seq=x
B receives FIN
B sends ACK x+1
Host A Host B
A receives ACK
A sends ACK y+1
B receives ACK
(Application wants to close the connection)
(B informs its application)
(Application closes connection)
B sends FIN seq = y; ACK x+1
A receives FIN+ACK
104
HPN Fundamentals
Simplified State Diagram of TCP Connection Management
Copyright 2011/2012 Computer Science 4, University of Bonn
closed
SYN
sent
estab-
lished
close
wait
last
ACK
FIN
wait-1
closing
FIN
wait-2
timed
wait
begin
passive open /
anything / reset
close
active open / SYN
close / timeout /
reset
send /
SYN
SYN / SYN+ACK
reset
SYN / SYN+ACK
close /
FIN
ACK /
close / FIN
FIN / ACK
SYN+ACK /
ACK
close / FIN
ACK
/
ACK
/
FIN /
ACK
ACK
/
FIN /
ACK
FIN+ACK /
ACK
Timeout after 2 lifetimes of a segment
SYN
receivd
listen
Terminology:
Input / Output
105
HPN Fundamentals
3.4. TCP Retransmission Timer
Copyright 2011/2012 Computer Science 4, University of Bonn
17.10.2011
In the Internet, we observe
heavy variations of the
Round Trip Time
(= time from sending a PDU to
receiving the corresponding
ACK).
The figure shows an example.
In 1988, Van Jacobson proposed an RTT estimation algorithm for TCP which uses an
aging function:
1. For each PDU, determine the point in time of sending the PDU
2. For each PDU determine the point in time of receiving the corresponding ACK
3. Calculate the difference of both
4. Update a weighted average value
The choice of o (0< o <1) determines the adaptation time of the RTT estimation to variations.
A typical value is o = 7/8.
t measuremen RTT New RTT Old RTT _ _ ) 1 ( _ - - o o
130
140
150
160
170
180
190
200
210
220
0 100 200 300 400 500 600 700 800 900 1000
R
T
T

[
m
s
]
PDU Number
106
HPN Fundamentals
Precise Measurement of the Round Trip Time ?
Copyright 2011/2012 Computer Science 4, University of Bonn
Unfortunately, in case of
retransmissions the ACKs are
ambiguous:
ACK for original PDU or
ACK for retransmission/
duplicate ?
1
3
4
5
6
7
8
9
10
11
2
1
-
-
-
-
-
-
-
-
-
2
2
T
i
m
e
o
u
t

I
n
t
e
r
v
a
l
A
C
K

1
A
C
K

2
Go back n
Sender Receiver
A
C
K

2

?
RTT ?
RTT ?
107
HPN Fundamentals
Karns Algorithm and Timer Backoff
Copyright 2011/2012 Computer Science 4, University of Bonn
timeout timeout new -
a) Ignore RTT measurements in case of timeout and PDU retransmission.
b) Instead, use a timer backoff strategy:
A typical value is = 2.
This algorithm originally proposed by Phil Karn (included in almost all implementations of
TCP)
eliminates the ambiguity of ACKs,
enlarges the timeout interval in case of high network load,
in critical situations decouples the calculation of timeout intervals from
RTT measurements.
The timeout interval grows until a successful transmission (without retransmissions)
happens again.
After successful transmission, the timeout interval estimation is based on RTT
measurements as discussed before.
108
HPN Fundamentals
Timer Control according to Van Jacobson
Copyright 2011/2012 Computer Science 4, University of Bonn
The Timer control algorithm originally proposed by Van Jacobson is presented by
William Stallings** as follows:
aging function SRTT(k+1) = (1-g) x SRTT (k) + g x RTT (k+1)
SERR (k+1) = RTT(k+1) SRTT(k)
SDEV (k+1) = (1-h) x SDEV (k) + h x | SERR (k+1) |
RTO (k+1) = SRTT (k+1) + f x SDEV (k+1)
*Van Jacobson, Michael J. Karels, Congestion Avoidance and Control, Proceedings of SIGCOMM
Almost identically available at ftp.ee.lbl.gov/papers/congavoid.ps.Z
**W. Stallings, Data & Computer Communications, 6th Ed., Prentice Hall, 2000
aging function
RTT round trip time SRTT smoothed round trip time
SERR smoothed error SDEV smoothed mean deviation
RTO retransmission timeout
Van Jacobson proposed for the constants:
g = 1/8; h =1/4; f = 2
Later (1990) he changed his recommendation to:
g = 1/8; h =1/4; f = 4
109
HPN Fundamentals
3.5. TCP Flow Control and Congestion Control
Copyright 2011/2012 Computer Science 4, University of Bonn
(end-to-end) Flow control
protects the receiver from being overloaded by the sender.
Congestion control(Internet flow control)
protects the network(s) from being congested.
The senders reduce their load in critical situations.
Obviously, the receiver cannot be overloaded in case of stop-and-wait: A new
message may only be transmitted after receiving the (positive) ACK.
ACK based window mechanisms provide flow control in a similar way: The
transmission window may only be moved after receiving ACKs.
This effect is not sufficient because of buffer overflow and retransmission
mechanisms.
110
HPN Fundamentals
Flow control by acknowledgements
Copyright 2011/2012 Computer Science 4, University of Bonn
With increasing network load,
- data arrive later at the receiver.
With increasing receiver load,
- data received wait longer for processing (by the receiver).
In both cases,
- acknowledgements are sent later,
- acknowledgements arrive later at the sender,
- finally, the sender must wait for acknowledgements before resuming
transmission,
- [ there is a risk of timeouts and (unnecessary) duplicate transmissions ].
A situation where the sender is completely controlled by the incoming ACK stream
is called ACK Clocking.
Acknowledgement based error detection and correction with appropriately
chosen window sizes results in flow control.
111
HPN Fundamentals
TCP Window Advertisement
Copyright 2011/2012 Computer Science 4, University of Bonn
The TCP header includes a window field (Window Advertisement) telling the
buffer space available at the sender of this packet.
TCP Packet
Source Port Destination Port
0 8 16 24 31
S A F
Sequence Number
Acknowledgement Number
Checksum
Window
112
HPN Fundamentals
TCP Window Advertisement
Copyright 2011/2012 Computer Science 4, University of Bonn
Sender Receiver
A
ck 1001, W
indow
200
Send
Receive
Send
Wait
Wait
ACK and
new window
A
ck 1, W
indow
1000
A
ck 1201, W
indow
0
Receive
ACK and
new window
The TCP header includes a window field (Window Advertisement) telling the
buffer space available at the sender of this packet.
Note:
The receiver must
not revoke
transmission
permissions
already granted:
The window may
only be reduced
after receiving
(new) data.
Remark:
The strategy shown here
may also be used at OSI
layer 2.
1
0
0
0
b
y
te
s
2
0
0
b
y
te
s
113
HPN Fundamentals
Data to transmit
Not yet transmitted.
May only be transmitted
after the window has
opened again.
TCP window control mechanisms (simplified)
Copyright 2011/2012 Computer Science 4, University of Bonn
Not yet transmitted,
but ready for immediate
transmission.
Transmitted
but not yet
acknowledged.
Retransmission may be
necessary.
TCP sender window
Minimum of
sender buffer size and
receiver capabilities (advertised window)
Transmitted
and
already
acknowledged
Border moves right
when receiving
ACKs
Border moves right
when transmitting
data.
Border moves right
if and only if the
receiver tells the
sender to do so.
The following figure illustrates the TCP window control mechanisms.
114
HPN Fundamentals
TCP in case of high load and overload
Copyright 2011/2012 Computer Science 4, University of Bonn
In the Internet,
more than 80 % of the total load is TCP traffic,
network collapse is avoided by the cooperative behaviour of TCP.
TCP tries to reach both maximum efficiency and maximum predictability: a trade-off!
Maximum
network utilization
(max. efficiency)
Predictable
network behaviour
(in particular
for real time traffic)
TCP supports both interactive application and bulk transfer:
Interactive applications: usually small amount of data
typical examples: telnet, ssh
Bulk transfer of data: usually large amount of data
typical examples: ftp, email, http
115
HPN Fundamentals
TCP in case of bulk data transfer
Copyright 2011/2012 Computer Science 4, University of Bonn
Slow Start
Fast Retransmit and Fast Recovery
Congestion Avoidance
For bulk data transfer, TCP tries to achieve
maximum throughput with
minimum packet loss.
With adaptive load control TCP achieves efficient resource utilization in todays Internet.
The throughput achievable per data stream usually cannot be predicted.
Inventions
by Van Jacobson
TCP applies mainly three techniques to achieve these goals:
116
HPN Fundamentals
Slow Start
Copyright 2011/2012 Computer Science 4, University of Bonn
The slow start and congestion avoidance algorithms MUST be used by a TCP
sender to control the amount of outstanding data being injected into the network.
RFC 2581, TCP Congestion Control, April 1999, p.3
The slow start and congestion avoidance algorithms MUST be used by a TCP
sender to control the amount of outstanding data being injected into the network.
RFC 2581, TCP Congestion Control, April 1999, p.3
Slow Start makes TCP discover the load situation on the path from the source
to the destination
when starting data transfer and
after packet loss with Retransmission Timer Timeout.
Idea: Limit the transmission window by a Congestion Window
Idea: Limit the transmission window by a Congestion Window
CONGESTION WINDOW (cwnd):
A TCP state variable that limits the amount of data a TCP can send.
At any given time, a TCP MUST NOT send data with a sequence number higher than
the sum of the highest acknowledged sequence number and the minimum of cwnd and
rwnd*.
RFC 2581, TCP Congestion Control, April 1999, p.2
*RECEIVER WINDOW (rwnd): The most recently advertised receiver window.
117
HPN Fundamentals
Data to transmit
Not yet transmitted.
May only be transmitted
after the window has
opened again.
TCP window control mechanisms
Copyright 2011/2012 Computer Science 4, University of Bonn
Not yet transmitted,
but ready for immediate
transmission.
Transmitted
but not yet acknowledged.
Retransmission may be
necessary.
TCP sender window
Minimum of
sender buffer size and
receiver capabilities (advertised window)
current congestion window
Transmitted
and
already
acknowledged
Border moves right
when receiving ACKs
Border moves
right when
transmitting data.
Border moves right
if and only if the
receiver tells the
sender to do so*.
*if the congestion window is not exceeded
Initial cwnd size: maximum message size (new: 2 x max. message size)
When to increment cwnd: cf. next slide
118
HPN Fundamentals
How slow is slow start ?
Copyright 2011/2012 Computer Science 4, University of Bonn
Initial cwnd size: max. one segment (max. SMSS); cf. RFC 2001, 1997
max. 2 segments (max. 2xSMSS); cf. RFC 2581, 1999
How to increment cwnd: One segment per correctly received ACK.
The congestion window size is influenced by
the size of transmitted messages and by
the Round Trip Time:
SENDER MAXIMUM SEGMENT SIZE (SMSS):
The SMSS is the size of the largest segment that the sender can transmit.
This value can be based on
the maximum transmission unit of the network,
the path MTU discovery algorithm,
Receiver Maximum Segment Size, or other factors.
The size does not include the TCP/IP headers and options.
RFC 2581, TCP Congestion Control, April 1999, p.2
119
HPN Fundamentals
Example: Congestion window size
Copyright 2011/2012 Computer Science 4, University of Bonn
0
10
20
30
40
50
60
0 10 20 30 40 50 60 70 80 90 100
Segments transmitted
C
o
n
g
e
s
t
i
o
n
w
i
n
d
o
w

s
i
z
e
The graph shows how the congestion window is incremented for each ACK
received.
The resulting timeout yields
packet retransmission (duplicate),
change to Timer Backoff and
congestion window reduction to 1 segment.
Finally, the tx_window and the transmission data rate become too large:
Packet loss due to buffer overflow.
120
HPN Fundamentals
Linear or exponential growth?
Copyright 2011/2012 Computer Science 4, University of Bonn
The transmission window only seems to grow slowly.
The larger the tx_window, the larger the number of ACKs.
After log
2
N Round Trip Times, TCP may already transmit N segments
Round
Trip
Time
121
HPN Fundamentals
Slow Start
With maximum speed into the traffic jam
Copyright 2011/2012 Computer Science 4, University of Bonn
Congestion
Avoidance
cwnd < ssthresh ?
Yes No
Slow Start obviously makes TCP
very quickly reach the available bandwidth and
very quickly go beyond this to overload.
When a TCP sender detects segment loss using the retransmission timer, the value of ssthresh
MUST be set to no more than the value ...
ssthresh = max (FlightSize / 2, 2*SMSS) .. [ssthresh = slow start threshold]
..., FlightSize is the amount of outstanding data in the network.
RFC 2581, TCP Congestion Control, April 1999
After this, the value ssthresh (any value for connection setup) determines the upper
limit for staying with slow start:
... upon a timeout cwnd MUST be set to no more than ... 1 full-sized segment
RFC 2581, TCP Congestion Control, April 1999
122
HPN Fundamentals
Introduction to Time Sequence Plots
Copyright 2011/2012 Computer Science 4, University of Bonn
0
5
10
15
20
25
30
35
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
S
e
g
m
e
n
t

n
u
m
b
e
r
Time [s]
Segment transmitted
Ack received
Time Sequence plots are a common means of logging (and observing) TCP behavior.
In the following
a diamond ( ) denotes a data segment transmission event
a crosshair ( ) denotes an acknowledgement segment reception event
At second 1.0, the sender
Each mark resembles a packet receive or a packet transmission event.
The X-axis denotes the time at which an event occurs
The Y-axis denoted the sequence number of the packet
The following plot derives from the observation of a TCP sender:
receives an acknowledgement for
segment 10
transmits segment 20
123
HPN Fundamentals
Introduction to Time Sequence Plots (2)
Copyright 2011/2012 Computer Science 4, University of Bonn
0
5
10
15
20
25
30
35
4 4.5 5 5.5 6
S
e
g
m
e
n
t

n
u
m
b
e
r
Time [s]
Segment transmitted
Ack received
Time Sequence plots convey more information than that.
In the following we assume that the sender is saturated (i.e. the senders application has
always sufficient data to transmit)
Observable facts from the plot:
The maximum transmission
window size W is 10 segments. It
corresponds to the y-offset of the
dot trails.
The round trip time is one
second. It corresponds to the x-
offset of the dot trails.
The transmission rate W / RTT is
10 segments per second. It
corresponds to the slope of the dot
trails.
W
RTT
W / RTT
124
HPN Fundamentals
TCP Slow Start (Time Sequence Plot)
Copyright 2011/2012 Computer Science 4, University of Bonn
The TCP Slow-start algorithm is applied
on connection establishment, or
on reestablishment after a retransmission timeout
The slow-start algorithm results in
exponential growth of the congestion
window over time.
Q: How long can this continue?
Fundamental question on connection startup:
Which congestion window size to begin with?
TCP solution: start with minimum congestion window size and increase cwnd by one
segment for each acknowledgement received.
Slow-start example:
0
10
20
30
40
50
60
70
0 0.2 0.4 0.6 0.8 1 1.2
S
e
q
u
e
n
c
e

n
u
m
b
e
r
Time [s]
Segment transmitted
Ack received
125
HPN Fundamentals
TCP Slow Start (2)
Copyright 2011/2012 Computer Science 4, University of Bonn
Q: How long can slow-starts exponential growth continue?
A: Until packet loss is detected, or the congestion window grows too large.
TCP maintains a state variable, the slow-start threshold (ssthresh) that determines
whether the TCP sender is in slow-start or congestion avoidance.
For
congestion window size < ssthresh: TCP is in slow-start
congestion window size >= ssthresh: TCP is in congestion avoidance
The task of slow-start is to quickly ramp up the
congestion window to ssthresh. The ssthresh is
regarded as an estimate for the proper magnitude of
the congestion window.
The task of congestion avoidance is to
continuously probe if the network can handle a
higher congestion window.
RTT
cwnd
ssthresh
Congestion
avoidance
Slow-start
126
HPN Fundamentals
Congestion Avoidance
Copyright 2011/2012 Computer Science 4, University of Bonn
Idea:
The congestion only grows linearly over time (instead of exponentially).
Current versions of TCP carefully discover the bottleneck capacity.
One formula commonly used to update cwnd during congestion avoidance is ...:
cwnd += SMSS*SMSS/cwnd (2)
This adjustment is executed on every incoming non-duplicate ACK.
Equation (2) provides an acceptable approximation to the underlying principle of increasing
cwnd by 1 full-sized segment per RTT.
During congestion avoidance, cwnd is incremented by 1 full-sized segment per
round-trip time (RTT). Congestion avoidance continues until congestion is detected.
RFC 2581, TCP Congestion Control, April 1999, p. 4
127
HPN Fundamentals
Congestion window during Congestion Avoidance
Copyright 2011/2012 Computer Science 4, University of Bonn
0
10
20
30
40
50
60
70
80
90
100
0 10 20 30 40 50 60 70 80 90 100
Time [Round Trip Times]
c
w
d

s
i
z
e
Over time, the congestion window size
initially grows exponentially (Slow Start)
then grows close to linearly (Congestion Avoidance)
Note:
TCP believes all kinds of packet loss to be due to network congestion.
Consequently, TCP considerably reduces the load.
TCPs fundamental assumption is not necessarily true for wireless networks.
128
HPN Fundamentals
TCP Congestion Avoidance (Time Sequence Plot)
Copyright 2011/2012 Computer Science 4, University of Bonn
In congestion avoidance, the congestion window grows, but at a slower rate than in slow
start. It grows at a rate of one packet per round-trip-time.
cwnd := cwnd + 1 / cwnd
Congestion avoidance example:
This results in a congestion window increase slightly less than 1 packet per RTT, but is
simpler to implement.
RTT
In practical implementations, the following formula applies per incoming acknowledgement:
110
120
130
140
150
160
170
180
190
3 3.1 3.2 3.3 3.4 3.5 3.6
S
e
q
u
e
n
c
e

n
u
m
b
e
r
Time [s]
Segment transmitted
Ack received
cwnd increase
129
HPN Fundamentals
TCP Retransmission Timeouts
Copyright 2011/2012 Computer Science 4, University of Bonn
On a retransmission timeout, the TCP sender assumes that it is the source of congestion on
the network and reduces its congestion window.
It assumes all pending packets as lost and applies
ssthresh := cwnd / 2
cwnd := 1
Example (link failure at second 4.2 causes total loss of packets)
and enters slow-start
cwnd = 20
cwnd = 10
Congestion
avoidance
Slow-start
Retransmission
timeout
200
205
210
215
220
225
230
235
240
4.2 4.4 4.6 4.8 5 5.2 5.4
S
e
q
u
e
n
c
e

n
u
m
b
e
r
Time [s]
Segment transmitted
Ack received
130
HPN Fundamentals
TCP Fast Retransmit
Copyright 2011/2012 Computer Science 4, University of Bonn
The sender detects packet loss when receiving multiple acknowledgements for the same
sequence number. These acknowledgements are called duplicate acknowledgements
(dupacks).
After the reception of the third dupack, a sender assumes a packet loss. Then, the sender
retransmits the segment reported to be missing (Fast Retransmit) and changes from
Congestion Avoidance to Fast Recovery.
Example:
Packet 82 is dropped
(e.g. due to router queue overflow)
With a congestion window
size of 10, the receiver
emits 9 dupacks on a single
packet loss.
(Note: only the first five
dupacks are shown here)
70
75
80
85
90
95
100
2.4 2.45 2.5 2.55 2.6
S
e
q
u
e
n
c
e

n
u
m
b
e
r
Time [s]
Segment transmitted
Ack received
Fast Retransmit
Dupacks
131
HPN Fundamentals
TCP Fast Recovery
Copyright 2011/2012 Computer Science 4, University of Bonn
The goal of Fast Recovery is to reduce the congestion window by half. This effectively
reduces the senders contribution to path congestion.
"FlightSize" denotes the number of unacknowledged packets on the path. Assuming a
saturated sender, this is equal to the congestion window size. (FlightSize = cwnd = 10)
Next, the congestion window increases
on each arriving dupack:
cwnd := cwnd + 1
After FlightSize / 2 = 5 dupacks, the
congestion window is large enough to
resume transmission (cwnd = 11).
From now on, the sender emits a new
segment for each dupack arriving.
On entering Fast Recovery, the congestion window (cwnd) is adapted:
ssthresh := FlightSize / 2
cwnd := ssthresh + 3
70
75
80
85
90
95
100
105
110
2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75
S
e
q
u
e
n
c
e

n
u
m
b
e
r
Segment transmitted
Ack received
10
8
9
11
10
14
12
13
132
HPN Fundamentals
TCP Fast Recovery (2)
Copyright 2011/2012 Computer Science 4, University of Bonn
70
75
80
85
90
95
100
105
110
2.4 2.45 2.5 2.55 2.6 2.65 2.7 2.75
S
e
q
u
e
n
c
e

n
u
m
b
e
r
Segment transmitted
Ack received
14
On acknowledgement for the (fast) retransmitted segment 82, the sender leaves Fast
Recovery.
Since in our example no further segment loss occurred, the acknowledgement covers all
segments transmitted so far (segments 82 91)
Now, the congestion window is set to its target value (half its size prior to packet loss)
cwnd := ssthresh (in our example: 5).
5
This concludes Fast Recovery.
Since cwnd = ssthresh, the
sender changes to Congestion
Avoidance.
It continues transmission with a
congestion window size of 5.
5
133
HPN Fundamentals
Fast Retransmit and Fast Recovery
Copyright 2011/2012 Computer Science 4, University of Bonn
Fast Retransmit:
A TCP receiver SHOULD send an immediate duplicate ACK when an out-of-order segment arrives.
... After receiving 3 duplicate ACKs, TCP performs a retransmission of what appears to be the missing
segment, without waiting for the retransmission timer to expire.
RFC 2581, TCP Congestion Control, April 1999
Fast Recovery:
1. When the third duplicate ACK is received, set ssthresh to no more than ...
ssthresh = max (FlightSize / 2, 2*SMSS)
2. Retransmit the lost segment and set cwnd to ssthresh plus 3*SMSS. This artificially "inflates" the
congestion window by the number of segments (three) that have left the network and which the receiver
has buffered.
3. For each additional duplicate ACK received, increment cwnd by SMSS. This artificially inflates the
congestion window in order to reflect the additional segment that has left the network.
4. Transmit a segment, if allowed by the new value of cwnd and the receiver's advertised window.
5. When the next ACK arrives that acknowledges new data, set cwnd to ssthresh (the value set in step 1).
This is termed deflating the window.
RFC 2581, TCP Congestion Control, April 1999
Changing to Slow Start after losing just one packet does not seem to be appropriate.
This effect may be avoided by Fast Retransmit.
Network overload requires immediate reaction. For this reason, Fast Retransmit has an
impact on the congestion window:
134
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Evolution of TCP
1975 1980 1985
1990
1981
TCP & IP
RFC 793 & 791
1974
TCP described by
Vint Cerf, Bob Kahn
In IEEE Trans Comm
1983
BSD Unix 4.2
supports TCP/IP
1984
Nagels algorithm
to reduce overhead
of small packets;
predicts congestion
collapse
1987
Karns algorithm
to better estimate
round-trip time
1986
Congestion
collapse
1
st
observed
1990
4.3BSD Reno
fast recovery
delayed ACKs
1975
Three-way handshake
Ray Tomlinson
In SIGCOMM 75
1988
Van Jacobsons
algorithms
slow start,
congestion
avoidance, fast
retransmit (all
implemented in
4.3BSD Tahoe)
SIGCOMM 88
Source: Slides TCP Variations: Tahoe, Reno, New Reno, Vegas, Sack by Paul D. Amer, University of Delaware
135
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Evolution of TCP (2)
Source: Slides TCP Variations: Tahoe, Reno, New Reno, Vegas, Sack by Paul D. Amer, University of Delaware
1993 1994
1996
1994
ECN
Explicit
Congestion
Notification
(Floyd)
1993
TCP Vegas(not
implemented)
real congestion
avoidance
without causing
congestion itself
(Brakmo et al)
1994
T/TCP
Transaction TCP
(Braden)
1996
NewReno
modified fast
recovery
concerning
multiple losses
(partial ACKs)
SACK TCP
Selective Ack
(Floyd et al)
1996
Improving TCP
startup
(Hoe)
1996
FACK TCP
Forward Ack
extension to SACK
(Mathis et al)
For new ideas and
extensions, see
recent IETF drafts.
136
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
and what do we see in the wild ???
OS Linux Windows
Slow Start yes yes
Cong. Avoidance yes yes
Fast Retransmit yes yes
Fast Recovery yes yes
SACK since 2.2 2K
F-RTO since 2.4.21 / 2.6 Vista; Server 2008
LCD since 2.6.32 ???
E
n
h
a
n
c
e
m
e
n
t
s

f
o
r

W
i
r
e
l
e
s
s

T
r
a
f
f
i
c
137
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
4. IP and Routing in a Nutshell
4.1. Important Terms
4.4. Routing
4.2 IPv4
4.3 IPv6
When a process (application) wants to send data to another process (application), the network
has to
route the data on a suitable path (cheap, fast, reliable, )
to the specific host.
At the destination host the appropriate destination process has to be identified.
4.6. Link State Routing
4.5. Distance Vector Routing
4.7. Hierarchical Routing
138
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
4.1. Important Terms
A Bitstring x is a (cf. Radia Perlman, "Interconnections: Bridges and Routers", Addison Wesley, 1992)
Remarks: - The route identifies the path to reach a specific receiver
- The IEEE 802 LAN/MAC addresses (48 bit length) are tightly bound to the network
interface card and therefore independent of the location (=> "names")
- Some authors use the term "name" for the user-friendly version of an address, i.e. the
ASCII-string that is assigned to an address
Address, if it is
independent of the location of the sender, but
dependent of the location of the receiver.
Example: Postal address, street and number
Route, if it is
dependent of the location of the sender, and
dependent of the location of the receiver.
Example: Driving instructions:
make an immediate right turn, at the third set of traffic
lights turn left. Go to the last building on the right hand side.
Name, if it is
independent of the location of the sender, and
independent of the location of the receiver.
Example: Social Security Number
139
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Name, Address, Route
Quotation from RFC 791: Internet Protocol, September 1981
A name indicates what we seek.
An address indicates where it is.
A route indicates how to get there.
140
HPN Fundamentals
4.2 IPv4
Copyright 2011/2012 Computer Science 4, University of Bonn
Network layer PDUs (OSI layer 3) are called packets. In case of IP they are also called
Internet datagram, short: IP datagram; even shorter: datagram.
data
type of service 1
total length 2
identification 2
DF MF 0 offset 1
offset (continued) 1
time to live 1
protocol 1
header checksum 2
source address 4
destination address 4
options variable
padding variable
Length in byte
1
Version IHL
precedence D T R unused
IPv4 datagrams
141
HPN Fundamentals
IP Datagrams (2)
Copyright 2011/2012 Computer Science 4, University of Bonn
version: today: version 4
IHL: Internet Header Length (in 32 bit words)
type of service: Information to routers
precedence: integer value 0 (normal) und s 7 (high priority)
D: 0 normal, 1 low delay
T: 0 normal, 1 high throughput
R: 0 normal, 1 high reliability
total length: total length of the currently fragment (in octets; max. 65.535)
identification: packet number for reassembly (chosen by sender)
DF: don't fragment
MF: more fragments (follow)
offset: for reassembly
time to live: maximum number of "hops" to destination, decremented by routers
protocol: protocol of IP service user at destination
precedence D T R unused
142
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
192.0.1.255 (Class C) Broadcast to all
hosts in class C net
with netid 192.0.1
128.3.2.3 (Class B) netid 128.3
hostid 2.3
10.0.0.0 (Class A) netid 10 (Arpanet)
Dotted Decimal Notation
The sequence of 32 Bits is hardly readable for human users.
IP addresses in most cases are denoted more convenient as
four decimal numbers
separated by a dot (".")
each representing 1 Byte of the whole 32 Bit address.
Examples of "Dotted Decimal Notation":
00001010 00000000 00000000 00000000
netid hostid
10000000 00000011 00000010 00000011
11000000 00000000 00000001 11111111
netid hostid
netid hostid
Important:
Only network addresses (netids) are assigned by a central institution. The
assignment of specific host addresses (hostids) is done by the network provider in a
local manner.
143
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
IP Addresses: How to get one?
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 a server
plug-and-play
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)
Support for mobile users who want to join network (more shortly)
144
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
DHCP
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
223.1.1.1
223.1.1.2
223.1.1.3
223.1.1.4 223.1.2.9
223.1.2.2
223.1.2.1
223.1.3.2
223.1.3.1
223.1.3.27
A
B
E
DHCP
server
arriving DHCP
client needs
address in this
network
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

145
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
DHCP client-server scenario
DHCP server: 223.1.2.5
arriving
client
time
DHCP discover
src : 0.0.0.0, 68
dest.: 255.255.255.255,67
yiaddr: 0.0.0.0
transaction ID: 654
DHCP offer
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 654
Lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
transaction ID: 655
Lifetime: 3600 secs
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

146
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
CIDR - Classless Inter-Domain Routing
Reminder: Classes A, B, C with IPv4:
=> About 2 Million Class C addresses are unused (= 500 Million IP addresses !!!)
Solution:
Abolition of fixed classes A, B, C
Variable Border between netid and hostid (variable length)
In practice:
All earlier assigned IP addresses will be used without changes.
Unused class C addresses will be assigned in a different manner.
=> CIDR Classless Inter-Domain Routing, RFC 1519 (1994, 1995)
The entry in a routing table now has base address and address mask (= length of netid).
A too large
=> B is ok
C too small
Class A: 24 bit hostid = 15 Million hosts
Class B: 16 bit hostid = 64.000 hosts
Class C: 8 bit hostid = 250 hosts
147
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
CIDR - Classless Inter-Domain Routing (2)
Assign class C addresses as contiguous blocks of variable size
(=> > 250 hosts per subnet, this equals variable length of netid and hostid)
Example: We need IP addresses for about 1,800 hosts
Base address:
194.24.0.0
e.g. only 194.24.0.0 / 255.255.248.0 for the block 194.24.0.0 - 194.24.7.255 (8 addresses)
Emerging problem: larger size of routing tables (?)
Solution: Routing table entries consist of IP base address + address mask
=> A single routing entry for the whole block of class C addresses
Address mask:
255.255.248.0
Use addresses:
194.24.0.0 -250 hosts
194.24.1.0 -250 hosts
...
194.24.7.0 -250 hosts
total of -2000 hosts
Realized with:
21 bit netid 11 bit hostid
255 255 248 0
11111111 11111111 11111 000 00000000 11111111 11111111 11111 000 00000000
With a Boolean AND operation of address mask and a specific destination address the
bits of the hostid are suppressed before a lookup in the routing table takes place.
Hereby, all addresses of the contiguous block are mapped to 194.24.0.0.
Prefix notation:
194.24.0.0/21
148
HPN Fundamentals
4.3 IPv6
Copyright 2011/2012 Computer Science 4, University of Bonn
New requirements and problems (with address space) made the IETF start work on a new
version of IP:
Fall 1990: The IETF starts work on a new version of IP.
January 1995: Proposal of a new version of IP.
Originally known as Next Generation IP (IPng), the new version of
IP now is called IPv6.
The IPv6 header format is completely different from IPv4:
The address field has been extended to 128 bit.
The header checksum was deleted.
Irrelevant fields were dropped.
Preparation for new services with resource reservation.
More flexibility for options.
Fragmentation by hosts only, not by routers.
Note: The version number 5 was used for the experimental protocol ST.
149
HPN Fundamentals
Comparison of IPv4 and IPv6 headers
Copyright 2011/2012 Computer Science 4, University of Bonn
IHL Ver Ver
4 byte 4 byte
Options, Padding + Data
Extension Header + Data
Basic IPv4 header
(20 byte)
Basic IPv6 header
(40 byte)
TOS Class Flow Label
Identification Flags + Fragm. Offs.
Header Checksum
Total Length
Payload Length
Protocol
Next Hdr.
TTL
Hop Limit
Source Address
Destination Address
Source Address
Destination Address
Version=4 Version=6
IHL (Internet header length) dropped (basic IPv6 header always 40 byte)
TOS (Type of Service) Traffic Class + Flow Label for QoS
Total Length (incl. header) Payload Length (not including Header)
Identification, flags, fragment offset
(Fragmentation / Reassembly)
Extension header used for fragmentation
(Note: No fragmentation in routers!)
TTL (Time To Live) Hop Limit
Protocol (encapsulated protocol, e.g. TCP) Next header (following IPv6 header)
Header checksum dropped (was almost irrelevant with IPv4)
Source/Destination Address (32 bit each) Source/Destination Address (128 bit each)
IPv6 Header
six fields + two addresses
flexible extension (Extension Header(s))
IPv4 Header
ten fields + two addresses
+ variable option fields
150
HPN Fundamentals
Options in IPv6
Ver
32 bits
Class Flow Label
Payload Length Next Hdr. 0 Hop Limit
Source Address
Destination Address
IPv6 has a fixed header size (without any option fields).
Options are carried after the header in extension headers.
The number of extension headers for
one IPv6 datagram is variable.
IPv6 specifies the following option headers:
Hop-by-Hop Options (Next Hdr. == 0)
Routing Header (Next Hdr. == 43)
Fragmentation Header (Next Hdr. == 44)
Authentication Header (Next Hdr. == 51)
Destination Options (Next Hdr. == 60)
Hop-by-Hop Options
Next Hdr. 43 Hdr. Length
Routing Information
Next Hdr. 44 Hdr. Length
Fragment Identification
Next Hdr. 51 Hdr. Length
Authentication Data
Next Hdr. 6 Hdr. Length
TCP Header and Data
The protocol payload transported by IPv6 is the last
header in the chain. Each protocol has its own next
header id (e.g. Next Hdr. == 6 for TCP)
Copyright 2011/2012 Computer Science 4, University of Bonn
151
HPN Fundamentals
Migration Path from IPv4 to IPv6
The transition from IPv4 to IPv6 should be smooth and should guarantee interoperability.
From the beginning of IPv6 design, the IETF carefully considered migration strategies.
The three main components of the migration path are:
Dual Stack
some hosts use IPv4 and IPv6
IPv4 IPv4
Ethernet Ethernet Ethernet
TCP
IPv4
TCP TCP
IPv6 IPv6 IPv4
Tunneling (IPv6 in IPv4 datagrams)
IPv4 islands are traversed by tunneling
IPv6
IPv4
IPv4
IPv6
IPv6
Header Translation
RFC 2766 specifies a Network Address Translator Protocol Translator
(NAT-PT) that translates IPv6 headers to IPv4 and vice versa
IPv6
IPv6
IPv4
IPv6
IPv6
Copyright 2011/2012 Computer Science 4, University of Bonn
152
HPN Fundamentals
Tunneling
Copyright 2011/2012 Computer Science 4, University of Bonn
A tunnel
is a path followed by an IP packet while encapsulated.
Tunnels have well-defined starting and termination points.
Header payload
IP Src: Original Sender
IP Dst.: Ultimate Destination
Outer Header payload
IP Src: Tunnel Entry-Point
IP Dst.: Tunnel Exit-Point
Header payload
Tunneled packets carry the IP-ID in the protocol field of the IP-Header:
IP in IP.
153
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Addressing according to IPv6
The new version 6 of the Internet Protocol uses addresses of 128 Bit length.
When assigning
1 Million addresses / s it would take
more than 20 years
to exhaust the address space of IPv6.
Considering an appropriate hierarchical addressing structure and further "pessimistic"
assumptions there are still about 1564 addresses / m
2
of Earths surface.
The Dotted Decimal Notation seems to be inappropriate, as demonstrated by the following
example:
Size of the address space:
= 665.570.793.348.866.943.898.599 addresses / m
2
of Earth
These are more addresses per head of world population than all available addresses of
todays Internet!
340.282.366.920.938.463.463.374.607.431.768.211.456
104.230.140.100.255.255.255.255.0.0.17.128.150.10.255.255
incl. oceans
154
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
"Colon hex"
Therefore, IPv6s designer proposed the so-called Colon Hexadecimal Notation (colon hex):
An IPv6 address still refers to a network interface (as IPv4). Now, a single network interface
may have several addresses (e.g. to support overlapping virtual networks).
IPv6s designer recommend to use at least the last 48 bit for addressing hosts/network
interfaces (Node ID) within subnets.
Example (Mapping of IPv4 addresses):
From 128.10.2.1 to 0:0:0:0:0:0:128.10.2.1, short ::128.10.2.1
Example (Zero Compression):
FF05:0:0:0:0:0:0:B3 changes to FF05::B3
Mapping of IPv4 addresses to IPv6 uses a combination of notations.
Readability may be improved by compression of a contiguous sequence of zeros (zero
compression). This can only be used once per IP address!
68E6:8C64:FFFF:FFFF:0:1180:960A:FFFF
104.230.140.100.255.255.255.255.0.0.17.128.150.10.255.255
changes to
155
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
4.4. Routing
Correctness
Simplicity (fast, low memory demand)
Robustness (also in presence of hardware/software failures)
Stability (achieve equilibrium despite "dynamics")
Fairness
Optimality (considering specific criteria)
Scalability (number of networks, number of hosts)
A routing strategy has to be able to route data packets over
very large distances.
Remark:
Furthermore, when communicating via several networks,
possibly contractual issues and charging have to be
considered: "Policy-based Routing".
Requirements for Routing Strategies
156
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Router Architecture Overview
Two key router functions:
run routing algorithms/protocol (RIP, OSPF, BGP)
forwarding datagrams from incoming to outgoing link
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

157
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Input Port Functions
Decentralized switching:
given datagram dest., lookup output port
using forwarding table in input port memory
goal: complete input port processing at line
speed
queuing: if datagrams arrive faster than
forwarding rate into switch fabric
Physical layer:
bit-level reception
Data link layer:
frames
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

158
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Every incoming packet is sent out on every outgoing line.
Flooding
Flooding is the most straightforward routing strategy:
Exceptions:
The packet is destined for the router itself (arrived at destination).
The router already has received the packet earlier (how to recognize it?).
The packet is not sent out on the line it arrived on.
Advantages:
If the destination is reachable at all, the path will definitely be found.
The given packet will actually reach the destination on the shortest path.
Drawback:
A huge number of unnecessary duplicates of the packet.
159
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Routing with Shortest Paths
The (sub-) network is represented by a graph:
Router Node
Link Edge
3
2
10
5
7
4
2
3
2
4
3
5
2
2
Important question:
Wherefrom do we know the current graph, in particular in the presence of
dynamic changes (failures, new links, new routers, )?
"Costs" (weights) will be assigned to each edge, e.g.
"1" for "1 hop"
the distance between two nodes in kilometers/miles (length of the connecting line)
mean queuing and transmission delay to transmit on the link
Well-known graph algorithms allow to determine the shortest path (according to the given
costs).
160
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
4.5. Distance Vector Routing
This strategy (also known as "Old ARPANET Routing" or "Bellman-Ford Routing")
assumes that
every router
knows the distance
to every other router in the subnet
and stores this information in a table (Distance Vector).
The calculation of distances is based on information on the direct neighborhood.
The basic idea of Distance Vector Routing is as follows:
1. Each intersection acts as a "router". Initially, the router
only knows its own location.
???
??? km
2. Ultimate goal of the router is to set up direction
signs to all possible destinations.
RIP (Routing Information Protocol) RFC 1058
RIP-2 RFC 1723
RIPng for IPv6 RFC 2080
161
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Distance Vector Routing (2)
3. Initial direction sign will be the one to its own
location (distance "0").
Bonn
0 km
Bonn
0 km
Siegburg
15 km
Lohmar
27 km
5. The router updates its own direction signs
according to the measured distance and the
neighbors direction signs (destination, distance).
E.g. new sign for Lohmar = 12 km + 15 km
Lohmar
12 km
Siegburg
0 km
15
km
4. For all links, it determines the distance to the
next intersection (neighbor) and remembers the
distances of the neighbor routers direction
signs.
162
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Distance Vector Routing (3)
The protocol operation drafted on the preceding slides is:
1. Every router learns about its identity and the "costs" of each of its outgoing lines.
2. Every router maintains a routing table ("Distance Vector"), for every (known) destination bearing the
shortest distance. Initial distances in the table are
"0" (distance to itself) and
"" (to all other destinations)
Furthermore, the router "remembers" the specific outgoing link for every (known) destination.
3. Every router sends its routing table to all direct neighbors when changes occur. The same happens
at startup, for further changes in the table, and possibly in periodic intervals of time.
4. Every router "remembers" the most recent routing tables received from direct neighbors.
5. Every router (re-) calculates its routing table using
the distances to its (direct) neighbors and
the routing tables of its (direct) neighbors
This way the router determines the minimal costs for a path to every known destination and the outgoing
line it has to use. These shortest distances (from its point of view) are sent to the (direct) neighbors.
6. Step 5 is being repeated whenever
a (direct) neighbor sent a routing table with changed entries (i.e. new distances)
an outgoing line fails.
Problems with this strategy:
It is rather error-prone.
Slow convergence to a steady state.
163
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Error-Proneness and Slow Convergence
Error-Proneness:
With Distance Vector Routing a single router failure may cause a network collapse.
Imagine a router which claims to have distance "0" to all known destinations! As a result, all
packets will be sent to that specific router!
(Exactly this happened on some December 24th, the so called "Christmas Deadlock" in the ARPANET)
Slow convergence:
After changes in the routing table have occurred, it may take a long time until the routing
table of all routers are consistent once again (remember: the routing tables are only sent to direct
neighbors, causing recalculation of their routing tables, and so on).
During such phases packets might "vanish" (because of exceeding the max. packet lifetime).
164
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
"Count-to-Infinity"
A particular problem is known as "Count-to-Infinity".
It can already be demonstrated with a simple network consisting of 3 nodes and distance =
"number of hops":
To A To B To C
Since A has sent the vector (0,1,2).
Once again, A has to send the updated vector to B ... count to infinity!
A: (0,1,4)
A has to update its distance vector as soon as it has received the change of B:
B: (1,0,3)
When the link B-C fails, B updates its distance vector (using the most recent information from A
about As distance to reach C)
A: (0,1,2) B: (1,0,1) C: (2,1,0)
Distance Vectors:
B: 1
C: 2
A: 1
C: 1
Host A Host B
B: 1
A: 2
Host C
As soon as B has sent its vector (1,0,3).
165
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
4.6. Link State Routing (Interior Gateway Protocol, OSPF)
"Link State Routing" is recommended for IP-based autonomous systems. In the Internet, it
is in widespread use as "OSPF: Open Shortest Path First":
Steps 3 and 4 are repeated as soon as
a new neighbor router has been detected,
the "distance" (costs) to a neighbor router has changed,
the link to a neighbor router fails.
1 Every router has to "learn" about the presence of its
direct neighbor routers and has to remember their
network addresses.
2 Every router determines the costs to all of its direct
neighbor routers.
3 All routers send (in some way) to all routers a "Link State
Packet" (LSP). The LSP carries the information of step 1
and 2.
4 Every router now is able to use graph algorithms on
the collected LSP information and determine shortest
distances and therefore shortest paths to all other
routers.
AS 1
Area
border
router
Remark:
OSPF distinguishes between
area and backbone
(AS internal hierarchy):
separate graphs
Exchange of information via
Area Border Router
166
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Link State Routing (2)
The Chicken-and-Egg Problem:
How to send the LSPs to all other routers when
the routing table is not (yet) known?
I.e. step 3 before step 4.
Solution 1: "Flooding"
Every router sends the LSP to all outgoing lines
except to the line the packet arrived on.
Problem: Exponential growth of the number of packets sent.
Solution 2: "Flooding with Elimination of Duplicates"
Every router has to store the youngest LSP of each other router anyway. Therefore,
duplicates may be recognized and transmitting these again may be suppressed.
(Each LSP will only be sent once on each outgoing line)
"Old" and "new" LSPs may be distinguished by using a sequence number (analog to
sliding window protocols). Additionally, we need an "aging" function to account for
further special cases (e.g. router crash).
167
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Link State Routing (3)
Lack of Stability
If the calculation of "distances" (costs) considers the actual load of a
link, Link State Routing repeats steps 3 and 4, leading to
increasing load on those lines that are only slightly loaded
decreasing load on those lines that are highly loaded
Immediately after an update of the routing tables, the situation turns
around once again,
leading to a
regular oscillation:
A
B
C
D
E
F
G
H
I
J
K
"West part"
"East part"
E-G loaded; D-F unused E-G unused; D-F loaded
168
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Comparison DVR vs. LSR
Distance Vector Routing
"tell your neighbor about
your view of the world"
Global information (distance vector) is
distributed locally (only to neighbors)
Maintain the "Distance Vector":
- cost for all known destinations
- next hop to all known destinations
- use information from neighbors to
update vector
Link State Routing
"tell the world about the details
of your neighborhood"
Local information (link state to
neighbors) is distributed globally (to
all routers using flooding)
Maintain a network map (graph):
- use Dijkstras algorithm to
determine shortest paths to all known
destinations.
- use link state packets to update
network graph
Both calculate shortest paths each in its specific way!
169
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
4.7. Hierarchical Routing
With a growing network also the size of the routing tables is growing. Therefore
increased memory for routing tables,
increased time for "lookup" in the (larger) routing tables,
increased bandwidth to distribute routing updates
is needed. Finally, it is no longer possible for every router to have a detailed view of the complete
network.
With hierarchical routing every router is assigned to a certain region.
Every router has
detailed knowledge about its own region, but
no detailed information about the other regions.
When several networks are connected to each other, we already have a natural way of
separating particular regions.
For complex network systems it might even be useful to work in several levels of hierarchy
(e.g. sub-regions within a larger region ).
170
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Example: Hierarchical Routing
Complete Routing Table of 1A (18 entries):
Dest. 1A 1B 1C 2A 2B 2C 2D 3A 3B 4A 4B 4C 5A 5B 5C 5D 5E
Line - 1B 1C 1B 1B 1B 1B 1C 1C 1C 1C 1C 1C 1C 1B 1B 1C
Hops - 1 1 2 3 3 4 3 2 3 4 4 4 5 5 6 6
Routing Table of 1A with hierarchical routing (7 entries):
Dest. 1A 1B 1C 2 3 4 5
Line - 1B 1C 1B 1C 1C 1C
Hops - 1 1 2 2 3 4
1A
1B
1C
3A 3B
4A
4B
4C
Region 1
5A
5B
5D
5E
5F
Region 3
Region 4
Region 5
2B
2A
2C
2D
Region 2
the route from 1A to 5C and 5D
is no longer the shortest one!
5C
5F
1C
5
171
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Hierarchical Routing in the Internet
Interior Gateway Protocol (IGP): Routing within AS (=> OSPF)
Exterior Gateway Protocol (EGP): Routing between ASs (=> BGP-4)
Important notion with IP Routing: Autonomous System AS
Autonomous System:
operated by individual organization/company
individual network administration
using its own (internal) routing algorithm
Exterior Gateway Protocol
"connecting" ASs AS 1
AS 2
AS 3
Internal
router
AS
boundary
router
Area
Area
border
router
Backbone
router
Backbone
172
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Border Gateway Protocol v4: BGP-4
AS 1
AS 2
AS 3
Exterior Gateway Protocol
connecting ASs
Exterior Gateway Protocol: BGP-4
AS
boundary
router
Border Gateway Protocol v4: BGP-4
BGP only knows:
Routers (AS boundary)
Lines between routers
Further ASs
Three categories of networks:
1. "Stub": Only one connection to the BGP graph (no transit)
2. "Multiconnected": x > 1 connections to BGP (transit possible)
3. "Transit": Backbone network, mainly for transit
BGP fundamentally uses the concept of Distance Vector Routing.
Remarks:
Routing table contains cost and exact path to each destination
BGP considers "policies" or additional "routing constraints"
(e.g. no transit via specific ASs, IBM traffic not to be routed via Microsoft network, )
173
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
IGP vs. EGP
Autonomous System
AS xy
?
AS 1
?
AS 2
Information about detailed
topology of peer ASs
not available.
EGP
EGP
EGP
EGP
IGP
EGP: exchange of network
reachability information
between ASs
Propagation of network
reachability information
within AS
IGP: Exchange of
internal routing information
BGP-4 is the EGP currently in place in the Internet.
IGP = Interior Gateway Protocol
EGP = Exterior Gateway Protocol
174
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
5. Link Layer in a Nutshell
5.2. Aloha from Hawai
5.1. Introduction
5.3. The classical "Local Area Network"
5.4. WLAN at a quick glance
175
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
5.1 Introduction
data-link layer has responsibility of
transferring datagram from one node
to adjacent node over a link
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

Some terminology:
hosts and routers are nodes
communication channels that connect
adjacent nodes along communication
path are links
wired links
wireless links
LANs
layer-2 packet is a frame,
encapsulates datagram
176
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Link layer: context
datagram transferred by different link protocols over different links:
e.g., Ethernet on first link,
frame relay on intermediate links,
802.11 on last link
each link protocol provides different services
t r anspor t at ion analogy
r t r ip f r om Pr incet on t o Lausanne
m limo: Pr incet on t o J FK
m plane: J FK t o Geneva
m t r ain: Geneva t o Lausanne
r t our ist = dat agr am
r t r anspor t segment = communicat ion link
r t r anspor t at ion mode = link layer pr ot ocol
r t r avel agent = r out ing algor it hm
177
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Link layer services
framing, link access:
encapsulate datagram into frame, adding header, trailer
channel access if shared medium
MAC addresses used in frame headers to identify source, dest
different from IP address!
reliable delivery between adjacent nodes
seldom used on low bit-error link
(fiber, some twisted pair)
wireless links: high error rates
flow control:
pacing between adjacent sending and receiving nodes
error detection:
errors caused by signal attenuation, noise.
receiver detects presence of errors:
signals sender for retransmission or drops frame
error correction:
receiver identifies and corrects bit error(s) without resorting to
retransmission
178
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Link layer: Where is it implemented?
controller
physical
transmission
cpu memory
host
bus
(e.g., PCI)
network adapter
card
host schematic
application
transport
network
link
link
physical
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

in each and every host
link layer implemented in adaptor
(aka network interface card NIC)
Ethernet card, PCMCI card,
802.11 card
implements link, physical layer
attaches into hosts system buses
combination of hardware, software,
firmware
179
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Link layer: Adapters Communicating
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

sending side:
encapsulates datagram in
frame
adds error checking bits,
flow control, etc.
receiving side
looks for errors, flow control,
etc
extracts datagram, passes to
upper layer at receiving side
controller
controller
sending host receiving host
datagram
datagram
datagram
frame
180
HPN Fundamentals
Copyright 2011/2012 Computer Science 4, University of Bonn
5.2. Aloha from Hawai
Advantages of Pure Aloha:
- Simple mechanism, easy to implement
- Illustration of general random access
network characteristics
- Easy to analyze
Disadvantage of Pure Aloha:
- Low maximum throughput
when frame first arrives
transmit immediately
collision probability increases:
frame sent at t
0
collides with
other frames sent in [t
0
-1,t
0
+1]
181
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Behavior of a Reference Scenario
Transmission by the reference station
frame transmission time
P
Start of
transmission
End of
transmission
Transmission by other station
P
Start Start
P
collision window
2 P
All transmission attempts starting during the
collision window result in a collision
Time
Time
182
HPN Fundamentals
Copyright 2011/2012 Computer Science 4, University of Bonn
Slotted Aloha
Assumptions:
all frames same size
time divided into equal size slots
(time to transmit 1 frame)
nodes start to transmit only slot
beginning
nodes are synchronized
if 2 or more nodes transmit in slot, all
nodes detect collision
Operation:
when node obtains fresh frame,
transmits in next slot
if no collision: node can send
new frame in next slot
if collision: node retransmits
frame in each subsequent slot
with prob. p until success
183
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
5.3. The classical "Local Area Network"
Until the middle of the 1990s, the shared medium was thought to be characteristic
for LANs:
The LANs described herein are distinguished from other types of data
networks in that they are optimized for a moderate-sized geographic area,
such as a single office building, a warehouse, or a campus.
The IEEE 802 LAN is a shared-medium peer-to-peer communication
network that broadcasts information for all stations to receive...
There is always need for an access sublayer in order to arbitrate the access
to the shared medium.
From: IEEE Std. 802-1990; IEEE Standards for Local and Metropolitan Area Networks:
Overview and Architecture
Key Concepts
184
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
"CSMA/CD"
This strategy of Ethernet and IEEE 802.3 LANs allows immediate medium access
if no other station uses the shared bus.
Collisions are detected and resolved:
Same as:
"Listen-Before-Talk" in
conversations.
CSMA/CD is based on a protocol called "Aloha" which was developed in Hawaii
for satellite communication.
Aloha: - Send whenever you want
- Collisions are detected by message loss (missing ACK)
- Lost data are re-transmitted
In LANs, the signal propagation time is small. For this reason, collisions may be
detected while transmitting.
C Carrier
S Sense
M Multiple
A Access with
C Collision
D Detection
185
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
CSMA/CD medium access
wait for
free
medium
send
"jamming signal",
calculate backoff
time
Backoff
prepare
frame for
transmission
inactive
start
transmission
finish
transmission
Medium
now free
Jamming signal
finished
Accept data from
attached device
Frame ready,
medium busy
Transmission
finished
No
Collision
Backoff finished,
medium free
Frame ready,
medium free
Collision
Backoff
finished,
medium
busy
186
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
"Ethernet": Yesterday - today - tomorrow
Full-duplex Ethernet
Original Ethernet
Transceiver
Cables
Switching Hub Switching Hub
Switched Ethernet
Repeater
Twisted Pair Ethernet
Twisted Pair
Cables
Coaxial Cable
187
HPN Fundamentals
5.4. WLAN at a quick glance
Copyright 2011/2012 Computer Science 4, University of Bonn
Wireless LAN (WLAN) is also called Wireless Ethernet.
In fact, Ethernet and WLAN have several characteristics in common:
Shared medium: The wireless medium is shared by all stations in the area.
Risk of collisions: Collisions may happen.
4.6.7.2. The Distribution System
4.6.7.3. Wireless Medium Access Methods
4.6.7.2. Basic Building Blocks of Wireless LAN
However, there are important differences:
Collision Detection: In WLAN, collisions are hard to detect
(The transmitted signal is much stronger than the received signal)
Network Formation: Who belongs to the network?
(In Ethernet, you can check the cables. In WLAN, you need identifiers)
4.6.7.1. Wireless Links
188
HPN Fundamentals
Wireless Links
Copyright 2011/2012 Computer Science 4, University of Bonn
As in wired communication, a transmission in wireless systems is between
neighbouring stations on the same physical link. However, a link in wireless
systems behaves completely different than in wired systems.
Wired Wireless
low bit error rate high bit error rate (10
-1
to 10
-2
)
constant propagation
characteristics
(rapidly) changing propagation
characteristics
constant quality of the link
short periods with no
communication (deep fades)
clear separation of links by cables unclear boundaries of a link
Note: This has consequences on the networking mechanisms:
further protection and error recovery mechanisms have to be introduced
While a link in a wired channel is deterministic, a link in
wireless communications is a probabilistic property.
While a link in a wired channel is deterministic, a link in
wireless communications is a probabilistic property.
189
HPN Fundamentals
Wireless Medium Access Methods
Copyright 2011/2012 Computer Science 4, University of Bonn
Fundamental access method:
Distributed Coordination Function (DCF),
Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA).
is implemented in all STAs (both IBSS and infrastructure network configurations)
Collisions are avoided by random backoff times after busy medium conditions.
All directed traffic uses immediate positive acknowledgment (ACK frame).
Retransmission is scheduled by the sender if no ACK is received.
190
HPN Fundamentals
The distributed coordination function (DCF)
Copyright 2011/2012 Computer Science 4, University of Bonn
The DCF allows for automatic medium sharing through the use of
CSMA/CA with a random backoff time following a busy medium condition.
All directed traffic uses immediate positive acknowledgment (ACK frame) where
retransmission is scheduled by the sender if no ACK is received.
t
medium busy
SIFS
PIFS
DIFS
next frame contention
IEEE 802.11 defines access priorities through different inter frame spaces:
SIFS (Short Inter Frame Spacing)
highest priority, for ACK, CTS, polling response
PIFS (PCF IFS)
medium priority, for time-bounded service using PCF
DIFS (DCF, Distributed Coordination Function IFS)
lowest priority, for asynchronous data service
191
HPN Fundamentals
CSMA/CA, mandatory
Copyright 2011/2012 Computer Science 4, University of Bonn
when ready: start sensing the medium
if the medium is free for the duration of an Inter-Frame Space (IFS), the station can start
sending (IFS depends on service type)
if the medium is busy,
o the station has to wait for a free IFS,
o then the station must additionally wait a random back-off time
(collision avoidance, multiple of slot-time)
if another station occupies the medium during the back-off time of the station, the
back-off timer stops (fairness)
IEEE 802.11 uses exponential backoff: The contention window doubles with each
collision.
t
medium busy
DIFS DIFS
next frame
contention window
(randomized back-off
mechanism)
slot time
direct access if
medium is free DIFS
S
o
u
r
c
e
:

J
o
c
h
e
n

S
c
h
i
l
l
e
r
:

M
o
b
i
l
e

C
o
m
m
u
n
i
c
a
t
i
o
n
s

,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

2
0
0
3
192
HPN Fundamentals
Basic idea: 5 stations competing for access
Copyright 2011/2012 Computer Science 4, University of Bonn
bo
r
bo
r
bo
r
bo
r
bo
r
bo
r
bo
r
bo
r
bo
r
t
busy
bo
e
station
1
station
2
station
3
station
4
station
5
packet arrival at MAC
DIFS
bo
e
bo
e
bo
e
busy
elapsed backoff time
bo
r
residual backoff time
busy
medium not idle (frame, ack etc.)
DIFS
bo
e
bo
e
bo
e
DIFS
busy
busy
DIFS
busy bo
e
bo
e
bo
e
(example for collision)
S
o
u
r
c
e
:

J
o
c
h
e
n

S
c
h
i
l
l
e
r
:

M
o
b
i
l
e

C
o
m
m
u
n
i
c
a
t
i
o
n
s

,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

2
0
0
3
193
HPN Fundamentals
Acknowledgements
Copyright 2011/2012 Computer Science 4, University of Bonn
t
SIFS
DIFS
data
ACK
waiting time
other
stations
receiver
sender
data
DIFS
contention
Instead of Collision Detection, IEEE 802.11 uses ACKs:
station has to wait for DIFS before sending data
receivers acknowledge at once (after waiting for SIFS) if the packet was received
correctly (CRC)
automatic retransmission of data packets in case of transmission errors
Duplicate frames (lost ACK) shall be filtered out within the destination MAC.
This is facilitated through a Sequence Control field (sequence number + fragment number) within
data and management frames.
The sequence number is generated by the transmitting STA as an incrementing sequence
of integers.
S
o
u
r
c
e
:

J
o
c
h
e
n

S
c
h
i
l
l
e
r
:

M
o
b
i
l
e

C
o
m
m
u
n
i
c
a
t
i
o
n
s

,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

2
0
0
3
194
HPN Fundamentals
Comparison Ethernet - WLAN
CS
MA
collisions
(CD vs. CA)
operation
without
collisions
sense medium before
sending
all stations share the
medium (cable)
collision detection (CD):
physically detect collision,
stop transmission,
retry after random backoff
full-duplex Ethernet
sense medium before
sending
all stations share the medium
(radio frequency)
collision avoidance (CA):
when medium getting free,
wait for DIFS + random
contention period
collision is detected by
ACKnowledgement mechanism
PCF Point Coordination Function
Ethernet WLAN Wireless Ethernet
Copyright 2011/2012 Computer Science 4, University of Bonn
195
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
6. Physical Layer in a Nutshell
Questions concerning the physical representation of signals belong to the
layer 1 of the OSI model.
In-depth knowledge of signal theory (cf. electrical engineering) is needed for a
broad discussion of these questions.
We only present the fundamental ideas here.
6.2. A Simplified Data Communications Model
6.1. The Physial Layer
6.3. Attenuation and Distortion
6.4. Wireless Signals
6.5. Multiple Access Schemes
196
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
6.1. The Physical Layer
The protocols of the physical layer specify:
- the physical representation of "0" and "1",
- the duration of a bit (i.e. the data rate),
- the direction of the transmission on the "channel",
a) simplex,
channel is only usable in one direction
b) half-duplex,
switching between sending and receiving
c) full-duplex (=duplex)
parallel transmission in both directions
- whether the transmission of bits is serial or parallel,
- whether the transmission is synchronous (in fixed time steps) or asynchronous,
- whether the channel is used exclusively or as a multiplex channel.
197
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Classification of Signals
0
t
s (t)
a
continuous values,
discrete in time
0
t
s (t)
q
discrete values,
continuous in time
0
t
s(t)
continuous values, continuous in time
(analog)
0
t
discrete values and
discrete in time (digital)
quantization sampling
quantization sampling
198
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
6.2. A Simplified Data Communications Model
S
o
u
r
c
e
:
W
.

S
t
a
l
l
i
n
g
s
,

D
a
t
a

a
n
d

C
o
m
p
u
t
e
r

C
o
m
m
u
n
i
c
a
t
i
o
n
s

,
P
r
e
n
t
i
c
e

H
a
l
l
,

2
0
0
0
Data are sent by generating a signal (a physical phenomenon representing 0s and 1s) and
transmitting this signal over a medium.
This transmitted/received signal is a function of time.
However, it can also be expressed as a function of frequency:
Time Domain View:
Study the signal intensity varying over time
The natural view.
Frequency Domain View:
Study the frequency components of the signal,
The often more important view.
199
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Periodic and Aperiodic Signals
In a periodic signal, the same signal pattern repeats over time.
Otherwise, the signal is aperiodic.
Mathematically, a signal is defined to be periodic if and only if:
s (t+T) = s (t) - < t < +
T: (constant) period of the signal
f = 1/T: frequency of the signal
The frequency is the rate (in cycles per second or Hertz [Hz]) at which the signal pattern
repeats.
The phase is a measure of the relative position in time within a single period of a
signal (as illustrated later).
200
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Periodic and Aperiodic Signals
What is a signal?
A periodic signal is a time-dependent variation of voltage usually described by a series of
sin- and cos-waves (the Fourier-representation of the signal).
A single sin- or cos-wave is described by its
frequency f=1/T
amplitude A
phase
y(t) [V]
t [s]
T = oscillation period
A = amplitude
Note: The wavelength / is proportional
to the frequency f with /=cf
= phase
201
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
6.3. Attenuation and Distortion
The signal changes on its way along the medium:
a) Attenuation The signal gets weaker.
b) Distortion The signal gets deformed.
From mathematics and the signal theory we know:
A periodic function (with period T) may be described as a sum of
weighted sine functions and
weighted cosine functions
More precisely:

- -
1 n
n n 0 p
t)] F n 2 ( sin b t) F n (2 cos [a a (t) s
F = 1/T is the fundamental frequency.
More about this: Fourier analysis ("harmonic analysis")
coefficient multiples of fundamental frequency
202
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Attenuation and Distortion of the signal
The signal changes during its trip on the medium:
a) Attenuation signal-power lowers (absorption)
b) Distortion signal is deformed
c) Noise unwanted components are added to the signal
Analogous channels
effects cause a decrease of the signal parameter
Digital channels
tampering of bits should be avoided
other effects are mainly irrelevant
The attenuation may be countered by using an amplifier.
Distortion may be countered by technical measures like equalization.
203
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Example: Attenuation and Distortion
Source:
Fred Halsall
"Data Communications,
Computer Networks and Open
Systems", Addison-Wesley,
4th Edition, 1996
The high frequency components
of a signal suffer more from
attenuation. The result is
Distortion (German: Verzerrung).
In addition, there are line noise
and delay distortion.
204
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Effects of the bandwidth on a Digital Signal
Source: W. Stallings, "Data and Computer Communications", Prentice Hall, 2000
Finally, we study the transmission of a
2,000 bit/s data signal over channels
with different bandwidths.
As a rule of thumb we learn:
However, unless noise is very severe, the
bit pattern may be recovered with less
bandwidth than this.
For a W bit/s digital signal a very good
representation may be achieved with a
2W Hz channel.
205
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Note: The successful reception of a signal does not only depend on the transmission
power, but also on environmental influences (signal fading) and on interference
from other sources, including background noise.
6.4. Wireless Signals
transmitter receiver
signal
For the communication with wireless transmissions, a signal must be strong
enough at the receiver to decode it.
distance s
power
carrier sense threshold
In (vacuum) free space, the signal strength at the receiver decreases quadratically
with the distance from the transmitter.
receive threshold
receiver can
decode the signal
receiver can
detect the signal
(but not decode)
206
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Interference
For a given receive threshold, correct reception of a signal depends on:
the signal strength of the actual carrier
the presence of concurrent signals (on the same frequency)
the amount of background noise.
The latter two factors sum up to the interference at the receiver.
Note: For a signal to be decoded successfully, the signal strength must exceed the receiver
threshold and the SINR must be high.
The signal-to-interference-and-noise-ratio (SINR), also known as the
carrier-to-interference-ratio, is defined as:
The signal-to-interference-and-noise-ratio (SINR), also known as the
carrier-to-interference-ratio, is defined as:
I I
i
- N
i

I
i
~ strength of interfering signals
N ~ background noise.
W
C
I
C ~ carrier signal strength
I ~ total interference
207
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Transmission Range - In Theory
distance
transmitter
communication
detection
interference
Communication range (also misleadingly known as transmission range)
Decoding of the signal possible with low error rate
communication possible
Detection range
detection of the signal possible
no communication possible
For given receive thresholds and transmission powers, we have under ideal
conditions:
Beyond this, the signal only adds to the
background noise at the receiver, possibly
interfering with other communication.
Note: In general, a signal can always be an interfering signal.
When several communication takes place in parallel, the given ranges depend on
the C/I at the receiver.
208
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Zur Anzeige wird der QuickTime
Dekompressor TIFF (Unkomprimiert)
bentigt.
Transmission Range - In Practice
strong signal weak signal
In reality, signal propagation is much more complex and influenced by
obstacles in between or in proximity of the sender and the receiver.
209
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Influences on the signal strength
shadowing
There are several factors on the transmission path between a transmitter and
a receiver that influence the signal strength at the receiver:
Shadowing
Shadowing occurs by obstacles which prohibit signals from
crossing (or more precisely: which attenuate the signal so strongly that it
cannot be decoded by the receiver)
Attenuation
Additional attenuation, apart from the vacuum path loss, is caused when the
signal crosses different materials, e.g. air, liquids, walls, ...
reflection
Reflection
Reflection occurs at large obstacles (compared to the wavelength /)
210
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
scattering
Scattering
Scattering occurs at small obstacles (compared to the wavelength /)
diffraction
Diffraction
Diffraction occurs at edges or holes and causes a change in the
propagation direction (technically a new wave is formed at the wave
front). By diffraction a signal may even be received in otherwise
shadowed areas.
Refraction
Refraction occurs when electromagnetic waves enter a medium
with a different refraction index (e.g. from air into water). Then,
part of the wave is reflected and the other part changes its
propagation path.
Influences on the signal strength (II)
There are several factors on the transmission path between a transmitter and
a receiver that influence the signal strength at the receiver:
refraction
211
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
6.5. Multiple Access Schemes
Required: controlled separation of the communication
Time Division Multiple Access (TDMA):
- all communication on the same frequency
- separation by allocating time slots for communication
Frequency Division Multiple Access (FDMA):
- all communication at the same time
- separation by allocating different frequencies for communication
Code Division Multiple Access (CDMA):
- all communication at the same time on the same frequency
- separation by allocating different communication codes
Space Division Multiple Access (SDMA):
- all communication at the same time on the same frequency
- separation by allowing separating the communication based on the
users location
Time Division Multiple Access (TDMA):
- all communication on the same frequency
- separation by allocating time slots for communication
Frequency Division Multiple Access (FDMA):
- all communication at the same time
- separation by allocating different frequencies for communication
Code Division Multiple Access (CDMA):
- all communication at the same time on the same frequency
- separation by allocating different communication codes
Space Division Multiple Access (SDMA):
- all communication at the same time on the same frequency
- separation by allowing separating the communication based on the
users location
Goal: parallel wireless communication of several devices in spatial proximity.
212
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
frequency
time
Time Division Multiple Access
Time Division Multiple Access (TDMA):
each channel is split up into time slots
time slots repeat periodically (also called TDMA frames)
each sender is assigned a fixed subset of slots per frame
Slot Slot
TDMA Frame
Properties:
different users transmit/receive in different time slots
requires exact synchronization of the devices
devices may be turned off during idle slots to save power
Challenge:
mobile devices are placed at different distances to each other (different round trip times)
mobile devices change their location (round trip times change)
a scheduling policy is required
213
HPN Fundamentals Copyright 2011/2012 Computer Science 4, University of Bonn
Frequency Division Multiple Access
Frequency Division Multiple Access (FDMA):
each channel is split up into narrower frequency bands, so-called sub-carriers
each frequency is used exclusively by one user
Note: Perfect separation of sub-carriers is impossible due to imperfect filters!
* Guard-Bands between neighbouring frequencies
this limits the max. achievable data rate of a channel
Typical usage: FDD (Frequency Division Duplex)
Base station and mobile use two different frequencies to achieve a full duplex
communication.
Typical usage: FDD (Frequency Division Duplex)
Base station and mobile use two different frequencies to achieve a full duplex
communication.
f
r
e
q
u
e
n
c
y

b
a
n
d
s
time
FDM cable
S
o
u
r
c
e
:

J
i
m

K
u
r
o
s
e
,

K
e
i
t
h

R
o
s
s
:

C
o
m
p
u
t
e
r

N
e
t
w
o
r
k
i
n
g
:

A

T
o
p

D
o
w
n

A
p
p
r
o
a
c
h

-
5
t
h

e
d
i
t
i
o
n
,

A
d
d
i
s
o
n
-
W
e
s
l
e
y
,

A
p
r
i
l

2
0
0
9
.

Vous aimerez peut-être aussi