Title: Department of Computer Science
1Department of Computer Science Southern Illinois
University Carbondale CS441 Mobile Wireless
Computing MAC Protocols for Wireless Networks
MANETs
Dr. Kemal Akkaya E-mail kemal_at_cs.siu.edu
Some slides are adapted from CS 851
Seminar University of Virginia www.cs.virginia.edu
/cs851-2/course.html
2What is MAC? / Why need it?
- Wireless Channel
- Open and broadcast medium
- Limited bandwidth
- Multiple users would like to use it at the same
time - Each user desires a high capacity for use
- Solution?
- Share the channel among multiple
users/devices/computers - MAC Protocols
- The algorithms and protocols that enables this
sharing by multiple users and controls/coordinates
the access to the wireless channel (medium) from
different users are called MEDIUM ACCESS, or
MEDIA ACCESS or MULTIPLE ACCESS protocols,
techniques, schemes, etc.
A
C
B
D
Who will transmit and when
MAC protocols organize it
3Background from Wired Links
- Three broad classes for MAC
- Channel Partitioning
- Divide channel into smaller pieces (time slots,
frequency, code) - Allocate piece to node for exclusive use
- TDMA, FDMA, CDMA
- Random Access
- Channel not divided, allow collisions
- Recover from collisions
- CSMA, CSMA/CD, CSMA/CA
- Taking turns
- Nodes take turns
- Nodes with more to send can take longer turns
- Token Ring, Polling
- What do we expect from a MAC protocol?
- Limited Delay
- High Throughput
- Fairness
- Stability
- Scalability
- Robustness against channel fading
- Low power consumption
- Will see in Sensor Networks
- Support for multimedia
- QoS in High Speed Networks
4Problems in Wireless Environments
- Can we use those protocols in wireless
environments? - Partially
- We have different problems
- Half-Duplex Operation
- Send and receive can not be at the same time
(FDD, TDD) - Time Varying Channel
- Due to multipath fading
- Burst Channel Errors
- Multiple bit errors in the transmitted data
- Packet Loss
- Location Dependent Carrier Sensing
- Hidden Terminal
- Exposed Terminal
- Limited battery lifetime
- More crucial in sensor networks
5Problem with Random Access Protocols
- The following divide channel into smaller
pieces (time slots, frequency, code) and can be
used - TDMA
- FDMA
- CDMA
- They are not very efficient, not preferred
- Random access is more popular but cannot be used
- Due to hidden exposed terminal problem
- Contention/collision will occur at receiver side
- Carrier sense (send side) approach is
inappropriate for wireless networks - What does this mean?
6Hidden Terminal Problem
As range
Cs range
B
C
A
Hidden terminal
- A is transmitting to B
- C is sensing the carrier and detects that it is
idle - It can not hear As transmission
- C also transmits and collision occurs at B
- A is hidden from C
7Exposed Terminal Problem
Bs range
Cs range
B
C
A
D
Exposed terminal
- B is transmitting to A. C is hearing this
transmission - C now wants to transmit to D. It senses the
existence of carrier signal and - defers transmission to D
- However, C can actually start transmitting to D
while B is transmitting to A - Since A is out of range of C and Cs signals can
not be heard at A - C is exposed to Bs transmission
8Classification of Wireless MAC Protocols
9Distributed MAC Protocols
Centralized MAC Protocols
- Collision avoidance mechanisms
- Collision avoidance with out-of-band signaling
- Collision avoidance with in-band control messages
- Two distributed random access protocols
- DFWMAC Distributed Foundation Wireless MAC (used
in IEEE 802.11) - EY-NPMA Elimination Yield-Nonpreemptive Priority
Multiple Access (used in HyperLan)
- Work for centralized wireless networks
- Base station has explicit control for who and
when to access the medium - All nodes can hear from and talk to base station
- All communications go through the base station
- The arbitration and complexity are in base
station - Centralized TDMA
10MACA
- A New Channel Access Method for Packet Radio,
Phil Karn, 1990 - Multiple Access with Collision Avoidance
- 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
CSMA/CA
MA/CA
MACA
11Three-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 - Nodes overhearing CTS keep quiet for some time to
allow B to receive data packet
- Assumptions
- Symmetry
- A can hear from B ? B can hear from A
- No capture
- No channel fading
- Packet error only due to collision
- Data packets and control packets are transmitted
in the same channel
RTS
1
CTS
DATA
2
3
D
C
B
A
RTS Request To Send
E
CTS Clear To Send
12More 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 As 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 Bs CTS, set a timer which is long
enough to allow B to receive data packet. - E overhears As RTS and Bs 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 - Note no carrier sense
13Possible Collisions
14Possible Collisions-2
15Summary
- MACA still not adequate in solving hidden
exposed terminal problems - MACA did not provide specifications about
parameters - What are RTS, CTS packet sizes, timers etc.?
- What is initial backoff window size?
- A lot things need to do if using MACA
- Solution
- MACAW A Media Access Protocol for Wireless Lans
- V. Bharghavan, A. Demers, S. Shenker, and L.
Zhang (Sigcomm 1994)
16MACAW
- Goals
- This paper refined and extended MACA
- Main Contributions
- Modified control messages
- Four-way handshake (reliable, recover at MAC
layer) - Five-way handshake (relieve exposed terminal
problem) - RRTS (unfairness)
- Modified back-off algorithms
- Multiplicative increase and linear decrease
(MILD) - Synchronize back-off counter using piggyback
message - Revisit Hidden Terminal Problem
- To recover packet loss at transport layer is too
slow - Recover at MAC layer is more fast
- Need ACK from destination
- Revisit Exposed Terminal Problem
- Provide fairness
17Four-Way Handshake
- Sender sends Ready-to-Send (RTS)
- Receiver responds with Clear-to-Send (CTS)
- Sender sends DATA PACKET
- Receiver acknowledge with ACK
- RTS and CTS announce the duration of the transfer
- Nodes overhearing RTS/CTS keep quiet for that
duration - Sender will retransmit RTS if no ACK is received
- If ACK is sent out, but not received by sender,
after receiving new RTS, receiver returns ACK
instead of CTS for new RTS
destination
source
18Revisit Exposed Terminal Problem
- RTS/CTS/DATA/ACK can not solve exposed terminal
problem - When overhearing RTS, a node doesnt overhear CTS
- It needs to wait longer enough to allow the data
packet being completely transmitted. - To relieve exposed terminal problem
- Let exposed terminal know the DATA packet be
transmitted - Extra message DS (data send)
- Five Handshaking to let exposed terminal know how
long it should wait - RTS, CTS, DS, DATA, ACK
19Five-Way Handshake
- Sender sends Ready-to-Send (RTS)
- Receiver responds with Clear-to-Send (CTS)
- Sender sends DATA SENDING (DS)
- Sender sends DATA PACKET
- Receiver acknowledge with ACK
- RTS and CTS announce the duration of the transfer
- Nodes overhearing RTS/CTS keep quiet for that
duration
B
A
C
20Collision without DS
P2
B2
21Unfairness
- Using RTS/CTS/DATA/ACK or RTS/CTS/DS/DATA/ACK
might cause unfairness - A sends data to B D sends data to C
- A and D have enough data to send
- C can hear from B and D, but not A
- B can hear from A and C, but not D
- A is in luck and gets the channel
- D sends RTS and times out
- Backoff window for D repeatedly doubles
- For the next transmission
- A picks a random number from a smaller window
- Unequal probability of channel access
- Throughput for flow A ?B gt 90
- Throughput for flow D ? C 0
C
D
22Request for RTS (RRTS)
- Try to solve unfairness by having C do the
contending for D
C
D
23Why Uses RRTS Instead Of CTS ?
- CTS or RRTS packet size ltlt data packet size
- When nodes overhear CTS, they need to defer a
time period to allow the expected data packet
transmission - When nodes overhear RRTS, they only need to defer
a time period to overhear the expected CTS - Normal data exchange is commenced
- Use of CTS will cost long waiting indefinitely
- The node may not be ready to send data
24Evaluation of MACAW
Every flow has the same data rate 32 packet per
second
Total Throughput MACA 51.06 MACAW 70 37 higher
25IEEE 802.11 Wireless LAN Standard
- First Standard of WLANs
- IEEE Std 802.11 1999
- The 802.11 standard provides MAC and PHY
functionality for wireless connectivity of fixed,
portable and moving stations moving at pedestrian
and vehicular speeds within a local area - Usage
- Avoid the high installation and maintenance costs
incurred by traditional additions, deletions, and
changes in wired LANs - Physical and environmental necessities
- Operational environment temporary usage
- Challenges and Constraints
- Frequency allocation
- All users operates on a common frequency band
- Must be approved and licensed by the government
- Inference and reliability
- Collision begin transmission at the same time
hidden terminal multipath fading - Security
- Power consumption
- Human safety
- Mobility
26802.11 Technologies
27802.11 Architecture
- Works in Two Operational Modes
- Infrastructure Mode
- Ad-Hoc Mode
Infrastructure Mode
Access Point
Access Point
Wireless Link
Wireless Link
Wireless Link
Mobile Station
Extended Service Set (ESS)
Basic Service Set (BSS)
All traffic has to go through access
points Access point provides connectivity to the
wired backbone
28802.11 Architecture
Ad-Hoc Mode
Independent Basic Service Set (IBSS)
Mobile Stations can talk directly with
each-other. All stations in an IBSS need to be in
the range of each-other.
29802.11 MAC Sublayer
- Primary operations
- Accessing the wireless medium
- Joining the network
- Providing authentication and privacy
- Wireless medium access
- Support two different MAC modes depending on the
operational mode of the Wireless LAN - DCF Distributed Coordination Function
- Based on CSMA/CA
- Carrier Sensing Physical and Virtual.
- PCF Point Coordination Function
- Connection oriented
- Contention free service
- Polling based
DCF and PCF coexist and alternate PCF logically
sits on top of DCF
30802.11 MAC Sub-layer
- Supports both infrastructure and ad-hoc modes of
operation - CRC is added to each MAC frame
- Packet fragmentation is supported to chop large
higher layer (IP) packets into small pieces. Has
advantages - Probability a packet gets corrupted increases
with the packet size. - In case of corruption, only a small fragment
needs to be re-transmitted - 802.11b uses CSMA/CA (Carrier Sense Multiple
Access/Collision Avoidance) MAC protocol - CSMA/CA is the protocol to implement the
distributed coordination function (DCF) of the
MAC sub-layer - RTS/CTS is used to avoid collisions.
- Use of RTS/CTS can be enabled or disabled
depending on the traffic load (probability of
collisions)
31CSMA/CA Algorithm
- Sense channel (CS)
- If busy
- Back-off to try again later
- Else
- Send RTS
- If CTS not received
- Back-off to try again later
- Else
- Send Data
- If ACK not receive Back-off to try again later
- Next packet processing
- Maintain a value CW (Contention-Window)
- If Busy
- Wait till channel is idle. Then choose a random
number between 0 and CW and start a back-off
timer for proportional amount of time - If transmissions within back-off amount of time,
freeze back-off timer and start it once channel
becomes idle again - If Collisions (Control or Data)
- Binary exponential increase (doubling) of CW
32CSMA Transmission of MPDU (Data) without use of
RTS/CTS
DIFS
Data
Source
SIFS
ACK
Destination
Contention Window (Slot Times)
DIFS
Data
Others
Defer Access
Backoff afterDefer
A station backoffs a random number of slot times.
33CSMA/CA Transmission of MPDU (Data) using
RTS/CTS
DIFS
RTS
DATA
Source
SIFS
SIFS
SIFS
CTS
ACK
Destination
Others
DIFS
Defer Access for NAV(RTS)
Defer Access for NAV(CTS)
Backoff afterDefer
Defer Access for NAV(Data)
34CSMA/CA Collision Avoidance
- RTS/CTS is used to reserve channel forthe
duration of the packet transmission. This
prevents hidden and exposed terminal problems - ACK is required to understand if the packet is
correctly received (without any collisions ) at
the receiver. - Ethernet does not require ACK to be sent, since
the transmitter can detect the collision on the
channel (cable) without requiring an explicit
feedback from the receiver. - A wireless transmitter can not detect collision,
because - Transmit power is much larger than the received
power received signal is regarded as noise (not
collision) - There could be a hidden terminal
Access Point
Mobile
RTS
CTS
DATA
ACK
- Both physical carrier sensing and virtual carrier
sensing used in 802.11 - If either function indicates that the medium is
busy, 802.11 treats the channel busy - Virtual carrier sensing is provided by the NAV
(Network Allocation Vector)
35Network Allocation Vector (NAV)
- Most 802.11 frames carry a duration field which
is used to reserve the medium for a fixed time
period - Tx sets NAV to time for which it expects to use
medium - Other stations start counting down from NAV to 0
- When NAV gt 0, medium is busy
36Interframe Spacing
- 802.11 uses 4 different interframe spacings
- Interframe spacing plays a large role in
coordinating access to the transmission medium - Varying interframe spacings create different
priority levels for different types of traffic! - SIFS
- Short interframe space
- Used for highest priority transmissions RTS/CTS
frames and ACKs - DIFS
- DCF interframe space
- Minimum idle time for contention-based services
(gt SIFS) - PIFS
- PCF interframe space
- Minimum idle time for contention-free service
(gtSIFS, ltDIFS) - EIFS
- Extended interframe space
- Used when there is an error in transmission
37Channel Assignment and Registration
- In multi-access environment, the operator should
try to allocate non-overlapping channels to the
physically adjacent channels - If adjacent access points use overlapping
channels, then interference can be high - A mobile station periodically tunes to all
channels and evaluates the signal strength
received over each channel - Depending on the signal strength received over
the channels, a mobile selects an access point
and registers with that provided that the access
points accepts the mobile. This is also called
association - Re-association with a new access point occurs
when - The mobile moves away from the current access
point - When the signal conditions changes between the
mobile and current access point - When there are a lot of users associated with the
current access point
38Re-association at the PHY layer
Access Point (AP) A
Access Point (AP) B
Signal from A
Signal from B
Associated withAccess Point B
Associated withAccess Point A
Mobile tunes to the channel of AP B when it moves
into its range.
39802.11b Frame Format
IEEE 802.11b MAC Frame Format
FC(2 bytes)
ID(2)
Add1(6)
Add2(6)
Add3(6)
SC(2)
Add4(6)
Data(0-2312 bytes)
CRC(4)
Frame Control Format (2 bytes)
Protocol(2 bits)
Type(2)
Subtype(4)
To DS(1)
From DS(1)
More Frag(1)
Retry(1)
Pw Mgt(1)
More Data(1)
WEP(1)
Order(1)
Protocol Version version of 802.11
standardType Management. Control, Data
frameSubtype RTS, CTS, ACK frameTo DS 1 if
frame is sent to Distribution System (DS)From
DS 1 if frame is received from Distribution
SystemMore fragment 1 if there are more
fragments belonging to the same frame following
the current frame. Retry indicates that is
fragment is retransmission of previously
transmitted fragment. Power Management the type
of power management mode that the station will
be after the transmission of the frame. More
Data indicates that there are more frames
buffered at the sender for this station. WEP
indicates that frame body is encrypted according
to WEP. Order indicates that the frame is sent
using the strictly-ordered service class.
Frame Control (FC) protocol version and frame
typeDuration/ID (ID) power-save poll message
frame type and for NAV calculationAddress
Fields contains up-to 4 MAC addressesSequence
Control fragmentation and sequence number.
Data higher layer data that is maximum 2312
bytes. CRC 32 bit cyclic redundancy check for
detecting error on the frame.