An Improved Routing Algorithm of Zigbee Wireless Sensor Network for Smart Home System Dexing Zhong, Wei Ji, Yongli Liu, Jiuqiang Han
Shengbin Li
Ministry of Education Key Lab for Intelligent Networks and Network Security Xi’an Jiaotong University 28 XianNing West Road, Xi’an, 710049 P. R. China Email:
[email protected]
State Key Laboratory of The Health Ministry for Forensic Sciences Xi’an Jiaotong University 76 Yanta West Road, Xi’an, 710061 P. R. China
Abstract—Smart home is a networked intelligent living environment which employs a house as the platform to integrate automatic control system, computer network system and communication technology all-in-one. In order to avoid the constraints of cabling, moving and aesthetics in the traditional smart home system using wired network, a design of smart home network based on Zigbee wireless sensor network technology is demonstrated in this paper. An improved routing algorithm combining Cluster-Tree and AODVjr is proposed for Zigbee wireless network. Therefore a more convenient and reliable wireless communication environment is achieved in the smart home system.
I. I NTRODUCTION Smart home is an intelligent living system which employs a family home as the platform to integrate cabling, network communications, automatic control, audio and video, security and defense technology [1]. Usually the smart home has many useful functions for a better life experience, e.g. appliances control, residential video intercom, home information integration, automatic security precautions and so on. Smart home integrates the distributed devices into network to implement convenient, efficient and safe control. Therefore it can greatly enhance the convenience, safety and artistic of daily life. The concept of smart home can be considered as deriving from the 1980s. With the rapid development of electronic technology, such as television, telephone, air conditioning, refrigerators and other large electrical devices into the home environments, it greatly enhanced the efficiency and interesting of family life. At that time, people felt the power of technology and expected more electronic devices into the family life to replace the traditional equipment, resulting in the concept of Home Electronics (HE). However with the number and category of appliances increasing, it brings troubles for home applications. On the one hand it causes inconvenient to use the appliances since they are scattered in every corner of the rooms, on the other hand it causes confusion when control similar appliances. As a result, there are urgent needs to integrate the appliances together in certain way. Through a unified terminal for implementation of distributed control, thus one can get rid of the space constraint and remotely control the different equipments. So the concept of Home Automation
(HA) is gradually proposed. During the late 1980s, with the development of control and communication technologies, home appliances, communication equipment and security equipment can be integrated for remote monitor, control and management online. This is the prototype of Smart Home [2]. As technology advances, nowadays the smart home system has become increasingly comprehensive and complex. However no matter what the smart home system is, all forms need the network to connect the distributed devices for the implementation of centralized control. Therefore the network structure is the core component of the smart home. According to the different manners of network, it can be divided into wired network, wireless network and hybrid network [3]. (1) Wired Network The traditional and widely used smart home network is the wired network which uses telephone lines, cable or Ethernet cable to set up the communication network. And it is able to ensure the signal transmission and control effects via a wired connection agreements. Currently the common wired connection protocols are the data communication protocol for Building Automation Control network (BACnet), Digital Home Working Group (DHWG), European Installation Bus (EIB), Home Bus System (HBS) and Power Line Carrier (X10) [4]. Wired network is easy to implement, but it requires cumbersome wiring, so that the cost is higher and it is not conducive to the aesthetics of the family and the flexibility of the equipments. Fig. 1 shows a typical smart home system based on the TCP/IP wired network. (2) Wireless Network The commonly used wireless protocols are the infrared connection, Bluetooth, Wi-Fi, and the wireless sensor network represented as Zigbee. Wireless networking can overcome the space constraints of traditional wired networking problems, the device can be arranged freely in every place of the home for flexible control without compromising aesthetics. (3) Hybrid Network Applying wired network and wireless network in the same system, it makes the system more practical value by taking benefits of the flexible control of wireless network as well as the convenience and reliability of wired network for lighting, curtain, door locker and other stationary applications.
mance of the communication is closely related to the structure of the network. Therefore the design of the network structure is the primary task of the smart home system. A. Common architecture of Zigbee network Zigbee standard provides three types of network topologies, namely star, mesh and cluster-tree structures[8]. (1) The Star Network based on the central communication Topology is shown in Figure 2. Star Network has a unique network coordinator, and the sensor nodes only communicate with the coordinator, they can not communicate between each other. The characteristic of Star Network are simple structure, convenient design, direct information transmission and small delay.
Fig. 1.
A smart home system based on TCP/IP wired network
Wireless sensor network (WSN) derives from ”low-power wireless integrated micro-sensors” proposed by Prof. William J Kaiser of UCLA in 1996 [5]. Subsequently, Prof. Gregory J Pottie of UCLA re-interpreted the meaning of wireless sensor network from the perspective of network research. The next decades, wireless sensor network technology has attracted wide attention from academia, industry and even governments, and it quickly became one of the most promising core technologies in military, smart home, health care, environmental monitoring and forecasting, structural monitoring, urban transport, space exploration and other areas [6]. In 2002, ”Zigbee Alliance” has been established consisting of the world’s leading semiconductor manufactures, technology providers, technology integrators and the end-users. They began the design of the network application specifications with high-reliable, cost-effective, low power consumption based on IEEE802.15.4 protocol. In 2004, the first Zigbee V1.0 came out, although it is not perfect in many respects, it has became the mark of the birth of Zigbee wireless sensor network. In 2006, a new protocol is proposed which can be considered as the new development of WSN in the field of sensor control technology [7]. Compared with other wireless smart home networking, Zigbee is more suitable for the field of intelligent appliances control, since it has many obvious advantages as following: (1) Low power consumption, (2) Low-cost, (3) Low transmission rate, (4) Short range, (5) Short delay, (6) High capacity and (7) High security. The rest of this paper is organized as following: topology of Zigbee wireless network is reviewed in Section 2 and routing algorithm of Zigbee wireless network is described in Section 3. Finally, we conclude this study in Section 4. II. T OPOLOGY OF Z IGBEE W IRELESS N ETWORK Zigbee is the core communication network of the smart home system. Due to the environmental impact, the perfor-
Fig. 2.
Star Network
(2) The mesh network based on the peer communication Topology is shown in Figure 3. Mesh Network is a peer communication network where nodes can interconnect with each other, and each node has the forwarding function. The characteristic of Mesh Network are the multi-hop transmission of the information and the high reliability of the communication.
Fig. 3.
Mesh Network
(3) The cluster-tree integrated network
Topology is shown in Figure 4. Cluster-Tree Network is the combination of Star and Mesh Networks. There are coordinators, sensors and routing nodes in the network, the coordinator is responsible for the network management, communication occurs only between the nodes and the coordinator. Unlike the star network, the information can be forwarded by routing nodes.
Fig. 4.
Cluster-Tree Network
B. Smart Home Systems Network Architecture Analyzing the environment of home, the following features can be obtained: (1) With chamber structure varied, the range of communication varies; (2) There is no inter-communication between the controlled devices; (3) The network may be interfered by wall and other barriers; (4) The controlled devices are in scattered locations, and the number of them is up to dozens. According to the above mentioned features, in the design of the Zigbee network topology, the selected network should have reliable communication, low delay, high efficiency and fault-tolerant architecture. Firstly, Star Network has small communication delay, high efficiency, but the signal of Zigbee network is poor through walls and lack of relay transmission, therefore it leads to signal attenuation and loss in the home environment with multibarriers. Secondly, Mesh Network can ensure the reliability of transmission through a multi-hop way, but the complexity of the structure, high consumption of network maintenance and high transmission delay are not very suitable for smart home application. Thirdly, Cluster-Tree Network has the advantages of both Star and Mesh Networks, which balances the reliability and real-time factors. Through flexibly setting several redundant routing nodes in the smart home environment, the system can remain the high efficiency and small delay of Star Network,
also improve the anti-jamming capability. Therefore, ClusterTree Network is the most suitable for applying Zigbee in Smart Home System. III. ROUTING A LGORITHM OF Z IGBEE W IRELESS N ETWORK In smart home environment there are more barriers and interference, combined with the 2.4GHz band’s short-range and low-penetration, so Cluster-Tree Network is required for multi-hop transmissions, but the real-time transmission may be impacted as well. The purpose of designed routing algorithm is to find the most optimal path between the message endpoints, and ensure that messages arrive quickly and accurately. A. Common routing algorithm of Zigbee Network According to the Zigbee protocol, it provides two routing algorithms for common application, i.e. Cluster-Tree and AODVjr routing algorithms. 1) Cluster-Tree Routing algorithm: According to the Zigbee protocol, each node has two addresses. One is the 64-bit IEEE extended address, firmed in the node chip; the other is a short 16-bit PAN ID for network unique identifier. When a new node is added into the network, the coordinator node will assign a new PAN ID to the new node. In the Zigbee network, when a terminal node needs to establish communication with other nodes, firstly the message is sent to the parent node with routing function, and then forwarded by the parent node to perform routing function. Correspondingly, when other nodes need to communicate with the terminal nodes, they need to send message to the parent nodes first and then the message can be forwarded by the parent nodes. As a result, identifying the logical connection relationship between nodes, it can control the information transmission path. Cluster-Tree algorithm is to determine the logical connection relationship between nodes by the tree address allocation strategy, which is benefit to find the next hop node for the transmission of information [8]. According to Cluster-Tree algorithm, the address of each node within the network is assigned by parent node using a distributed address allocation scheme. Firstly, parent node calculates the node address parameter according to Eqn. 1 as following: { 1 + 𝐶𝑚(𝐿𝑚 − 𝑑 − 1), 𝑅𝑚 = 1 𝐶𝑠𝑘𝑖𝑝(𝑑) = 1+𝐶𝑚−𝑅𝑚−𝐶𝑚×𝑅𝑚𝐿𝑚−𝑑−1 , otherwise 1−𝑅𝑚 (1) where: Cskip(d) — the node address parameter Cm — the maximum of child nodes of the parent node Rm — the maximum of routing nodes of the parent node Lm — the length of the network d — the current length of the node If the new node i is the terminal node, since it does not have the routing function, it will be assigned as the 𝑛𝑡ℎ child node of the coordinator, its parent node j assigns the node address according to Eqn. 2 𝐴𝑖 = 𝐴𝑗 + 𝐶𝑠𝑘𝑖𝑝(𝑑) × 𝑅𝑚 + 𝑛, 1 ≤ 𝑛 ≤ (𝐶𝑚 − 𝑅𝑚) (2)
If the new node i is the routing node, its parent node j will assign the node address according to Eqn. 3 𝐴𝑖 = 𝐴𝑗 + 𝐶𝑠𝑘𝑖𝑝(𝑑) × (𝑛 − 1), 1 ≤ 𝑛 ≤ 𝑅𝑚
(3)
Figure 5 is the diagram of assigning IP addresses by Cluster-Tree algorithm. Through the address assignment, the logic connections between nodes are established for routing and addressing without complex calculations. Allocated by Cluster-Tree algorithm the network address of each node is unique, and the address of the node is location-related to the logical topology, then addressing can be executed according to the address directly which is facilitated to apply.
(a) Flooding RREQ
(b) Selecting the least costing path
Fig. 5.
The diagram of the address allocation by Cluster-Tree algorithm
2) AODVjr Routing algorithm: The Ad hoc On-demand Distance Vector (AODV) routing protocol has become the most commonly applied protocol in the Mobile Ad hoc Network (MANET) since its fast convergence, scalability and high compatibility. AODVjr algorithm for Zigbee network application is the simplified edition based on AODV. The path discovery process of AODVjr algorithm is as follow: when node 1 needs to communicate with node 4, since the routing table does not have direct path to reach node 4, so node 1 will broadcast the Route Request (RREQ) to its neighbor nodes in order to query the path to node 4 in the neighbor node’s routing table. Neighbor node receives a RREQ packet, it updates the routing information of node 1 in the routing table and forwards the RREQ to other nodes. Through this flooding query method, node 4 will eventually receive RREQ packets from multiple nodes. Subsequently, the node 4 calculates the cost of each routing path and selects the least costing routing to store in the routing table, then by Unicast way to reply RREP packet along the reverse path. When node 1 receives the RREP packet, the whole path discovery process is completed, node 1 updates its own routing table, and then it can communicate with node 4. Routing process is shown in Figure 6. AODVjr algorithm compared to the AODV algorithm, it removes the intermediate node RREP response and improves the routing discovery efficiency. By removing periodically Hello message, it can avoid the broadcast storm. In the path maintenance, one-way communicating node needs to send data periodically to detect the integrity of the path, while
(c) Unicast RREP Fig. 6.
The diagram of the address allocation by Cluster-Tree algorithm
double-way communicating node can maintain the routing information in the communication process without additional periodic probe. Therefore, AODVjr algorithm is simple and practical that is able to adapt to in many applications with frequent changes. B. Routing algorithm for Smart Home System Although both Cluster-Tree algorithm and AODVjr algorithm have the routing detection and the path optimizing functions, there are still some deficiencies in the actual application, which mainly includes the following: (1) To assign addresses using Cluster-Tree algorithm, it can be affected by the number of the routing nodes, distribution nodes and the maximum depth of the network. While in the actual application, the network is organized in the form of Ad hoc, i.e. network nodes automatically select the best node as its parent node among the nearby nodes based on the signal strength. So the choice of non-adaptive routing algorithm will not be the optimal routing. (2) According to Cluster-Tree algorithm, the tree-level routing way will make the cluster-head node closed to the root under a greater communication load, which causes the fast
energy attenuation. When the energy of the cluster-head node is exhausted, it will lead to networking partitioning, and poor communication problems. (3) AODVjr algorithm is designed based on the symmetric links, i.e. the calculated rout is double-way reliable communication routing. However, the wireless channel is affected significantly by the environment, routing channels often appear the phenomenon that it is smooth in one direction while the opposite direction impeding. In this situation, AODVjr algorithm can not well identify the asymmetric links case. Based on the above analysis, Smart home system is improved by combining the advantages of Cluster-Tree address allocation strategy and AODVjr routing algorithm, as following: (1) The address assignment of the initial nodes of network still use Cluster-Tree algorithm to allocate, at this time it is not the optimal routing. In the subsequent message transmission, AODVjr routing algorithm is employed to fulfill the path identification and address correction. Using the integrating method, it can take full use of Cluster-Tree algorithm for fast routing calculations and AODVjr algorithm for routing discovery and maintenance. (2) Using the cluster head rotation mechanism to balance the energy consumption among the network nodes. Firstly, setting a minimum energy threshold of the cluster head node according to the needs of system, the greater the depth of the node network is, the more energy the cluster head node consumes. It can calculate the energy required for the cluster head node in the netwrok depth d by Eqn. 4 𝐸 = 𝐸𝑚𝑖𝑛 +
𝑘1 𝑑+1
IV. C ONCLUSION In this paper, the key technologies of Zigbee wireless sensor network are analyzed and discussed to satisfy the specific needs of Smart Home System. We propose an improved routing algorithm of Zigbee which is based on Cluster-Tree topology combining Cluster-Tree algorithm for fast routing and ADOVjr algorithm for routing discovery and maintenance. The cluster head rotation mechanism is employed to balance the energy consumption among nodes for extending the network survival. NLSM is applied to solve the asymmetrical link problem of AODVjr algorithm. The improved routing algorithm offers a more stable and reliable wireless communication environment for Smart Home System. ACKNOWLEDGMENT
(4)
where: 𝐸𝑚𝑖𝑛 — the minimum threshold of the cluster head node 𝑘1 — additional factor of the node’s energy consumption d — the network depth of the node For the original cluster head nodes in the network, it can reflect the energy remaining after time t by Eqn. 5 𝑘2 𝑡 𝑃 = 𝐸0 − 𝑑+1
tables of applicator nodes, it will select the node with most neighbor nodes as the new cluster head node. Finally, new cluster head node broadcasts a cluster head information for the surrounding nodes to modify the routing information. (3) Using Network Link Status Message (NLSM) of Zigbee 2007/Pro protocol to solve the asymmetrical link problem of AODVjr algorithm. The idea is as following : the routing node 1 periodically sends NLSM to the neighbor nodes, which includes the node’s neighbor table. When the node 4 receives the NLSM from node 1, it does not find the node 1 in its neighbor table, or it finds the node 1 but does not receive NLSM in a certain period of time, it can determine that the connection between node 4 and node 1 is a non-symmetrical link. As a result, it should select other options for the message transmission and avoid to use this link.
(5)
where: 𝐸0 — the initial energy of the cluster head node 𝑘2 — additional factor of the node’s energy consumption d — the network depth of the node When the cluster head node’s residual energy is less than the required energy, the cluster head node sends an application to the coordinator for a replacement. Subsequently, the coordinator node releases the cluster head competition message to all nodes, the node satisfied with the energy requirement will broadcast the message as well as the additional application for the cluster head using RREQ packet of AODVjr routing algorithm. All nodes received RREQ packet are required to reply RREP for applicator node to modify the neighbor information table, which will be sent to the coordinator later. The coordinator node receives multiple neighbor information
The authors would like to thank the anonymous reviewers for their constructive suggestions. This research is supported by “National Nature Science Foundation of China (NSFC)” Project No. 61105021 and “the Fundamental Research Funds for the Central Universities”. R EFERENCES [1] S. Park, S. Won, J. Lee et al., Smart home–digitally engineered domestic life, Personal and Ubiquitous Computing, vol. 7, no. 3, pp. 189-196, 2003. [2] V. Ricquebourg, D. Menga, D. Durand et al., The smart home concept: our immediate future, Proceedings of the 1th IEEE International Conference on E-Learning in Industrial Electronics, pp. 23-28, 2006. [3] L. Jiang, D. Liu, B. Yang et al., Smart home research, Proceedings of IEEE international conference on Machine learning and cybernetics, pp. 659-663, 2004. [4] Y. Tsou, J. Hsieh, C. Lin et al., Building a remote supervisory control network system for smart home applications, Proceedings of IEEE International Conference on Systems, Man and Cybernetics, pp. 18261830, 2006. [5] G. Pottie, and W. Kaiser, Wireless integrated network sensors, Communications of the ACM, vol. 43, no. 5, pp. 51-58, 2000. [6] M. Osipov, Home automation with ZigBee, Next Generation Teletraffic and Wired/Wireless Advanced Networking, vol. 5174, pp. 263-270, 2008. [7] D. Egan, The emergence of ZigBee in building automation and industrial control, Computing and Control Engineering Journal, vol. 16, no. 2, pp. 14-19, 2005. [8] Z. Alliance, IEEE 802.15. 4, ZigBee standard, http://www.zigbee.org.