6
WSN monitoring for agriculture: comparing SNMP and emerging CoAP approaches A Paventhan, Sai Krishna, Hari Krishna, R Kesavan, N Mohan Ram ERNET India R&D Centre 397,13 th Cross, Sadashiva Nagar, Bangalore - 560080, INDIA, Email: [email protected] Abstract The IPv6 protocol adaptation for the Wireless Sensor Network (6LoWPAN) enables the reuse of the TCP/IP application layer in WSN environment. It has been shown that the Simple Network Management Protocol (SNMP) originally envisioned for monitoring & managing hosts on the internet can be adapted for the 6LoWPAN networks. Also, IETF Constrained Application Protocol (CoAP), designed specifically for machine-to-machine application scenario, is emerging as an open application layer specification for resource constrained networks. In this paper, we compare SNMP and CoAP-based WSN monitoring approaches in agricultural field deployments connecting to ERNET IPv6 backbone network. We present the results comparing these two approaches in terms of protocol features, ease-of-use and memory footprint. 1. Introduction With IP-based Wireless Sensor Networks on the increase, WSN protocols for monitoring and management is an important requirement to gather application data and control the WSN operations over the internet. Both, SNMP originally envisioned for monitoring & managing hosts on the internet and the emerging IETF CoAP can be adapted for monitoring IPv6 enabled WSNs. The IEEE 802.15.4 [13] Low-rate Wireless Personal Area Networks (LoWPAN) standard is aimed at applications requiring limited power and moderate throughput requirements. IETF has defined RFC4944 [12] 6LoWPAN specification to efficiently transport IPv6 datagrams over IEEE LoWPAN links supporting fragmentation, header compression and layer 2 forwarding. Some of the popular OS platforms implement 6LoWPAN stack - μIPv6 in Contiki and blip in TinyOS. This enables adaptation of many application layer protocols of the TCP/IP stack. We look at two application layer protocols used for WSN monitoring applications, namely, Simple Network Management Protocol (SNMP) and Contrained Application Protocol (CoAP). In this paper, we are presenting SNMP and CoAP based WSN monitoring approaches in real world agriculture field-deployment scenarios. ERNET India is the first network in the country to support IPv6 in native mode. The agriculture sensor network connects to ERNET IPv6 backbone for remote monitoring. In section 2, background and related work are discussed. Section 3 compares SNMP and CoAP protocol features in WSN monitoring scenario. We present and discuss the two agriculture field deployment scenarios in section 4 and implementation details of both are given in section 5. The conclusion and future work is presented in section 6. 2. Background and related work Simple Network Management Protocol (SNMP) [14] is a UDP-based network management and monitoring protocol. SNMP management system consists of (1) several SNMP entities running command responder / notification originator application (also known as agents), (2) at least one entity running command generator / notification receiver application (also known as manager) (3) protocol that is used to convey management information base (MIBs) between SNMP entities. Contiki-SNMP is an SNMP implementation for the Contiki operating system supporting Atmel Raven hardware platform. It provides memory efficient implementation by storing OIDs in native formats and optimized storing of data structures considering the limited memory available in hardware. The contiki 2013 Texas Instruments India Educators' Conference 978-0-7695-5146-3/13 $26.00 © 2013 IEEE DOI 10.1109/TIIEC.2013.69 352 2013 Texas Instruments India Educators' Conference 978-0-7695-5146-3/13 $26.00 © 2013 IEEE DOI 10.1109/TIIEC.2013.69 353

[IEEE 2013 Texas Instruments India Educators' Conference (TIIEC) - Bangalore (2013.4.4-2013.4.6)] 2013 Texas Instruments India Educators' Conference - WSN Monitoring for Agriculture:

  • Upload
    n-mohan

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Page 1: [IEEE 2013 Texas Instruments India Educators' Conference (TIIEC) - Bangalore (2013.4.4-2013.4.6)] 2013 Texas Instruments India Educators' Conference - WSN Monitoring for Agriculture:

WSN monitoring for agriculture: comparing SNMP and emerging CoAP approaches

A Paventhan, Sai Krishna, Hari Krishna, R Kesavan, N Mohan Ram ERNET India R&D Centre

397,13th Cross, Sadashiva Nagar, Bangalore - 560080, INDIA, Email: [email protected]

Abstract

The IPv6 protocol adaptation for the Wireless Sensor Network (6LoWPAN) enables the reuse of the TCP/IP application layer in WSN environment. It has been shown that the Simple Network Management Protocol (SNMP) originally envisioned for monitoring & managing hosts on the internet can be adapted for the 6LoWPAN networks. Also, IETF Constrained Application Protocol (CoAP), designed specifically for machine-to-machine application scenario, is emerging as an open application layer specification for resource constrained networks. In this paper, we compare SNMP and CoAP-based WSN monitoring approaches in agricultural field deployments connecting to ERNET IPv6 backbone network. We present the results comparing these two approaches in terms of protocol features, ease-of-use and memory footprint.

1. Introduction

With IP-based Wireless Sensor Networks on the increase, WSN protocols for monitoring and management is an important requirement to gather application data and control the WSN operations over the internet. Both, SNMP originally envisioned for monitoring & managing hosts on the internet and the emerging IETF CoAP can be adapted for monitoring IPv6 enabled WSNs.

The IEEE 802.15.4 [13] Low-rate Wireless Personal Area Networks (LoWPAN) standard is aimed at applications requiring limited power and moderate throughput requirements. IETF has defined RFC4944 [12] 6LoWPAN specification to efficiently transport IPv6 datagrams over IEEE LoWPAN links supporting fragmentation, header compression and layer 2 forwarding. Some of the popular OS platforms implement 6LoWPAN stack - µIPv6 in

Contiki and blip in TinyOS. This enables adaptation of many application layer protocols of the TCP/IP stack. We look at two application layer protocols used for WSN monitoring applications, namely, Simple Network Management Protocol (SNMP) and Contrained Application Protocol (CoAP).

In this paper, we are presenting SNMP and CoAP based WSN monitoring approaches in real world agriculture field-deployment scenarios. ERNET India is the first network in the country to support IPv6 in native mode. The agriculture sensor network connects to ERNET IPv6 backbone for remote monitoring. In section 2, background and related work are discussed. Section 3 compares SNMP and CoAP protocol features in WSN monitoring scenario. We present and discuss the two agriculture field deployment scenarios in section 4 and implementation details of both are given in section 5. The conclusion and future work is presented in section 6.

2. Background and related work

Simple Network Management Protocol (SNMP) [14] is a UDP-based network management and monitoring protocol. SNMP management system consists of (1) several SNMP entities running command responder / notification originator application (also known as agents), (2) at least one entity running command generator / notification receiver application (also known as manager) (3) protocol that is used to convey management information base (MIBs) between SNMP entities.

Contiki-SNMP is an SNMP implementation for the Contiki operating system supporting Atmel Raven hardware platform. It provides memory efficient implementation by storing OIDs in native formats and optimized storing of data structures considering the limited memory available in hardware. The contiki

2013 Texas Instruments India Educators' Conference

978-0-7695-5146-3/13 $26.00 © 2013 IEEE

DOI 10.1109/TIIEC.2013.69

352

2013 Texas Instruments India Educators' Conference

978-0-7695-5146-3/13 $26.00 © 2013 IEEE

DOI 10.1109/TIIEC.2013.69

353

Page 2: [IEEE 2013 Texas Instruments India Educators' Conference (TIIEC) - Bangalore (2013.4.4-2013.4.6)] 2013 Texas Instruments India Educators' Conference - WSN Monitoring for Agriculture:

Figure 1: Components of SNMP Entity

SNMP supports snmpget, snmpgetnext, snmpset and snmpwalk operations as defined in SNMPv1 and SNMPv2. SNMPv3 user-based security model is also supported.

6PANview [16] is a SNMP-based WSNmonitoring system developed on the TinyOS platform. μSNMP in 6PANview is a light-weight port of net-snmp supporting SNMPv1 message processing. The 6PANview includes a PAN server that acts as an intermediary between the network management system and the 6LoWPAN-enabled WSN. The management console is developed using Java.

IETF Constrained Application Protocol (CoAP) is a generic web protocol designed to meet the requirements of the resource constrained network environment such as 6LoWPAN networks. CoAP supports reliable and unreliable communications based on request / response paradigm in addition to supporting asynchronous notifications over UDP. The request method and response codes, and the messaging layer are the features in the CoAP header [1] (Figure 2).

There are many CoAP implementations supporting different OS and programming languages are being developed. The libcoap [2] is a C-Implementation of CoAP integrated with TinyOS, jCoAP [3] is a Java Library implementing the CoAP and CoAPy [4] is a Python implementation of the protocol supporting the development of CoAP client and servers in Python. Californium (Cf) is a modular CoAPimplementation written in Java using a

Figure 2: CoAP Layer

flexible and layered architecture. It allows easy creation of cloud-based client and server applications as well as CoAP proxies.

Erbium (Er) [5] is a C implementation of CoAP for Contiki OS with a low-power REST Engine. Erbium is part of the official Contiki OS repository. The software framework enables CoAP server and CoAP client applications development supporting features such as blockwise transfers and observing as defined in recent IETF CoAP drafts [1]. Erbium includes a Firefox browser plugin Copper (Cu), a CoAP user agent implementation for monitoring resources using Web browser.

In our discussions and project implementation, we have utilized Erbium CoAP, 6PANview and Contiki SNMP.

3. Comparing WSN monitoring approaches based on SNMP and CoAP

The remote monitoring and management of wireless sensor network elements and their associated application sensor properties require suitable network protocols supporting features and operations such as resource modeling, resource identification, lookup and discovery, resource creation and update, and asynchronous resource interactions. Both SNMP adaption for low power WSN and CoAP are comparable in operations for WSN monitoring. Specific protocol features between the two are compared below.

Message Format: CoAP messages are encoded using simple binary format with 4 byte header, followed by variable length token, CoAP options and payload. SNMP uses ASN.1 Basic

353354

Page 3: [IEEE 2013 Texas Instruments India Educators' Conference (TIIEC) - Bangalore (2013.4.4-2013.4.6)] 2013 Texas Instruments India Educators' Conference - WSN Monitoring for Agriculture:

Encoding Rules (BER) to encode/ decode messages as byte stream.

Resource Identification: Similar to HTTP, resources can be located using Uniform Resource Identifier (URI) in CoAP. The resources are organized hierarchically with hostname, optional UDP port number followed by resource path similar to http requests: coap://coap-server[:port]/resource-path/. InSNMP, the instance of any object type is defined in the MIB identified by a unique variable name known as an Object Identifier(OID).

Resource Lookup: CoAP uses the GET method to retrieve the data. In SNMP, Get is a manager-to-agent request to retrieve the data of variables and GetNext to discover variables and their values. GetBulk request is used for multiple iteration of GetNext.

Resource creation/updation: CoAP uses PUT method to update or create if the resource does not exist, while POST is used for creating new resource or update the existing one, depending on the target resource and the requesting server. SNMP supports SET method to alter the value of an object already managed by the agent in its MIB and there is no equivalent of CREATE operation in SNMP.

Resource Removal: CoAP allows resources to be removed from the server by means of DELETE method. There is no equivalent operation in SNMP as the objects managed by the agent conform to a well-defined MIB tree agreed between the manager and agent.

Asynchronous Notification: In addition to the pull model based on GET methods, CoAP supports Observe option for pushing the current state of the resource from server to client upon any change in resource state. SNMP supports Trap, anunsolicited message from SNMP agent to manager to indicate an occurrence of an event.

Resource Discovery: The Resource Discovery in CoAP isachieved by sending a multicast GET

request for resources hosted in servers atthe default entry point "/.well-known/core"and the response would be a list of link descriptions as defined in CoRE Link Format [15]. SNMP protocol does not support resource discovery by default but, all theresources managed by an agent can be discovered by an SNMPwalk operation that in turn uses GetNext request to query the MIB tree.

Security: Similar to HTTP, the security in CoAP isachieved using Datagram Transport Layer Security (DTLS). The CoAP bindings to DTLS is a minimal sebset to suit the constrained networks and the resource access are by "coaps" scheme similar to "https". SNMPv3 provides user-based security model (USM) for both authentication and message privacy.

Memory Footprint: If we compare memory footprint between the Erbium CoAP and Contiki–SNMP implementations for Contiki platform, the Erbium memory requirement is relatively low as it needs Flash ROM of 8.5K and RAM of 1.5K whereas Contiki-SNMP needs Flash ROM of 31.2K and RAM of 0.2K.

User Interface: SNMP implementations come with both command line tools and GUI. The dynamic listing of the resources available at the SNMP agent is not possible. If there are changes to the list of resources managed by the agent, it is possible that the SNMP Manager may parse the results displaying objects in its local MIB entry rather than SNMP agents. Hence, meeting the dynamic resource creation / update requirement in WSN is difficult to achieve in SNMP.

The mapping between CoAP and HTTP enables better integration with the existing Web. Hence resource monitoring using existing web browsers is possible using suitable web browser plugins (e.g., Copper(Cu) for Mozilla web browser). The resource status can queried dynamically from a browser including any returned errors such as 4.xx (client error), 5.xx (server error) etc. similar to HTTP response codes.

354355

Page 4: [IEEE 2013 Texas Instruments India Educators' Conference (TIIEC) - Bangalore (2013.4.4-2013.4.6)] 2013 Texas Instruments India Educators' Conference - WSN Monitoring for Agriculture:

As can be seen from the above discussions, CoAP protocol features make it better suited for resource constrained wireless sensor network environment as compared to SNMP considering that it is designed for monitoring network elements with static properties.

4. Agriculture use case – DeploymentScenarios

ERNET India is collaborating with Indian Council of Agriculture Research (ICAR) institutions that are connected by ERNET network for the agriculture field deployments. There are two possible deployment options available: (i) Deployment at remote locations without any wired network. (ii) Deployment of the WSN where ERNET IPv6 backbone connectivity is available.

In both the deployments, hierarchical IPv6 addressing and routing protocols are defined, so that each mote deployed at the field gets a global IPv6 address, and can be queried by any CoAP client/ SNMP manager.

In both scenarios, we have motes interfaced to 5TE soil sensor [6] for agriculture field measurements of three parameters: soil temperature, volumetric water content and electrical conductivity. Thishelps in understanding the real time soil properties and analyzing the soil conditions by scientists remotely.

Figure 3: Remote field deployment using 3G/6LoWPAN gateway

Scenario-1:

Figure 3 shows the remote deployment architecture using 3G/6LoWPAN gateway. The 3G dongle is used in order to establish IPv6 network connectivity to the nodes deployed in the remote field, where the PAN coordinator node is to be connected to gateway. Currently, the support for IPv6 is not available with 3G service providers. In order to achieve an end-to-end IPv6 connectivity, we use a dual stack host running OpenVPN server and the 3G/6LoWPAN gateway running the OpenVPN client. A "6in4" tunnel is required between the gateway and OpenVPN server to establish a IPv6 communication channel supporting IPv6 prefix advertisement to the end nodes.

Figure 4: Field deployment using Ethernet/6LoWPAN gateway

Scenario-2:

Figure 4 shows deployment of WSN at a field location where ERNET IPv6 backbone connection is already available. An intermediate device, Ethernet/6LoWPAN gateway is required between the 6LoWPAN nodes and IPv6 backbone network. The gateway device forwards the IPv6 packets from the backbone network to the field network and vice versa.

5. Implementation and results

Our agriculture field network uses TelosB motes that is IEEE 802.15.4 compliant having Texas Instruments (TI) MSP430 microcontroller and Chipcon CC2420 radio. 5TE soil sensor [6] from Decagon is interfaced to TelosB for soil temperature, soil moisture and electrical conductivity measurements. NETGEAR WNDR 3800 [7]is used as a Ethernet/6LoWPAN gateway device. PandaBoard [8] as a 3G/6LoWPAN gateway (uses TI OMAP4460 SoC) device.

355356

Page 5: [IEEE 2013 Texas Instruments India Educators' Conference (TIIEC) - Bangalore (2013.4.4-2013.4.6)] 2013 Texas Instruments India Educators' Conference - WSN Monitoring for Agriculture:

The 5TE soil sensor connects through a 3 wire cable (a stereo connector) or using bare wire interface. The three connections are Excitation, Ground and Serial Out (data). The excitation is from 3.6 to15 volts and the data output from sensor is more than 3.6VDC whereas TelosB mote operates with a maximum 3.6VDC. Hence, in order to drive the sensor and handle the data output, an external circuit shown in figure 5(a) is designed for interfacing soil sensor with TelosB mote. The figure 5(b) is the block diagram of interfacing board connected to sensor and mote.

Figure 5 (a): Interfacing PCBA

Figure 5 (b): Block diagram

We have tested remote deployment at Krishi Vigyan Kendra (KVK) [9], Hirehalli in the betel leaf garden shown in Figure 6. PandaBoard in the field acts as a 3G/6LoWPAN gateway and it runs Linux OS. Suitable software modules/ daemons toidentify the devices plugged into the PandaBoard have also been developed.

Figure 6: Remote Deployment at Hirehalli(KVK)

The connectivity daemons running in the gateway identifies 3G dongle and initiates connection to the service provider, without requiring any additional inputs from user during connection establishment process. Finally, each node deployed in the field location can be queried by its globally reachable IPv6 address for sensor values.

We have tested the nodes deployed at Soil Science division of Indian Institute of Horticultural Research (IIHR) [10] shown in figure 7 where Netgear WNDR3800 router is used as Ethernet/6LoWPAN gateway that runs OpenWrt [11] - a Linux based firmware for embedded devices. The PAN coordinatornode and ERNET IPv6 Ethernet link is connected to gateway. The gateway provides IPv6 bi-directional communication mode for querying sensor values.

Figure 7: Field Deployment at Soil Science Division (IIHR)

The following is the command line output ofsoil parameters using SNMP based approach.

[root@6LoWPAN-PC ernet]# snmpget -v 1 -c public \\ udp6:2001:e30:187c:2::2:161 temperature ec \\ dielectric IPV6LOWPANExtended-MIB:: temperature = INTEGER: 673 IPV6LOWPANExtended-MIB:: ec = INTEGER: 0 IPV6LOWPANExtended-MIB:: dielectric = INTEGER: 59 [root@6LoWPAN-PC ernet]#

Figure 8 shows Copper web browser used for monitoring agriculture sensor.

356357

Page 6: [IEEE 2013 Texas Instruments India Educators' Conference (TIIEC) - Bangalore (2013.4.4-2013.4.6)] 2013 Texas Instruments India Educators' Conference - WSN Monitoring for Agriculture:

Figure 8: Web Browser CoAP Client

6. Conclusions and future work

The support of IPv6 as a common network layer protocol in Wireless Sensor Network enables seamless adaptation of various application layer protocols for network monitoring and management. In this paper, we have presented SNMP & CoAP based network monitoring approaches to IP-based WSNs using agriculture use case. Considering that CoAP has been specifically designed to run on resource constrained devices with better integration support to Web, we can expect its wide spread use as a generic application layer protocol for WSN monitoring.

As part of our future work, we intend to develop a generalized monitoring framework based on CoAP supporting functions such as configure, sensor discovery, get sensor data, get state etc. for use in varying application domains. Further, we intend to support control decisions based on the data aggregated through WSN monitoring to trigger some field actions, e.g., drip irrigation and fertigation.

7. References

[1] Z. Shelby, K. Hartke, C. Bormann Constrained Application Protocol (CoAP).draft-ietf-core-coap-16, May, 2013.

[2] libcoap. http://libcoap.sourceforge.net/,2013.

[3] jCoAP. http://ws4d.e-technik.uni-rostock .de/ws4d-jcoap/, 2013.

[4] CoAPy. http://coapy.sourceforge.net/,2013

[5] Erbium. http://people.inf.ethz.ch/mkovat sc/erbium.php, 2013.

[6] 5TE Soil Sensor. http://www.decagon.c om/products/sensors/soil-moisture-sensors/,2013.

[7] WNDR NETGEAR 3800.http://support.netgear.com/product/WNDR3800, 2013.

[8] PandaBoard. http://pandaboard.org/content/pandaboard-es, 2013.

[9] KVK, Hirehalli. http://www.iihr.ernet.in/ krishi-vignana-kendra-kvk-hirehalli, 2013.

[10] Indian Institute of Horticulture Research(IIHR). www.iihr.ernet.in, 2013.

[11] OpenWrt. http://wiki.openwrt.org/toh/ netgear /wndr3800, 2013.

[12] G. Montenegro, N. Kushalnagar, J. Hui and D. Culler, Transmission of IPv6 Packets over IEEE 802.15.4 Networks.IETF RFC 4944, September, 2007.

[13] IEEE Std 802.15.4 Specifications for Low-Rate Wireless Personal Area Networks (WPANs). IEEE Computer Society, Published on 8th September 2006

[14] D.Harrington, R.Presuhn and B.Wijnen, An Architecture for Describing SNMP Management Frameworks. IETF RFC 3411, December2002.

[15] Z.Shelby, Constrained RESTful Environments (CoRE) Link FormatIETF RFC 6690, August 2012.

[16] 6PANview: A network monitoring system for the ”internet of things”http://ece.iisc.ernet.in/6panview,2012

8. Acknowledgements

This project was funded under the R&D Grants-in-Aid by the Convergence, Communication & Broadband Technologies (CC&BT) Group, Department of Electronics & Information Technology (DeitY), Ministry of Communications and Information Technology, Government of India.

357358