You are on page 1of 6

IMPLEMENTATION OF IEEE 802.15.

4 MODIFIED CSMA/CA
PROTOCOL ON NS3
N’Guessan Jean-Francois DEKI1, Dr Suchithra. R2
djfngs@aol.com1, suchithra.suriya@gmail.com2
JAIN
Deemed To be university
Department of Master Science (Information Technology)

Abstract--The 802.15.4 IEEE standard is one Extended IPS (EIFS), which correspond to,
among the Low Rate Wireless Personal Area for example, ACK frames, PCF control
Network (LR-WPAN) standard designed by frames, data frames, and retransmission
IEEE. the Carrier Sensing Multiple Access- frames, respectively. In 802.15.4, to avoid the
Collision Avoidance (CSMA-CA) protocol
collision of data the backoff procedure is
manage the medium access controller (MAC)
process for this standard. CSMA/CA is an
used, where each station gets a random time
algorithm that handle all packets with equal interval before its frame transmission
probability to access the data transmission CSMA-CA makes each node use a
channel. A compliant implementation of randomized waiting time before trying to
CSMA-CA protocol which follows the IEEE access the communication medium. To
802.15.4 specifications is important in order to reduce the interferences and collision in the
obtain the best quality of service (QoS). Some network the random mechanism is used. The
of the well-known Wireless Sensor Networks CSMA-CA of IEEE 802.15.4 is very widely
(WSNs) on NS3 simulation tool do not provide used in MAC protocols that are based on
a compliant. This work proposed an carrier sensing. In this algorithm, the node
implementation of the IEEE 802.15.4 modified
waits for a random time called backoff
CSMA-CA protocol.
period. The backoff period is in a range [0,
Keywords: IEEE 802.15.4 MAC, CSMA, 2BE -1], where BE (backoff exponent) that
BackOff, hidden nodes. determine the number of backoff period the
device shall wait before trying to access the
medium [16]. The CSMA-CA algorithm
I- INTRODUCTION mainly use a very small range of BE
(macMinBE – macMaxBE), where the
The 802.15.4 IEEE standard has two ways of minimum BE (macMinBE = 3) and the
access mechanisms channel: The unslotted maximum (macMaxBE = 5). This random
carrier sense multiple access with collision time variation is producing a loss of data in
avoidance (CSMA-CA) and the slotted transmission which will be retransmitted and
CSMA algorithm with a super frame create a waste of bandwidth in the network.
structure. The CSMA-CA is a contention- The proposed algorithm is implemented and
based multiple access technology that simulated in ns3 to compare its performance
requires each station to sense the medium to with the original 802.15.4 standard. The rest
be idle for a period of time before sending of the paper is organized as follow. In section
each frame. The period of time is called inter- II, the review of the recent literature for
frame space (IFS) whose length is related to research contributions that targeted on
the frame priority. The level of frame modifying the 802.15.4 standard. Section III
priorities is classified as Short IFS (SIFS), provides an overview of the modified
PCF IFS (PIPS), DCF IPS (DIPS) and CSMA-CA (RTS/CTS as well as proposed
CSMA-CA). In Section IV, the simulations mechanisms to enhance energy efficiency
conducted to analyze the performance of our and throughput of beacon-enabled mode
proposed algorithm. Finally, the conclusion 802.15.4. These mechanisms are enhanced
and future work is provided in Section V. collision resolution and enhanced backoff.
The first mechanism focuses on adjusting the
II- RELATED WORK range of backoff exponent (BE) based on
In [1], The authors propose an extension to both clear channel assessment results and
802.15.4. Their enhancements target on how packet transmission while the second
to achieve efficient power saving as well as mechanism proposes enhancement to the
reliability and channel utilization in WSNs. backoff period by shifting the range of
Basically, during channel access procedure, backoff counters to reduce unneeded backoff
the nodes try to access the wireless medium durations. However, their details can be
to initialize transmitting its packets. Once a found in [8]. Through this work, simulation
node captures the medium and completes results shown that CSMA-CA was not
sending the packets, the node should enter properly design for some characteristics and
standby state for some duration of time can be improved by the above-mentioned
denoted as LSB. The details of calculating mechanisms.
LSB can be found in [1]. This behavior can In [4], A model of discrete Markov chain that
achieve power saving and effectively reduce can dynamically represent different network
the number of contending nodes in the loads is proposed to evaluate the IEEE
network and thus reduce the level of 802.15.4 slotted CSMA/CA algorithm. By
collisions. On the other hand, the simulation computing the steady-state distribution
results show the performance of Standby probability of the Markov chain, authors
state only without comparing its results with present an evaluation formula for throughput,
802.15.4 standard or any other algorithm. energy consumption, and access latency.
In [2], The knowledge-based Exponential They further analyze the parameters that
Backoff (KEB) scheme is proposed. The influence performance like packet arrival
authors proposed KEB algorithm to enhance rate, initial backoff exponent and maximum
throughput and channel utilization based on number of backoffs. To validate the proposed
channel state information locally to each model, NS2 simulator is used to evaluate the
available node. In addition, the Exponential performance of the 802.15.4 CSMA/CA
Weighted Moving Average (EWMA) algorithm under different scenarios.
scheme is used to compute the collision rate
at any time. Backoff exponent decrease or In [6], Using OMNeT++ simulator, authors
increase based on the level of collision low or present the results of performance evaluation
high compared with a predefined threshold. of four scheduling algorithms: Random
Analytical model by using Markov Chain Select (RS), Destination Priority Queueing
model have been proposed to simulate KEB (DPQ), Longest Queue First (LQF), and
and compare its performance with BEB. The Shortest Packet First (SPF) designed for the
simulation and analytical results show the unslotted CSMA/CA algorithm to address the
improvement of KEB’s performance in terms issues of fairness and bandwidth efficiency.
of saturation throughput. From the simulation results, they showed that
under uniform traffic conditions, the LQF
In [3], The authors tackle the packet with buffer size of 13 and 78 bytes has the
collision’s problem during the slotted best performance in terms of fairness, while
CSMA-CA period and introduced two novel for throughput and packet delay, the DPQ
with the maximum buffer size of 1538 bytes Vector) is the time of occupation of node
gives the best result. Analytical studies and transmission. This mechanism helps to avoid
evaluation by simulation often fail to take the collision of data between 3 nodes trying
into account the architecture of the operating to exchange data each other. If a CTS packets
system and the stack overhead on the network is not sent, the backoff mechanism will start
protocols. On the other hand, simulators such and set a time for retransmission of data.
as Cooja and TOSSIM emulate the operation
system constraint (Contiki and TinyOS, • Proposed CSMA-CA
respectively) during the execution of the In the proposed CSMA/CA, for channel
protocols. access control three factors are maintained.
The backoff stage for the transmission of a
III- IMPLEMENTING THE frame (NB = number of backoff trials). To
MODIFIED CSMA-CA generate a time which the devices have to
• Overview RTS/CTS wait before attempting transmission (backoff
exponent = BE). The value of the slots for
When a node transmit data to another node, clear channel assessment (CCA) after the
an RTS 'Request to Send' packet is send out backoff time (contention window = CW). Let
first. The receiver node replies with a CTS n the backoff stage NB of a device, wn = 2 BEn
'Cleared to Send' packet. After the node the backoff window at backoff stage k of a
receive the CTS packet, it sends the data device, where backoff exponent BEn =1,2,3...
packets. Encoded with the RTS/CTS packets and 6 for 0 ≤ k ≤m (m = 5). Given a uniform
a field of duration. The duration field is that distribution of backoff times, the expected
the data transmission completed within the backoff time is the mean of the possibilities.
specific time period. If sender node does not That is, after c collisions, the number of
receive a CTS packet then the exponential backoff slots is in [0, 1, ..., N], where N = 2c
back off mode is executed and retransmission − 2 and the expected backoff time (in slots) is
is retried.
2

At the begin k=0, a random backoff value


among [0, w0−2] slots and the counter value
decrements automatically for each slot until
it reaches zero regardless of channel status.
The power consumption of device can be
saved in this way for medium sensing. The
device performs carrier sensing (CCA)
Figure 1: Channel access using RTS/CTS before attempting to access the wireless
frames medium. The CW starts from 1 and decreases
to 0 on idle contention window slot. If the
In the figure 1 when the source station wants contention window slot is busy, it
to send data destination stations, an RTS immediately increases backoff stage k and
packet is sent to the destination station which resets CW to one.
reply with a CTS packet if read to receive and Then, the count-down procedure with a new
then the data are exchange in between the random backoff value in between [0, wk−2],
stations. The NAV (Network Allocation and carrier sensing until the backoff stage
k=m. If the contention window slot for CCA busy results reaches
is busy at any backoff stage k, the device macMaxCSMABackoffs, the BE is
cannot have a chance to transmit the frame. increased. Second, the BE is adjusted
Depending on the ACK frame is successfully according to the result of the transmission,
received or not the transmitted frame can be and not resetting after a transmission. the BE
either success or failure (collision). For six is decreases after a successful packet
consecutive carrier sensing, if the channel is transmission. The BE when a device fails to
still sensed busy means the transmission also receive an ACK packet.
fails. Either due to busy channel or a collision IV- SIMULATION AND
When the device fails to transmission, the DISCUSSION
device is allowed to retransmit the frame up
to three times. In that case, the retransmission The performance evaluation of our
phase starts with a random backoff CSMA/CA implementation by means of
countervalue among [0, wk−2] with backoff simulation performed with the Network
stage k=0. After three retransmission failures, simulator 3. Network Simulator 3 is a flexible
the frame is dropped eventually. C++ based simulator designed for simulating
IOT device on the operating system. In the
scenario 10 node (device) are used to create
the wireless personal area network. The net
device configuration will be setup. The
proposed csma-ca will be configured after the
first test with the default csma-ca in the done.
A. Throughput Transmission

Figure 3: Throughput of the transmission


Figure 2: Flowchart of the Proposed In the figure 2, the proposed CSMA-CA has
CSMA-CA packet transmission that are better than the
The mechanism in the figure 1 adjusts the BE default one. The algorithm helps to increase
based on not only CCA results but also a the packet transmission in a better way. The
packet transmission. First, the mechanism number of packets in the default CSMA-CA
increases the BE after a fixed number of is less compare to the proposed one. The data
suites of CCA busy response, since a CCA transmission using the proposed CSMA-CA
busy result is not what expected for the give a better result than the default CSMA-
channel contention. At the time the CCA CA in network simulator 3.
B. Delay Transmission Savings: Simulation-Based Performance
Analysis," - 2011.
[2] S. Woo, W. Park, S. Ahn, S. An, and D.
Kim, "Knowledge-Based Exponential
Backoff Scheme in IEEE 802.15.4 MAC," -
2008.
[3] H. Jae Yeol, T. H. Kim, P. Hong Seong,
C. Sunghyun, and K. Wook Hyun, "An
Enhanced CSMA-CA Algorithm for IEEE
802.15.4 LR-WPANs," - 2007
[4] Wen H, Lin C, Chen ZJ et al. An
Figure 4: Delay of packet transmission improved Markov model for IEEE 802.15.4
slotted CSMA/CA mechanism - 2009
In the figure 3, after the proposed algorithm
execute, the time delay between the packet [5] Zheng J, Lee J M. A comprehensive
transmission has reduce as expected. The performance study of IEEE 802.15.4. Sensor
proposed backoff algorithm have success in Network Operations - 2006.
decreasing the time by few milliseconds
which increase the usage of the bandwidth. [6] Kim, Kyeong Soo, and Leonid G.
the proposed system has help in reducing the Kazovsky. "Design and performance
waiting time (backoff period) and increase evaluation of scheduling algorithms for
the throughput of the transmission between unslotted CSMA/CA with backoff MAC
the device. protocol in multiple-access WDM ring
networks." - 2003.
V- CONCLUSION
CSMA/CA is a protocol that have been use [7] F. Despaux, Ye-Qiong Song, Abdelkader
for the IEEE 802.11 and improve the Lahmadi. “On the Gap Between
communication between the host but the Mathematical Modeling and Measurement
implementation of this protocol into the IEEE Analysis for Performance Evaluation of the
802.15.4 need to be carefully done to respect 802.15.4 MAC Protocol. RTN “- 2013.
the 802.15.4 rule of transmission and the real
time device. Since a packet transmission in [8] Farooq, M. O., and Kunz, T. Contiki-
wireless network is subject to many Based IEEE 802.15. 4 Channel Capacity
collisions, the proposed method gives better Estimation and Suitability of Its CSMA-CA
data exchange with a better time period to MAC Layer Protocol for Real-Time
avoid the collision, which ends up enhancing Multimedia Applications - 2015.
the performance of the 802.15.4 device.
[9] Jae Yeol Ha, Tae Hyun Kim, Hong
REFERENCES Seong Park, Sunghyun Choi and Wook
Hyun Kwon, “An Enhanced CSMA-CA
[1] M. Khanafer, M. Guennoun, and H. T. Algorithm for IEEE 802.15.4 LR-WPANs”
Mouftah, "Extending Beacon-Enabled IEEE – 2007
802.15.4 to Achieve Efficient Energy
[10] D. Rohm, M. Goyal∗, H. Hosseini, A.
Divjak and Y. Bashir “A simulation-based
analysis of the impact of IEEE 802.15.4
MAC parameters on the performance under
different traffic loads” -2009
[11] Chang-Woo Pyo, Hiroshi Harada,
Shuzo Kato “Throughput Comparison of
CSMA/CA and Hybrid CSMA/CA-TDMA
in IEEE 802.15.3c WPAN”-2007

[12] Michelle X. Gong, Robert Stacey,


Dmitry Akhmetov and Shiwen Mao “A
Directional CSMA/CA Protocol for
mmWave Wireless PANs” - 2010

[13] B. H. Lee and H. K. Wu, "Study on a


delayed backoff algorithm for IEEE
802.15.4 low-rate wireless personal area
networks," Communications, IET, vol. 3, pp.
1089-1096, 2009.
[14] Z. Dahham, A. Sali, B. M. Ali, M. S.
Jahan “An Efficient CSMA-CA Algorithm
for IEEE 802.15.4 Wireless Sensor
Networks” - 2014

[15] HAUER, Jan-Hinrich. TKN15. 4: “An


IEEE 802.15. 4 MAC implementations for
TinyOS” - 2009.
[16] IEEE Standard for Information
Technology, Part 15.4; Wireless Medium
Access Control (MAC) and Physical Layer
(PHY) Specifications for Low-Rate Wireless
Personal Area Networks (LR-WPANs)
IEEE Computer Society - 2006.

You might also like