COE-541 LAN / MAN Simulation & Performance Evaluation of CSMA/CA Presented by Muhamad Khaled Alhamwi
Outline Introduction & Background Simulation Model Proposed Approaches Event-Driven Approach Implementation Simulation Results Conclusions Q & A
Introduction IEEE 802.11 is the standard for Wireless LANs Has two modes of operations Point Coordination Function (PCF) Distributed Coordination Function (DCF) CSMA/CA Protocol Contention-based
CSMA/CA CSMA/CA: Carrier Sense Multiple Access with Collision Avoidance Differs from CSMA/CD: CSMA with Collision Detection Collision can not be detected Inter Frame Space (sorted by length - priority) Short (SIFS) PCF (PIFS) DCF (DIFS)
CSMA/CA If a station has data to transmit Sense medium, and if it is idle for DIFS, transmit Otherwise, defer transmission until the medium is sensed idle Invoke the backoff algorithm
Backoff Procedure A station invokes its backoff algorithm when it defers its transmission A backoff timer is chosen randomly from [0 .. CW] This timer is decremented while the medium is sensed idle When the timer reaches zero, the station transmits its frame After each unsuccessful transmission CW is doubled up to CWmax
CSMA/CA Example Station A Station B Station C Station D Station E Frame Defer Station B Frame Defer Station C Frame Defer Station D Frame Defer Station E DIFS DIFS DIFS Remaining Backoff Backoff
Simulation Model Event-driven approach Multi-threaded approach Single thread that performs all operations All operations are performed using events An event processing results in changing system state, and can result in generation of multiple other events Multi-threaded approach Each station has two threads One for packets generation The other one for packets transmission applying CSMA/CA
Event-Driven Approach (1) Event is defined in terms of Station Id Event Type Occurrence Time Example An event of packet generation for station 1 at time 500 {1, Generate_Packet, 500} Maintain an ordered list of events according to their occurrence (time)
Event-Driven Approach (2) Start Initialize Variables Create “Generate_Packet” event for every station Select Next Event(s) Check Event Type Process Event Update System Variables Is Simulation Over? Generate Report End No Yes
Event-Driven Approach (3) Available events types GENERATE_PACKET START_CSMA DEFER START_BACKOFF DEC_BACKOFF STOP_BACKOFF TRANSMIT_FRAME TRANSMIT_ACK FREE_MEDIUM RECV_ACK NO_ACK
Event-Driven Approach (4) Condition / Next Event Time Event_Type (1) Actions to be done Event_Type (2) Actions to be done Queue is empty / +1 Generate_Packet Insert packet in q … Start_CSMA Check medium … When processing “Generate_Packet” event, “Start_CSMA” event will be generated if “Queue is empty” +1 means that the event will be fired in the next time slot
Event-Driven Approach (5) GENERATE_PACKET Enqueue packet Check queue length START_CSMA Check Medium DEFER Check Medium Initialize backoff q = 0 / +1 Busy / Fin / + Inter-arrival Idle / +DIFS Idle / +DIFS Backoff > min / +1 Retry < limit/+1 q > 0 / Fin+1 TRANSMIT_FRAME Medium = Busy Fin = cur + Frame len Check queue len Check collision DEC_BACKOFF Dec Backoff Compare Backoff START_BACKOFF Check Medium Counter++ Backoff = min / +1 / +min No collision/ Fin+SIFS / Fin TRANSMIT_ACK Medium = Busy Fin = cur + ACK len RECV_ACK Remove frame Decrease CW Collision / Fin + Timeout / Fin FREE_MEDIUM Medium = Idle / Fin NO_ACK Increase CW Increase Retry
Implementation MATLAB is used as development tool Events are maintained in a sorted list List is kept sorted while adding Multiple scenarios can be created and run Results can be plotted and multiple scenarios can be compared Simulation results can be saved Simulation can be resumed later
Simulator Snapshot (1) Main GUI
Simulator Snapshots (2) Plot Results
Simulation Parameters Packet Inter-arrival Time (Exponential): 2 msec Slot Time: 20 usec SIFS: 10 usec DIFS: 50 usec Data Rate: 1Mbps CWmin: 31 CWmax: 1023 Propagation Delay: 0 Retry Limit: 7 ACK Size: 38 Bytes ACK Timeout: 500 usec Station Queue Size: 300 packets
Performance Measures LAN Throughput Collision Ratio Successful Transmission Time / Simulation Time Collision Ratio Number of collided transmissions / Overall transmissions Average Queue Length Average of queue lengths of all stations Average Queuing Time Average queuing times of all stations
Simulation Results (1) WLAN Throughput
Simulation Results (2) Collision Ratio
Simulation Results (3) Average Queue Length
Simulation Results (4) Average Queuing Time (microseconds)
Conclusions Simulator efficiency is very important to get reasonable results in a limited time period Event-Driven simulation can be very efficient when it is well implemented Multi-threaded approach is not scalable When increasing the number of stations
References (main) IEEE Std 802.11, 1999 Edition, Information technology – Telecommunications and information exchange between systems – Local and metropolitan area networks – Specific requirements. Part 11: MAC and PHY specifications A. Al-Akeel, "Optimizing Backoff Procedure for Enhanced Throughput and Fairness in Wireless LANs", MS Thesis, King Fahd University of Petroleum & Minerals 2007
Thank you Q & A