tldr - MAC methods for IEEE 802.11 networks, MAC frame formats & MAC layer operations
MAC Methods for Ethernet Network (Recap)
CSMA/CD (Carrier Sense Multiple Access with Collision Detection)
A data link layer protocol defining the access control method for IEEE 802.3 (Ethernet) networks
How it works
Before transmission, a station listens
During transmission, the station should continue to listen
When a collision is detected, each station should stop transmission, send a “jammed” signal and re-transmit after a random interval
Problem with CSMA/CD in Wireless Networks
Cannot be used for WLAN as collisions are hard to detect
CSMA/CD requires stations to be able to transmit and receive at the same time
However, in radio systems, the transmitted signal has more power than the received signal
The signal from a transmitting station will overpower its own ability to receive a transmission
This means a transmitting station “drowns out” its own ability to detect a collision
∴ CSMA/CD cannot be used for IEEE 802.11 networks
MAC Methods for IEEE 802.11 Networks
Distributed Coordination Function (DCF)
a.k.a. CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance)
Mandatory
Contention-based
How it works
After a station has successfully transmitted a frame, all stations wait a random time for medium to clear before starting the next transmission
For IEEE 802.11b, each time slot is 20 microseconds
So, if a client’s random back-off period is 3 time slots, it has to wait for 60 ms before attempting to transmit
∴ reducing chances of a collision occurring
With radio-based LANs, a station cannot listen for collision while transmitting
∴ the receiving station has to send an acknowledgement (ACK) to the sender if it detects no errors in the received frame
If the sending station does not receive an ACK after a specified period of time, the sending station assumes a collision occured and retransmits the frame
Drawback
High overheads, as every data required acknowledgement, and lower throughput
Request To Send (RTS) and Clear To Send (CTS)
DCF incorporates the optional use of RTS / CTS protocol to reduce collisions further
How it works
Sending client sends RTS frame to AP
AP broadcasts RTS frame to receiving client, requesting for a certain amount of time to deliver data to it
RTS frame contains source, destination address and duration of transmission
Receiving client responds with CTS frame when ready
AP sends CTS frame to sending client
AP alerts all client that the medium is now reserved and they should suspend transmissions
Upon receiving CTS from AP, sending client begins transmission
Point Coordination Function (PCF)
Optional
Priority based
Suitable for time-sensitive data such as audio & video
How it works
A point coordinator in AP controls the transmission of frames from all clients
Each client is asked in sequence if it wants to transmit
If client has nothing to transmit, it returns a null data frame
Drawback
High overheads due to polling frames
802.11 MAC Frame Formats
IEEE 802.11 MAC frames are not the same as 802.3 Ethernet frames. They have different formats and functions.
Management Frames
Sets up initial communication between client and AP (e.g. association request & response)
Control Frames
Assists in delivering frames that contains data (e.g. RTS, CTS, ACK)
Data Frames
Carries info to be transmitted to client
MAC layer operations
MAC layer has 3 main roles
Discovering the WLAN
AP must transmit info about itself so clients can connect to it
Discovery process is done by passive or active scanning
Passive Scanning
The AP sends a beacon frame to announce its presence at regular interval
Client listens for beacon frame containing AP’s SSID
Active Scanning
Client sends out probe request frame and wait for probe response frame from AP(s)
Probe request frame may contain SSID of desired AP
Joining the WLAN
Client initiates the authentication and association steps of joining the network via the AP
Authentication
The process in which the AP accepts a client
AP requires client to be authenticated prior to joining the network
Open System Authentication
Basic and default method
Client sends authentication request frame to AP
AP replies with authentication response frame (contains acceptance or rejection notice)
Shared Key Authentication
AP and client given the same key in advance (Pre-Shared)
Client sends an authentication frame to AP
AP responds with an authentication frame containing challenge text
Client encrypts text with pre-shared key and responds
AP verifies the encryption key used
Association
Enables the client access to the WLAN
Client begins to negotiate a WLAN connection with AP
To join WLAN, client sends association request frame to AP
Frame includes client’s own capabilities and supported data rates
If AP accepts the request, it will reply with an association response frame
Frame includes status code and client ID number (used while client is connected)
Client has joined WLAN and can begin communicating
Re-Association (ROAMING)
Allows a device in an area covered by an AP to move to another area covered by another AP to remain connected to the network (seamless roaming)
When client determines the link to its current AP is poor, it begins scanning for another AP
It sends re-association request frame to new AP
If new AP accepts request, it will reply with a re-association response frame
New AP also sends disassociation frame to old AP
The disassociation frame terminates the old AP’s association with the client
Note: Re-Association only works in ESS wireless networks