Documente Academic
Documente Profesional
Documente Cultură
Wireless Techniques
Jorma Kekalainen
117
Wireless Techniques
Chapter 2: Link Layer and Multiple
Access
118
Page 1
Lecture notes
Layers
We can construct a
network as a layered
structure so that each
layer implements a
service
via its own internallayer actions and
relying on services
provided by layer below
119
Why layering?
Dealing with complex systems:
explicit structure allows identification and detection of
relationships inside of the complex system
modularization eases maintenance and updating of system
change of implementation of layers service transparent
to rest of system
e.g., change in some layer procedure doesnt affect rest
of system
120
Page 2
Lecture notes
application
transport
network
link
physical
PPP, Ethernet
121
122
Hypertext Transport Protocol (HTTP) is the standard protocol for the carriage of data around an internet
SMTP - Simple Mail Transfer Protocol
Page 3
Lecture notes
application
presentation
session
transport
network
link
physical
123
source
message
segment Ht
datagram Hn Ht
frame Hl Hn Ht
Encapsulation
application
transport
network
link
physical
link
physical
switch
destination
M
Ht
Hn Ht
Hl Hn Ht
application
transport
network
link
physical
Hn Ht
Hl Hn Ht
network
link
physical
Hn Ht
router
124
Page 4
Lecture notes
125
framing,
addressing,
flow control,
error control, and
media access control.
Page 5
Lecture notes
Page 6
Lecture notes
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, destination
different from IP address
Services
flow control:
pacing between adjacent sending and receiving nodes
error detection:
errors caused by signal attenuation, noise and distortion.
receiver detects presence of errors:
signals to the sender for retransmission or drops frame
error correction:
receiver identifies (detects) and corrects bit error(s)
without resorting to retransmission
130
Page 7
Lecture notes
131
Note
132
Page 8
Lecture notes
Accuracy of transmission
Networks must be able to transfer data from one
device to another with acceptable accuracy.
Some applications require that errors are detected
and corrected.
Some applications can tolerate a small level of error.
For example, random errors in audio or video
transmissions may be tolerable, but when we transfer
text, we expect a very high level of accuracy.
133
Error control
reliable point-point communication
generic problem: app-to-app, over path, over link
error model
bits flipped in packet
packets lost
packets reordered
134
Page 9
Lecture notes
136
Page 10
Lecture notes
Redundancy
The central concept in detecting or
correcting errors is redundancy.
To be able to detect or correct errors, we
need to send some extra bits with our data.
These redundant bits are added by the
sender and removed by the receiver.
Their presence allows the receiver to detect
or correct corrupted bits.
138
Page 11
Lecture notes
Note
139
Page 12
Lecture notes
Coding
Redundancy is achieved through various coding
schemes.
The sender generates and adds redundant bits
through a process that creates a relationship
between the redundant bits and the actual data
bits.
The receiver generates its own redundant bits and
checks the relationships between the two sets of
bits to detect or correct the errors.
The ratio of redundant bits to the data bits are
important factors in any coding scheme.
There are two broad categories of coding schemes:
block coding and
convolution coding.
142
Page 13
Lecture notes
143
The sender creates codewords out of datawords by using a generator that applies
the rules and procedures of encoding. Each codeword sent to the receiver may
change during transmission. If the received codeword is the same as one of the
valid codewords, the word is accepted; the corresponding dataword is extracted
from codeword for use. If the received codeword is not valid, it is discarded.
144
However, if the codeword is corrupted during transmission but the received word
still matches a valid codeword, the error remains undetected.
Page 14
Lecture notes
Note
145
In error detection, the receiver needs to know only that the received codeword is
invalid; in error correction the receiver needs to find (or guess) the original
codeword sent. More redundant bits for error correction are needed than for
error detection. The idea is the same as error detection but the checker functions
146
are much more complex.
Page 15
Lecture notes
Error control
Errors can be categorized as a single-bit error or a burst error.
A single-bit error has one bit error per data unit.
A burst error has two or more bit errors per data unit.
147
Note
148
Page 16
Lecture notes
Error detection
EDC= Error Detection and Correction bits (redundancy)
D = Data protected by error checking, may include header fields
Error detection is not 100% reliable!
protocol may miss some errors, but rarely
larger EDC field yields better detection and correction
otherwise
149
Example: Checksum
Goal: detect errors in transmitted packet
Sender:
compute checksum of
segment
put checksum value into
checksum field
Receiver:
compute checksum of
received segment
check if computed checksum
equals checksum field value:
NO - error detected
YES - no error detected.
But maybe errors
nonetheless? Yes, maybe
so!
Note: In the Internet the checksum is used by several protocols although not150
at
the data link layer.
Page 17
Lecture notes
151
ATM Asynchronous Transfer Mode creates a fixed channel, or path, between two points
whenever data transfer begins. This differs from TCP/IP , in which messages are divided into
packets and each packet can take a different route from source to destination. This
152
difference makes it easier to track and bill data usage across an ATM network, but it makes
it less adaptable to sudden surges in network traffic.
Page 18
Lecture notes
CRC example
Wanted: Remainder
if we divide D.2r
by G, we get
remainder R
R = remainder[
D.2r
G
153
The dataword has k bits (4 here); the codeword has n bits (7 here). The size of the dataword
is augmented by adding n - k (3 here) zeros to the right-hand side of the word. The n-bit
result is fed into the generator. The generator uses a divisor of size n - k + 1 (4 here). The
generator divides the augmented dataword by the divisor (modulo-2 division). The quotient of
154the
the division is discarded; the remainder (r2r1 r0) is appended to the dataword to create
codeword.
Page 19
Lecture notes
The decoder receives the possibly corrupted codeword. A copy of all n bits is fed to the
checker which is a replica of the generator. The remainder produced by the checker is a
syndrome of n - k (3 here) bits, which is fed to the decision logic analyzer. The analyzer
has a simple function: If the syndrome bits are all 0s, the 4 leftmost bits of the codeword
are accepted as the dataword (interpreted as no error); otherwise, the 4 bits are 155
discarded (error).
156
Page 20
Lecture notes
157
host schematic
application
transport
network
link
cpu
memory
controller
link
physical
host
bus
physical
transmission
network adapter
card
Note: Firmware is a term often used in electronic systems and computing to denote the
fixed, usually rather small, programs and/or data structures that internally control various
electronic devices. Higher level software can be changed without replacing
a hardware component, and firmware is typically involved with very basic low-level158
operations without which a device would be completely non-functional.
Page 21
Lecture notes
Adapters communicate
datagram
datagram
controller
controller
receiving host
sending host
datagram
frame
receiving side
sending side:
encapsulates datagram in
frame
adds error checking bits,
flow control, etc.
159
Link Layer
Multiple Access
160
Page 22
Lecture notes
If we have a dedicated link (or channel) between the sender and the
receiver, then we only need data link control, a mechanism which
provides a link with reliable communication.
On the other hand, if we use e.g. our cellular phone to connect to
another phone, the channel is not dedicated and we need some method
to resolve access to the shared media
We can consider the data link layer as two sublayers.
The upper sublayer is responsible for data link control, and
the lower sublayer is responsible for resolving access to the shared media.
Multiple-access control
161
Page 23
Lecture notes
TDMA
CDMA
CSMA
:
LLC
MAC
PHY
163
Access problem
The problem of controlling the access to the
medium is similar to the rules of speaking in an
assembly.
The procedures guarantee that the right to speak is
upheld and ensure that two people do not speak at the
same time, do not interrupt each other, do not
monopolize the discussion, and so on.
The situation is similar for multipoint networks.
Many formal protocols have been designed to handle
access to a shared link.
164
Page 24
Lecture notes
shared RF
(e.g., 802.11 WiFi)
shared RF
(satellite)
Students at a
classroom
(shared air, acoustical)
165
Page 25
Lecture notes
4. simple
167
168
Page 26
Lecture notes
169
Channelization (Channel
partitioning)
Channelization is a multiple-access method in
which the available bandwidth of a link is
shared in time, frequency, or through code,
between different stations.
In this section, we discuss three channelization
protocols: FDMA, TDMA, and CDMA.
170
Page 27
Lecture notes
Analogy
An analogy to the problem of multiple access
is a room (channel) in which people wish to
communicate with each other.
To avoid confusion, people could take turns
speaking (time division), speak at different
pitches (frequency division), or speak in
different languages (code division).
171
172
Page 28
Lecture notes
173
FDMA
FDM cable
frequency bands
174
Page 29
Lecture notes
Note
175
176
Page 30
Lecture notes
177
178
Page 31
Lecture notes
Synchronization
The main problem with TDMA lies in achieving
synchronization between the different stations.
Each station needs to know the beginning of its slot
and the location of its slot.
This may be difficult because of propagation delays
introduced in the system if the stations are spread
over a large area.
To compensate for the delays, we can insert guard
times.
Synchronization is normally accomplished by having
some synchronization bits (normally referred to as
preamble bits) at the beginning of each slot.
179
Note
180
Page 32
Lecture notes
182
Page 33
Lecture notes
Spread Spectrum
What can be gained from apparent waste
of spectrum?
Immunity from various kinds of noise and
multipath distortion
Can be used for hiding and encrypting signals
Several users can independently use the same
higher bandwidth with very little interference
184
Page 34
Lecture notes
Rxy (k ) = lim
1
N N
N 1
x
n=0
yn k
186
Page 35
Lecture notes
Classroom analogy
CDMA simply means communication with different codes.
For example, in a classroom with many students, two students
can talk in Finnish if nobody else understands Finnish.
Another two people can talk in Russian if they are the only ones
who understand Russian, and so on.
In other words, the common channel, the space of the classroom
in this case, can easily allow communication between several
couples, but in different languages (codes).
In such circumstances humans are actually quite good at locking
into the conversation in the language they understand, while
filtering out the remaining conversations
A CDMA protocol is similar to having students speaking in
multiple languages
Students at a classroom
(shared air, acoustical)
187
Correlation
Page 36
Lecture notes
Synchronous CDMA
If the dot product is zero, the two vectors are said to be orthogonal to
each other
If vectors a and b are orthogonal, then
189
Synchronous CDMA
Each user in synchronous CDMA uses a code
orthogonal to the other users' codes to
modulate their signal.
Orthogonal codes have a cross-correlation
equal to zero; in other words, they do not
interfere with each other.
E.g. 64 bit Walsh codes are used to encode the
signal to separate different users.
Since each of the 64 Walsh codes are orthogonal
to one another, the signals are channelized into 64
orthogonal signals.
190
Page 37
Lecture notes
Coordination
The set of N Walsh sequences will afford up to N
users, and in general, an NxN Walsh matrix can be
used to multiplex N users.
Multiplexing requires all of the users to be
coordinated so that each transmits their assigned
sequence v (or the complement, -v) so that they
arrive at the receiver at exactly the same time.
Thus, this technique finds use in base-to-mobile
links, where all of the transmissions originate from
the same transmitter and can be perfectly
coordinated.
On the other hand, the mobile-to-base links cannot
be precisely coordinated, particularly due to the
mobility of the handsets, and require a somewhat
different approach.
191
Asynchronous CDMA
Page 38
Lecture notes
Processing gain
193
Page 39
Lecture notes
Page 40
Lecture notes
Characteristics of CDMA
Page 41
Lecture notes
Characteristics of CDMA
Some CDMA devices use a rake receiver, which
exploits multipath delay components to improve the
performance of the system.
A rake receiver combines the information from several
correlators, each one tuned to a different path delay,
producing a stronger version of the signal than a simple
receiver with a single correlator tuned to the path delay of
the strongest signal.
Soft handoff
Reusing the same frequency in every cell eliminates the need for
frequency planning in a CDMA system; however, planning of the
different pseudorandom sequences must be done to ensure that
the received signal from one cell does not correlate with the
signal from a nearby cell.
Since adjacent cells use the same frequencies, CDMA systems have
the ability to perform soft handoffs.
Soft handoffs allow the mobile telephone to communicate
simultaneously with two or more cells.
200
Page 42
Lecture notes
Page 43
Lecture notes
203
Page 44
Lecture notes
205
206
Page 45
Lecture notes
207
Note: Exclusive-OR
DSSS system
Multiply BPSK signal,
sd(t) = A d(t) cos(2 fct)
At receiver, incoming
signal multiplied by c(t)
Since, c(t) x c(t) = 1,
incoming signal is
recovered
208
Page 46
Lecture notes
209
CDMA Example
If k=6 and code is a sequence of 1s and -1s
For a 1 bit, A sends code as chip pattern
<c1, c2, c3, c4, c5, c6>
210
Page 47
Lecture notes
CDMA Example
User A code = <1, 1, 1, 1, 1, 1>
To send a 1 bit = <1, 1, 1, 1, 1, 1>
To send a 0 bit = <1, 1, 1, 1, 1, 1>
211
DSSS-CDMA
212
Page 48
Lecture notes
Note
213
fc
Transmission
10 KHz bandwidth
fc
Reception
Baseband
Information Bits
Coding
and
Interleaving
Walsh Code
Spread
Walsh Code
Correlator
Deinterleaving
and Decoding
Baseband
Information Bits
9,6 kbps
19,2 kbps
chip rate
chip rate
19,2 kbps
9,6 kbps
fc
Thermal Noise
Spurious Signals
fc
External Interference
fc
Interference from other
cells within the system
fc
Interference from users
within the same cell
214
Page 49
Lecture notes
CDMA
Receiver for User 1
Transmitter for User 1
m1(t)
m1(t)c1(t)
Wireless
Channel
m1(t)+
m2(t)c1(t)c2(t)
m1(t)+e1(t)
TSym bol
m1(t)
m1(t)c1(t)+
m2(t)c2(t)
c1(t)
m2(t)c2(t)
c1(t)
m2(t)+e2(t)
TSym bol
c2(t)
m2(t)
c2(t)
Important Note:
The value of ei(t) depends on the
cross correlation properties
between c1 & c2
ei(t)=0 if c1 & c2 are orthogonal
216
Page 50
Lecture notes
BW= BS
BW= GBS
BW= GBS
BW= BS
Data
Symbol
Symbol
Detection
Spreading Code
Signal Spreading
Interference
Spreading Code
Communication
Channel
Signal De-spreading
217
218
Page 51
Lecture notes
PN Sequences
PN generator produces periodic sequence
that appears to be random
PN Sequences
Generated by an algorithm using initial seed
Sequence is not statistically random but will pass many test
of randomness
Sequences referred to as pseudorandom numbers or
pseudonoise sequences
Unless algorithm and seed are known, the sequence is
impractical to predict
219
M-sequences
A maximum length sequence (MLS or M-sequence) is a type of
pseudorandom binary sequence.
They are bit sequences generated using maximal linear feedback
shift registers and are so called because they are periodic and
reproduce every binary sequence that can be reproduced by the
shift registers (i.e., for length-m registers they produce a
sequence of length N=(2m 1).
Maximum length sequences are spectrally flat, with the
exception of a near-zero DC term.
Practical applications for MLS are used as a basis for deriving
pseudo-random sequences in digital communication systems that
employ direct-sequence spread spectrum and frequency-hopping
spread spectrum transmission systems.
220
Page 52
Lecture notes
221
Important PN Properties
Randomness
Uniform distribution
Independence
Correlation property
The periodic autocorrelation of a 1 m-sequence is
1
R ( ) = 1
= 0, N, 2N, ...
otherwise
Unpredictability
222
Page 53
Lecture notes
Definitions
Correlation
The concept of determining how much similarity or
resemblance one set of data has with another
Range between 1 and 1
1 The second sequence matches the first sequence
0 There is no relation at all between the two sequences
-1 The two sequences are mirror images
Cross correlation
The comparison between two sequences from
different sources rather than a shifted copy of a
sequence with itself
223
Advantages of M-sequences
The cross correlation between an M-sequence
and noise is low
This property is useful to the receiver in filtering out noise
224
Page 54
Lecture notes
Gold sequences
Gold sequences constructed by the XOR of
two m-sequences with the same clocking
Codes have well-defined cross correlation
properties
Only simple circuitry needed to generate
large number of unique codes
In following example two shift registers
generate the two m-sequences and these are
then bitwise XORed
A Gold code (Gold sequence, named after R. Gold), is a type of binary 225
sequence, used in telecommunication (CDMA) and satellite navigation (GPS).
Gold Sequences
Shift-register implementation
226
Page 55
Lecture notes
Orthogonal Codes
Orthogonal codes
All pairwise cross-correlations are zero
Fixed- and variable-length codes used in CDMA
systems
For CDMA application, each mobile user uses one
sequence in the set as a spreading code
Provides zero cross-correlation among all users
Types
Walsh codes
Variable-Length orthogonal codes
A Walsh matrix (proposed by J.L. Walsh) is a specific square matrix, with
dimensions a power of 2, the entries of which are +1 or 1, and the property that
the dot product of any two distinct rows (or columns) is zero. The Walsh matrix
(and Walsh functions) are used in computing the Walsh transform and have 227
applications in the efficient implementation of certain signal processing operations.
Chipping sequence
In a CDMA protocol, each bit being sent is encoded by
multiplying the bit by a signal or spreading code (the chipping
sequence) that changes at a much faster rate (known as the
chipping rate) than the original sequence of data bits.
Suppose that the rate at which original data bits reach the
CDMA encoder defines the unit of time; that is, each original
data bit to be transmitted requires a one-bit slot time.
Let di be the value of the data bit for the ith bit slot.
For mathematical convenience, we represent a data bit with a 0
value as -1.
Each bit slot is further subdivided into M mini-slots.
The CDMA code used by the sender consists of a sequence of M
values, cm, m = 1, . . . ,M, each taking a +1 or -1 value.
228
Page 56
Lecture notes
229
230
Page 57
Lecture notes
Additive signals
The real world is far from ideal, however, CDMA must
work in the presence of interfering senders that are
encoding and transmitting their data using a
different assigned code.
But how can a CDMA receiver recover a senders
original data bits when those data bits are being in a
mess with bits being transmitted by other senders?
CDMA works under the assumption that the
interfering transmitted bit signals are additive.
This means, for example, that if three senders send a
1 value, and a fourth sender sends a -1 value during
the same mini-slot, then the received signal at all
receivers during that mini-slot is a 2 (since 1 + 1 + 1 1 = 2).
231
Multiple senders
In the presence of multiple senders, sender s
computes its encoded transmissions, Zsi,m in
exactly the same manner as in Equation (1).
The value received at a receiver during the
mth mini-slot of the ith bit slot, however, is
now the sum of the transmitted bits from all
N senders during that mini-slot:
(3)
232
Page 58
Lecture notes
Code division
If the senders codes are chosen carefully, each receiver can
recover the data sent by a given sender out of the aggregate
signal simply by using the senders code in exactly the same
manner as in Equation (2):
(3)
d0 = 1
data
bits
code
Zi,m= di.cm
-1 -1 -1
1
-1
11 1
-1 -1 -1
slot 1
-1
slot 1
channel
output
1
-1
11 1 11 1
d1 = -1
1 1 1
-1 -1 -1
slot 0
1
-1
-1 -1 -1
slot 0
channel
output
Di = Zi,m.cm
m=1
received
input
-1 -1 -1
code
receiver
1 1 1 1 1 1
1
-1
1 1 1
-1 -1 -1
-1
1
-1
1 1 1
-1 -1 -1
slot 1
1
-1
-1 -1 -1
slot 0
d0 = 1
d1 = -1
slot 1
channel
output
slot 0
channel
output
Page 59
Lecture notes
235
CDMA example
236
Page 60
Lecture notes
CDMA example
237
Recap: CDMA
used in several wireless broadcast channels
(cellular, satellite, etc) standards
unique code assigned to each user; i.e., code set
partitioning
all users share same frequency, but each user has
own chipping sequence (i.e., code) to encode data
encoded signal = (original data) X (chipping
sequence)
decoding: inner-product of encoded signal and
chipping sequence
allows multiple users to coexist and transmit
simultaneously with minimal interference (if codes
are orthogonal)
238
Page 61
Lecture notes
Multiple-access protocols
239
Page 62
Lecture notes
Random access
In random access or contention methods, no station is superior
to another station and none is assigned the control over
another.
No station permits, or does not permit, another station to send.
241
Contention
Two features give this method its name.
242
Page 63
Lecture notes
Collision
In a random access method, each station has the
right to the medium without being controlled by any
other station.
However, if more than one station tries to send,
there is an access conflictcollisionand the frames
will be either destroyed or modified.
To avoid access conflict or to resolve it when it
happens, each station follows a procedure that
answers the following questions:
When can the station access the medium?
What can the station do if the medium is busy?
How can the station determine the success or failure of the
transmission?
What can the station do if there is an access conflict?
243
244
Page 64
Lecture notes
ALOHA
ALOHA, the earliest random access method, was
developed in early 1970.
It was designed for a radio (wireless) LAN, but it can
be used on any shared medium.
It is obvious that there are potential collisions in this
a very simple multiple access arrangement, where the
medium is shared between the stations.
When a station sends data, another station may
attempt to do so at the same time.
The data from the two stations collide and become
corrupted.
245
Pure ALOHA
The original ALOHA protocol is called pure
ALOHA.
This is a simple, but elegant protocol.
The idea is that each station sends a frame
whenever it has a frame to send.
However, since there is only one channel to
share, there is the possibility of collision
between frames from different stations.
246
Page 65
Lecture notes
Pure ALOHA
pure Aloha: simple, no synchronization
when frame arrives
transmit immediately
frame sent at t0 collides with other frames sent in [t0-1,t0+1]
247
248
Page 66
Lecture notes
Acknowledgement
250
Page 67
Lecture notes
Maximum number of
retransmission
Pure ALOHA has a second method to prevent
congesting the channel with retransmitted
frames.
After a maximum number of retransmission
attempts Kmax, a station must give up and try
later.
251
252
Page 68
Lecture notes
Back-off time
The time-out period is equal to the maximum possible roundtrip propagation delay, which is twice the amount of time
required to send a frame between the two most widely
separated stations (2 x Tp).
The back-off time TB is a random value that normally depends
on K (the number of attempted unsuccessful transmissions).
The formula for TB depends on the implementation.
One common formula is the binary exponential back-off.
In this method, for each retransmission, a multiplier in the
range 0 to 2K-1 is randomly chosen and multiplied by TP
(maximum propagation time) or Tfr (the average time required to
send out a frame) to find TB.
Note that in this procedure, the range of the random numbers
increases after each collision.
The value of Kmax is usually chosen as 15.
253
Example
The stations on a wireless ALOHA network are a maximum
of 600 km apart. If we assume that signals propagate at 3
108 m/s, we find the maximum propagation time
Page 69
Lecture notes
Example (continued)
b. For K = 2, the range is {0, 1, 2, 3}. This means that TB
can be 0, 2, 4, or 6 ms, based on the outcome of the
random variable.
255
Vulnerable time
Let us find the length of time, the vulnerable
time, in which there is a possibility of
collision.
We assume that the stations send fixedlength frames with each frame taking Tfr to
send.
256
Page 70
Lecture notes
257
258
Page 71
Lecture notes
Example
A pure ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the requirement to
make this frame collision-free?
Solution
Average frame transmission time Tfr is 200 bits/200 kbps
or 1 ms. The vulnerable time is 2Tfr = 2 1 ms = 2 ms. This
means no station should send later than 1 ms before this
station starts transmission and no station should start
sending during the one 1 ms period that this station is
sending.
259
Throughput
Let us call G the average number of frames generated by the
system during one frame transmission time.
Then it can be proved that the average number of successful
transmissions for pure ALOHA is S = G x e-2G.
The maximum throughput Smax is 0.184, for G =.
In other words, if one-half a frame is generated during one
frame transmission time (in other words, one frame during two
frame transmission times), then 18.4 percent of these frames
reach their destination successfully.
This is an expected result because the vulnerable time is 2
times the frame transmission time.
Therefore, if a station generates only one frame in this
vulnerable time (and no other stations generate a frame during
this time), the frame will reach its destination successfully.
260
Page 72
Lecture notes
Note
261
262
Page 73
Lecture notes
Example
A pure ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The G is 1. In this case
S = G e2 G or S = 0.135 (13.5 percent). This means
that the throughput is 1000 0.135 = 135 frames. Only
135 frames out of 1000 will on average survive.
263
Example (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G e 2G or S = 0.184 (18.4 percent). This
means that the throughput is 500 0.184 = 92 and that
only 92 frames out of 500 will on average survive. Note
that this is the maximum throughput case.
c. If the system creates 250 frames per second, this is
(1/4) frame per millisecond. The load is (1/4). In this case
S = G e -2G or S = 0.152 (15.2 percent). This means
that the throughput is 250 0.152 = 38. Only 38
frames out of 250 will on average survive.
264
Page 74
Lecture notes
265
Slotted ALOHA
Pure ALOHA has a vulnerable time of 2 x Tfr.
This is so because there is no rule that defines when
the station can send.
A station may send soon after another station has
started or soon before another station has finished.
Slotted ALOHA was invented to improve the
efficiency of pure ALOHA.
In slotted ALOHA we divide the time into slots of
Tfr and force the station to send only at the
beginning of the time slot.
266
Page 75
Lecture notes
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 probability p until
success
267
268
Page 76
Lecture notes
Vulnerable time
Because a station is allowed to send only at the beginning of
the synchronized time slot, if a station misses this moment, it
must wait until the beginning of the next time slot.
This means that the station which started at the beginning of
this slot has already finished sending its frame.
Of course, there is still the possibility of collision if two
stations try to send at the beginning of the same time slot.
However, the vulnerable time is now reduced to one-half, equal
to Tfr
Next Figure shows that the vulnerable time for slotted ALOHA
is one-half that of pure ALOHA.
Slotted ALOHA vulnerable time = Tfr
269
270
Page 77
Lecture notes
Throughput
It can be proved that the average number of
successful transmissions for slotted ALOHA is
S=Ge-G.
The maximum throughput Smax is 0.368, when G = 1.
In other words, if a frame is generated during one
frame transmission time, then 36.8 percent of
these frames reach their destination successfully.
This result can be expected because the vulnerable
time is equal to the frame transmission time.
Therefore, if a station generates only one frame in
this vulnerable time (and no other station generates a
frame during this time), the frame will reach its
destination successfully.
271
Note
272
Page 78
Lecture notes
273
Example
A slotted ALOHA network transmits 200-bit frames on a
shared channel of 200 kbps. What is the throughput if the
system (all stations together) produces
a. 1000 frames per second b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load G is 1. In this case
S = G eG or S = 0.368 (36.8 percent). This means
that the throughput is 1000 0.368 = 368 frames.
Only 386 frames out of 1000 will probably survive.
274
Page 79
Lecture notes
Example (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G eG or S = 0.303 (30.3 percent). This
means that the throughput is 500 0.303 = 151.
Only 151 frames out of 500 will probably survive.
c. If the system creates 250 frames per second, this is
(1/4) frame per millisecond. The load is (1/4). In this case
S = G e G or S = 0.195 (19.5 percent). This means
that the throughput is 250 0.195 = 49. Only 49
frames out of 250 will probably survive.
275
At best: channel
used for useful
transmissions 37%
of time!
!
276
Page 80
Lecture notes
277
Slotted ALOHA
Pros
single active node can
continuously transmit
at full rate of channel
highly decentralized:
only slots in nodes
need to be in sync
simple
Cons
collisions, wasting slots
idle slots
nodes may be able to
detect collision in less
than time to transmit
packet
clock synchronization
278
Page 81
Lecture notes
280
Page 82
Lecture notes
281
CSMA collisions
spatial layout of nodes
collision:
entire packet transmission
time wasted
note:
role of distance & propagation
delay in determining collision
probability
282
Page 83
Lecture notes
Vulnerable time
The vulnerable time for CSMA is the propagation
time Tp.
This is the time needed for a signal to propagate
from one end of the medium to the other.
When a station sends a frame, and any other station
tries to send a frame during this time, a collision will
result.
But if the first bit of the frame reaches the end of
the medium, every station will already have heard the
bit and will refrain from sending.
Next Figure shows the worst case:
The leftmost station A sends a frame at time t1, which
reaches the rightmost station D at time t1 + Tp.
The gray area shows the vulnerable area in time and space.
283
284
Page 84
Lecture notes
Persistence methods
What should a station do if the channel is busy?
What should a station do if the channel is idle?
Three methods have been devised to answer these
questions:
the 1-persistent method,
the non-persistent method, and
the p-persistent method.
285
286
Page 85
Lecture notes
1-Persistent
The 1-persistent method is
simple and straightforward.
In this method, after the
station finds the line idle, it
sends its frame immediately
(with probability 1).
This method has the highest
chance of collision because
two or more stations may
find the line idle and send
their frames immediately.
Note that Ethernet uses this
method.
287
Non-persistent
Page 86
Lecture notes
p-Persistent
The p-persistent method is used if the channel has
time slots with a slot duration equal to or greater
than the maximum propagation time.
The p-persistent approach combines the advantages
of the other two strategies.
It reduces the chance of collision and improves
efficiency.
In this method, after the station finds the line idle it
follows these steps:
1. With probability p, the station sends its frame.
2. With probability q = 1 p, the station waits for the
beginning of the next time slot and checks the line again.
a) If the line is idle, it goes to step 1.
b) If the line is busy, it acts as though a collision has occurred and
uses the back-off procedure.
289
Page 87
Lecture notes
291
p-Persistent
292
Page 88
Lecture notes
293
Page 89
Lecture notes
At time t1, station A has executed its persistence procedure and starts sending the
bits of its frame.
At time t2, station C has not yet sensed the first bit sent by A.
Station C executes its persistence procedure and starts sending the bits in its
frame, which propagate both to the left and to the right.
The collision occurs sometime after time t2.
Station C detects a collision at time t3 when it receives the first bit of As frame.
295
Station C immediately (or after a short time, but we assume immediately) aborts
transmission.
Station A detects collision at time t4 when it receives the first bit of Cs frame; it
also immediately aborts transmission.
Looking at the figure, we see that A transmits for the duration t4 t1 C transmits
for the duration t3 t2.
Later we show that, for the protocol to work, the length of any frame divided by
the bit rate in this protocol must be more than either of these durations.
At time t4, the transmission of As frame, though incomplete, is aborted; at time
296 t3,
the transmission of Cs frame, though incomplete, is aborted.
Page 90
Lecture notes
297
collision:
entire packet transmission
time wasted
298
Page 91
Lecture notes
Example
A network using CSMA/CD has a bandwidth of 10 Mbps. If
the maximum propagation time (including the delays in the
devices and ignoring the time needed to send a jamming
signal) is 25.6 s, what is the minimum size of the frame?
Solution
The frame transmission time is Tfr = 2 Tp = 51.2 s. This
means, in the worst case, a station needs to transmit for a
period of 51.2 s to detect the collision. The minimum size
of the frame is 10 Mbps 51.2 s = 512 bits or 64 bytes.
This is actually the minimum size of the frame for
Standard Ethernet.
300
Page 92
Lecture notes
Procedure
The flow diagram for CSMA/CD is similar to the one
for the ALOHA protocol, but there are differences.
The first difference is the addition of the
persistence process.
We need to sense the channel before we start
sending the frame by using one of the persistence
processes (non-persistent, 1-persistent, or ppersistent).
The corresponding box can be replaced by one of the
persistence processes.
301
302
Page 93
Lecture notes
Procedure
Energy Level
We can say that the level of energy in a channel can
have three values:
zero,
normal, and
abnormal.
Page 94
Lecture notes
305
Throughput
The throughput of CSMA/CD is greater than that
of pure or slotted ALOHA.
The maximum throughput occurs at a different value
of G and is based on the persistence method and the
value of p in the p-persistent approach.
For 1-persistent method the maximum throughput
is around 50 percent when G = 1.
For non-persistent method, the maximum
throughput can go up to 90 percent when G is
between 3 and 8.
G is the average number of frames generated by the system during one frame306
transmission time
Page 95
Lecture notes
collision detection:
easy in wired LANs: measure signal strengths,
compare transmitted, received signals
difficult in wireless LANs: received signal
strength overwhelmed by local transmission
strength and time varying channel
307
B
308
Page 96
Lecture notes
C
Cs signal
strength
As signal
strength
space
309
Fading
In wireless communications, fading is deviation of the
attenuation that a carrier-modulated telecommunication
signal experiences over certain propagation media.
The fading may vary with
time,
geographical position and
radio frequency.
Page 97
Lecture notes
Cs signal
strength
As signal
strength
space
Signal attenuation:
B, A hear each other
B, C hear each other
A, C can not hear each other
interfering at B
311
Page 98
Lecture notes
Timing in CSMA/CA
Page 99
Lecture notes
315
Note
316
Page 100
Lecture notes
Contention window
The contention window is an amount of time divided into slots.
A station that is ready to send chooses a random number of
slots as its wait time.
The number of slots in the window changes according to the
binary exponential back-off strategy.
This means that it is set to one slot the first time and then
doubles each time the station cannot detect an idle channel
after the IFS time.
This is very similar to the p-persistent method except that a
random outcome defines the number of slots taken by the
waiting station.
One interesting point about the contention window is that the
station needs to sense the channel after each time slot.
However, if the station finds the channel busy, it does not
restart the process; it just stops the timer and restarts it when
the channel is sensed as idle.
This gives priority to the station with the longest waiting time.
317
Note
318
Page 101
Lecture notes
Acknowledgment
With all these precautions, there still may be
a collision resulting in destroyed data.
In addition, the data may be corrupted
during the transmission.
The positive acknowledgment and the timeout timer can help guarantee that the
receiver has received the frame.
319
Procedure
Flow diagram for CSMA/CA
shows the procedure.
Note that the channel needs
to be sensed before and
after the IFS (InterFrame
Space) .
The channel also needs to be
sensed during the contention
time.
For each time slot of the
contention window, the
channel is sensed.
If it is found idle, the timer
continues; if the channel is
found busy, the timer is
stopped and continues after
the channel becomes idle
again.
320
Page 102
Lecture notes
321
Distributed InterFrame
Space (DIFS)
Request To Send (RTS)
Clear To Send (CTS)
Short InterFrame
Space (SIFS)
322
Page 103
Lecture notes
Hand-shaking
324
Page 104
Lecture notes
Hand-shaking
3. The source station sends
data after waiting an
amount of time equal to
SIFS (Short InterFrame
Space).
4. The destination station,
after waiting an amount of
time equal to SIFS, sends
an acknowledgment to show
that the frame has been
received.
Acknowledgment is needed in
this protocol because the
station does not have any
means to check for the
successful arrival of its
data at the destination.
325
Page 105
Lecture notes
ACK
Station B
Collision!
Station C
DIFS
328
Page 106
Lecture notes
ACK
Backoff
Station B
Remaining
backoff time
bn is large
Station C
DIFS
bn is small
329
330
Page 107
Lecture notes
332
Page 108
Lecture notes
333
Solution: Hand-shaking
The solution to the hidden station problem is the use of the
handshake frames (RTS and CTS) discussed earlier.
Figure shows that the RTS message from B reaches A, but
not C.
However, because both B and C are within the range of A, the
CTS message, which contains the duration of data
transmission from B to A reaches C.
Station C knows that some hidden station is using the channel
and refrains from transmitting until that duration is over.
334
Page 109
Lecture notes
Note
335
336
Page 110
Lecture notes
Station C hears the RTS from A, but does not hear the CTS from B.
Station C, after hearing the RTS from A, can wait for a time so that
the CTS from B reaches A; it then sends an RTS to D to show that it
needs to communicate with D.
Both stations D and A may hear this RTS, but station A is in the
sending state, not the receiving state.
Station D, however, responds with a CTS. The problem is here.
If station A has started sending its data, station C cannot hear the
CTS from station D because of the collision; it cannot send its data to
D.
It remains exposed until A finishes sending its data as Figure shows.
The handshaking
messages RTS and CTS
cannot help in this case.
337
338
Page 111
Lecture notes
CSMA/CA rule:
Backoff before
collision
339
Multiple-access protocols
340
Page 112
Lecture notes
MAC protocols
Channelization (channel partitioning MAC) protocols:
share channel efficiently and fairly at high load
inefficient at low load: delay in channel access,
1/N bandwidth allocated even if only 1 active node!
Random access MAC protocols:
efficient at low load: single node can fully utilize
channel
high load: collision overhead
Controlled access (taking turns) protocols:
look for best of both worlds!
341
Page 113
Lecture notes
Reservation
If there are N stations in the system, there
are exactly N reservation minislots in the
reservation frame.
Each minislot belongs to a station.
When a station needs to send a data frame, it
makes a reservation in its own minislot.
The stations that have made reservations can
send their data frames after the reservation
frame.
343
344
Page 114
Lecture notes
Polling
Polling works with topologies in which one device is
designated as a primary station and the other devices
are secondary stations.
All data exchanges must be made through the
primary device even when the ultimate destination is
a secondary device.
The primary device controls the link; the secondary
devices follow its instructions.
It is up to the primary device to determine which
device is allowed to use the channel at a given time.
345
346
Page 115
Lecture notes
Polling
master node invites
slave nodes to
transmit in turn
typically used with
dumb slave devices
concerns:
polling overhead
latency
single point of
failure (master)
data
poll
master
data
slaves
347
Token Passing
In the token-passing method, the stations in a
network are organized in a logical ring.
In other words, for each station, there is a
predecessor and a successor.
The predecessor is the station which is logically
before the station in the ring; the successor is the
station which is after the station in the ring.
The current station is the one that is accessing
the channel now.
The right to this access has been passed from
the predecessor to the current station.
The right will be passed to the successor when the
current station has no more data to send.
348
Page 116
Lecture notes
Token Passing
But how is the right to access the channel passed
from one station to another?
In this method, a special packet called a token circulates
through the ring.
The possession of the token gives the station the right to
access the channel and send its data.
When a station has some data to send, it waits until it
receives the token from its predecessor.
It then holds the token and sends its data.
When the station has no more data to send, it releases the
token, passing it to the next logical station in the ring.
The station cannot send data until it receives the token again
in the next round.
When a station receives the token and has no data to send, it
just passes the token to the next station.
349
350
Page 117
Lecture notes
Token management
Token management is needed for this access method.
Stations must be limited in the time they can have
possession of the token.
The token must be monitored to ensure it has not
been lost or destroyed.
For example, if a station that is holding the token fails, the
token will disappear from the network.
(nothing
to send)
T
data
352
Page 118
Lecture notes
Summary
We can consider the data link layer as two
sublayers.
The upper sublayer is responsible for data link
control, and the lower sublayer is responsible for
resolving access to the shared media.
Page 119