In this assignment you will investigate the effect of contention window on network throughput and fairness. In class the basic notion of a contention window, and how it scales from CW Min (minimum contention window size), to CW Max (maximum contention window size) has already been explained. The IEEE 802.11 spec has recommendations on how this should be implemented. However, they do not have any means on enforcing these actual contention window sizes, and the algorithm used to scale the actual window size between these two values.
The wireless interfaces we are using in the Lab are based on the Atheros chipset. This chipset uses the Madwifi driver. This card uses the thin MAC architecture which implements most of the complexity in software. This driver has the capability of specifying what the CW Min and the CW Max sizes are. Hence, we can experiment with changing these values. After the initial setup, most of the second part of the lab will use "iperf" to get data as we did in the previous assignment.
For an interesting read on how you can change contention window values to your own benefit, please refer to the paper "Selfish MAC Layer Misbehavior in Wireless networks" in IEEE Transactions on Mobile Computing, Volume 4, Number 5, September/October 2005, by Pradeep Kyasanur and Nitin H. Vaidya.
For this experiment, we will use the same 4 nodes, and modify the contention window on the source nodes. Changes have been made to the driver, which now takes two values as inputs, viz. "cwmin" and "cwmax". We have prepared a script which can take these values and load the driver accordingly. To save some key strokes this time, we will also setup the "iwconfig" options and "ifconfig" options automatically (we however expect that you know how to do this, as you learned from the previous lab).
For this particular experiment, you will change options during driver load time. However, all nodes are configured to use the same bit rate and similar wireless options.
As a first step, unload the driver which may already be present using the following command.
$ sudo /opt/ece498nhv/madwifi-cw/remove-driver.sh
Now let us see how to reload the driver with new cwmin and cwmax values. We have setup a script which can take the values from command line and instruct the driver to use these values. Say you want to set the cwmin value to 7 and cwmax value to 255, you can use the following command.
# First argument is the value of cwmin and the second of cwmax. You # should not used this command right away until asked to do so, in the # experimental procedure. $ sudo /opt/ece498nhv/madwifi-cw/insert-driver.sh 7 255
The next step is to configure the wireless interfaces and their IP addresses. On each node we have already placed a script which can do this. On any node, after loading the driver, you may execute the following command. It also shows you the exact commands being executed.
$ sudo /opt/ece498nhv/madwifi-cw/config-ath0-assn6.sh
For the experiment, we will assume that nodes A and C are transmitters and nodes B and D are receivers, similar to the previous assignment. When asked to set the contention window to a particular value, you will have to follow this procedure
1. Unload the present driver first. 2. Load driver with new contention window values. 3. Configure the node's wireless and network parameters. |
Follow the steps below to collect throughput values for different contention window sizes. You will have to repeat this procedure with different sets of values.
$ iperf -s -u -i 1
# Start flow A -> B (for 90 seconds, with packet size 64) node_a> iperf -c 192.168.20.2 -u -b 6m -t 90 -l 64 # Start flow C -> D (for 90 seconds, with packet size 64) node_c> iperf -c 192.168.20.4 -u -b 6m -t 90 -l 64
Repeat the throughput measurement procedure with the following sets of cwmin and cwmax values.
Node A | Node C | ||
---|---|---|---|
CW Min | CW Max | CW Min | CW Max |
7 | 255 | 7 | 1023 |
15 | 255 | 7 | 255 |
31 | 255 | 7 | 255 |
Please turn in all the throughput data obtained in each case. Make sure you label them, so we can understand what you turn in. Finally, explain briefly why the data looks the way it does. Also try answering the following questions.
1. Can you explain the data for each case. Could you explain why in some cases the fairness is more drastically effected as compared to the other.