Sie sind auf Seite 1von 6

Proceedings of the 2009 IEEE 9th Malaysia International Conference on Communications

15 -17 December 2009 Kuala Lumpur Malaysia

Performance Analysis and Simulation of MAC Layer


in WLAN
Hossain Md. Shamim 1, Abdullah Al Masud 2,
1,2
Department of Computer & Communication Engineering, International Islamic University Chittagong
158 College Road, Chawkbazar, Chittagong, Bangladesh
1
startanim@yahoo.com
2
iammasud@yahoo.com

Abstract This paper proposes and discusses the modification that all stations use the Distributed Coordination Function
and extension of the present Wireless Local Area Network (DCF) of 802.11 and they always have packets to send and it
(WLAN) to use it for communication system to enhance its is also assumed for simplicity that no delay is made in packet
performance in the Medium Access Control (MAC) layer. The transmission. We discuss some basic functions and
Medium Access Control (MAC) protocol is the primary element
parameters used in the simulation of WLAN and then the
determining how efficiently the limited communication
bandwidth of the wireless channel is shared in a Wireless Local model of our simulation is presented. Finally we show the
Area Network (WLAN). It is crucial that the MAC protocol results of the simulation.
should provide robustness and fairness among users. This paper
also discusses the simulation results for understanding the II. FUNCTIONS AND PARAMETERS IN WLAN
variation in number of transmissions and collisions for different
communication stations, packet size, mobility, difference between
A. Distributed Coordination Function (DCF)
Carrier Sense Multiple Access with Collision Avoidance (CSMA- DCF[1, 2] is a basic medium access protocol that allows for
CA) and CSMA-CA with RTS-CTS. It also shows the simulation automatic sharing between compatible Physical Layers, with
results; number of transmissions and collisions for varying the help of CSMA/CA and a random back off interval
different parameters. And also CSMA-CA and CSMA-CA with following any busy medium condition. All directed traffic
RTS-CTS cases are calculated in the simulation. For CSMA-CA uses immediate positive acknowledgment (ACK frame) where
and CSMA-CA with RTS-CTS cases, Distributed Co-ordination
the sender schedules retransmission if no ACK has been
Function (DCF) is used. In the simulation, we used three to seven
stations. Simulation duration is 10000 ms. received.

Keywords WLAN, CSMA-CA, CTS, RTS, MAC, DCF.

I. INTRODUCTION
The IEEE 802.11 WLAN technology offers the largest
deployed wireless access to the Internet. This standard by
IEEE specifies both the Medium Access Control (MAC) and
the Physical (PHY) Layers [1, 2]. The Physical layer selects
the correct modulation scheme given the channel conditions
and provides the necessary bandwidth, while the MAC layer
makes a decision in a distributed manner on how the offered
bandwidth is shared among all the stations within the
communication range. Different analytical models and
simulation studies have been done to evaluate the 802.11
MAC layer performances in different cases. These studies
mainly aim at computing the throughput of the MAC layer
and focus on its improvement. One of the most promising
models is the Bianchi model [3]. The modelling of the 802.11
MAC layer is an important issue for the evolution of this
technology. One of the major shortcomings in existing MAC
models is that the varying Physical layer conditions are not
considered in those models. The main contribution of this
paper is considering MAC layer protocols to analyze the Fig. 1 State transition for DCF using CSMA-CA.
performance of IEEE 802.11 standard varying different B. Different Inter-Frame Spacing (IFS) Parameters
parameters. We compute, for a given topology, the throughput,
the number of successful transmissions and collisions for any The time interval between two consecutive frames is called
wireless station using the 802.11 MAC protocol. We assume the IFS [1, 2]. A station shall determine that the medium is

978-1-4244-5532-4/09/$26.00 2009 IEEE 863


idle through the use of the CS function for the interval Random () = pseudo-random integer drawn from a uniform
specified. Five different IFS are defined to provide priority distribution over the interval [0, CW], CW is an integer within
levels for access to the wireless media. Fig. 2 shows some of the range of values of the Physical characteristics CWmin and
these relationships. CWmax, CWmin CW CWmax.

SIFS (short interframe space) SlotTime = the value of the correspondingly named
PIFS (PCF interframe space) Physical characteristic.
DIFS (DCF interframe space)
AIFS (arbitration interframe space)
EIFS (extended interframe space)

Fig. 2 Relationship among different IFS parameters [1, 2] Fig. 3 Random Backoff procedure[1, 2 ]

The relationships among the IFS specifications are defined


as time gaps on the medium. The associated attributes are D. NAV Settings
provided by the specific Physical. All timings that are Stations receiving a valid frame shall update their NAV
referenced from the end of the transmission are referenced (Network Allocation Vector) [1,2] with the information
from the end of the last symbol of a frame on the medium. received in the Duration field for all frames where the new
The beginning of transmission refers to the first symbol of the NAV value is greater than the current NAV value, except the
preamble of the next frame on the medium. SIFSTime and NAV shall not be updated where the RA is equal to the
SlotTime are fixed per Physical. receiving stations MAC address. Upon receipt of a PS-Poll
frame, a station shall update its NAV settings as appropriate
PIFS = SIFSTime + SlotTime under the data rate selection rules using a duration value equal
DIFS = SIFSTime + 2 SlotTime to the time, in microseconds, required to transmit one ACK
EIFS = SIFSTime + DIFS + ACKTxTime frame plus one SIFS interval, but only when the new NAV
value is greater than the current NAV value. If the calculated
duration includes a fractional microsecond, that value is
C. Backoff Time Calculation rounded up the next higher integer.
Carrier sense mechanism is used to determine the busy or
idle state of the medium. If the medium is busy, the station
shall defer until the medium is determined to be idle without
interruption for a period of time equal to DIFS when the last
frame detected on the medium was received correctly, or after
the medium is determined to be idle without interruption for a
period of time equal to EIFS when the last frame detected on
the medium was not received correctly. After this DIFS or
EIFS medium idle time, the station shall then generate a
random backoff period for an additional deferral time before
transmitting, unless the backoff timer already contains a
nonzero value, in which case the selection of a random
number is not needed and not performed.
Backoff Time = Random () SlotTime
Fig. 4 RTS-CTS/data/ACK and NAV setting[1, 2]
Where

864
III. STATE PARAMETERS FOR THE SIMULATION simulation, the following five cases can occur. The followings
In our simulation we used the following states and numbering are the cases that can occur in the simulation.
of the states is as shown below:
A: Successful transmission occurs if all steps are done.
-6: Waiting for ACK B: Collision occurs if one step is missed.
-3: DATA collision? C: Ack-collision occurs if ack is not received.
-2: ACK collision? D: Unreachable occurs if receiver is out of range.
-1: sending an ACK E: Ack-unreachable occurs if receiver is out of range.
0: idle (nothing to send)
1: Waiting for free media (have something to send)
V. RESULTS AND DISCUSSIONS
2: Free media detected, wait for DIFS
3: Random back-off A. Results for CSMA-CA Vs CSMA-CA with CTS-RTS by
4: Waiting for SIFS to send ACK varying different parameters:
5: sending successfully 1) Collision of CSMA-CA Vs CSMA-CA with CTS-RT:
6: sending to a busy station
Results for the collision of CSMA-CA Vs CSMA-CA with
7: sending to an out-of-range node
CTS-RTS are shown in Fig. 6. The maximum number of
8: sending an RTS signal/packet
collision is 2526 for CSMA-CA when there are 7 stations and
9: sending a CTS signal/packet for CSMA-CA with CTS-RTS it is 1108. For the curve
10: NAV (Net allocation vector)
CSMA-CA collision rise steadily whereas for CSMA-CA with
CTS-RTS it is almost remain flat. So according to this result
CSMA-CA with CTS-RTS is better in regarding number of
collisions.

Fig. 5 State transitions for some stations

IV. SIMULATION MODEL


Our MATLAB based simulator simulates a static two
dimensional network with wrap-around topology. Every node Fig. 6 Collision of CSMA-CA Vs CSMA-CA with CTS-RTS
transmits omni-directionally with the same radius, same
motion in milliseconds, same packet size and same PCWmin.
Around each node, a circular region exists, called the footprint, 2) Ack-Collision of CSMA-CA Vs CSMA-CA with CTS-RTS:
which defines the transmission range of the node. Nodes Results for the ack-collision of CSMA-CA Vs CSMA-CA
within transmission range of each other communicate without with CTS-RTS are shown in Fig. 7. The maximum number of
any error in the absence of packet collisions, nodes outside ack-collision is 1155 for CSMA-CA when there are 7 stations
transmission range can be interfere if they dont hear RTS or and for CSMA-CA with CTS-RTS it is 48. For the curve
CTS. The common average rate of packet generation per CSMA-CA collision rise steadily whereas for CSMA-CA with
footprint defines the load of the network. The destination of CTS-RTS it is almost remain flat. Here we also see that
each packet is one hop away, chosen at random. In addition, number of ack-collision in CSMA-CA is almost 24 times than
we assume that a successful RTS-CTS exchange guarantees a CSMA-CA with CTS-RTS. So according to this result
collision free DATA packet transmission so that the effect of CSMA-CA with CTS-RTS is better in regarding number of
packet loss does not obscure the simulation results. In the ack-collisions.

865
B. Results for CSMA-CA with CTS-RTS by varying different
parameter:
1) Transmission Vs Collision with varying stations:
Here we see results for Transmission Vs Collision with
varying stations in Fig. 9. The maximum number of collision
is 1073 when there are 5 stations and for transmission it is 328
when there are 2 stations. For the curve collision it rises
sharply till 3 stations then it rises slowly till 5 stations. For the
curve transmission it falls sharply till 3 stations then falls is
slowly till 5 stations. Here we also see that difference in
number of collision and transmission in 5 stations is huge
which is almost 67 times than transmission. So according to
this result number of collision is increases as the number of
stations increases and the number of transmission is decreases
as the number of stations increases.

Fig. 7 Ack-Collision of CSMA-CA Vs CSMA-CA with CTS-RTS

3) Transmission of CSMA-CA Vs CSMA-CA with CTS-RTS:


Here we see results for transmission of CSMA-CA Vs
CSMA-CA with CTS-RTS in Fig. 8. The maximum number
of transmission is 711 for CSMA-CA when there are 3
stations and for CSMA-CA with CTS-RTS it is 112. For the
curve CSMA-CA transmission falls steadily after 4 stations
whereas for CSMA-CA with CTS-RTS it is falling slowly. So
according to this result CSMA-CA is better in regarding
number of transmissions.

Fig. 9 Transmission Vs Collision with varying stations

2) Transmission Vs Collision with varying motion:


Results for Transmission Vs Collision with varying motion
of stations are shown in Fig. 10. The maximum number of
collision is 674 when the motion of communicating stations is
50 milliseconds and for transmission it is 348 when the
motion is 100 milliseconds and there is also another curve for
unreachable attempts and maximum number of unreachable
packets is 60 when motion is 10 milliseconds. For the curve
collision it rises sharply till 50 ms and then it remains flat till
100 ms. For the curve transmission it rises steadily till 100 ms
with slight variation in 50 ms. For the curve unreachable it
falls slowly till 100 ms. We also see that difference in number
of collision and transmission in 100 ms is almost double than
transmission. Number of collisions is increase as the motion is
decreases and the number of transmission is increases as the
number of the motion is decreases and for the number of
unreachable packets is decrease as the number of motion is
Fig. 8 Collision of CSMA-CA Vs CSMA-CA with CTS-RTS decreased.

866
4) Transmission Vs Collision with varying PCWmin size:
Here we see results for Transmission Vs Collision with
varying PCWmin or contention window size stations in Fig.
12. The maximum number of collision is 712 when PCWmin
size is 2 and for transmission it is 378 when PCWmin size 2.
For the curve collision it deceases sharply till PCWmin size is
8 with slight fluctuations when PCWmin is 4. For the curve
transmission it deceases steadily till PCWmin size is 8 with
slight fluctuations when PCWmin is 4. Here we also see that
difference in number of collision and transmission when
PCWmin is 8 which is almost double than transmission. So
collision is deceases as the PCWmin size increases and the
transmission is decreases as the PCWmin size increases.

Fig. 10 Transmission Vs Collision with varying motion of stations.

3) Transmission Vs Collision with varying packet size:


Here we see results for Transmission Vs Collision with
varying packet size in Fig. 11. The maximum number of
collision is 712 when packet size is 2 bytes and for
transmission it is 368 when packet size is 2 bytes. For the
curve collision it deceases gradually till packet size is 8 bytes
then it falls sharply when packet size is 16 bytes. For the curve
transmission it falls steadily till packet size is 4 bytes then it
falls slowly till packet size is 16 bytes. Here we also see that
difference in number of collision and transmission in packet
size 2 bytes which is almost double than transmission. So Fig. 12 Transmission Vs Collision with varying packet size.
according to this result number of collision is deceases as the
packet size increases and the number of transmission is
decreases as the packet size increases. VI. CONCLUSIONS
The numerical results reported in this project clearly show
that the CSMA-CA with RTS-CTS basic protocol suffers of
several performance drawbacks. In particular, the throughput
performance is strongly dependent on the number of stations,
motion, contention window size and packet size.
We also calculate the difference in performance for both
CSMA-CA and CSMA-CA with CTS-RTS and found that
number of transmission is increased because of less step is
needed for CSMA-CA whereas collision and ack-collision
also have increased for CSMA-CA. In comparing both
CSMA-CA and CSMA-CA with CTS-RTS we see that
collision and ack-collision is much less in CSMA-CA with
CTS-RTS. It also has another advantage that it can solve the
hidden node problem which we will implement in the future.
There is a scope to develop this simulation model and to
implement in more advanced work. We have a plan to work
on the design of directional MAC protocol that will provide:
Increased throughput
Less collision
Fig. 11 Transmission Vs Collision with varying packet size. More station can transmit at the same area
Power efficiency
Greater range

867
REFERENCES [4] J. G. Proakis, Digital Communications, 3rd ed., Mc-Grew Hill, New
York, NY, 1995.
[1] Wireless LAN Medium Access Control (MAC) and Physical Layer [5] W. Stalling: Data and Computer Communications, 5th Ed. Prentice
(PHY) specifications, Standard Specification, IEEE Std.802.11, 1999. Hall, 1997.
[2] Wireless LAN Medium Access Control (MAC) and Physical Layer [6] T. S. Rappaport, Wireless Communications: Principles and Practice,
(PHY) Specifications, IEEE Std 802.11-2007 (Revision of IEEE Std Prentice Hall, 1996.
802.11-1999) [7] Wi-Fi (2007), Wi-Fi official website <http://www.wi-fi.org/>
[3] G. Bianchi, Performance Analysis of the IEEE 802.11 Distributed [8] Bianchi, Understanding 802.11e contention-based prioritization
Coordination Function, IEEE Journal on Selected Areas in mechanism and their coexistence with legacy 802.11 stations, IEEE
Communications, Vol. 18, Number 3, March 2000. Network, pp. 28-34, 2005

868

Das könnte Ihnen auch gefallen