Lab c1: MAC Contention Window and RTS

Introduction

The goal of part I of this exercise is to investigate the impact of contention window size on the performance of the IEEE 802.11 MAC protocol. IEEE 802.11 specification requires all nodes to choose a random back off interval between zero and CW (contention window), and wait for the chosen number of slot times before trying to access the channel. Initially, CW is set to CWMin (minimum contention window size). However, when there is a collision, the contention window size is doubled, until a maximum value: CWMax. This technique of randomization and scaling the contention window size is used to reduce collisions. In our study however, we will consider a variant of 802.11 where the contention window size is fixed, i.e., CWMin=CWmax=CW. We will not scale the contention window, but still use randomization.

We will need a topology under which to study the effect of contention window sizes. For this, let us choose a single hop network where all nodes are in range of each other. Specifically we consider a 150m X 150m area. All nodes are involved in two Constant Bit Rate (CBR) conversations: one as source, and one as destination.

The goal of part II of this exercise is to see the effect of RTS/CTS, or virtual carrier sending. When RTS/CTS is enabled and a node has a packet to send, the node will first send out an RTS, or a Request-to-Send packet. If the receiving node receives that RTS error-free and the channel is idle, then the receiving node will respond with a CTS, or Clear-to-Send message. This tells the transmitter node that it is OK to send. This method is particularly useful when the transmitter sees the channel as idle, but the receiver does not.

For our simulation, we will use the same topology as in case 1, but we will not vary the CW size. We will vary the number of nodes (rlen), packet size, and turn RTS on and off and record the aggregate throughput.

NS2 Instructions - PART I

NS2 Instructions - PART II

Turn In

Electronically turn in a writeup with the plots and answers to the analysis questions. Expected plots are the (i) aggregate CBR throughput vs CW size for different rlen values, (ii) Packet Delivery Ratio (PDR) vs CW size for different rlen values, and (iii) (3 plots) aggregate CBR throughput vs packet size for the two RTS cases for the three rlen values. Once again, completeness and neatness are stressed.

Analysis

(PART I)This part lets you correlate the CW size and network size/density. The trend may or may not be very clear due to factors like interference with increase in density etc. Try to answer following questions with respect to the graph obtained above-
1. What trends do you observe? Do you observe any optimal CW size for each network population?
2. If yes, does the optimal window size exhibit any particular relationship with the network population?
3. Can you predict what would happen if you try to run this script for rlen = 6? Explain.
4. Could you explain what the grep command does to extract information from the trace file?

(PART II)This part lets you correlate the packet size and the throughput, for RTS on and off. The trend may or may not be very clear due to factors like interference with increase in density etc. Try to answer following questions with respect to the graph obtained above-
1. What trends do you observe? What is happening as the packet size increases? What is happening as rlen increases?
2. Is RTS more helpful when the packet size is small or large? Try to explain.
3. Explain how RTS is helpful to battle the hidden node problem? (i.e. where the receiver senses the channel is busy, but the transmitter cannot sense anything.)

References

1. What is contention window?
2. Overview of IEEE 802.11
3. Know ns2