Wireless Networking Lab 103: 802.11 Carrier-Sense


The goal of this exercise is to understand the concept of Carrier-Sensing in IEEE 802.11 standard and compare Physical Carrier Sense and Virtual Carrier Sense mechanisms.

Recall that when Physical Carrier Sense is used, a node seeking to transmit first assesses the channel. if the energy detected on the channel is above a certain threshold (caller carrier sense threshold), the channel is deemed busy, and the node must wait. Otherwise, the channel is assumed idle, and the node is free to transmit.

On the contrary, Virtual Carrier Sense involves use of a special handshake to "reserve" the channel. The RTS/CTS mechanism in 802.11 is a Virtual Carrier Sense mechanism. To briefly summarize 802.11 RTS/CTS, the sender first sends an RTS message, and the destination replies with a CTS. Only then does the actual DATA/ACK exchange happen. Neighboring nodes that receive either the RTS or CTS set their Network Allocation Vector (NAV) so as to reserve the channel for the impending DATA/ACK transmission.

We consider the following topology:

Node A is transmitting CBR packets to node B, and node C is transmitting CBR packets to node D.

ns2 Instructions

1. Get the tcl script from here.
2. A script "csense.tcl" is provided. This script takes three command-line arguments: RTSthresh, CSthresh, and the value of x. Script usage is : ns csense.tcl -RTSthresh {RTS_Threshold} -CSthresh {carrier-sense threshold} -dist {x}
3. By setting RTSthresh to some absurdly high value (e.g. above 10000), you can effectively shut down RTS/CTS. Similarly, by setting CSthresh to the value of RXThresh, you can get "close" to removing carrier-sensing (this is due to a peculiarity of the ns2 implementation; otherwise one would expect that CSthresh be set to some absurdly large value; resultantly CSThresh must always be less than or equal to RXThresh in ns2). Supplying a negative argument causes the default ns2 value to be used.
4. Obtain the CSThresh value needed to have a carrier-sense range of 250m, 300m, 400m, 500m. This may be done by using the "threshold" utility provided with ns2 (assume TwoRayGround propagation model, and keep all other parameters at their default value).
5.For each value of CSThresh, run the simulation by shutting down RTS/CTS and for values of x=100m, 200m, 300m. Also run the simulation for each value of x using the default RTS-threshold but shutting down carrier-sense.
6. Obtain the CBR throughput in both cases.(To calculate throughput, you need to calculate [num of received packets/num of sent packets]. Go through the sections 16.1.6 and 16.1.7 of the ns2 manual for understanding and using trace files. For this particular assignment, use the commands 'grep "^s" {trace file name} | wc -l' and 'grep "^r" {trace file name} | wc -l' to get the number of sent and received packets respectively.)
7. Also examine the number of MAC collisions recorded in the trace, and the type of packet involved (CBR/non-CBR).
8. Plot the overall throughput for each run as a bar-graph. Also plot the number of CBR and non-CBR packets dropped due to collision.


IEEE 802.11 MAC mainly relies on two techniques to combat interference: physical carrier sensing and RTS/CTS handshake (also known as ”virtual carrier sensing”). Ideally, the RTS/CTS handshake can eliminate most interference. However, the effectiveness of RTS/CTS is still based on certain assumptions. This assignment should help students to understand their significance and efficacy.
Try to answer following questions-

1. Briefly discuss and what you observe from the graphs, try to explain why, and state what you conclude about the efficacy of physical and virtual CS?
2. Now consider the following topology:

The distances AB, BC, AC, and CD are all 200m.
However, now there is an obstacle between A and C that does not permit RF propagation. Do you expect that the trends seen in your simulation would continue to hold for this topology? Briefly discuss which scheme you think would perform better?


1. Overview of IEEE 802.11
2. Know ns2