Embedded WWW Server in Wireless Sensor Networks

Embedded WWW Server in Wireless Sensor Networks

Embedded WWW Server in Wireless Sensor Networks Iwona Grobelna, Michał Grobelny, Agnieszka Węgrzyn, Marek Węgrzyn University of Zielona Góra, Institut...

551KB Sizes 0 Downloads 47 Views

Embedded WWW Server in Wireless Sensor Networks Iwona Grobelna, Michał Grobelny, Agnieszka Węgrzyn, Marek Węgrzyn University of Zielona Góra, Institute of Computer Eng. and Electronics ul. Podgórna 50, 65-246 Zielona Góra, Poland, (e-mail: {i.grobelna, a.wegrzyn, m.wegrzyn}@iie.uz.zgora.pl, [email protected]) Abstract: In the paper the embedded WWW server in Wireless Sensor Networks is presented. Such dedicated WWW server runs in a mote and present data in a user-friendly form. User specifies his interests in web browser and receives as an answer a web page. This simplifies data presentation for not experienced users. In Wireless Sensor Network there may be placed multiple servers running at motes connected to a constant energy supply. This may also be used for process supervising and controlling. Keywords: Embedded systems, WWW server, Wireless Sensor Networks, FPGA, SoPC.

1. INTRODUCTION Sensor networks which sense the surrounding world are gaining nowadays popularity. They were considered as Technology Review (2003) to be one of the technologies that will have enormous influence on the future and will change the world. They are commonly used in commercial, industrial, military and medical solutions (Patel et al., 2007; Lorincz et al., 2004), as well as for monitoring natural environment (Mehta et al., 2007) or tracking animals (Xu, 2003; Culler et al., 2004). Data are being sent to the computer and a human being can read it from computer screen, often also in a graphical form. Making usage of Wireless Sensor Networks more convenient can involve retrieving the data from anywhere in the area covered with sensor network in a quick and comfortable way with any device. This can be realized by a dedicated WWW server embedded in a sensor network component and responsible for data presentation. Network technologies offer an easy-to-use interface which is an Internet service. Internet is actually a common medium used by many people on every continent, in cities and villages, at home, at school and at work, starting from small children and ending on elderly people. They all can use resources placed in the global Internet. Using Internet services for presentation of sensed data seems therefore to be fully motivated. Extending the WWW services possibilities and adding functionality for system behavior controlling gives a fully administrated system for monitoring of the surrounding world and controlling of ongoing processes. The proposed solution can be used, e.g. in miniatures parks, science parks, theme parks or heritage parks. Visitors equipped with their mobile phones or PDAs can just walk around and control on-going processes presenting some historical, geographical or chemical events. A possible communication medium between mobile phones or PDAs and sensor nodes is Bluetooth or Wi-Fi (more information in

Ferro and Potorti, 2005). Nowadays almost all available portable devices are equipped with a web browser, what makes a web interface most suitable in proposed solution. The solution can also be used in offices or hotel rooms for controlling of humidity or temperature and administrating air conditioning parameters. The paper is structured as follows. Section 2 presents the idea of using embedded WWW server to enable data presentation and process supervision in Wireless Sensor Networks. Section 3 describes simple and real-time usage scenarios, addressing also shortly the aspect of security. Section 4 focuses on the wirelessness of proposed solution and explains where our solution is different from a typical Wireless Sensor Network solution. Section 5 concerns data storage, while section 6 concentrates on in-network data aggregation mechanisms. 2. THE EMBEDDED WWW SERVER The proposed system is supposed to enable data presentation in Wireless Sensor Network and to simplify communication between user and motes. A mote has an embedded WWW server among its software. Server is responsible for communication and interaction with user. 2.1 Data presentation Main role of an embedded WWW server is receiving of requests (queries) from user’s web browser, analyzing them and gathering data needed to answer the questions. Answer is sent in form of a prepared WWW site. Web site presents sensed data and essential mechanisms enabling configuration of work parameters and sensor node’s settings. Schema of communication between a user and Wireless Sensor Network component equipped with embedded WWW server is presented in Fig. 1.

Fig. 1. User-mote communication 2.2 Process supervision Fig. 3. Schema of the communication in the system An additional control function can be supervision of processes which are being monitored by sensor nodes, where Wireless Sensor Network uses also SoC devices (System-onChip). By using WWW services the user can control the processes from any place within the network. Wireless Sensor Network components send then appropriate control signals to an addressed device using own mechanisms and return device status and answer. Use Case diagram of such an application is presented in Fig. 2.

Fig. 2. Use Case – data presentation and processes controlling Monitoring of control processes can be realized by using additional embedded FPGA element (Field Programmable Gate Array) as SoPC (System-on-Programmable-Chip). It is responsible for monitoring and controlling of technological process or it realizes functions of automata sending defined control signals. Such an integration of microprocessor and FPGA element in one device enables reprogramming the device at any time by using a web site prepared by WWW server. Communication between devices is considered in details in (Grobelny and Węgrzyn, 2006; Bukowiec and Węgrzyn, 2004). A schema of the proposed system is presented in Fig. 3. A disadvantage of such a solution is much energy consumption characteristic to FPGAs. In that case sensor node has to be equipped with big volume batteries, a rechargeable energy source or wired power supply. The summary of technical aspects of WWW server motes in proposed solution is presented in Table 1. Table 1. Technical aspects of WWW server motes in the proposed solution Area

Technology

Communication

Bluetooth / WiFi

Data processing

FPGA & microprocessor

Energy

Wired power supply

Memory

Flash

The WWW server software consists of modules responsible for basis tasks which communicate with each other. The architecture of the server is presented in Fig. 4 and short description of particular modules is presented in Table 2.

Fig. 4. Architecture of the WWW server Table 2. Modules of the WWW server Module

Role in the system

Sensing logic

Measurements

Memory manager

Measurements storage

Controlling logic

Processes control

Query executor

Executes queries

Data aggregation

Aggregation of data

Results generation

Creating of WWW site

Query analyzer

Analyzing of queries

Node-to-node interface

Communication between nodes

Communication interface

Communication with user

Sensing logic has appropriate mechanisms needed for data gathering of connected sensors – the embedded ones as well as extensional ones. Measurements are passed to memory manager module which stores them into node’s non-volatile memory. The module also retrieves the data from the storage whenever they are needed. At the same level of the system there is controlling logic module. It communicates either with embedded FPGA element or external controller. Changes of controller parameters are done on user’s request passed from query executor. Query executor behaves dependent of received request – it can retrieve data from storage or send

control commands to controlling module. Data aggregation module is responsible for aggregation of data. It is described in detail in the Section 6. Results generation is mainly creating of appropriate WWW site basing on user’s request and data gathered from query executor. Results can include status of controlled processes as well as measurements data from data storage. Queries received from user received as a properly formatted HTTP request are analyzed in query analyzer. It gathers data from appropriate request fields and transforms them to internal structures which are passed to query executor. The content of appropriate fields and its analysis is done upon to the currently running web site / service. A special protocol for communication between nodes is provided in node-to-node interface module. It runs whenever it is needed to exchange data between motes or to pass control commands to other parts of Wireless Sensor Networks. The last module – communication interface – is responsible for communication with user. It receives and handles HTTP requests and adds HTTP specific elements to generated results so that they form a web site which can be sent to the user’s web browser.

site. The request sent by the user is interpreted by the first device which will hear the message. It will then inform other motes in the vicinity about beginning of request processing to avoid multiple answers. The request for data from other motes or data which have to be gathered in the network is realized after receiving these data. The request for data from another mote can be realized in two ways. The first case is situation, when mote chosen by the user is in the vicinity and they can see each other (one-hop communication is possible). The request is then sent using internal communication mechanisms to the chosen mote which then answers the request and sends appropriate web site. A schema of the described situation is presented in Fig. 6.

3. USAGE SCENARIO Proposed solution can be used in many domains. As an example an office building can be taken. Motes are placed in office rooms and each mote senses temperature and humidity. The system user can move within the building with mobile computer or PDA (Personal Digital Assistant) equipped with suitable network module (e.g. Bluetooth) and read data from motes at any time. The only thing the user has to do is to type in a web browser an appropriate web site address in previously defined format which is then translated by a sensor node into an appropriate localization. Mechanisms for passing of addresses (IP routing, DNS services, etc.) are not discussed in this paper. A proposed address format is part1.part2, where part1 is sensor identification name and part2 is Wireless Sensor Network identification name. Example: sens1.wsn – points at mote with sens1 identification name in a Wireless Sensor Network with wsn identification name (Fig. 1). As an answer to the request the user receives measurement results from specified mote in as a user-friendly form of the generated web site.

Fig. 5. Activity diagram – data request

3.1 Simple usage scenario An activity diagram for simple data request is presented in Fig. 5. The simplicity here means that if sensor node has no appropriate data to answer data request it does not do anything. The scenario can be used only in application prototype. However in real applications all data requests should be processed further. The scenario is described in the next subsection. 3.2 Real-world usage scenario Up-to-date data and also archival data on demand will be read from node’s local memory and presented as a sent web

Fig. 6. Request realization by the appropriate sensor node The second case is situation when motes do not see each other. Then the mote which received the user request sends properly constructed data request into the network. Data gathering is then realized using mechanisms dedicated for Wireless Sensor Networks. Dedicated mechanisms are much more effective and allow maximal use of the resources. Additionally by realizing data request answer some data aggregation mechanisms (Kalpakis et al., 2002) or in-network data processing mechanisms can be used (also in the Section 6). Both mechanisms allow minimizing the amount of data

without influencing its quality. They enforce additional calculations and increased work of motes. However in many cases an additional calculation cost is given back as smaller energy consumption needed to transmit these data to request source. After receiving necessary data or after time period supposed to give an answer, mote generates a web site with measurement results and sends it to the user.

wind energy, vibration, etc.) which are nowadays becoming more popular in many life domains, also in Wireless Sensor Networks. There are still being performed some researches on energy scavenging methods for sensor network components. The solutions proposed in (Roundy et al., 2004) aim at both increasing battery volume and scavenging energy from surrounding environment by keeping small sizes of motes.

3.3. Security

5. DATA STORAGE

An additional aspect which has to be taken into account is the security of Wireless Sensor Network. It is especially important by processes controlling where the system has to be fully reliable. Despite physical security preventing from destroying devices or manipulating the vicinity to change sensor readings, the communication between motes should also be secured, so that even if an intruder snaffles the message it will be useless for him. Using cryptographic algorithms, like the one proposed by Koo et al. (2008), some security threads could be prevented. Also communication with user in case of processes controlling applications should be secured using web security mechanisms. 4. WIRELESSNESS Sensor Networks rarely work as separate systems. Usually they interact with other systems (Römer, 2004). In this case Wireless Sensor Network is only a part of the whole system. It senses the environment, stores measured values in local memory (possibly also replicates data to other motes in the vicinity) and that is all. Data gathering is realized by Sensor Network mechanisms and data presentation by the embedded WWW server. In the described scenario of using Sensor Networks not only for measurement but also for processes controlling, the usage of sensor nodes connected to constant energy source seems to be fully reasonable. Frequent measurements and data storing in the local memory result in frequent operations in data processing unit. Continuous process monitoring enforces the FPGA element (Vieira et al., 2003) to work without breaks and that consumes much energy. However possible wires will be used only as energy source for devices, communication between them will be still realized wireless. The used Sensor Network is therefore not a typical wireless network where all devices are fully wireless and therefore mobile. In the described usage scenario the motes have their own places which take into account the possibility to connect them to constant energy source. Such solution has a big disadvantage which is the necessity of ensuring appropriate infrastructure and wiring. In case of installing a system in new building wirings can be hidden in the walls and elements of Wireless Sensor Network can be placed in suitable places. However in case of installing a system in already existing and exploited building one should find some compromise between suitable places for Wireless Sensor Network components and a nice look of the room. The solution of the problem can be renewable energy sources scavenging energy from the environment (using solar energy,

The embedded WWW server works continuously and makes data available in an easy way without any additional applications. Sensor node measures surrounding environment at a constant time interval dependent of sensed parameter type and particular usage scenario. Results of measurements are stored in local memory. In the case of monitoring applications the amount of stored data can be enormous. Sample numbers of entries only for one parameter are presented in Table 3. Storing multiple parameters sensed with the same frequency will have equal amount of entries, but if they are sensed with different frequency, the total amount will be bigger. Therefore the recommended solution is to use Flash memories. Their advantages are big volume, low price and low energy consumption. An additional aspect is the fact that Flash memories are non-volatile what allows to keep the data even after node’s failure or energy run out. An easy way how to extend a mote with additional external Flash memory is presented by Mathur et al. (2006a). Table 3. Amount of entries for one parameter Sensing frequency per minute 1

Entries amount per hour 60

Entries amount per day 1440

2

120

2880

3

180

4320

12

720

17280

60

3600

86400

Unfortunately, using even Flash memories, their capacity is limited and not always all data can be stored or time to keep them can be limited. There are currently going on some researches focusing on better usage of memory. A proposal of energy efficient and memory saving system for data storing in Wireless Sensor Networks is presented by Mathur et al. (2006b). Another way to solve the problem is to place in the network one or multiple motes with extended resources and with large memory for data storing and to transport continuously or at some specified time interval data to it (Balani et al., 2005) Such a mote could also have an extended WWW server enabling to perform more operations and service more requests at the same time to help “usual” motes. In case of introducing distributed data storing where measurement data from one device are stored at multiple different devices in the vicinity an additional operation is data

replication. A mote sends synchronously packets including specified sets of measured values (with inter alia data source identification, type of measured parameter, its value and time stamp). Motes in the closest vicinity which hear the message can store particular data in local memory. It increases data redundancy and hence data security. Next they can redistribute the message further in an unchanged form or with appended own values. A restriction is here size of local memory which however in devices powered by constant energy source can be quite big. Furthermore there exist some strategies for storing data in memory, for deleting or overwriting them with new values. It is also possible to perform partial data migration from a mote with memory maximal usage to a mote which has some free place in its storage. Aspect of distributing data in Wireless Sensor Network aiming at their effective storage is presented by Luo et al. (2007). 6. IN-NETWORK DATA AGGREGATION In the case when the user is interested not in particular parameter value but in many parameter values or some statistical values, in-network data aggregation can be performed. This can reduce the communication as some of the computations can be realized at distant intermediate nodes during data flow. While combining data from different sensors some redundant data and redundant transmissions can be eliminated. Some computations have to be executed but they typically consume less energy than communication. Data aggregation can decrease the amount of data with insignificant loss of its entropy. The WWW server presents then data in a compact form and the in-network data aggregation is performed invisible for the user. The simplest mechanism is direct delivery. Each parameter value is then sent independently what causes much communication overhead. Multiple small packages are sent using the same paths. This is mostly used is situations, when the user is interested only in particular parameter values from one or couple of nodes scattered over an area in different directions. When the user has requested parameter values from different sensor nodes which are placed in the vicinity a packet merging can be performed. All measured values are then passed to the WWW server, but nodes merge own value and received values into one data packet. The sent packets can achieve large sizes, but the amount of them will be smaller than by direct delivery schema. When the user has requested some statistics, a partial aggregation can be performed. The sent packets include then only the aggregated value instead of complete set of particular measured values. The computations are executed step by step at some distant intermediate nodes. For example to compute the average temperature, it is enough that the WWW server receives only the sum of all values and number of motes which contributed to it. By duplicate sensitive operators (like sum or average) it must be ensured that there are no multiple answers from one sensor node and that a single answer is taken into account only by one neighbor. By duplicate insensitive operators (like minimal or maximal

value) multiple answers does not influence final result – they just cause communication overhead. The comparison of different data aggregation schemas is presented in Table 4. Table 4. Data aggregation schemas

Amount of sent packages Size of sent packages Energy consumption Preferable usage scenario

Direct delivery

Packet merging

Partial data aggregation

large

medium

medium

small

big

small

big

medium

small

request for small amount of data

request for multiple parameter values

request for statistics

7. CONCLUSION Embedding a WWW server in elements of Wireless Sensor Network gives the possibility to access in a simple way stored data and control monitored processes. The user can send a request to a mote any time and receive an answer without using any additional dedicated applications with everywhere available web browser. As an answer user receives data in form of a WWW service which enables back communication to modify monitored processes. By specifying properly the request, e.g. by marking chosen options or pressing some buttons, hyperlinks or menu positions, the user can get data which he is interested in. When no data are available a request for them using dedicated mechanisms will be sent to the Wireless Sensor Network. After receiving the answer from the network, the mote stores the received data in its local memory, so that it will be prepared for similar requests in the future. REFERENCES Balani, R., Han, C.-C., Raghunathan, V., and Srivastava, M. (2005). Remote Storage for Sensor Networks. NESL Technical Report. Bukowiec, A., and Węgrzyn, M. (2004). Design of logic controllers for safety critical systems using FPGAs with embedded microprocessors. In Colnaric, M., Halang, W.A., and Węgrzyn M. (Eds.). Real-time Programming 2004: a proceedings volume from the 28th IFAC/IFIP Workshop - WRTP 2004, Elsevier Ltd., Oxford, 107-112. Culler, D., Estrin, D., and Srivastava, M. (2004). Guest Editors’ Introduction: Overview of Sensor Networks. IEEE Computer, 37 (8). 41-49. Ferro, E., and Potorti, F. (2005). Bluetooth and Wi-Fi wireless protocols: a survey and a comparison. IEEE Wireless Communications. 12 (1). 12-26. Grobelny, M., and Węgrzyn, M. (2006). Implementation of WWW server in SoPC”, In Romaniuk R.S. (Ed.). Proceedings of SPIE, Photonics Applications in

Astronomy, Communications, Industry, and High-Energy Physics Experiments 2006. 6347. 63472Y1-8. Kalpakis, K., Dasgupta, K., and Namjoshi, P. (2002). Maximum Lifetime Data Gathering and Aggregation in Wireless Sensor Networks”, The 2002 IEEE International Conference on Networking – ICN 2002. Atlanta. 685-696. Koo, W.K., Lee, H., Kim, Y.H., and Lee, D.H. (2008). Implementation and Analysis of New Lightweight Cryptographic Algorithm Suitable for Wireless Sensor Networks. International Conference on Information Security and Assurance - ISA 2008, 73-76. Lorincz, K., Malan, D.J., Fulford-Jones, T.R., Nawoj, A., Clavel, A., Shnayder, V., Mainland, G., Welsh M., and Moulton, S. (2004). Sensor Networks for Emergency Response: Challenges and Opportunities. IEEE Pervasive Computing. 3 (4). 16-23. Luo, L., Huang, C., Abdelzaher, T., and Stankovic, J.A. (2007). EnviroStore: A Cooperative Storage System for Disconnected Operation in Sensor Networks. 26th IEEE International Conference on Computer Communications - INFOCOM 2007. 1802-1810. Mathur, G., Desnoyers, P., Ganesan, D., and Shenoy, P. (2006a). Ultra-Low Power Data Storage for Sensor Networks. 5th International Conference on Information Processing in Sensor Networks - IPSN 2006. Nashville. ACM. New York. 374-381. Mathur, G., Desnoyers, P., Ganesan, D., and Shenoy, P. (2006b). CAPSULE: An Energy-Optimized Object Storage System for Memory-Constrained Sensor Devices. 4th ACM Conference on Embedded Networked Sensor Systems – SenSys 2006. Boulder. 195-208.

Mehta, P., Chander, D., Shahim, M., Tejaswi, K., Merchant, S.N., and Desai, U.B. (2007). Distributed Detection Strategies for Landslide Prediction using Wireless Sensor Network. The IEEE Global Information Infrastructure Symposium - GIIS 2007. 195-198. Patel, S., Lorincz, K., Hughes, R., Huggins, N., Growdon, J.H., Welsh, M., and Bonato, P. (2007). Analysis of Feature Space for Monitoring Persons with Parkinson's Disease With Application to a Wireless Wearable Sensor System. 29th IEEE EMBS Annual International Conference, Lyon, France. Römer, K. (2004). Programming Paradigms and Middleware for Sensor Networks. GI/ITG Fachgespräch Sensornetze, Karlsruhe. Roundy, S., Steingart, D., Frechette, L., Wright, P. and Rabaey, J. (2004). Power Sources for Wireless Sensor Networks. In Holger, K., Willig, A., and Wolisz A. (Eds.). Lecture Notes in Computer Science, Proceedings of the 1st European Workshop on Wireless Sensor Networks - EWSN’04. 2920. Springer. Berlin. 1-17. Technology Review (2003). Ten Emerging Technologies That Will Change the World. www.technologyreview.com. Vieira, M.A.M., Coehlo, C.N.Jr., da Silva, D.C.Jr., and da Mata, J.M. (2003). Survey on Wireless Sensor Network Devices. The IEEE Conference on Emerging Technologies and Factory Automation - ETFA 2003. 1. 537-544. Xu, N. (2003). A Survey of Sensor Network Applications. University of Southern California.