Mobile agents assisted data collection in wireless sensor networks utilizing ZigBee technology

ABSTRACT


SYSTEM MODEL
shows a WSN architecture that uses Zigbee communication to collect data. The data from the surroundings is collected by the sensor nodes. This data will then be transmitted to the routers located within the shortest communication range. Then the data from the routers will be forwarded to the coordinator and now the coordinator will connect with other networks to bring the data to the user interface.
There are many possible scenarios during data collection in sensor networks. However, in this paper we assume three scenarios. Scenario 1 is a WSN that uses many static routers to forward data from end devices to the coordinator. Scenario 2 is a WSN that only uses a mobile router moving in an existing trajectory to collect data from sensor nodes and then transfer this data to the coordinator. Scenario 3 is similar to scenario 2 however, the mobile router moves at a higher speed. The purpose of the different scenarios is to evaluate the advantages and disadvantages of each. Therefore, depending on the requirements of the actual problem to apply the scenario to specific applications in the most effective way.

OVERVIEW OF ZIGBEE
Zigbee is a wireless technology based on industry standards and was developed to enable low-power, low-cost wireless networks for machine-to-machine (M2M) and internet of things (IoT) applications. Zigbee is an open standard that was designed for applications that require low data rates and low amounts of power. This makes it possible to have a combination of implementations from various manufacturers. In actual use, however, vendors have extended and modified the functionality of Zigbee's products. As a consequence of this, it suffers from interoperability problems. Zigbee supports much lower data rates in comparison to WiFi, which is the network that connects the terminal to the high-speed network. Additionally, Zigbee utilizes the mesh topology protocol to avoid centralized equipment and construct an architecture capable of self-healing.

Network components
A ZigBee network consists of 3 types of devices: -Zigbee coordinator (ZC): this is the root device that has the ability to determine the network topology, it also shows how to generate addresses and store the address table. Each network has only one coordinator and it is also the sole component that can communicate with other networks. -Zigbee router (ZR): ZR has the functions of intermediate routing of data transmission, detection, and mapping of surrounding nodes, monitoring, control, and data collection like normal nodes. Routers are usually active modes to communicate with other elements of the network. -Zigbee end devices (ZED): these nodes only communicate with the coordinator or router near it, they are considered as the endpoint of the network and are only responsible for operating/reading information from physical (PHY) components. ZED has a simple structure and is usually sleep mode to save energy. They are only "awakened" when they need to receive or send a certain message. These devices are usually divided into 2 types: full function device (FFD) and reduced function device (RFD). Where FFD can act as a coordinator, router or end device, while RFD can only act as end device in a ZigBee network.

ZigBee topologies
The ZigBee standard has three basic network topologies, depending on the specific application that people set up the network in different topologies as shown in Figure 2: -Star network: the network only has ZC and ZED. When ZC is activated for the first time it becomes the personal area network (PAN) coordinator. Each star network has its own PAN ID to operate independently. The network has a sole ZC that connects to other FFDs and RFDs. ZEDs do not transmit data directly to each other as shown in Figure 2(a). -Tree topology: this topology is a special kind of mesh topology, where most devices are FFDs and a RFD can connect to the network as a discrete node at the end of the tree branch. Any FFD can act as a coordinator, providing synchronization signals to other devices and coordinators. Therefore, this type of network structure has high coverage and scalability. In this type of network configuration, although there can be many coordinators, there is only one PAN coordinator as shown in Figure 2(b). -Mesh network: mesh network has the advantage of allowing continuous communication and being able to reconfigure themselves around a shielded path by jumping from node to node until a connection is established. Each node in the mesh has the ability to connect and route traffic with neighboring nodes. The mesh topology is created similar to the star network, but in this network, there is the presence of ZR. ZR plays the role of data routing, and network expansion, and it also has the ability to control and collect data like a normal node as shown in Figure 2(c).

ZigBee layers
In addition to the two PHY layers and the medium access control (MAC) layer defined by the 802.15.4 standard. The ZigBee standard also has more upper layers of the system including the network layer (NWK), application support layer, device object layer, and application object layers as shown in Figure 3.
The physical layer is the lowest protocol layer and is in charge of controlling and activating the radio transceiver and selecting and monitoring the channel frequency. In addition, it is in charge of communicating with radio-based equipment. Packages are what are used to communicate either data or commands. Each physical layer (PHY) packet consists of a synchronization header (SHR), a PHY header (PHR) that contains information about the frame length, and a PHY payload. The SHR is responsible for receiver synchronization, and the PHY header contains information about the frame length (provided by the upper layer as a frame and including data or commands).
MAC layer: it is responsible for acting as an interface between the PHY layer and the NWK layer. It is accountable for generating Beacons and synchronizing devices in the network that supports beacons. A few different types of frames can be used for the MAC protocol: a beacon frame, a data frame, an acknowledgment frame, or a command frame. A MAC header, a MAC payload with an arbitrary length, and a MAC footer make up its constituent parts.  The NWK links the application layer (APL) to the MAC layer. It sets up and routes traffic through networks. It creates a new network and chooses the topology of the network. A NWK header and a NWK payload are the two components that make up the NWK framework. The header is where information regarding addressing and control at the network level is stored.
Application support sublayer (APS): it is responsible for providing a set of services by utilizing two entities: the support data application entity and the application support management entity. The application, as well as the NWK. These entities can be accessed using the appropriate service access point (SAP).
The APL is the top layer in the network structure and holds the role of storing application objects and user applications. A ZigBee device has the capacity to store as many as 240 application objects, which are used to manage and control protocol layers. Each application object can incorporate a user-created application profile 1131 or a program developed by the ZigBee consortium. Data transmission and reception within the network are the responsibilities of the APL. In the APL, each device's type and function are specified. ZigBee device objects provide the interface between application items, device formatting, and application sublayers.

ROUTING PROTOCOL IN ZIGBEE NETWORK
Configuration of tree addresses and tree addressing routing are both part of the tree routing mechanism. When the coordinator is first established in the network, it gives itself the address 0 and sets the depth parameter to 0. In the event that node (i) desires to become a part of the network and associates with node (k), then node (k) will become the father node of node (i). ZigBee's tree structure is displayed in Figure 4. The value of the nwkMaxChildren ( ) parameter indicates the maximum number of child nodes that may be associated with a router or a coordinator [25].  is what's known as a RFD, which stands for "reduced function device," and this designation indicates that it is incapable of routing. The network address will be given to the child node (n) by the parent node (k), which will take into account its depth d: where is network address of node n.
The size of each sub-block is determined based on a number of predetermined parameters, including: is the limit on the number of children that one parent is allowed to have; represents the greatest possible depth in the spanning-tree network; is the maximum number of routers that a parent is allowed to have in their family. As soon as those parameters are known, we are able to compute the size of the address sub-block at depth d, which we will refer to as , using (3): We assume that a router will send a data packet on to the destination node, which has the network address D. This router has an address on the network denoted by the A, and its network depth is denoted by the d. It will first determine whether or not this destination node is its child node by evaluating it in accordance with the expression: The address of the next hop node is as follows if the destination node is the child node of the sending node:

SIMULATION MODEL
Simulation and modeling are essential approaches to developing and analyzing systems in terms of time and cost requirements. The simulation demonstrates the system's expected behavior based on the simulation model by simulating the system under various conditions. As a result, this simulation model aims to ascertain the precise model and anticipate how the real system will behave. We will run our simulations in OPNET Modeler 14.5, the industry standard for modeling and simulation environments. This simulation tool gives users access to an all-encompassing development environment, which helps model communication networks and distributed systems. It is possible to play out a variety of scenarios using this version of the simulation.
Suppose we have N-1 routers between the source and destination hosts. Assuming that the waiting delay is negligible, the processing delay at each router and the source node is , the baud rate of each router and the source host is R bits/s, and the propagation delay per link is , then the end-to-end delay is defined as (6) and (7): where L is the packet size; where S is total size of received packets; is the time when the last packet was received; is time to receive the first packet.
where is packet loss rates; is total packets sent; is total packets received.

Simulation scenarios
In this paper, we give three simulation scenarios. -Scenario 1: we use three static routers to collect and forward data from end devices to coordinator as shown in Figure 5(a). -Scenario 2: we only use one mobile router to replace 3 static routers. The mobile router moves along a definite trajectory at a speed of 10 km/h as shown in Figure 5(b). -Scenario 3: still the same mobile router use case as scenario 2 but in this scenario the router moves at a speed of 40 km/h.

Simulations results
There are three parameters that we are interested in in the simulation scenarios above which are throughput, packet delay, and packet loss rate. Figure 6(a) shows the throughput with static routers is the blue line, and the red line is the throughput when the router moves at 10 km/h. The green line shows the throughput for the router when traveling at 40 km/h. Throughput is about 13,700 bits/s in the case of a network using three static routers. Throughput is about 6,500 bits/s in the case of a network using only one mobile router moving at a speed of 10 km/s according to the available trajectory as shown in Figure 5(b). Throughput is only about 2,300 bits/s in the case of a network using a mobile router with a speed of 40 km/h. Thus we see that, as the routers move faster, the throughput decreases. Figure 6(b) shows packet latency for the three scenarios above. The blue line represents average latency for a network scenario using three static routers. The average latency for this scenario is about 0.022 s. The red line represents the average latency for the network scenario using a mobile router traveling at 10 km/h. Average latency now is about 0.018 s. The green line represents the average latency of the scenario where the network uses a mobile router traveling at 40 km/h. The average latency for this scenario is about 0.011 s. Thus, we see that, when the network uses mobile routers, the latency parameter will be lower than when using static routers. The faster the router moves, the lower the latency.  Figure 7 shows packet loss rates in the network for three different scenarios as outlined above. Figure 7(a) shows the packet loss rate in the case of a network using three static routers, the red line shows the number of packets sent, the blue line shows the number of packets received. We see that, in the case of static routers, the packet loss rate is almost 0 %. Figure 7(b) shows the packet loss rate in the case of a network using a mobile router instead of three static routers. The mobile router moves at a speed of 10 km/h. The red line is the total number of packets transmitted; the blue line is the total number of packets received. When we send an average of 4 packets/s, we receive about 3.8 packets/s so the packet loss rate is approximately 5%.
Similar to the above scenarios, Figure 7(c) shows the packet loss rate in the case where the network uses a mobile router to travel at 40 km/h. The red line is the average number of packets sent and the blue line is the average number of packets received. As shown in Figure 7(c), we see that the average total packet sent is 5.9 packets/s but only received 2.0 packets/s so the packet loss rate is approximately 66.1%.

CONCLUSION AND FUTURE WORK
Zigbee is one of the standards suitable for sensor networks. The routing tree mechanism is mentioned and described by formulas to analyze the routing mechanism. In this paper we present different data collection methods using Zigbee communications. The simulation results are run on OPNET software to evaluate the effectiveness of different data collection methods, which are proposed in this paper. From these results, we can see that each method of data collection will be suitable for a specific application. In the future, we will study the optimization of Zigbee network routing.