The Research and Simulation of CSMACA Mechanism of

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Available online at www.sciencedirect.

com
Available online at www.sciencedirect.com
Procedia
Engineering
Procedia Engineering
Procedia 00 (2011)
Engineering 000–000
29 (2012) 3466 – 3471
www.elsevier.com/locate/procedia

2012 International Workshop on Information and Electronics Engineering (IWIEE)

The Research and Simulation of CSMA/CA Mechanism of


ZigBee Protocol
Shi Longlonga*, Qiu Chunlinga, Gao Penga, Jia Zhengsena,
a
College of Instrumentation & Electrical Engineering, Jilin University, No.938 Ximinzhu Street, Changchun, 130021, Jilin, China

Abstract

In order to improve the performance of star-topology ZigBee network with fewer nodes, modified the CSMA/CA
channel access mechanism of ZigBee protocol, and proposed an improved channel access mechanism - Circular
Queue access mechanism. Described and realized Circular Queue mechanism; showed the beacon frame format of
Circular-Queued. Finally, gave the simulation results, compared and analyzed the network performance of CSMA /
CA mechanism before and after the modification from network response time, throughput, packet loss rate.

© 2011 Published by Elsevier Ltd. Selection and/or peer-review under responsibility of Harbin University
of Science and Technology Open access under CC BY-NC-ND license.

Keywords: ZigBee protocol; CSMA/CA; network performance; Circular Queue

1. Introduction

ZigBee has been successfully used in industrial and life applications such as intelligent buildings,
industrial control, intelligent transportation and environmental monitoring as a wireless communication
technology. It solves the problem of channel access with the use of CSMA / CA mechanism.
Because of its uniformity of technology, highly scalability, the performance of CSMA / CA
mechanism of ZigBee Protocol in specific environments will be affected. The efficiency of CSMA / CA
mechanism is not very high when solving the conflicts that are caused by multiple devices sharing the
same channel in star-topology ZigBee network with fewer nodes, and the collision rate and backoff period
are still relatively high and long. In view of this situation, this paper presents a mechanism based on
CSMA / CA channel access mechanism - the Circular Queue mechanism, than the CSMA / CA

* Corresponding author. Tel.: +86 13578806258.


E-mail address: SLL0622@163.com

1877-7058 © 2011 Published by Elsevier Ltd. Open access under CC BY-NC-ND license.
doi:10.1016/j.proeng.2012.01.513
Shi Longlong et al. / Procedia Engineering 00
Shi Longlong/ 29 (2011)
(2012) 000–000
3466 – 3471 3467

mechanism can automatically adjust and change the parameter settings to improve the performance of
star-topology network with fewer nodes.

2. Circular Queue mechanism

2.1. Description, implementation of Circular Queue Access Mechanism

The research focus on reducing the risk of collision of CSMA / CA mechanism , and the main methods
are as follows : controls the time of backoff period, staggers the backoff period of devices, makes the
backoff periods different. The variable that controls backoff period is BE. We focusing on its beacon-
enabled mode for star-topology Time Slots network and BE is initialized with constant macMinBE. The
devices’ BEs select the same value, As a result, after the first time backoff, the probability of the second
conflict is very high. So we increased the range of BE selection to reduce the probability of choosing the
same BE value by changing the original range of 0 to 3 to 0 to 5, and dynamically adjusted the initial
value of macMinBE and BE according to different network addresses of each device, which may cause
less conflicts. By setting variable macMinBE, dynamically adjusting macMinBE ,we achieve the dynamic
adjustment of the BE value. And by senting variable ROT during the beacon frame to take into account
the fairness of the node transmission in the beacon-enabled star-topology network.
Improved mechanism described as follows :
Set variable nodes_all as the total number of nodes, then set the variable ROT that transmit in the
beacon frame, and edit a function abv (x,y)that takes subtraction and then absolutes .Use the network
address of each node minus the coordinator node’s and take the absolute value. we can get an initial
sequence number for each node with this value,and than sum with a continuous increment rotation
variable ROT. The node constantly adjust it’s final number current_order by a series operations with the
BE’s range. The variable current round number, which is later to be assigned to macMinBE and BE,
decides backoff period. Fig. 1
Start

Initialize parameters

Caculate the absolute difference value of network segment address

Caculate the current round number of the device node

Larger than aMAXBE?


N

Assign to backoff period macMimE


Y

Enter CSMA/CA

End

Fig. 1. flow chart of Circular Queue access mechanism based on CSMA/CA


3468 Shi Longlong et
ShiLonglong/ al. / Procedia
Procedia Engineering
Engineering 29 (2012)
00 (2011) 3466 – 3471
000–000

We’ll easily get the absolute value after the subtraction, and the value may be a large number. so we
need to get the remainder of total numer of nodes nodes_all using the absolute value, then sum the
rotation variable ROT and the reminder to get current round number. If the number is larger than the
specified maximum of macMinBE, give up the value. It means that the node will not be transmitted in
this round, and the CAP part in this super frame will not be transmitted because Back Period is too long.
The status variable t_status will be assigned with m_INVALID_PARAMETER, meaning it’s illegal
parameter. If the absolute value is not larger than the maximum of macMinBE, assign it to macMinBE,
then we identify the backoff period.

2.2. Beacon frame format of Circular Queue channel access mechanism

As the improved mechanism need to synchronize the backoff period of each device node in the
network, and we can get the status of Synchronization from the information with beacon transmitted from
coordinator nodes, we need to open up new parts and structures to meet the requirement of sending
information for the beacon frame. This mechanism sends the rotation variable ROT by using one byte,
and determines back period from the follow-up calculations of each device node.
The following table reveals the beacon frame format of Circular Queue channel access mechanism.
Among them, we add “The synchronization information area” to this mechanism.

Table 1. Structure of the improved beacon frame

2 bytes 1 byte 4/10 2bytes variable variable 1 byte variabl 2 byte


bytes e
Frame Frame Source Frame The Address The Beacon
control serial Addres characterizati distributio description synchronization frame FCS
field number s field on field n area of field of information payloa
GTS untreated area d field
devices

MHR(MAC layer head) MAC frame load MFR Check


code
However you can’t use this mechanism in all cases. In order to ensure that the mechanism can really
effectively operate, the duration SD of each superframe time slot must accommodate all region including
new entrants. If SD is smaller than the minimum time of beacon frame, this mechanism can not
effectively run. We can calculate the minimum beacon frame size: (2 +1 +2 +1 +2 +10) = 18 bytes from
the beacon frame format table. So the minimum time of each time slot of superframe is 18 Bytes. And
MAC layer supports a maximum of 127 bytes of data, so the duration of superframe time slot must be
within this range.

SD
Tslot =
N
SF × 2SO
= min
N
ST × N × 2SO
= min
N
= STmin × 2SO Symbols (1)
Shi Longlong et al. / Procedia Engineering 00
Shi Longlong/ 29 (2011)
(2012) 000–000
3466 – 3471 3469

Tslot :duration of single superframe time slot(Unit: symbols)


N :number of superframe time slot, the standard value is 16 generally
SD :total duration of superframe (Unit:symbols)
SFmin :Minimum duration of superframe (Unit: symbols)
STmin : Minimum duration of superframe time slot (Unit: symbols)
Assuming that 1symbols and 1bit are the same. When SO=1, SO=2, SO=3, the capacity of superframe
time slot can be calculated by the above formula:
Tslot ( so =1) = 15Byte
Tslot ( so = 2) = 30 Byte
Tslot ( so =3) = 60 Byte
No matter SO equals 2 or 3,they meet the requirements of this mechanism. In addition to a minimum of
18 bytes, there may need to transmit description field and beacon frame payload field of address of raw
device .So it is better to choose 3 for simulation and testing.

3. Simulation and Analysis

We select three wireless network performance parameters: network throughput, response time and
packet loss rate to make comparations of network performance between the original and the improved
ZigBee CSMA / CA channel access mechanism.

3.1. Simulation of Throughput and network response time

Network throughput testing is an essential tool when analyzing problems related to network
performance. Network throughput is the number of packets transmitted in unit time without packet loss.
Assuming that the frame length is l bit and the unit successfully transmitted in unit time is n, then the
throughput can be expressed as nl (bps) (bit / sec). Usually we can use the channel transmission rate R
(bps) to normalize throughput . The normalized throughput can be set by S,

l
=
S n= nT
R (2)
In the above formula, l / R is the transmission time of each frame in the channel. Ideally, frame
collision does not occur, and the inter-frame gap is zero, then nl = R, the throughput S = 1. In contrast, if
the number of frames successfully transmitted n = 0, then the throughput dropped to the minimum S = 0.
So the range of normalized throughput is 0 ≤ S ≤ 1.
Fig. 2.(a) is the throughput curve of the original CSMA / CA mechanism, Fig. 2.(b) is the throughput
curve of new mechanism. Fig. 2.(c) is the comparison between the two curves.
3470 Shi Longlong et
ShiLonglong/ al. / Procedia
Procedia Engineering
Engineering 29 (2012)
00 (2011) 3466 – 3471
000–000

(a) (b)

(c) (d)
Fig. 2.(a) Simulated throughput curve of the original CSMA / CA mechanism; (b) Simulated throughput curve of the
improved CSMA / CA mechanism; (c) comparation of the two simulated throughput; (d) comparation of the two
simulated packet loss rate

Fig. 2.(c) shows the reaction time when the network start up. From the blue box we can see that the
new mechanism starts massive data transmitting faster than the original mechanism. The new mechanism
starts to transmit data at 30.60 seconds, while the original starts at 33.30 seconds by observing the data.
In the simulation time of 200 seconds, the green line is the improved the mechanism, the red line is the
original CSMA / CA mechanism. The normalized average throughput of the original is 0.0530 in 200
seconds, while the Circular Queue channel access mechanism is 0.0550.The throughput increases 3.77%
compared to the original .With the new mechanism, we reduces the probability of collision while
transmitting between devices by assigning different Back time to different devices. The system's overall
performance has been improved to some extent.

3.2. Simulation of packet loss rate

Packet loss rate (Loss Tolerance) is the ratio of the number of lost packets with the number of data
packets sent, usually tested in the range of throughput. Packet loss rate is determined by packet length and
packet transmission frequency. The packet length Used in this test is 117 bytes, and the sending rate is
250kbps.
From Fig. 2.(d), the red line is the curve of the number of packet loss of the original CSMA / CA
mechanism when sending data in the simulation environment, while the green line is the improved in the
same environment. We can see that the number of packet loss of the improved Mechanism is less than the
old. The packet loss rate of the original mechanism is 37.12% in the simulation environment, and packet
loss rate of Circular Queue channel access mechanism is 11.45%, with 25.67% less. The data shows the
difference of backoff time reduces the number of collisions between devices, which improves the
performance at packet loss rate and transmission efficiency.
Shi Longlong et al. / Procedia Engineering 00
Shi Longlong/ 29 (2011)
(2012) 000–000
3466 – 3471 3471

4. Summary

Based on the simulation of CSMA / CA mechanism and Circular Queue Channel access mechanism
and the analysis and comparation of simulation results, this paper proves that the Circular Queue channel
access mechanism are better at reducing the probability of choosing the same backoff period by changing
the range of BE and macMinBE, transmitting the variable priority in beacon frame, and using different
network addresses of different devices. As a result, we reduced the collision rate, improved the efficiency
of information transmission. And improved performances in network throughput, network boot response
time, packet loss rate.

Acknowledgements

Thanks are given to the crew of well-ground ERT project team in College of Instrumentation &
Electrical Engineering, Jilin University for their constructive suggestions and experimental cooperation.

References

[1] Lv Zhian. The network theory and application development of ZigBee. Beijing Aerospace University Press; 2008,p. 35–37
[2] Jin Chun, Luo Zuqiu, Luo Feng,Chen Qianbin.The technology infrastructure and case studies of ZigBee. National Defense
Industry Press; 2008.
[3] Zhong Yongfeng, Liu Yongjun.ZigBee wireless sensor networks. Beijing University of Posts and Telecommunications Press;
2011.
[4] Di Lei, Liu Shengde, Hu Xianbin.The technology and application of ZigBee.. Beijing Aerospace University Press; 2007.
[5] Li Wenzhong, Duan Chaoyu. ZigBee wireless network technology practi.. Beijing Aerospace University Press; 2008.

You might also like