WAVE Media Access Control
Layer
WAVE Physical Layer
•
7.1 MAC Layer Operations
•
7.2 MAC Layer Amendments
MAC Layer
•
IEEE 802.11 defines MAC layer in DSRC
•
It is channel access with Carrier
Sensing Multiple Access with Collision
Avoidance (CSMA/CA)
•
Uses back off timer to reduce frame
collision
•
MAC filters out frames not meant for
CSMA/CA
802.11 sender
1 Initially: it senses channel idle
for short DIFS
(Distributed Inter-Frame Space) time
then
- transmit entire frame
2 Otherwise,
choose random backoff time, timer
counts down while channel idle and is frozen if
channel is busy.
3 When timer reaches zero (if channel is sensed
idle), transmit entire frame
sender
receiver
DIFS
data
•
Transmitter must sense the medium before making a decision to
send a frame
•
If the medium is busy transmitter waits
•
Transmitter only send a frame if the medium is continuously idle
for some time.
•
This waiting time is the sum of Distributed coordination function
InterFrame Space (DIFS) + randomly calculated back-off time
CSMA/CA
•
Does not require coordination among nodes
•
It is simple to implement
•
Offers good performance over moderately
loaded channels
•
IEEE 802.11 adopts enhanced distributed
channel access (EDCA)
•
Four different priority classes achieved by
picking different values of Arbitration
InterFrame Spacing (AIFS)
CSMA/CA Example
Busy
Idle
Transmit request from upper layer
Back-off timer is loaded with a random
value (0-CW) e.g. 6 AIFS Wait for AIFS
time Decrement back-off
timer Back-off timer is zero, start transmitting
Busy
TX2
TX1
Time Time Transmitter 1 Transmitter 2 (AIFS=4) 6 5 4 3 2 1 0 Transmit request from upper layerBack-off timer is loaded with a random
value (0-CW) e.g. 5
AIFS Wait for AIFS
time
Decrement back-off
timer
Back-off timer is zero, start transmitting Time Transmitter 3 (AIFS=8) 5 4 3 2 1 0
Idle
TX3
Defer counting downHidden Terminal Effect
•
B hears A and C, but A and C do not
hear each other
•
Messages from A and C can collide over
the air
A
B
•
WiFi addresses Hidden Terminal with RTS/CTS messages
•
V2V DSRC is a broadcast and there is not RTS/CTS
Basic Service Set
•
In IEEE 802.11 (WiFi) standard
•
BSS is a group of radios configured to talk to
each other over the air
•
All other communication is filtered out
•
Infrastructure BSS contains a station acting
as Access Point (AP)
•
48 bit BSSID is the MAC address of the AP
•
Ad Hoc mode does not require Access Point,
Independent BSS (IBSS)
Basic Service Set
Internet
Access
Point
BSS
BSSID: AP MAC
Ad Hoc
IBSS
IBSSID:
0xFFFFFFFFFFFF
Outside of the Context of a BSS
•
802.11p (MAC layer amendment) for DSRC: ability
to send Outside of a Context of a BSS (OCB)
•
Vehicles can immediately communicate with each
other and with road side equipment with out any
additional overhead
Exercise
Busy
Transmit request from upper layer
Back-off timer is loaded with 5 AIFS
TX2
TX1
Time Time Transmitter 1 Transmitter 2 (AIFS=4) 5 4 3 2 1 0 Transmit request from upper layerBack-off timer is loaded with 8 Time Transmitter 3 (AIFS=6) Medium State 8 AIFS 7 6 5
Idle
Busy
4 3 2 1 0TX3
Idle
Busy
deferedComplete
MAC Layer Modeling in ns-2
Transmission Coordination Transmission Reception Coordination Reception Channel State Manager Back-Off ManagerUpper Layers
PHY State Manager Power MonitorMAC
PHY
RF ModelMobile
Node
Channel State Manager SM
IFS – Inter Frame Space
Cs1 – Carrier Sensing (physical) indicating medium is busy
Cs0 – Carrier Sensing (physical) indicating medium is idle
Nav1 – Network Allocation Vector (virtual) indicating medium is busy
Nav0 – Network Allocation Vector (virtual) indicating medium is idle
CS_IDLE, CS_BUSY – signals to the Back-Off Manager
Cs0Nav0 Cs0Nav1 Cs1Nav0 Cs1Nav1 Wait IFS CS_BUSY CS_BUSY Start new NAV Timer CS_IDLE CS_BUSY NAV timer expired Start new NAV timer NAV received NAV timer expired
CS_IDLE CS_BUSY Update NAV timer Update NAV timer CS_IDLE
Back-Off Manager SM
No Back-Off Back-Off Running Back-Off Paused Initialize Back-off counter (CS_BUSY)Signal “back-off zero” to TC Initialize Back-off counter (CS_IDLE) CSM signals CS_BUSY CSM signals CS_IDLE
CSM - Channel State
Manager
TC – Transmission
Coordination
Transmission
Reception
Transmission Coordination SM
TC_IDLE Data queued? Wait for CTS Wait SIFS Transmit RTS RTS Pending Data Pending Transmit Data Back-off needed RTS needed Retry Limit Reached Back-off needed Yes No No No No Back-off zero Yes Yes YesFrame transmission request from upper layers
CTS timer expired
Start Back-off counter RTS – Request To Send
CTS – Clear To Send SIFS – Short IFS
Reception Coordinator SM
RC Idle
Wait TX Wait SIFS
No NAV or Unicast data
frame received Transmission complete