Using Commodity Hardware Platform to Develop and Evaluate CSMA Protocols Amy (Mei-Hsuan) Lu Peter Steenkiste and Tsuhan Chen Carnegie Mellon University 1 Wireless Experiment is Hard Simulators Provide full control and flexibility Can suffer from lack of realism Software Defined Radio Fully programmable Considerable flexibility Steep learning curve Usually expensive Host-based MAC Simulators Realism Flexibility SDRs Alternative: Host-based MAC Use commodity hardware Sufficient for certain experiments 2 Host-based MAC Administrative tasks User-define Inter-frame spacing User-defined Random backoff Userdefined ACK Userdefined RTS/CTS Host Userdefined rexmissions Driver Inter data packet operations RTS/CTS exchange Random backoff Inter-frame spacing HW Rexmission Control transactions ACK response Card Chips reveal flexibility to do so Computing technologies advance 3 Outline Design of FlexMAC Challenges and Solutions Precision of FlexMAC Two Case Studies Conclusion 4 Capability of FlexMAC 1. generate data packets and retransmissions 2. suppress ACK channel busy SIFS RTS CTS DIFS DIFS DATA ACK 4. modify backoff distribution 5. create transactions of control messages (flexible mode) 3. change inter-frame spacing 5 Challenges Supporting Precise Scheduling Handling Delay between Dependent Transmissions Determining the Current State of Use of the Channel 6 Supporting Precise Scheduling Host posts packets to the HW HOST t6 t0 Packet arrived at HW t2 t1 t4 t3 Interrupt of TX status HW transmission time HW sends packets out ACK arrived at HW AIR 700 600 500 bus delay ≈ 20μs histogram bus delay 400 300 200 100 0 0 20 40 60 80 bus delay (usec) 100 120 7 Handling Delay between Dependent Transmissions Host posts packets to the HW HOST t6 t0 Interrupt of TX status Packet arrived at HW t2 t3 t1 HW t4 transmission time HW sends packets out ACK arrived at HW AIR histogram 1500 Interrupt latency bus delay ≈ 30μs 1000 interrupt latency 500 0 0 20 40 60 80 100 interrupt latency (TX) (usec) 120 bus delay + interrupt latency ≈ 52μs ≈ 1x 802.11b DIFS can afford dept. 802.11b data packet transmissions 8 Determining the Current State of Use of the Channel Most CSMA protocols require backoff freezing when the channel is in use Virtual carrier sense NAV is obtainable from headers of overhearing packets Physical carrier sense Leverage on-chip registers to obtain the current status of the channel 9 System Diagram Network Interface (socket) 2. Dependentother transmissions packets (e.g. re-TXs) Frame Dispatcher 1. Precise scheduling NAV Frame Scheduler Host packet pool self data packets TX Controller frame rcvd frame sent ISR Madwifi HW 3. Current channel status WNIC ISR: Interrupt Service Routing Run in the promiscuous mode 10 Disable retransmission and backoff Precision of FlexMAC Comparing a FlexMAC-based 802.11b implementation (SW MAC) with the hardware-based implementation (HW MAC) 11 Throughput Comparison sources destinations clear channel TCP UDP 2.5 2.5 SW MAC SW MAC HW MAC 2 Throughput (Mbps) 2 Throughput (Mbps) HW MAC 1.5 1 1.5 1 0.5 0.5 0 0 1 2 3 1 Total: 6.30 Mbps 3 Session ID Session ID 6.29 Mbps 2 5.91 Mbps Total: 5.88 Mbps 12 Collision Ratios sources destinations clear channel 13 Coexistence with HW MAC and FlexMAC FlexMAC FlexMAC sources destinations HW MAC clear channel HW MAC HW MAC HW MAC 14 Possible Use of FlexMAC Link-layer multi-hop relaying Fairness provision Performance improvement Differentiated services Rate adaption Network security (e.g. address spoofing) Selfish nodes detection and isolation Unequal error protection for streaming video Adaptive FEC codes to deal with channel dynamics … 15 Case Study I: Opportunistic Relaying freespace Source R R w/OR w/oOR Destination S w/OR w/oOR D R R under fading Idle nodes (relays) coexist in the network Relay(s) overhear xmissions from S to D Relay(s) retransmit on behalf of S upon failed xmissions The closest relay that overheard the packet has a higher chance to transmit 16 rate Case Study II: Fairness rate time Temporal fairness (equal share of transmission time) Ratio of TX rate = Throughput fairness (equal share of throughput) =4 Temporal fairness: We can manipulate backoff distributions to grant the green sender 4 consecutive transmissions 17 Conclusion FlexMAC provides a flexible platform for research in CSMA wireless protocols FlexMAC performs closely to HW implementations Two case studies are given to demonstrate the usefulness of FlexMAC 18 Thank You! 19 Interoperable Mode Administrative tasks 802.11b Inter data packet operations Host Rexmission Random backoff Inter-frame spacing Driver Control transactions HW RTS/CTS exchange ACK response Card Chips reveal flexibility to do so Computing technologies advance 20 Flexible Mode Administrative tasks 802.11b/g Inter data packet operations Control transactions RTS/CTS exchange Random backoff Inter-frame spacing Host Rexmission ACK response Driver HW Card Chips reveal flexibility to do so Computing technologies advance 21