CSC535 Communication Networks I Chapter 3a: Data Transmission Fundamentals Dr. Cheer-Sun Yang.
Data Communication Fundamentals
-
Upload
natasnji13 -
Category
Documents
-
view
160 -
download
6
description
Transcript of Data Communication Fundamentals
-
1
2010/02/15(C) Herbert Haas
Communication Basics
Principles and Dogmas
In this chapter we discuss basic communication issues, such as synchronization,
coding, scrambling, modulation, and so on.
-
2
Everything
should be made
as simple as possible,
...but not simpler.
Albert Einstein
-
3
3(C) Herbert Haas 2010/02/15
Information
What is information?Carried by symbols
Recognized by receiver (hopefully)
Interpretation is the key
What is information? This question may sound quite easy but think a bit about it.
Obviously we need symbols to represent information. But these symbols must
also be recognized as symbols by the receiver. In fact, philosphical considerations
conclude that information can only be defined through a receiver. The same
problem is with art. What is art? Several decades and centuries had their own
definitions. Today most critics use a general definition: art can only be defined in
context with the viewer.
In the following chapters throughout the whole data communication we will
deal with symbols representing information. A symbol is not a 0 or a 1. But this
binary information can be represented by symbols. Be patient...
-
4
4(C) Herbert Haas 2010/02/15
Symbols
Symbols (may) represent information
Voice patterns (Speech)
Sign language, Pictograms
Scripture
Voltage levels
Light pulses
Blue Whale Sonagrams
What is a good information source? From a theoretical point of view a random
pattern is the best because you'll never know what comes next. On the other hand,
if you receive a continous stream of the same symbol this would be boring. More
than boring: there is no information in it, because you can predict what comes
next! From this we conclude that a sophisticated coding representing the
information as efficient as possible using symbols is a critical step during the
communication process.
Throughout these chapters we will mainly deal with symbols such as voltage
levels or light pulses.
Look at the Blue Whale Sonograms. The x-axis represents time, the y-axis
frequency and the color represents power density. This communication pattern is
very complex (those of dolphins is even more complex). It is known that each
herd has their own traditional hymn. And: they like to communicate!
-
5
5(C) Herbert Haas 2010/02/15
Symbols on Wire
Discrete voltage levels = "Digital"
Resistant against noise
How many levels?
Binary (easiest)
M-ary: More information per time unit!
Binary M-ary
(here 4 levels, e. g. ISDN)
What symbols do we encounter on wire? Digital binary symbols are commonly
known and widely in use. Why? Consider information transmissions in groups of
symbols (for example the group of 8 binary symbols is called a byte). We have
two parameters: the number base B and the group order C. If you calculate the
"costs" that you get for arbitrary variations of B and C, and if we assume a linear
progress (so that cost =kBC) then for any given (constant) cost the perfect base
would be B=e, that is B=2.7182...
In other words: the perfect base is a number between 2 and 3. The technical
easiest solution is to use B=2. Note that these considerations assume a linear cost
progression.
In many cases we pay the price of higher efforts and use a larger base. This leads
us to m-ary symbols and later to PAM and QAM.
-
6
6(C) Herbert Haas 2010/02/15
Synchronization
Sender sends symbol after symbol...
When should receiver pick the signal samples? => Receiver must sync with sender's clock !
?00001
00001100110
000100111111
001010010111
Sampling instances Interpretation:
(only this one is correct)
One of the most important issues among communication is that of
synchronization. Nature forbids absolute synchronization of clocks. Suppose you
are a receiver and you see alternating voltage levels on your receiving interface. If
you had no idea about the sending clock then you would never be able to
interprete the symbols correctly. When do you make a sample?
-
7
7(C) Herbert Haas 2010/02/15
Synchronization
In reality, two independent clocks are NEVER precisely synchronous We always have a frequency shift
But we must also care for phase shifts
?
001010011110
????????????
001010011011
Phase shift
(worst case)Different
clock
frequencies
So we must assume that the receivers clock is approximately identical to the
senders clock. At least we must deal with small phase and frequency gaps. As you
can see in the slide above, we still cannot be sure when to make samples.
What we need is some kind of synchronization method.
-
8
8(C) Herbert Haas 2010/02/15
Serial vs Parallel
Parallel transmission Multiple data wires (fast)
Explicit clocking wire
Simple Synchronization but not cost-effective
Only useful for small distances
Serial transmission Only one wire (-pair)
No clocking wire
Most important for data communication
In case of parallel transmissions there is always a dedicated clock line. This is a
very comfortable synchronization method. A symbol pattern on the data lines
should be sampled by the receiver each time a clock pulse is observed on the
clock line. But unfortunately, parallel transmissions are too costly on long links.
In LAN and WAN data communication there are practically no parallel lines.
The most important transmission technique is the serial. Data is transmitted over
a single fiber or wire-pair (or electromagentic wave). There is no clock line. How
do we synchronize sender and receiver?
-
9
9(C) Herbert Haas 2010/02/15
Asynchronous Transmission
Independent clocks Oversampling: Much faster than bitrate
Only phase is synchronized Using Start-bits and Stop-bits
Variable intervals between characters
Synchronity only during transmission
Inefficient
Character Character Character
Stop-Bits
Start-
Edge
Start-Bit
Variable
One synchronization method is the Asynchronous Transmission. Actually this
method cannot provide real synchronization (hence the name) but at least a short-
time quasi-synchronization is possible. The idea is to frame data symbols using
start and stop symbols (lets sloppy call them start- and stop bits). Using
oversampling, the receiver is able to get a sample approximately in the middle of
each bit but only for short bit-sequences.
Asynchronous transmission is typically found in older character-oriented
technologies.
Example application: RS-232C
Relative overhead: 3/11
-
10
10(C) Herbert Haas 2010/02/15
Synchronous Transmission
Synchronized clocks Most important today!
Phase and Frequency synchronized
Receiver uses a Phased Locked Loop (PLL) control circuit Requires frequent signal changes
=> Coding or Scrambling of data necessary to avoid long sequences without signal changes
Continous data stream possible Large frames possible (theoretically endless)
Receiver remains synchronized
Typically each frame starts with a short "training sequence" aka "preamble" (e. g. 64 bits)
The most important method is the Synchronous Transmission. Don't confuse this
with synchronous multiplexingwe are still on the physical layer! Two things are
necessary: a control circuit called Phased-Locked-Loop (PLL) and a signal that
consists of frequent transitions. How do we ensure frequent transitions in our data
stream? Two possibilities: coding and scrambling our data.
Synchronous Transmission is found in most modern bit-oriented technologies
nearly anything you know.
-
11
11(C) Herbert Haas 2010/02/15
Line Coding
1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0NRZ
RZ
Manchester
DifferentialManchester
NRZI
AMI
HDB3
Code Violation
The trivial code is Non Return to Zero (NRZ) which is usually the human naive
approach.
Remarks:
RZ codes might also use a negative level for logical zeroes, a positive level for
logical ones and a zero Volt level inbetween to return to. RZ is for example used
in optical transmissions (simple modulation).
NRZI codes either modulate for logical ones or zeros. In this slide we modulate
the zeroes, that is each logical zero requires a transition at the beginning of the
interval.
NRZI means Non-return to zero inverted or interchanged.
B8ZS: same as bipolar AMI, except that any string of eight zeros is replaced by a
string of two code violations.
Manchester is used with 10 Mbit Ethernet. Token Ring utilizes Differential
Manchester. Telco backbones (PDH technology) use AMI (USA) or HDB3
(Europe). Of course there are many many other coding styles.
-
12
12(C) Herbert Haas 2010/02/15
Power Spectrum Density
0.5 1.51.0 2.0
1.0
0.5
NRZ,
NRZI
HDB3
AMI
Manchester,
Differential Manchester
Normalized
Frequency (f/R)
Spectral
Density
The slide above compares the power density distribution of some codes
mentioned before. Obvously the code must match the spectral characteristics of
the transmission channel.
Note that these codes are still kinds of baseband transmissions. Each one can be
modulated using a carrier signal at higher frequency to comply to a specific
channel characteristic.
-
13
13(C) Herbert Haas 2010/02/15
Scrambling Example
TS
TS
TS
TS
TS
TS
TS
TS
TS
TS
TS
TS
TS
TSChannel
Example:
Feedback Polynomial = 1+x4+x7
Period length = 127 bit
t(n-4) t(n-4)
t(n-7) t(n-7)
s(n) t(n) t(n) s(n)
Another method to guarantee frequent transitions is scrambling. Scramblers are
used with ATM, SONET/SDH for example.
The feedback polynomial above can be written as
t(n) = s(n) XOR t(n-4) XOR t(n-7)
The descrambler recalculates the original pattern with the same function (change
s(n) with t(n))
Period length = 2^R 1 , where R is the number of shift registers
That is, even a single 1 on the input (and all registers set to 0) will produce a 127-
bit sequence of pseudo random pattern.
This scrambler is used with 802.11b (Wireless LAN).
-
14
14(C) Herbert Haas 2010/02/15
Transmission System Overview
Information
Source
Source
Coding
Channel
Coding
Line
Coding
Modulation
Information
Interpretor
Source
Decoding
Error
Detection
Descramber
Equalizer
FilterDemodulator
10110001...
Filter unnecessary bits
(Compression)
FCS and FEC (Checksum)
Bandlimited pulses
NRZ, RZ, HDB3, AMI, ...
Signal
NoiseNoise AN
AL
OG
UE
DIG
ITA
L
Coding is not coding. The above slide gives you an overview about different
coding purposes. Even modulation is sometimes called coding.
Source coding tries to eliminate redundancy within the information. Source
coders must know well about the type of information that is delivered by the
source.
Channel coding protects the non-redundant data stream by adding calculated
overhead. Typically a Frame Check Sequence (FCS) is added. Only on very
errourness and/or long-delay links a Forward Error Correction (FEC) method
might be useful. FEC requires too much overhead in most terrestial applications.
Line coding focuses on the line, that is we want the symbols to be received
correctly, even if noise and distortions are present. Furthermore line coding
provides clock synchronization as discussed earlier.
Finally modulation might be necessary in case the channel has better properties at
higher frequencies.
-
15
15(C) Herbert Haas 2010/02/15
Communication Channels
Usually Low-Pass behavior Higher frequencies are more attenuated than
lower
Baseband transmission Signal without a dedicated carrier
Example: LAN technologies (Ethernet etc)
Carrierband transmission The baseband signal modulates a carrier to
match special channel properties
Medium can be shared for many users (different
carriers) e. g. WLAN
Each communication channel exhibits a low-pass behaviorat least beyond a
very high frequency. Not only is the signal attenuated; phase shifts occur and
even nonlinear effects sometimes rise with higher frequencies. The result is a
smeared signal with little energy.
In most cases the signals do not need to be modulated onto a carrier. That is, all
the channel bandwidth can be used up for this signal. We call this baseband
transmission.
Carrier and transmission put the baseband signal onto a carrier with higher
frequency. This is necessary with radio transmissions because low frequencies
have a very bad radiation characteristic. Another example is fiber optics, where
special signal frequencies are significantly more attenuated and scattered than
others.
-
16
16(C) Herbert Haas 2010/02/15
Channel utilization examples
Frequency
Power
Density Baseband
Transmission
Frequency
(kHz)
Power
Density
1 2 30.3 3.4
Telephone
Channel
Frequency
Power
Density
fc1 fc2 fc3
Multiple Carriers
The above slide shows some examples for baseband and carrierband
transmission. In case we use multiple carriers we may also call it broadband-
transmission.
The third picture (bottom of slide) shows the spectral characteristic of a telephony
channel (signal). The ITU-T defined an "attenuation-hose" in great detail
(dynamics, ripples, edge frequencies, etc). As a rule of thumb we can expect low
attenuation between 300 Hz and 3400 Hz.
-
17
17(C) Herbert Haas 2010/02/15
Maximal Signal-Rate
Maximal data rate proportional to channel-bandwidth B Raise time of Heavyside T=1/(2B)
So the maximum rate is R=2B, also called the Nyquist Rate
Note: We assume an ideal channel here without noise!
Bandwidth decreases with cable length As a dirty rule of thumb: BW Length @ const
But note that the reality is much more complex
Solitons are remarkable exceptions
0
1
(2B)-1
Maximum signal rate: At least
the amplitude must be reached
Since each channel is a low-pass, and some channels even damp (very) low
frequencies, data can only be transmitted within a certain channel bandwidth B.
If we put a 0 to 1 transition on the line (with ideally zero transition time), the
receiver will see a slope with a rise time of T=1/(2B).
So the maximal signal rate is T=1/(2B) in theory. In practice we need some
budget because there is noise and distortion and imperfect devices.
The longer the cable the more dramatically the low-pass behaviour. In other
words: on the same cable type we can transmit (let's say) 1,000,000,000 bits/s if
the cable is one meter in length, or only 1 bit/s if the cable is one million
kilometers in length.
It is very interesting to mention that some modern fiber optic transmission
methods violate this basic law. This methods base on so-called Soliton-
Transmission.
-
18
18(C) Herbert Haas 2010/02/15
The Maximum Information Rate
What about a real channel? What's the maximum achievable information rate in presence of noise?
Answer by C. E. Shannon in 1948 Even when noise is present, information can
be transmitted without errorswithout errors when the information rate is below the channel capacitychannel capacity
Channel capacity depends only on channel bandwidth AND SNR Example: AWGN-channel
C = B log (1 + S/N)
The great information theory guru Claude E. Shannon made a great discovery in
1948. Before 1948, it was commonly assumed, that there is no way to guarantee
an error-less transmission over a noisy channel. However, Shannon showes that
transmission without errors is possible when the information rate is below the so-
called channel capacity, which depends on bandwidth and signal-to-noise ratio.
This discovery is regarded as one of the most important achievements in
communication theory.
-
19
19(C) Herbert Haas 2010/02/15
Bitrate vs Baud
Information Rate: Bit/s
Symbol Rate: Baud
The goal is to send many (=as much as possible) bits per symbol
=> QAM (see next slides)
0 10 1 1 1 1 10 0 0 0 00 10 10 01 01 11
N bit/s 2N bit/s
N Baud N Baud
Baud is named after the 19th centurey French inventor Baudot, originally referred
to the speed a telegrapher could send Morse Code.
Today the symbol rate is measured in Baud whereas the information rate is
measured in bit/s.
-
20
20(C) Herbert Haas 2010/02/15
Analogue Modulation Overview
t
1 0 1
Amplitude Shift Keying (ASK)
t
1 0 1
Phase Shift Keying (PSK) Frequency Shift Keying (FSK)
t
1 0 1
)2cos()( ttt tfAtg jp +=
EVERY transmission is analogue but there are different methods to put a base-band signal onto a high-frequency carrier
The most simple (and oldest) is ASK The illustrated ASK method is simple "On-Off-Keying" (OOK)
FSK and PSK are called "angle-modulation" methods (nonlinear => spectrum shape is changed!)
For digital transmission, almost always QAM is used The BER of BPSK is 3 dB better than for simple OOK
These three parameters can be modulated
The slide shows a general modulation equation. The 3 parameters of the equation describe the 3 basic modulation
types. All 3 parameters, the amplitude At, the frequency ft and the phase t, can be varied, even simultaneously. In
nature, there is no real digital transmission; the binary data stream needs to be converted into an analog signal. As
first step, the digital data will be directly transformed into a analog signal (0 or 1), which is called a baseband
signal. In order to utilize transmission media such as free space (or cables and fibers) the base signal must be mixed
with a carrier signal. This analog modulation shifts the center frequency of the baseband signal to the carrier
frequency to optimize the transmission for a given attenuation/propagation characteristic.
Amplitude Shift Keying
A binary 1 or 0 is represented through different amplitudes of a sinus oscillation. Amplitude Shift Keying (ASK)
requires less bandwidth than FSK or PSK since natura non facit saltus. However ASK is interference prone. This
modulation type also used with infrared-based WLAN.
Frequency Shift Keying
Frequency Shift Keying (FSK) is often used for wireless communication. Different logical signals are represented
by different frequencies. This method needs more bandwidth but is more robust against interferences. To avoid
phase jumps, FSK uses advanced frequency modulators (Continuous Phase Modulation, CPM).
Phase Shift Keying
The 3rd basic modulation method is the Phase Shift Keying (PSK). The digital signal is coding through phase
skipping. In the picture above you see the simplest variation of PSK, using phase jumps of 180. In practice, to
reduce BW, phase jumps must be minimized, and therefore PSK is implemented using advanced phase modulators
(e. g. Gaussian Minimum Shift Keying, etc). The receiver must use same frequency and must be perfectly
synchronized with the sender using a Phase Locked Loop (PLL) circuit. PSK is more robust as FSK against
interferences, but needs complex devices.
After understanding these modulation methods QAM shall be introduced, which is the most important modulation
scheme today for both wired and wireless transmission lines.
-
21(C) Herbert Haas 2010/02/15
QAM: Idea
"Quadrature Amplitude Modulation"
Idea:
1. Separate bits in groups of words (e. g. of 6
bits in case of QAM-64)
2. Assign a dedicated pair of Amplitude and
phase to each word (A,)
3. Create the complex amplitude Aej
4. Create the signal Re{Aej ejt}
= A (cos cos t - sin sin t ) which
represents one (of the 64) QAM symbols
5. Receiver can reconstruct (A,)
-
22
22(C) Herbert Haas 2010/02/15
QAM: Symbol Diagrams
Q
I
10 11
00 01
Standard
PSK
Quadrature
PSK (QPSK)
Q
I1 0
Q
I
16-QAM
Re{Ui}
Im{Ui}
1V 3V 5V
Other example:
Modem V.29
2400 Baud
Max. 9600 Bit/s
For noisy and
distorted channels
4800 bit/s
For better channels
7200 bit/s
For even better
channels
9600 bit/s
Worth to know: Simple Phase Shift Keying (PSK) which only uses two symbols,
each representing either 0 and 1. Quadrature Phase Shift Keying (QPSK) with
four symbols.
Usually the assignment of bit-words to symbols is such that the error probability
due to noise is minimized. For example the Gray-Code may be used between
adjacent symbols to minimize the number of wrong bits when an adjacent symbol
is detected by the receiver.
The above slide also shows the symbol distribution over the complex plane for
the V.29 protocol which is/was used by modems. Depending on the noise-power
of the channel, different sets of symbols are used.
14,400 bit/s requires 64 points
28,800 bit/s requires 128 points
-
23
23(C) Herbert Haas 2010/02/15
Example QAM Applications
One symbol represents a bit pattern Given N symbols, each represent ld(N) bits
Modems, 1000BaseT (Gigabit Ethernet),
WiMAX, GSM,
WLAN 802.11a and 802.11g: BPSK @ 6 and 9 Mbps
QPSK @ 12 and 18 Mbps
16-QAM @ 24 and 36 Mbps
64-QAM @ 48 and 54 Mbps
It is important to understand that spread spectrum (or OFDM) techniques are always combined
with a symbol modulation scheme. Quadrature Amplitude Modulation (QAM) is a general method
where practical methods such as BPSK, QPSK, etc are derived from.
The main idea of QAM is to combine phase and amplitude shift keying. Since orthogonal
functions (sine and cosine) are used as carriers, they can be modulated separately, combined into a
single signal, and (due to the orthogonality property) de-combined by the receiver.
And since A*cos(wt + phi) = A/2{cos(wt)cos(phi) sin(wt)sin(phi)} QAM can be easily
represented in the complex domain as Real{ A*exp(i*phi)*exp(i*wt)}.
The standard PSK method only use phase jumps of 0 or 180 to describe a binary 0 or 1. In the
right picture above you see a enhanced PSK method, the Quadrature PSK (QPSK) method. While
using Quadrature PSK each condition (phase shift) represent 2 bits instead of 1. Now it is
possible to transfer the same datarate by halved bandwidth.
The QSK signal uses (relative to reference signal)
- 45 for a data value of 11
- 135 for a data value of 10
- 225 for a data value of 00
- 315 for a data value of 01
To reconstruct the original data stream the receiver need to compare the incoming signal with the
reference signal. The synchronization is very important.
Why not coding more bits per phase jump ?
Especial in the mobile communication there are to much interferences and noise to encode right.
As more bits you use per phase jump, the signal gets more closer. It is getting impossible to
reconstruct the original data stream. In the wireless communication the QPSK method has proven
as a robust and efficient technique.
-
24
24(C) Herbert Haas 2010/02/15
QAM Example Symbols (1)
Note that the above QAM signals show different successive QAM-symbols for
illustration purposes. In reality each symbol is transmitted many
hundred/thousand times
-
25
25(C) Herbert Haas 2010/02/15
QAM Example Symbols (2)
Note that the above QAM signals show different successive QAM-symbols for
illustration purposes. In reality each symbol is transmitted many
hundred/thousand times
These diagrams have been generated using Octave, a free Matlab clone.
-
26
The biggest problem
with communication
is the illusion
that it has occured.
Married?
-
1
2009/08/12(C) Herbert Haas
Network Layers
Standardization Cruelty
This chapter introduces the layer concept widely used in data communication.
Most famous is the ISO-OSI 7-layer model, which is also discussed in great
detail here. By the way the interaction of layering and standardization is
explained.
-
2
The good thing
about standards is
that there are so
many to choose from
Andrew S. Tanenbaum
-
3
3(C) Herbert Haas 2009/08/12
Standards
We need networking standards Ensure interoperability
Large market, lower cost (mass production)
Vendors need standards Good for marketing
Vendors create standards Bad for competitors, hard to catch up
But: Slow standardization processes freeze technology...
We need standards. Unfortunately. Otherwise, each vendor would create what
he wants and we would not be able to communicate accross networks. This
situation occured very often in history. For example the United Nations
initiated a world-wide Telephony standardization board, known as CCITT
(today ITU-T). Or in the pre-Ethernet age, many vendors built completely
incompatible LAN protocols.
Especially to force interoperability, many vendors for Internet-equipment
initiated the TCP/IP Interoperability Conference in 1987, today known as
"INTEROP".
-
4
4(C) Herbert Haas 2009/08/12
Who Defines Standards?
ISO Anything
IETF Internet
ITU-T Telco Technologies
ATM Forum
Frame Relay Forum
IEEE LAN Protocols
The above slide mentions the most important standardization organizations.
The Internet Engineering Task Force (IETF) is "actually" the most important
technical organization for the Internet working groups and is organized in
several areas. Area manager and IETF chairman form the IESG (Internet
Engineering Steering Group). The IETF is also responsible to maintain the
RFCs.
-
5
5(C) Herbert Haas 2009/08/12
Standards Types
De facto standards
Anyone can create them
E.g. Internet RFCs
De jure standards
Created by a standardization
organization
E.g. ISO/OSI, ITU-T
Not all standards are like the others. De facto standards are more flexible and
speed-up the implementation. Usually everybody is allowed to extend them.
The whole Internet is built on such loosely standards. Unfortunately
misinterpretations can occur. (RFCs)
De jure standards are like acts of law. For example ITU-T standards explain
nearly every detail implementers may ask.
-
6
6(C) Herbert Haas 2009/08/12
Note
Standardization is applied
to network layersnetwork layers
and interfaces interfaces
between them
The above sentence leads us to network layers. Break big problems into smaller
ones and write standards for them ("divide and conquer"). Of course the
interfaces between the layers must be standardized too. Eventually, multiple
developers can work on different parts of the whole story.
-
7
7(C) Herbert Haas 2009/08/12
Network Layers
Divide task of communication in multiple sub-tasks
Hierarchically organized Each layer receives services from the
layer below
Each layer serves for the layer above
Good for interoperability Capsulated Entities and Interfaces
But increases complexity
Network layers are an abstraction to hide complexity. Layers are organized
hierarchically, that is there is a predefined command direction. Imagine what
would happen if we have a democratic model?
Note that network layers force a more complex development. Many high-
performant communication technologies have been developed in an ad-hoc act,
or alternatively consists of only a few layers.
-
8
8(C) Herbert Haas 2009/08/12
Where to Define Layers
Group functions (services) together
When changes in technology occur
To expose services
To allow changes in protocol and HW
To utilize existing protocols and HW
A good layering structure requires a intelligent grouping of functions. Ideally,
technology improvements can be implemented immediately.
For example the X.25 packetizing algorithm, which is written in software and
part of a network driver of the operating system can remain untouched, while
the serial line hardware can be updated, and vice versa.
-
9
9(C) Herbert Haas 2009/08/12
The ISO/OSI Model
International Standards Organization (ISO)
International agency for the development of
standards in many areas
Founded 1946
Currently 89 member countries
More than 5000 standards until today
1988 US Government OSI Profile (GOSIP) Requires Government products to support OSI
layering
The ISO standardized anythingcharacter sets, paper sizes, screws, ..., and
network layers. In 1988 the US Government required any communication
device to comply with the ISO/OSI model (GOSIP). Note that the non-OSI
Internet was built much earlier, so many people expected the end of the
Internet. But the Internet (which was created as nuclear-bomb resistant) not
only survived the ISO/OSI model but also displaced many OSI-compliant
protocols, such as CLNP.
Similarly, in Europe the "European Procedurement Handbook for Open
Systems" (EPHOS) had been released.
-
10
10(C) Herbert Haas 2009/08/12
Purpose
OSI model describes communication
services and protocols
No assumption about
Operating system
Programming Language
Practically, the OSI model
Organizes knowledge
Provides a common discussion base
Although every book of data communication mentions the ISO/OSI 7-layer
model it is not that important in the real world: most technologies do not
comply to this model. It is merely a reference model so that we can refer to it
when we want to explain certain functions in our protocols. From this point of
view the OSI model is indeed important today.
-
11
11(C) Herbert Haas 2009/08/12
OSI Basics
Point-to-Point, no shared media
Nodes are called End Systems (ES)
Intermediate Systems (IS)
Each layer of the OSI model detects and handles errors (FCS)
Dumb hosts and intelligent network Compared with Internet: dumb network,
intelligent hosts
The original OSI modes was created for point-to-point connections only (for
example there was no specification for LAN-like shared media originally).
-
12
12(C) Herbert Haas 2009/08/12
The OSI Truth
OSI model was created before
protocols
Good: Not biased, general approach
Bad: Designers had little experience, no
ideas in which layers to put which
functionality...
Not widespread (complex,
expensive)
But serves as good teaching aid !!!
Although the OSI Model was created before the protocols, and so the complete
model is very complex and not practically elaborated, its widely used today to
define and category most of the important protocols. OSI is not biased because
this reference framework is not associated with any particular vendor
philosophy. OSI represents a general approach for describing data
communication procedures but this property is often considered as a big
disadvantage, because practical implementations typically can be described
with a much simpler model and on the other hand the OSI architects had only
little experience with real life implementations. Therefore, genuine OSI
protocols are not really widespread today, because of its complexity.
Nevertheless, the OSI model serves as reference frame when discussing or
learning about protocols.
-
13
13(C) Herbert Haas 2009/08/12
The 7 OSI LayersThe 7 OSI Layers
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
System A System B
Sender Process Receiver Process
Because the communication between different systems can be a very complex
task, OSI splits the communication aspects into smaller tasks. All layering is
based on the OSI reference Model, which defines tasks and interactions of
seven layers.
The users data moves from the first layer (Application Layer) through all other
layers. When two systems communicate with each other, then only the different
layers talk. The application layer only talk with the application layer or the
network layer only communicate with the network layer of system B. We can
talk about a parallel communication between the layers. Every layer works for
its own, it is not interested what the other layer does.
-
14
14(C) Herbert Haas 2009/08/12
Physical Layer
Mechanical and electrical
specifications
Access to physical medium
Generates Bit stream
Line coding and clocking
Examples LAN: Ethernet-PHY, 802.3-PHY
WAN: X.21, I.400 (ISDN),
RS-232
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
The Physical Layer generates the bit stream. This layer provides access to the
physical medium by applying line coding (NRZ, Manchester, etc),
synchronization (clocking, PLL), but also includes mechanical specifications.
Layer 1 also can activate or deactivate the links between end systems (link
management).
The physical part of the Ethernet NIC is called "PHY" and is perhaps the most
complex entity of Ethernet because the PHY consists of a number of sublayers
that care for interoperability with different Ethernet speeds (10, 100, 1000,
10000 Mbit/s) and codings (Manchester, 4B5B, 8B10B, ...). Note that there is
a fundamental difference between "Ethernet" and IEEE "802.3": these are two
separate LAN specifications but typically implemented on the same NICthey
just share the same topology and use the same media access strategymost
people are not aware of that.
The X.21 is a typical and widely available interface on a Cisco router. The
ISDN-layer 1 is specified in the ITU-T standard I.400 and describes both a 192
kbit/s synchronous multiplexing interface capable to transport 2 B channels and
one D channel and secondly a high speed 2.048 Mbit/s interface capable to
carry 30 B channels and one D channel. These ISDN specifics are presented in
the N-ISDN chapter in more details. The old well-known Recommended
Standard (RS) 232 specifies the classical serial interface found on many PCs
and other peripheral devices.
-
15
15(C) Herbert Haas 2009/08/12
Link Layer
Reliable transmission of frames between two NICs
Framing
FCS
Physical Addressing of NICs
Optional error recovery
Optional flow control
Examples: LAN: 802.2
PPP, LAPD, LAPB, HDLC
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
The data link layer builds the frame. In that way, framing or frame
synchronization is the most important thing on layer 2. Where is the beginning
of the frame ? Where is the end ? With a special Bit-Code the layer 2 protocols,
such as HDLC or PPP, guarantee the framing of the data. Thats important for
the MTU (maximum transfer unit).
Also frame checking, correction of transmission errors on a physical link, is
implemented on layer 2. There are also a physical address of the network
interface cards. This address is transported with the data link layer too (e.g.
MAC-Address with Ethernet).
Error recovery and flow control may be realized in connection-oriented mode.
-
16
16(C) Herbert Haas 2009/08/12
Network Layer
Transports packets between networks
Provides structured addresses to name networks
Fragmentation and reassembling
Examples: CLNP
IP, IPX
Q.931, X.25
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
The network layer builds the so-called "packet". Layer 3 transports the packets
between the different networks. Therefore layer 3 needs structured and routable
addresses to find the right networks. IP is the most important Layer 3 protocol
today (IPv4 has a structured 4 byte address). The OSI Connectionless Network
Protocol (CLNP) is another example for a layer-3 protocol but it is not so
widely used today, except some Telcos and Carriers use it for internal
purposes. IPX has been developed by Novell in order to extend Novell
networks over different data-link layer worlds. Q.931 is the ISDN layer 3
carried over the D-channel and is used for signaling purposes. Basically Q.931
conveys the telephone numbers and other service parameters. The classical
packet-switched WAN standard X.25 actually specifies only the layer 3 of this
technology and is used to set up a number of virtual calls over an asynchronous
link layer (LAPB).
-
17
17(C) Herbert Haas 2009/08/12
Transport Layer
Reliable transport of segments between applications
Application multiplexing through T-SAPs
Sequence numbers and Flow control
Optional QoS Capabilities
Examples: TCP (UDP)
ISO 8073 Transport Protocol
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
The transport layer is necessary to build a logical connection to the application
in order to send data in so-called "segments". With the help of port numbers
(by TCP and UDP), a layer 4 protocol guarantees the transport of the segments
to the right application. These port numbers are called T-SAPs in the OSI
world. The transport layer optionally takes care about flow control, reliable
transmission between end systems, and is most important for QoS capabilities.
Flow control requires connection oriented mode.
-
18
18(C) Herbert Haas 2009/08/12
Session Layer
Provides a user-oriented
connection service
Synchronization Points
Little capabilities, usually
not implemented or part of
application layer
Telnet: GA and SYNCH
FTP: re-get allows to continue
an interrupted download
ISO 8327 Session Protocol
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
The Session Layer coordinates and controls dialogue between different end
systems. This layer is only seldom or sparsely implemented. For example a
Telnet server gives the sending permission to the Telnet client via a Go Ahead
(GA) sequence. Using the BRK-Key, a SYNCH sequence is triggered and the
server must synchronize with the client by flushing the buffered stream. FTP
keeps track of the data blocks transmitted and is able to continue an interrupted
session from this checkpoint on.
Session protocols are important with telephony applications such as H.323
which employs H.225 to establish sessions. Another example is the IETF
Session Initiation Protocol (SIP). The ISO 8327 is an OSI basic connection
oriented session protocol specification.
-
19
19(C) Herbert Haas 2009/08/12
Presentation Layer
Specifies the data
representation format for the
application
Examples:
MIME (part of L7) and
UUENCODING (part of L7)
ISO: ASN.1 and BER
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
The layer 6 is responsible for common language between end systems. The
presentation layer specifies the "meaning" of the data and how each byte
should be interpreted.
In the Internet the presentation layer uses ASCII coding and the meaning of the
data is specified by a so-called "Multipurpose Internet Mail Extension"
(MIME) header. MIME is used by SMTP (Email) and HTTP (Web browsing)
for example. UUENCODING is one example of how to transform 8-bit-bytes
into 7-bit-bytes and it is typically used with Internet Mail attachments. The
ISO/OSI world generally uses the "Abstract Syntax Notation Language
Number One" (ASN.1) as common presentation layer. This language is used to
specify data structures and contents. On the wire the data is transmitted using
the "Basic Encoding Rules" (BER).
-
20
20(C) Herbert Haas 2009/08/12
Application Layer
Provides network-access for
applications
Examples: ISO 8571 FTAM File Transfer
Access + Management,
X.400 Electronic Mail, CMIP
SMTP, FTP, SNMP, HTTP,
Telnet, DNS,
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Session Layer
Presentation Layer
The Application layer supports user with common network applications. For
example: file transfer or virtual terminals. Layer 7 also supports basic network
procedures in order to implement distributed applications (e.g. transaction
systems). Note that the application layer is not identical with the application!
The application itself "sits" upon the application layer and uses the service
primitives provided by the application layer to access the network.
Application layer protocols either use "inline" or "inband" control sequences
(as it is used with Telnet), where control bytes are mixed with the data stream,
or it might use a predefined frame structure, consisting of header and body.
Another method is to open a dedicated logical control connection only to
exchange control information (as it is used with FTP).
-
21
21(C) Herbert Haas 2009/08/12
Encapsulation Principle
L7
L4
L3
L2
L1
L5
L6
DATA
DATA
A-PDU
P-PDU
S-PDU
T-PDU
N-PDU
7
4
3
2
1
5
6
DATA
101000111010010110100101001010000100101010001010101010101010010110001001010101010100101111100000101010
L-PDU or "Frame"
N-PDU or "Packet"
T-PDU or "Segment"
S-PDU
P-PDU
A-PDU
The data moves through all 7 layers. Every layer add his own header. The data
with layer 4,5,6 and 7 header is called segment. A segment plus layer 3
header is called packet. The so called frame (data plus six headers) will be
transport over layer 1 to the destination system. Then the frame will moves
through all 7 layers again, and in each station a header will be removed.
-
22
22(C) Herbert Haas 2009/08/12
Practical Encapsulation
Ethernet Frame
IP Packet
TCPSegment
HTTPMessage
HTMLWebpage
The idea of encapsulation is fundamental in the data communication world.
Adjacent layers encapsulate or decapsulate information by adding/removing
additional "overheads" or "headers" in order to implement layer-specific
functionalities. The whole process can be regarded as Matroschka-puppet
principle.
In our example let's suppose a webserver sends a webpage (HTML code) to a
client. The webpage is carried via the Hyper Text Transfer Protocol (HTTP)
which provides for error and status messages, encoding styles and other things.
The HTTP header and body is carried via TCP segments, which are sent via IP
packets. On some links in-between, the IP packets might be carried inside
Ethernet frames.
-
23
23(C) Herbert Haas 2009/08/12
Internet Encapsulation
HTTPHeader
HTTP-Data
HTML-Content
(Webpage)
TCPHeader
TCP-Data
IPHeader
IP-Data
Will reach the next
Ethernet DTE Eth
HeaderEthernet-DataEth
Trailer
Will reach the target host
Will reach the target application
This is what the application wants
This is what the user wants
In our example let's suppose a webserver sends a webpage (HTML code) to a
client. The webpage is carried via the Hyper Text Transfer Protocol (HTTP)
which provides for error and status messages, encoding styles and other things.
The HTTP header and body is carried via TCP segments, which are sent via IP
packets. On some links in-between, the IP packets might be carried inside
Ethernet frames.
-
24
24(C) Herbert Haas 2009/08/12
OSI Speak (1)
Entities Anything capable of sending or
receiving information
System Physically distinct object which
contains one or more entities
Protocol Set of rules governing the exchange of
data between two entities
Entities:
Any hardware or software module that acts upon a single layer is called an
"entity". Several entities exist peer to peer within a given layer and are capable
to communicate which each other. This type of communication is referred as
"horizontal" communication -- this is actually what we mean when we talk
about a "protocol".
System:
Several entities make up a "system". For example a PC is a "system" because
it consists of the entities Ethernet PHY entity, MAC entity, LLC entitiy, IP
entity, TCP entity, and several L7 entities. A system is merely a term that
reflects the physically separation of groups of entities.
Protocol:
We already described the meaning of protocol above together with the
definition of a entity, but a protocol can be explained more simple: A protocol
is a set of rules that are necessary to exchange data in an ordered and
unmistakable way.
-
25
25(C) Herbert Haas 2009/08/12
OSI Speak (2)
Layer
A set of entities
Interface
Boundary between two layers
Service Access Point (SAP)
Virtual port where services are passed
through
Layer:
A "layer" in the OSI jargon is a set of entities--but do not confuse layers with systems! The
entities of a layer reside on the same hierarchy level and a single layer comprises several
systems. On the other hand a system comprises several layers but typically only one (or a
limited number) of entities are available on each layer of a system. For example: In order to
communicate in the Internet, all devices must support layer 3 (the IP layer). That is, each
system must provide at least one IP-entity.
Interface:
An "interface" is simply the logical boundary between two layers. Note that interfaces are
typically not physically visible because they represent the boundary between two layers at a
whole. The local representation of an interface is called a "Service Access Point" or SAP. The
Service Access Point is one of the most frequently used terms in data communication and
simply reflects the piece of hardware or software that acts as an interface between two layers.
The previously OSI-interface is meant globally, while the SAP has local meaning, i. e. at one
system. A SAP is a practical term, in some technologies such as IEEE 802.2 it is just a field in
the header indicating the destination and source layer. If you use an Ethernet NIC with an AUI
interface, than this electrical interface can be also considered a SAP because "service
primitives" are passed through this interface. Service Primitives are explained below...
Service Access Point:
An "Interface Data Unit" (IDU) is practically spoken the piece of data that is passed through a
SAP to the next layer's entity. It contains ICI and SDU which is described below. When an
IDU is passed through a SAP to the next layer, this layer extracts and processes the Interface
Control Information (ICI).
-
26
26(C) Herbert Haas 2009/08/12
OSI Speak (3)
Interface Data Unit (IDU)
Data unit for vertical communication
(between adjacent layers of same
system)
Protocol Data Unit (PDU)
Data unit for horizontal communication
(between same layers of peering
systems)
Interface Data Unit:
An "Interface Data Unit" (IDU) is practically spoken the piece of data that is
passed through a SAP to the next layer's entity. It contains ICI and SDU which
is described below. When an IDU is passed through a SAP to the next layer,
this layer extracts and processes the Interface Control Information (ICI).
Note that data is passed through a SAP using "service primitives". Service
primitives are functions that are implementation specific (for example an API)
and are used to pass data from one layer to another on the same system. These
service primitives actually pass on these IDUs.
Protocol Data Unit:
The SDU actually represents the payload plus headers for upper layers. The
SDU is transported horizontally with an header used at this layer. Both SDU
and Header is called a "Protocol Data Unit" (PDU). The PDU is the most
often used term of all these terms mentioned here. At least you should
remember the PDU.
-
27
27(C) Herbert Haas 2009/08/12
OSI Speak (4)
Interface Control Information (ICI)
Part of IDU
Destined for entity in target-layer
Service Data Unit (SDU)
Part of IDU
Destined for further communication
Contains actual data ;-)
-
28
28(C) Herbert Haas 2009/08/12
OSI Speak Summary (1)
(N) Layer
(N+1) Layer
(N-1) Layer
Interface
Interface
(N) Layer
Entity
(N+1) Layer
Entity
(N+1) Layer
Entity
(N-1) Layer
Entity
(N-1) Layer
Entity
"Protocol"
Service Access Point (SAP)
Service Primitives
Service Primitives
(N) Layer
Entity
The ISO/OSI model defines four service primitives: request, indication,
response and confirm.
Note that the service primitives are only used for vertical communication.
-
29
29(C) Herbert Haas 2009/08/12
OSI Speak Summary (2)
(N) Layer
(N+1) Layer
Interface
(N) Layer
Entity
(N+1) Layer
Entity
(N) Layer
Entity
ICI SDUIDU
ICI SDU
SDU NH
N-PDU
SAPVertical
Communication
Horizontal
Communication
-
30
30(C) Herbert Haas 2009/08/12
Layer 1 Devices
Adapts to different physical
interfaces
Amplifies and/or refreshes the
physical signal
No intelligence
Repeater, Hub,
NT1
Application
Transport
Network
Data Link
Physical
Session
Presentation
Application
Transport
Network
Data Link
Physical
Session
Presentation
Repeater
To connect different system with each other we need special devices. If you
want to connect two systems only per physical layer you need a so called hub
or repeater.
This kind of devices are not intelligence and only used to amplifies or refresh
the physical signal, or to connect systems with different physical interfaces.
-
31
31(C) Herbert Haas 2009/08/12
Layer 2 Devices
Filter/Forwards frames according Link Layer Address
Incorporates Layer 1-2
LAN-Bridge ("Switch")
Application
Transport
Network
Data Link
Physical
Session
Presentation
Application
Transport
Network
Data Link
Physical
Session
Presentation
Bridge
A so called bridge or switch is a device to connect systems per data link
layer. This kind of devices determine the physical layer and can forward
datagram's according the link layer address. For example: MAC address with
Ethernet. Note that a bridge utilizes two or more physical layer entities (NICs)
that is a bridge is able to convert encodings and signal-rates.
Note the difference between bridge and switch: A bridge is implemented in
software, whereas a switch is built in hardware. Today only switches are used,
because they are much faster.
-
32
32(C) Herbert Haas 2009/08/12
Layer 3 Devices
"Packet Switch" or "Intermediate System"
Forwards packets to other networksnetworks according structuredstructured address
Terminates Links
Router,WAN-Switch
Application
Transport
Network
Data Link
Physical
Session
Presentation
Application
Transport
Network
Data Link
Physical
Session
Presentation
Router
The most important device in the Internet is the so called router. A router
consists of several layer 1 and layer 2 entities and a single layer 3 entity, thus it
can forward packets to other networks according structured addresses
(remember IP-Addresses). By terminating layer 1 and 2 a router is able to
connect total different network technologies with each other. For example: on
one side there is Ethernet on the other side ATM.
-
33
33(C) Herbert Haas 2009/08/12
A Practical Example
Physical(Twisted Pair)
Physical(Serial Line)
Physical(Fiber Ring)
Link(Ethernet)
Link(HDLC)
Link(FDDI)
Network(IP)
Transport(TCP)
Netscape
Browser
Apache
Webserver
MAC
Address
MAC
Address
Simple or
dummy Address
IP A
ddre
ssIP
AddressP
ort
Num
ber
Port N
um
ber
What is my
destination application?
Where is my
destination network?
Just move this frame
to the next NIC
In the picture above you see a good example in which symbolic way the
different layers talk with each other. The link layer only searches for the right
NIC address. IP only wants to the destination network, and TCP is the protocol
to communicate between applications. Most importantly, notice that packets
are sent over different link layer technologies such as Ethernet, HDLC, or
FDDI. Exactly this is the reason why a common network layer is needed to
allow communication over different "networks" (=links).
Don't be confused about the different usages of the term "network". People say
"network" and mean "bunch of devices interconnected with each other". To be
more exact, a network is identified by a unique network identifier, such as the
network-ID of the IP-address. Since a contiguous link layer implementation
(such as an Ethernet LAN) can have assigned a single IP net-ID, each link can
be regarded as network.
-
34
34(C) Herbert Haas 2009/08/12
Padlipsky's Rule
If you know what
you're doing, three
layers is enough. If
you don't, even
seventeen won't help.
Until now we discussed the famous OSI seven layer reference model, but real
implementations typically consist of a subset of this 7-layer model. On the one
hand, not all OSI layers are necessary in real-world applications, on the other
hand, many important technologies had been created before the OSI standard.
-
35
35(C) Herbert Haas 2009/08/12
Stevens 4-Layer Model
Transport Layer
Network Layer
Data Link Layer
Process Layer
Transport Layer
Network Layer
Data Link Layer
Process Layer
Equivalent to the DoD Model (Internet)
The picture above shows the W. Stevens 4 layer model which is used also in
the Internet. The Internet layer model is also called "Department of Defense"
(DoD) model.
-
36
36(C) Herbert Haas 2009/08/12
Tanenbaum 5-Layer Model
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
Application Layer
Transport Layer
Network Layer
Data Link Layer
Physical Layer
The famous computer scientist Andrew S. Tanenbaum defined a more practical
approach utilizing five layers. Other than the DoD or Stevens 4-layer model
the physical specifications are defined in a separate layer.
-
37
37(C) Herbert Haas 2009/08/12
Summary
Network layers ensures
interoperability and eases
standardization
ISO/OSI 7 layer model is an
important reference model
Practical technologies employ a
different layer set, but it's always
possible to refer to OSI
-
The Internet perspective is implement it,
make it work well, then write it down.
The OSI perspective is to agree on it,
write it down, circulate it a lot and now
we'll see if anyone can implement it after
it's an international standard and every
vendor in the world is committed to it.
One of those processes is backwards,
and I don't think it takes a Lucasian
professor of physics at Oxford to figure
out which.
Marshall Rose, "The Pied Piper of OSI"
-
39
39(C) Herbert Haas 2009/08/12
Quiz
Explain layer-2 capabilities!
What could be the task of a layer-4
device ?
What is a "gateway"?
How does the (N) layer tell (N+1)
layer that it has data to hand over ?
Why have OSI protocols not been
successful on market ?
-
40(C) Herbert Haas 2009/08/12
Hints
Q1: Framing, Protection, Access,...
Q2: Layer 4 device might deal with QoS, sequencing and flow control
Q3: According to OSI a layer 1-7 device, according to IETF a router.
Q4: Using Service Primitives (Indicate)
Q5: OSI is too complex and general, several fields in headers might have variable length, sometimes ignores byte- and word-delineation, ...
-
1
2005/03/11(C) Herbert Haas
Protocol Principles
Framing, FCS and ARQ
-
2
2(C) Herbert Haas 2005/03/11
Link Layer Tasks
Framing
Frame Protection
Optional Addressing
Optional Error Recovery
Connection-oriented or
connectionless mode
Optional Flow Control
The Data-link layer of the OSI model is the first layer above the physical layer
that is used to perform logical tasks like:
Framing is the task of packing the information of higher layers to provide for
example start and end of packet detection plus some optional features
which will be discussed on the following slides
Frame protection is used to detect possible errors during data transmission
Addressing is optional and is normally only used in point-to-multipoint Data-
link technologies.
Error recovery can be used to allow packet retransmissions if data errors are
detected by the frame protection mechanism
The Data-link can be driven in connection oriented mode or connection-less
mode. Newer technologies mainly use the connection-less mode because the
connection-oriented functionality is typically provided by higher OSI layers
e.g. TCP on OSI layer 4.
Flow control can be used to prevent buffer overflow situations on the receiver
side
-
3
3(C) Herbert Haas 2005/03/11
Building a Frame
DATAControl FCS EDSDPreamble
Consists of
Data
Metadata (Header or "Overhead")
Requires synchronous physical
transmission (PLL)
Arbitrary frame lengths
A basic layer 2 transmission frame consists of following components:
Preamble - is used to provide synchronization between the sender and the
receiver transmission clock. This is necesarry to allow the detection of the
single bit borders.
SD - Start Delimiter is needed to detect the actual beginning of the layer 2
transmission frame. From this point on data is fed from the physical layer into
the receive buffer.
Control Field - provides optional addressing, connection establishment, error
recovery and flow control
Data - is the payload provided by higher OSI layers
FCS - Frame Check Sequence is used for error detection
ED - End Delimiter is used to determine the end of the layer 2 frame
-
4
4(C) Herbert Haas 2005/03/11
Preamble
DATAControl FCS EDSDPreamble
Enables PLL synchronization Typically a 0101010...-pattern
Example: 8 Byte preamble in Ethernet frames
Note: Only necessary when sender- and
receiver-clock are not synchronized
between frames
Asynchronous physical layer
The purpose of the Preamble is to lock the receiver clock towards the sender
clock by the help of Phase Locked Loop (PLL) circuits. The Preamble is
different depending on the type of Data-link technology that is used.
In Ethernet technology for example the bit pattern consists of 62 clock changes
between a logical 1 and a logical 0, followed by two logical 1s to indicate the
start of frame.
The Preamble is obviously only needed for synchronous physical layers. In the
case that an asynchronous physical layer is used, e.g. COM port on PC or async
serial interface on a router, the Preamble is not needed. Because sender and
receiver clocks don t need to be synchronized.
-
5
5(C) Herbert Haas 2005/03/11
Frame Synchronization
DATAControl FCS EDSDPreamble
Beginning and ending of a frame is
indicated by SD and ED symbols
bit-patterns or code-violations
lenght-field can replace ED (802.3)
Idle-line can replace ED (Ethernet)
Also called "Framing"
Starting
Delimiter
Ending
Delimiter
There are different methods available to indicate the start and the end of a data
frames. The simplest method is the use of a special bit pattern. In the HDLC
protocol and its derivates the bit pattern 01111110 is used to indicate start
and end of frame.
In Token Ring technology code violation is used. Code violation is an intended
brake in the rules of coding.
In Ethernet technology the SD is indicated by the bit pattern 11 following the
Preamble. But the end of the frame is indicated by an idle line, this means
silence on the wire for a specified period of time.
Optionally the ED can be omitted if an length field is present inside the Data-
link frame. In this case the end of frame can be calculated by counting the
number of bytes received.
-
6
6(C) Herbert Haas 2005/03/11
Protocol Transparence
What, if delimiter symbols occur
within frame ?
Solution:
Byte-Stuffing
Bit-Stuffing
DATAControl FCS EDSDPreamble ED SD
! !
In the case that a special bit pattern is used to indicate the start and end of a
frame, it is necessary to prevent this pattern inside the data portion of the
frame. Otherwise this would lead to frame misinterpretation.
There are two principle methods to achieve this goal either by modifying single
bits of the data stream (bit-stuffing) or by replacing the whole byte (byte-
stuffing).
-
7
7(C) Herbert Haas 2005/03/11
Byte Stuffing
Some character-oriented protocols divide data stream into frames Old technique, not so important today
Data Link Escape (DLE) character indicates special meaning of next character
A B C DLE DLE E F G ETX H I STX HSTX ETXDLE DLE
A B C DLE E F G ETX H I STX H
Data to send:
Typically, character-oriented protocols use asynchronous transmission (start-
stop bits), so the receiver gets a bunch of characters but has to find the frames
in it. In this case special control characters Start of Text (STX, 0x02) and End
of Text (ETX, 0x03) are used to indicate start/end of a transmission frame.
Obviously STX and ETX must not appear inside the date portion, so an
additional special control character Data Link Escape (DLE, 0x10) is used.
STX and ETX are only interpreted as control characters if the DLE pattern is
found in front of them. This means if STX or ETX bit pattern are found inside
the data stream, with the DLE pattern in front of them, they are interpreted as
data.
If the DLE pattern itself would appear inside the data portion it is doubled to
indicate that it is only data.
-
8
8(C) Herbert Haas 2005/03/11
Bit Stuffing
Used in bit-oriented protocols Used by most protocols Bits represent smallest transmission unit
HDLC-like framing: 01111110-pattern Rule:
Trasceiver-HW inserts a zero after five ones Receiver rejects each zero after five ones
010011111000111111100101100110
Data to send:
0100111110000111110110010110011001111110 01111110
In HDLC technology and its derivates bit stuffing is used to prevent the
appearing of the SD, ED pattern inside the data frame.
This means there is a common rule between sender and receiver that after every
fifths 1 an additional logical 0 will be inserted by the sender in the data
stream. The receiver itself removes all logical 0s following five logical 1s.
-
9
9(C) Herbert Haas 2005/03/11
Code Violations
Manchester
AMI
DifferentialManchester
Code violation is an intended hurt of the rules of coding. It can be used for
signaling purposes.
In Token Ring systems for example the differential manchester code is used.
Violations of the differential manchester code are used for the SD and ED
patterns to indicate the start and the end of frame.
The differential manchester code violation symbols are called J and K. The
code violation in the differential manchester code is achieved by omitting the
change from 1 to 0 or from 0 to 1 in the middle of a pulse.
-
10
10(C) Herbert Haas 2005/03/11
Frame Protection
A frame check sequence (FCS) protects the integrity of our frame From Sunspots, Mobile-Phones, Noise,
Heisenberg and others
FCS is calculated upon data bits Different methods based on mathematical
efforts: Parity, Checksum, CRC
Receiver compares its own calculation with FCS
DATAControl EDSDPreamble FCS
Protected
The Frame Check Sequence (FCS) allows the receiver to detect possible errors
in the data stream.
The FCS is calculated by the sender and is attached at the end of the frame. The
calculation of the FCS is typically performed in hardware.
There are many different technologies available to calculate an FCS like:
Parity bit calculation
XOR operation
Modulo operations
Cycle Redundancy Check (CRC)
Forward Error correction (FEC)
-
11
11(C) Herbert Haas 2005/03/11
FCS Methods
Parity Even (100111011) or odd (100111010)
parity bits
Examples: Asynchronous character-transmission and memory protection
Checksum Sum without carries (XOR operation)
Many variations and improvements
Examples: TCP and IP Checksums
The simplest method of FCS technologies is the parity bit calculation. This
method is typically used in asynchronous character based transmission systems.
One parity bit is computed for each single character. The first two least
significant bits are XORed together and the output of this operation is then
XORed with the next more significant bit, and so on. The output of the final
operation represents the required parity bit, which can be even (1) or odd (0).
Obviously the parity check can only protect against single bit errors. A two bit
failure for example in the opposite direction 1 to 0 and 0 to 1 cannot be
detected by the parity check.
For packet based transmission systems a similar method to calculate a
checksum can be used. Instead of a single bit, 16 or 32 bit long words are used
in combination with the XOR operation.
The XOR operation is also known as a modulo-2 adder, since the output of the
XOR operation between two binary digits is the same as the addition of the two
digits without a carry bit.
-
12
12(C) Herbert Haas 2005/03/11
Checksum Example: ISBN
100% Protection against Single incorrect digits
Permutation of two digits
Method: 10 digits, 9 data + 1 checksum
Each digit weighted with factors 1-9
Checksum = Sum modulo 11
If checksum=10 then use "X"
ISBN 0-13-086388-2
0*1+1*2+3*3+0*4+8*5+6*6+3*7+8*8+8*9 = 244
244 modulo 11 = 2
ISBN stands for International Standard for Book Numbering.
The ISBN code which you may use to order your favourite books is protected
by an checksum as well. This checksum is built on the basis of an modulo 11
operation.
The ISBN code itself consists of 10 digits where the first nine digits represent
the book code and the tens digit is the checksum used for error detection.
The ISBN checksum allows the detection of a single bit failure or the
permutation of two bits with a probability of 100%.
-
13
13(C) Herbert Haas 2005/03/11
Cyclic Redundancy Check
CRC is one of the strongest methods
Bases on polynomial-codes
Several standardized generator-
polynomials
CRC-16: x16+x15+x2+1
CRC-CCITT: x16+x12+x5+1
Checksums which are built on basis of the XOR operation do not provide a
reliable detection scheme against error bursts.
Therefore the Cycle Redundancy Check is based on mathematical polynomial
equations and it is capable to detect even bursts of erroneous bits inside the
data stream.
A single set of check bits is generated using an polynomial equation for each
transmitted frame and appended to the tail of the frame by the sender. The
receiver then performs the same computation on the complete frame and
compares the received checksum with its own calculated checksum.
There are a lot of different standardized polynomial equations like the CRC-16,
CRC-32 or the CRC-CCITT equations.
The CRC-16 check for example will detect all error bursts of less than 16 bits
and most error bursts greater than 16 bits. The CRC-16 and the CRC-CCITT
are mainly used in WAN technologies, while the CRC-16 is mainly used in
LAN environments.
It is quite simple to implement these CRC checks in Hardware with the use of
16 or 32 bit long shift registers.
-
14
14(C) Herbert Haas 2005/03/11
Forward Error Correction
Required for "extreme" conditions High BER, EMR
Long delays, space-links
Introduces much redundancy Example: Reed-Solomon codes,
Hamming-codes
1 1 1 0
0 1 0 0
0 0 1 1
0 1 0 1
1
1
0
0
1 1 0 0 0
1 1 0 0
0 1 0 0
0 0 1 1
0 1 0 1
1
1
0
0
1 1 0 0 0
All till now discussed error protection technologies lead to an drop or optional
retransmission of the corrupted data fame. With the help of Forward Error
Correction (FEC) technologies it is possible to fix the faults inside a data frame
up to a certain extend.
One error correction coding scheme is the Hamming FEC scheme. In this
scheme the data bits plus the additional check bits are called the codeword. The
minimum number of bit positions in which two valid codewords differ is
known as the Hamming distance of the code.
It can be shown that to correct n errors we need a code with a Humming
distance of 2n + 1.
In practice the number of check bits needed for error correction is much larger
than the number of bits needed just for error detection. Therefore in most
transport systems ARQ techniques are still used for error correction.
FEC technologies are mainly used in nische technologies, e.g. communication
with space probes, where the RTT is very high and sometimes only a
unidirectional communication channels exists.
-
15
15(C) Herbert Haas 2005/03/11
Control Field
Contains protocol information
Addressing
Sequence numbers
Acknowledgement Flag
Frame Type
SAP or Payload Type
Signalling information
The contents of the control field depends on the tasks that need to be
performed by the Data-link protocol.
So the control field could contain:
Address information for addressing especially in point to multipoint
environments
Sequence numbers that can be seen like serial numbers for each single frame
Acknowledgement Flags to indicate that the data was received properly
Frame Type information to indicate whether its a frame that carries data or
control information
Service Access Point (SAP) or payload type information to indicate what is
transported by the frame
Signaling information in case of connection oriented protocols to build up an
connection
-
16
16(C) Herbert Haas 2005/03/11
Connection-Oriented Protocols
Different definitions
Some say "protocols without
addressing information" and think of
circuit-switched technologies
Some say "protocols that do error
recovery"
Correct: "protocols that require a connection establishment before sending data and a disconnection procedure when finished"
In the past an connection oriented protocol was very often seen as a protocol
that performs a connection setup procedure and supports error recovery and
flow control.
But newer technologies like frame relay typically do not carry address
information, do not need an connection setup procedure in case of PVC service
and do not support error recovery and flow control. But they are still
connection oriented.
So we may say there are two different types of connections temporary (like
SVC) and permanent (like PVC).
For temporary connections we obviously will need addressing and connection
setup procedures.
For permanent connections a virtual circuit identifier is enough.
In both cases temporary or permanent connections we may optionally support
error recovery and flow control.
-
17
17(C) Herbert Haas 2005/03/11
CO-Protocol Procedures (1)
time time
Connection Request
Connection Established
DATA
Disconnection Request
Disconnected
Station A Station B
In connection oriented protocols a connection is established before data is
allowed to flow.
The connection establishment is done by special control frames like connection
request and connection established.
Then we find the data exchange phase which may use error recovery and flow
control. When the data transmission is finished we have special control frames
like disconnect request and disconnected to tear down the connection again.
-
18
18(C) Herbert Haas 2005/03/11
CO-Protocol Procedures (2)
time time
Keepalive
Keepalive ACK
Other synonyms:
"Hello" or
"Receiver Ready"
.
.
.
.
.
.
.
.
(Connection
already
established)
Connection oriented protocols use special keep-alive procedures to make sure
the connection is up in periods where no data frames are transmitted.
-
19
19(C) Herbert Haas 2005/03/11
CO-Issues
Establishment delay
Traffic desriptor during
establishment (QoS)
Additional frame types necessary
Connection establishment
Disconnect
Keepalive
ARQ possible (Error Recovery)
Obviously it takes some time to establish a connection before the data is
allowed to flow. But the establishment delay is typically in the range of
milliseconds. Even ISDN provides a connection establishment worldwide in
less than one second.
A traffic descriptor may be used optionally for all technologies that support
Quality of Service features. The traffic descriptor holds the information about
the service parameters, e.g. delay, burst size etc, that should be used for this
connection.
There are also separate frame types defined for connection establishment,
disconnect procedures and keep-alives.
The use of Automatic Repeat Requests (ARQ) is optional depending on the
technology used. The purpose of the ARQ is to provide error recovery in case
of transmission failures.
-
20
20(C) Herbert Haas 2005/03/11
Automatic Repeat Request
ARQ protocols guarantee correct
delivery of data
Receiver sends acknowledgements
Acknowledgements refer to sequence
numbers
Missing data is repeated
When do we need this?
For most data traffic (FTP, HTTP, ...)
Not for real-time traffic (VoIP)
ARQ techniques are used to allow data retransmissions in the case of
transmission errors and packet loss.
With the help of sequence numbers (serial number of a data packet), applied by
the sender, the receiver is able to detect packet loss and is further able to
acknowledge properly received frames.
Reliable transmission techniques are mainly used for data traffic e.g. SMTP,
HTTP, FTP etc, because we don t want to receive corrupted mails or html
pages.
For real time traffic like Voice over IP systems we prefer unreliable
transmission techniques, because it makes no sense to retransmit a lost word a
few milliseconds later again. This would destroy the harmony in the speech
even more than the lost word. For real time systems Forward Error Correction
systems would be much more useful.
-
21
21(C) Herbert Haas 2005/03/11
ARQ Variants
Idle-RQ Selective ACK
Positive ACK
GoBackN
SREJ
Continuous-RQ
There are two major families of ARQ requests the idle-RQ system and the
continuous-RQ system.
The continuous-RQ system consists of four different flavors. The Selective
ACK, Positive ACK, GoBackN, the Selective Reject (SREJ) method and
sometimes even a mix out of these basic methods.
-
22
22(C) Herbert Haas 2005/03/11
Idle-RQ
Sender Receiver
Data
Ack
Data
Ack
Ack
Ack
Data
Data
The idle-RQ technique is a stop and go protocol, this means when the sender
has sent out one data frame he must wait for the according acknowledgement
before he is allowed to sent the next frame.
The idle-RQ protocol operates in a half duplex mode and is typically used in
master slave environments. So the master sends a frame and must wait for the
response of the slave whether the frame was properly received or not.
In today's networks the idle-RQ technique is seen very rarely, because it
introduces large delays and is not able to fill data pipes we are currently used
to.
-
23
23(C) Herbert Haas 2005/03/11
Without Sequence Numbers:
Sender Receiver
Data "ABCD"
Ack
Ack
Ack
Data "ABCD"
Data "EFGH"
No Ack?
Retransmission!
ABCD
ABCD
ABCD
ABCD
ABCD
EFGH
There are two different ways how idle-RQ technique might be implemented.
In this graphic an idle-RQ system without the use of sequence numbers is
shown. The sender sends out a data frame, starts an retransmission timer and
waits for the receive of an acknowledgement.
An already sent data frame remains in the send buffer and may only be deleted
if an proper acknowledgement is received.
A data frame retransmission will happen, if the retransmission timer times out
before an acknowledgement is received. Even if the transmission itself was
successful and only the acknowledgement was lost. This could lead to an
transport of duplicate data frames.
-
24
24(C) Herbert Haas 2005/03/11
With Sequence Numbers:
Sender Receiver
Data "ABCD" S=0
Ack=0
Ack=0
Ack=1
Data "ABCD" S=0
Data "EFGH" S=1
No Ack?
Retransmission!
ABCD
ABCD
ABCD
EFGH
In the second scenario of idle-RQ systems sequence numbers are used.
In this case the sender sends out a data frame with a valid sequence number.
Keeps the data frame in the send buffer and starts the retransmission timer. The
acknowledgement frame is lost again and the data frame is retransmitted.
But now the receiver is able to recognize, by the help of the sequence number,
that the received data frame is a duplicate and is able to discard it.
-
25
25(C) Herbert Haas 2005/03/11
Slow !
Vienna Tokyo
Data
Ack
"Stop and Wait":"Stop and Wait":
Data is traveling round
the earth while sender
waits for the
acknowledgement.
In the meantime
no data can be sent !!
Data
As already mentioned before the idle-RQ technique is not suited for today's
data transport systems. The stop and wait procedure would introduce a lot of
delay, especially on long distance connections, and would no be able to
efficiently use the network infrastructure.
-
26
26(C) Herbert Haas 2005/03/11
Empty Pipe !
Vienna Tokyo
t = 0 s
t = 350 ms
1 KB Data
Ack
1.5 Mbit/s
This pipe allows
1.5 Mbit/s 350 ms
= 525,000 bit @ 64 KB
of data.
But stop-and-wait only
allows one frame to be
outstanding !!!
Assume MTU=1 KByte,
then the max rate is
(1024 8) bit / 0.35 s
@ 23 Kbit/s
In this scenario we have a 1.5 Mbit/s connection between Vienna and Tokyo.
A 1 KByte data frame is sent from Vienna to Tokyo with a transport delay of
175 milliseconds in one direction. With the use of idle-RQ technique it would
take at least 350 milliseconds before an acknowledgement is received and the
next data frame is sent.
In this case a maximum throughput of only 23 Kbit/s can be achieved.
-
27
27(C) Herbert Haas 2005/03/11
Idle-RQ Facts
Old and slow method
But small code and only little resources
necessary
At least two sequence numbers
necessary
To distinguish new from old data
Half duplex protocol
Example: TFTP
The only advantage of the idle-RQ technique compared to the more
sophisticated continuous RQ techniques is the little amount of memory and
processor resources that is needed.
Therefore it is very easy to implement them in ROM based systems e.g. cisco
router support TFTP from ROM monitor
-
28
28(C) Herbert Haas 2005/03/11
Continuous RQ
Data and Acks
are sent
continuously !!
Data
Ack
Data
Data
Data
Ack
Ack
Ack
Acks
DataIdle-RQ Continuous-RQ
In continuous-RQ technology data frames and their according
acknowledgements are sent continuously.
The sender is allowed to put a certain amount of frames into the send buffer
and transmit them all in one go. The amount of frames the sender is allowed to
send is either negotiated during the connection establishment phase or
dynamically adjusted by max window size announcements of the received
acknowledgements.
-
29
29(C) Herbert Haas 2005/03/11
Full Pipe !
Vienna Tokyo
t = 0 s
t = 350 ms
1 KB Data
Ack
1.5 Mbit/s
This situation
corresponds with a
sliding window
By the use of continous-RQ technique and an proper adjusted send window
size it would now be possible to use the complete capacity of our Vienna
Tokyo connection.
-
30
30(C) Herbert Haas 2005/03/11
Need For Retransmission Buffer
Vienna Tokyo
Data S=0Data S=1Data S=2Data S=3
Four packets are sent,
but due to a network
failure none of them
arrive (or equivalently
they do arrive but the
Acks are lost)
Timeouts !!!
0
0 1
0 1 2
0 1 2 3
Data S=0Data S=1
.
.
.
.
0 1 2 3
0 1 2 3
0 1 2 3
0 1 2 3
Retransmissions
Ack
0
1 0Ac
k
In this example four data frames are sent from Vienna to Tokyo and all of them
are lost or the according acknow