You are on page 1of 4

A Routing Layer Number Generation and Dynamic

Routing Algorithm on Random Wireless Sensor


Network
Tan Guolin, Qiu Kaijin*, Yu Qunchao
College of Computer & Information Science
Southwest University
Chongqing, China
gl920624@swu.edu.cn

Abstract—in real life, random wireless sensor network is very multi-hop routing is accomplished by its common network
common, such as network of monitoring nodes in rural anti-theft nodes; there is no specific routing equipment. So each node
system and as well as in agriculture-forestry environmental can be both the initiator of the information and forwarder.
monitoring, and so on. Large-scale network, intensive nodes and As the nodes needing monitoring become more and more,
disorganized distribution are the features of this network. If we
it will be of challenge to adopt central point-to-point manner.
transmit data by point-to-point method on such a network, then
there exist disadvantages of large transmitting power at the It will be of more and more advantages to perform networking
monitoring nodes and high energy consumption of the nodes, so and transmission of the monitor nodes. After the networking
networking between nodes is inevitable development. Based on of the nodes, an individual node just needs to transmit data to
the characteristics of random wireless sensor network proposed the neighboring nodes, so the transmission power is small and
routing layer number generation algorithm and dynamic routing the energy consumption is low.
algorithm for random wireless sensor network, to achieve This paper presents a random wireless sensor network
transmit reliable data stably between routing nodes. implemented on microcontroller. Microcontroller as the node’s
main controller composes a random node network on which
Keywords-random wireless sensor network; dynamic routing
algorithm; routing layer number generation algorithm;
proposed routing layer number generation and dynamic
routing algorithm.
I. INTRODUCTION II. OVERALL FRAMEWORK OF RANDOM WIRELESS SENSOR
Random wireless sensor network not only has the common NETWORK
features of Ad Hoc networks’, but also has the following As is illustrated in Figure 1, the random wireless sensor
distinctive features[1][2][3][4]. network implemented by the paper is mainly composed of
a. Large-scale network. In order to obtain accurate monitor nodes, central nodes, GSM modules, smart phone
informationˈa large number of sensor nodes are usually monitor center.
deployed in the monitoring area , the number of sensor nodes
may reach hundreds of thousands, or even more. Information
obtained through different spatial perspective has greater SNR
(Signal to Noise Ratio).
b. Self-organizing network. In the application of
Random wireless sensor network, the sensor nodes are usually
placed in the place without infrastructures. Position of sensor
nodes can not be precisely set in advance and mutual neighbor
relationship between nodes also can not be known in advance,
such as sowing a large number of sensor nodes to the vast area
of virgin forest by plane or randomly placing into the
dangerous area where people can’t reach.
c. Multihop routing. Communication distance of this
network is limited, generally within the range of tens to
hundreds of meters, only can nodes communicate directly with
its neighbors. If the node wants to communicate with other
node which is outside the radio frequency coverage, it needs Figure 1. Random wireless sensor network diagram
routing through intermediate nodes. Wireless sensor networks
The hardware structure of the monitor nodes of the paper is
*
Corresponding author. E-mail address: qkjqkj@swu.edu.cn illustrated in Figure 2, including a sensor module, a
____________________________________
978-1-4799-3279-5 /14/$31.00 ©2014 IEEE


microprocessor chip, a wireless communication module, and number, and the meaning and description of each field is
power supply. The microprocessor chip adopts STC89C52, illustrated in Table II. 
which is a kind of low cost, lower energy consumption, high
performance CMOS8 bit microprocessor; the wireless TABLE I. FRAME TYPE INFORMATION
communication module adopts CC1101 which has sleep
function, low cost, lower energy consumption, and no need to
Label Types of Frame Detailed Description
apply for frequency points.
The sensors at the monitor nodes can monitor surrounding 00 Central Node Sent by the central node to awaken the
things in real time, and gain the monitor data, after the Awakening Frame monitor nodes
processing of SCM, the monitor data can be transmitted by 01 Monitor Node Sent by the monitor node
Awakening Frame
wireless communication module. The microprocessor is Routing Layer Number The central node to generate the
powered by power supply, and has power-off protection 02 Generation Frame Routing Layer number of each node
functions, so even when power is incidentally off, it can also
03 Data Frame Sent by the monitor node
switch to the standby power supply.
Sent by the central node within a
Microprocessor Wireless 04 Sleep Frame certain time when no order from the
Sensor Unit Communication smart cell phone is received.
Module
TABLE II. FRAME STRUCTURE INFORMATION

Power-off Length
Field (Byte) Detailed Description

Power Label No 1 To distinguish the data frames of different types


Serial 1 To distinguish the data frames sent at different
Number times
Figure 2. Monitor Node Hardware Structure 
ID No 6 To identify each node
The central node is special monitor node, and the hardware
structure of the central node implemented by the paper is Data 1 Data information
illustrated by Figure 3. It is also provided with a GSM wireless The distance numbers from each monitor node to
communication module and the GSM communication module Routing 2 the central node are the present routing layer
can send the information to the smart cell phones of the user, Level No number and the target routing layer number, and 1
byte each.
and remind the user in time to adopt corresponding measures. As the monitor node and the central node can form a
The central node can sent the monitoring information to the distributed network architecture, the transmission direction
remote cell phone, and the user can also control the random shall be determined if the monitor node shall transmit nodes to
wireless sensor network system via the smart cell phone, and the central nodes, the number of each monitor node in the
can also awaken or sleep each monitor node. network shall be determined.
Wireless
The routing layer number of the central node is 0, and the
Sensor 
Microprocessor
routing layer number increases gradually as per the distance
Chip Communication

Module from the central node to the monitor nodes.
Microprocessor
GSM Module Chip  B. Monitor Routing Layer Number Generation Algorithm
The routing layer number is generated from the central
 nodes to the outside, as is illustrated in Figure 4.
Power
 Standby 3
3
battery 3
Figure 3. Central Node Hardware Structure 3 2
2 3
2 2
3 2 1
2
III. THE IMPLEMENTATION OF THE DATA TRANSMISSION 1
3 1
ALGORITHM 1 2
2
Center 1
3 2
A. Frame Design 2 1
1 1 2 3
The paper designs five types of data frames, which can be 3
distinguished as per their labels, as is illustrated in Table I. 2
2
The data frame is composed of five fields, namely a label 3
number, a serial number, an ID number, data and routing layer
Figure 4. Routing Layer Number Generation


The wireless transmission powers of the central node and }
each monitor node are almost the same, and they both can if(V_layer> TempLayer){
achieve double direction transmission. To complete the V_layer= TempLayer;
algorithm, the structure of the routing layer number generation The frame with the generation label of 00, the
frame is illustrated in Table III.
routing serial number of V_routRN and the
routing layer number of V_layer is generated, and
TABLE III. ROUTING LAYER NUMBER GENERATION FRAME then the frame is sent out.
STRUCTURE
}
Serial Target Routing Layer
Label Data
Number Node No No.
C. Data Frame Transmission Algorithm
02 0 XXXX Arbitrary 0 1) Monitor Node Sending Data Frame
Suppose the node number of the monitor node is XXXX,
The four variables (the first is the level number variable and the target routing layer number is XX, and then the
V_layer, the second is the routing serial number V_routRN, contents of the data frame is illustrated in Table IV.
the third is the temporal routing layer number variable
TempLayer, and the fourth is the temporal routing serial TABLE IV. STRUCTURE OF THE DATA FRAME
number variable TempRN) set on each node are generated by Target Present
Serial Target
routing layer number. When power is on, the initial max value Label Data Routing Routing
Number Node No
Layer No. Layer No.
of the V_layer routing layer number at each node is 255, and
Monitor
the initial value of the routing serial number variable TempRN 04 0 XXXX
Data
XX XX
is 0;
The central node sends routing layer number generation The initial value of the serial number is 0; when one
frame, as is illustrated in Table 4; it starts counting when the respond frame is sent, the serial number will be added by 1
serial number is 0, and the number value returns to 0 when it is automatically, and when the value reaches 256, it will starts
256; the routing layer number V_layer of the central node is 0; from 0 again. The number of the present routing layer is the
when the neighboring node receives the frame, the procession same as the number of the target routing layer.
flows are as follows: 2) Monitor Node Transmitting Data Frame
The extracted values of the routing serial number and the When the monitor node receives the BufferFrame with an
routing layer are assigned to TempRN and TempLayer ID No. 0f 04, it shall be required to judge whether frame
respectively. Add 1 to routing layer number TempLayer. If the transmitting is demanded, and the method is as follows:
received serial number is not equal to the serial number Rule 1: If the routing layer number of its own is larger than
variable V_routRN that is saved in the node, this demonstrates the present routing layer number of BufferFrame, no
new routing layer number generation frame, and the max value procession is demanded, and the rule guarantees the data
of the updated V_layer is 255, and V_routRN is the new serial frame can transmit downward to the central node.
number value. Rule 2: If the serial number and the node number of the
Then we will compare TempLayer with the routing layer BufferFrame and the serial number and target node number of
number variable V_layer, if TempLayer is less than V_layer,
the saved data frame DataFrameLib are the same, it
this demonstrates that it is the first time to receive routing layer
demonstrates that frame has be transmitted, and no procession
frame, then the label 00 is generated, routing serial number is
V_routRN, the routing layer number is frame V_layer, and then shall be demanded, and the loop is quit. The rule guarantees
the frame is sent out. The value of TempLayer is assigned to that the frame can be transmitted only once.
V_layer. If they are the same, this demonstrated that it is the Rule 3: Frame Transmitting: the routing layer number of
routing layer number generation frame sent by the other nodes the monitor node is copied to the routing layer number of the
of the same layer, and then no treatment is required, and thus BufferFrame, and then the frame is transmitted. If there has
quit. If value of TempLayer is higher than V_layer, this been the target node number of BufferFrame in DataFrameLib,
demonstrated that it is the routing layer number generation Buffer Frame is then copied to replace the records with the
frame sent by the other nodes of the higher layer, and then no same node number in DataFrameLib, and if there is not target
treatment is required, and thus quit. node number of BufferFrame, then the BufferFrame shall be
copied to DataFrameLib. In adding, if the max capacity of
The pseudo-codes are as follows: DataFrameLib is reached, then replacement shall be performed
1) When frame with the label of 00 is received, the as per the principle of “first come, first enter”.
extracted values of the routing serial number and the routing
3) Central Node Receiving Data Frame
layer are assigned to TempRN and TempLayer respectively. If the central node receives the data frames from the
2) tempLayer= tempLayer+1; monitor nodes, then the ID number of the data frame shall be
3) if(TempRN!= V_routRN) { judged. If the ID number is 04, the serial number and the node
V_layer=255; number of the frame shall be judged for whether they have
V_routRN= TempRN; existed in the database; if they have existed, it demonstrates
that the database has accepted the data frame, and no


procession shall be required; if they do not exist, the contents frame from Node 3-10 to Node 2-9 shall be received first, and
of the data frame shall be extracted to fill into corresponding the frame from 3-13 to Node 2-9 will be discarded.
database, and then the data is received successfully. If the ID Step 3: Nodes 2-9 and 2-12 of the second layer will
number is not 04, then no procession shall be demanded, and transmit the frames.
the loop is ended. Algorithm Overall Flow Chart is illustrated Step 4: Node 1-6, 1-8 and 3-11 will transmit the frames
in Figure 5. outward, Center Node 0-0 will receive the frames transmitted
by Nodes 1-6 and 1-8, and in the figure, the frames transmitted
Central node by Node 1-6 arrives first, and then the frames transmitted by
Node 1-8 will be discarded.

Receive frame
4-14 3-13 3-1
2-12

No
ID No. 04? 3-10 1-8
2-9
2-7
Yes Discard

The first time to No


receive? 1-6 Center0-0
1-5

Yes Discard

3-4 2-3 1-2 2-1


Receive data

Forward after receiving Discard after receiving


Figure 5. Data Frame Procession Flowchart at Central Node
Figure 6. The schematic diagram passing from Node0-0 to Node1-1

D. Algorithms of Awakening Frame and Sleep Frame


Transmission V. SUMMARY
The transmission of the awakening frame is similar to the This paper studies the characteristics of random wireless
transmission of the generation frame, and where the difference sensor network, design hardware implementations of wireless
exits is that the node transmission requires the repeated sensor network system and data frame structure, proposed
sending at the awakening window time larger that the node routing layer number generation and dynamic routing
awakening window time. No procession shall be required algorithm to achieve reliable and stable transmission of data
when the awakening frame from the same layer or the higher between routing nodes.
layer is received, and each node can only transmit one
ACKNOWLEDGMENT
awakening frame each time. After being awakened, each node
shall need a certain long time to sleep again.  This work is partially supported by the Fundamental
Research Funds for the Central Universities
IV. ALGORITHM DATA ANALYSIS (NO.XDJK2011C073 and NO. XDJK2012A006).
A. Algorithm Examples REFERENCES
Suppose there are 14 monitor nodes and 1 central node, [1] Xiangyang Xu, Kejun Xu, “Research and realization of ad hoc network
the date now transmits from Center 0-0 to Node 4-14; Node4- protocol for Wireless Sensor Networks,” Hefei: HeFei University of
Technology, 2007.
14 means that the routing layer number is 4 and the ID is 14,
[2] Yibing Cai, Zhongcheng Li, “Wireless ad hoc networks MAC and
and the coding rules of other nodes are the same. The routing technology research,” Beijing:Institute of computing technology
transmitting power of the node is small, transmission can only Chinese Academy of Sciences, 2006.
to the neighboring nodes, and transmission shall be performed [3] Hao Cheng, Weishan Wu, “Research and implementation of wireless
as per the transmitting rules, as illustrated in Figure 6. sensor network based on ad hoc network protocol,” Xi’an:Xi'an
University Of Architecture And Technology, 2009. 
Step 1: the node 4-14 send frames to the nodes 3-10 and 3-
[4] Xianming Chen, Lianfeng Shen, “Vehicle control and dynamic wireless
13 whose routing layer number is 3. network protocol research,” Nanjing:Southeast University, 2005
Step 2: 3-10 and 3-13 of the third layer transmit the frame
outward, and the node 4-14 will also receive the frame, but the
discard the frame. Node 2-9 and 2-12 of the second layer will
receive the frames. The frame arriving first will be received,
and frame arriving later will be discarded. In the figure, the



You might also like