Medium Access
Medium Access
= 1/(2e) = .184
Pros Cons
single active node can collisions, wasting slots
continuously transmit at idle slots
full rate of channel
nodes may be able to
highly decentralized: detect collision in less
only slots in nodes need than time to transmit
to be in sync
packet
simple
Slotted Aloha efficiency
Suppose N stations have frames to send
each transmits in slot with probability p
probability of successful transmission S is:
by any specific single node: S= p (1-p)(N-1)
by any of N nodes
S = Prob (only one transmits)
= N p (1-p)(N-1)
for optimum p as N -> infinity ...
= 1/e = .37
At best: channel used for useful transmissions 37% of time!
Slotted ALOHA throughput
Nonpersistent:
Constant or variable delay transmit if idle
if busy, wait random time and repeat process
if collision, back off
Time
Ready
1 – persistent
transmit as soon as channel goes idle
if collision, back off
P –persistent
transmit as soon as channel goes idle with probability of P.
Otherwise, delay one time slot and repeat process
If collision, back off
CSMA – Persistence methods
Non persistent, 1-Persistent, and p-Persistent (continuously
sense)
• Rule:
1. If idle, transmit, otherwise step 2
2. If busy, listen until idle, then transmit immediately
3. If collision detected (measure signal strengths,
compare transmitted and received signals), jam then cease
(abort) transmission
4. After jam, wait random time then start from step 1
Collision detection
B Tx for a duration t3 – t0,
and D Tx for t2 – t1
t2
t3
for a protocol to work, the
length of any frame divided
by the bit rate must be more
than these durations
Tfr ≥ 2Tp
CSMA/CD procedure
Tx & CD is a
Tx done
continuous and
or
simultaneous
collision
process (using
detected
different ports)
Binary exponential backoff
• Attempt to transmit repeatedly if repeated collisions
• First 10 attempts, mean value of random delay doubled
Tb = {0 - 2K-1} X Tp or Tfr
3. Acknowledgement
IFS
STA Defers Tx even if channel is idle
Waits for IFS time period
IFS time allows the front of the Tx s/g by the distant STA to
reach this STA
If after IFS time, channel is found idle, the STA still needs to
wait a time equal to contention time
The IFS time can also be used to prioritize STAs or frames
-- a STA that is assigned shorter IFS has a higher priority
CW
CW is an amount of time divided into slots
STA ready to send chooses a random no. of slots as its
wait time (according to binary exp. backoff strategy)
Set to one slot first time and then doubles each time the
STA can’t detect an idle channel after IFS time
-- STA needs to sense the channel after each time slot
If channel is found busy, STA stops the timer and restart it
when the channel is sensed free (doesn’t restart the
process or timer of CW)
Thus a STA with longest waiting time gets priority over
other STAs
Time-out timer and ACK
A B C
A B C
collision
t
Aloha reserved Aloha reserved Aloha reserved Aloha
Packet Reservation Multiple Access (PRMA)
Implicit reservation of slots:
a certain number of slots form a frame, frames are repeated
stations compete for empty slots according to the slotted aloha
principle
once a station reserves a slot successfully, this slot is automatically
assigned to this station in all following frames as long as the station
has data to send
competition for this slots starts again as soon as the slot was empty
in the last frame
reservation
1 2 3 4 5 6 7 8 time-slot
ACDABA-F
frame1 A C D A B A F
ACDABA-F
frame2 A C A B A
AC-ABAF-
frame3 A B A F collision at
A---BAFD reservation
frame4 A B A F D attempts
ACEEBAFD
frame5 A C E E B A F D
t
Reservation TDMA
Reservation Time Division Multiple Access
every frame consists of N mini-slots and x data-slots
every station has its own mini-slot and can reserve up to k data-slots
using this mini-slot (i.e. x = N * k).
other stations can send data in unused data-slots according to a
round-robin sending scheme (best-effort traffic)
A B C D
52
Exposed Terminal Problem
Node C can communicate with B and D both
Node B can communicate with A and C
Node A cannot hear C
Node D can not hear B
When C transmits to D, B detect the transmission using the
carrier sense mechanism and postpone to transmit to A,
even though such transmission will not cause collision
A XB C D
53
MACA: A New Channel Access
Method for Packet Radio
54
Goals , New Ideas, and Main Contributions
Goals:
Try to overcome hidden & exposed terminal problems
New idea:
Reserve the channel before sending data packet
Minimize the cost of collision (control packet is much
smaller than data packet)
Main Contribution:
A three-way handshake MAC protocol : MACA
In contrast to CS, RTS-CTS exchange enables nearby
STAs to avoid collisions at the Rx, not the sender
55
Fundamental Assumptions
Symmetry
A can hear from B B can hear from A
No capture
No interference and channel fading
Packet error only due to collision
Data packets and control packets are transmitted in the same
channel
56
Three-Way Handshake
A sends Ready-to-Send (RTS)
B responds with Clear-to-Send (CTS)
A sends DATA PACKET
RTS and CTS announce the duration of the data transfer
Nodes overhearing RTS keep quiet for
some time to allow A to receive CTS CTS
DATA
RTS
Nodes overhearing CTS keep quiet
for some time to allow B D
A
C
E
57
More Details for MACA
A sends out RTS and set a timer and waits for CTS
If A receives CTS before timer go to zero, OK! sends data packet
Otherwise, A assumes there is a collision at B
Double the backoff counter interval
Randomly pick up a timer from [1,backoff counter]
Send next RTS after timer go to zero
B sends out CTS, then set a timer and waits for data packet
If data packet arrives before timer go to zero, OK!
Otherwise, B can do other things
C overhears A’s RTS, set a timer which is long enough to allow A to
receive CTS. After the timer goes to zero, C can do other things
D overhears B’s CTS, set a timer which is long enough to allow B to
receive data packet.
E overhears A’s RTS and B’s CTS, set a timer which is long enough
to allow B to receive data packet.
RTS and CTS can also contain info to allow sender A to adjust power
to reduce interference
58
Note: no carrier sense
Hidden Terminal Problem Still Exists (1)
B
C
59
Hidden Terminal Problem Still Exists (2)
B
C
A E
60
Exposed Terminal Problem Still Exists
A
C
D
61
Summary
MACA did not solve hidden & exposed terminal problems
MACA did not provide specifications about parameters
What are RTS, CTS packet sizes ?
How to decide timers?
What is initial backoff window size?
A lot things need to do if using MACA
62
Wireless LAN
63
Characteristics of wireless LANs
Advantages
very flexible within the reception area
Ad-hoc networks without previous planning possible
(almost) no wiring difficulties (e.g. historic buildings, firewalls)
more robust against disasters like, e.g., earthquakes, fire
Disadvantages
typically very low bandwidth compared to wired networks
(1-10 Mbit/s) due to shared medium
many proprietary solutions, especially for higher bit-rates, standards
take their time (e.g. IEEE 802.11)
Design goals for wireless LANs
AP wired network
AP
ad-hoc network
IEEE 802.11
Standard specifies the PHY and MAC adapted to the special
requirements of wireless LANs
Offers time-bounded and asynchronous services
Power management, handling of hidden nodes, and ability
to operate world wide (at 2.4 GHz ISM band)
Data rate 1 Mbps mandatory and 2 Mbps optional
System architecture – infrastructure based
Station (STA)
802.11 LAN
802.x LAN terminal with access mechanisms
to the wireless medium and radio
contact to the access point
STA1 Basic Service Set (BSS)
BSS1
Portal group of stations using the same
Access
radio frequency
Point
Access Point
Distribution System
station integrated into the wireless
Access LAN and the distribution system
ESS Point Portal
bridge to other (wired) networks
BSS2
Distribution System
interconnection network to form
one logical network (ESS:
Extended Service Set) based
STA2 802.11 LAN STA3
on several BSS
System architecture – ad hoc based
Direct communication within a
802.11 LAN limited range
•Station
(STA): terminal with access
STA1
IBSS1 STA3 mechanisms to the wireless medium
fixed
terminal
mobile terminal
infrastructure
network
access point
application application
TCP TCP
IP IP
LLC LLC LLC
802.11 MAC 802.11 MAC 802.3 MAC 802.3 MAC
802.11 PHY 802.11 PHY 802.3 PHY 802.3 PHY
802.11 Layers and functions
PLCP Physical Layer Convergence
MAC Protocol
access mechanisms, clear channel assessment
fragmentation, encryption signal (carrier sense)
MAC Management PMD Physical Medium Dependent
synchronization, roaming, MIB, modulation, coding
power management
PHY Management
channel selection, MIB
Station Management
coordination of all management
functions
PHY Management
PMD
802.11 PHY
3 versions: 2 radio (typ. 2.4 GHz), 1 IR
data rates 1 or 2 Mbit/s
FHSS (Frequency Hopping Spread Spectrum)
spreading, despreading, signal strength, typ. 1 Mbit/s
min. 2.5 frequency hops/s (USA), two-level GFSK modulation
DSSS (Direct Sequence Spread Spectrum)
DBPSK modulation for 1 Mbit/s (Differential Binary Phase Shift
Keying), DQPSK for 2 Mbit/s (Differential Quadrature PSK)
preamble and header of a frame is always transmitted with 1 Mbit/s,
rest of transmission 1 or 2 Mbit/s
chipping sequence: +1, -1, +1, +1, -1, +1, +1, +1, -1, -1, -1 (Barker
code)
max. radiated power 1 W (USA), 100 mW (EU), min. 1mW
Infrared
850-950 nm, diffuse light, typ. 10 m range
carrier detection, energy detection, synchronization
FHSS PHY packet format
Synchronization
synch with 010101... pattern
SFD (Start Frame Delimiter)
0000110010111101 start pattern
PLW (PLCP_PDU Length Word)
length of payload incl. 32 bit CRC of payload, PLW < 4096
PSF (PLCP Signaling Field)
data of payload (1 or 2 Mbit/s)
HEC (Header Error Check)
CRC with x16+x12+x5+1
80 16 12 4 16 variable bits
DIFS DIFS
PIFS
SIFS
medium busy contention next frame
t
direct access if
medium is free DIFS
DFWMAC – DCF using CSMA/CA
contention window
DIFS DIFS (randomized back-off
mechanism)
medium busy next frame
direct access if t
medium is free DIFS slot time
station ready to send starts sensing the medium (CS based on CCA)
if the medium is free for the duration of an Inter-Frame Space (IFS),
the station can start sending (IFS depends on service type)
allows for short access delay under light load
if the medium is busy, the station has to wait for a free DIFS, then the
station must additionally wait a random back-off time (CA, multiple of
slot-time)
if another station occupies the medium during the back-off time of the
station, the back-off timer stops (fairness)
DCF using CSMA/CA – competing stations
DIFS DIFS DIFS DIFS
boe bor boe bor boe busy
station1
boe busy
station2
busy
station3
busy medium not idle (frame, ack etc.) boe elapsed backoff time
DIFS
RTS data
sender
SIFS SIFS
CTS SIFS ACK
receiver
NAV (RTS)
NAV (CTS)
NAV (frag1) DIFS
other NAV (ACK1) data
stations t
contention
RTS packet includes the duration for the TX of the first fragment and the
corresponding ACK (a certain set of STAs receiving RTS, set their NAV)
a possibly different set of STAs receiving CTS, sets their NAV
another duration value is included in frame ‘frag1’, that reserves the
medium for the duration of the transmission following (i.e. ‘frag2’ and its ACK)
another set of STAs (receiving this reservation), adjust their NAV
ACK1 also includes the reservation for the next transmission, a fourth set of
STAs may receive this adjust their NAV
If frag2 is not the last frame then same will be continued
DFWMAC – PCF with polling
t0 t1
SuperFrame
PIFS SIFS
D3 D4 CFend
point
coordinator SIFS
U4
wireless
stations
stations‘ NAV
NAV contention free period contention t
period
MAC frames
bytes 2 2 6 6 6 2 6 0-2312 4
Frame Duration/ Address Address Address Sequence Address
Data CRC
Control ID 1 2 3 Control 4
bits 2 2 4 1 1 1 1 1 1 1 1
Protocol To From More Power More
Type Subtype Retry WEP Order
version DS DS Frag Mgmt Data
•Types
control frames, management frames, data frames
•Sequence numbers
important against duplicated frames due to lost ACKs
•Addresses
receiver, transmitter (physical), BSS identifier, sender (logical)
•Miscellaneous
sending time, checksum, frame control, data
MAC address format
scenario to DS from address 1 address 2 address 3 address 4
DS
ad-hoc network 0 0 DA SA BSSID -
infrastructure 0 1 DA BSSID SA -
network, from AP
infrastructure 1 0 BSSID SA DA -
network, to AP
infrastructure 1 1 RA TA DA SA
network, within DS
bytes 2 2 6 6 4
Frame Receiver Transmitter
RTS Duration CRC
Control Address Address
bytes 2 2 6 4
Frame Receiver
CTS Duration CRC
Control Address