Towards a Zero-Configuration Wireless Sensor Network Architecture ...

2 downloads 4096 Views 1MB Size Report
Lars Schor. Philipp Sommer. Roger Wattenhofer. Towards a Zero-Configuration. Wireless Sensor Network Architecture for Smart Buildings ...
Towards a Zero-Configuration Wireless Sensor Network Architecture for Smart Buildings Lars Schor Philipp Sommer Roger Wattenhofer

Smart Buildings  40% of total energy use is for buildings • Make buildings greener and save money

 Building control systems get smarter • Learn where energy is used and how it can be saved • Increase comfort, health and safety of people • Integration with traditional IT systems

Philipp Sommer, ETH Zurich @ BuildSys‘09

System Overview  Sensor nodes • Report current energy usage, temperature, ...

 Actuator nodes • Control small subsystems

 Central control unit • Coordinates different subsystems (actuators/sensors)

Philipp Sommer, ETH Zurich @ BuildSys‘09

Integration of Sensor Nodes into IP-based Networks Goals: 1. Integrate wireless sensor nodes into an existing IP-based infrastructure 2. Plug-and-Play system for building automation

Philipp Sommer, ETH Zurich @ BuildSys‘09

Advantages of using IPv6 for Wireless Sensor Nodes  Connectivity • Connect sensor with other devices in the Intranet/Internet • No application layer gateway required

 Use of standard networking tools/protocols in WSNs •

ping, telnet, http, web services, ...

 Scalability • 128-bit address space

Philipp Sommer, ETH Zurich @ BuildSys‘09

Target Platforms  How can we connect devices which are fundamentally different?

Sensor Node

Central Unit

CPU

8 MHz

2.4 GHz (4x)

RAM

8 kB

8 GB

128 kB

250 GB

Program Storage

Philipp Sommer, ETH Zurich @ BuildSys‘09

Communication Stack: WSN vs. IP Classical Stack

Internet Stack

Philipp Sommer, ETH Zurich @ BuildSys‘09

IPv6 over LoW Power wireless Area Networks (6LoWPAN)  Problem: 802.15.4 Header

IPv6 Header

TCP Header

TCP Payload

39 Bytes

40 Bytes

20 Bytes

28 Bytes

 Solution:

Source Addr

Dest Addr

TF

Next HC Header 2

IPv6 Hop Limit

Philipp Sommer, ETH Zurich @ BuildSys‘09

16

15

14

13

12

TCP Payload

11

10

7

6

5

4

3

2

1

802.15.4 Header

9

IPv6 Header Compression TCP Header 8

Fragment Header

How does… … a device know about other devices?

Philipp Sommer, ETH Zurich @ BuildSys‘09

Service Discovery  Service announcements using multicast DNS packets • Implemented by Zeroconf/Bonjour/Rendez-vous • Service announcements using DNS SRV records (RFC 2782) • Implemented using UDP packets • Integrate new devices without additional configuration Service: _rest._tcp.local Hostname: sensor-1.local Address: 2001:db8:0:8d3:0:8a2e:70:7344

Philipp Sommer, ETH Zurich @ BuildSys‘09

How does… … a device know which functionality another device provides

Philipp Sommer, ETH Zurich @ BuildSys‘09

Web Services for Sensor Networks  Web services enable machine-to-machine interaction

Service Requester

Service Provider

Data

 Classic solution: SOAP and XML •

Not optimal for memory-constrained sensor nodes

 Lightweight solution: REST and JSON SOAP: XML: REST: JSON:

Simple Object Access Protocol Extensible Markup Language Representational State Transfer Java Script Object Notation

Philipp Sommer, ETH Zurich @ BuildSys‘09

Representational State Transfer (REST)  Functionality provided by a system is a set of resources  Each resource can be identified using its distinct URI • Example: The red LED of a node can be accessed at “/Leds/Red”

 Web service based on REST: • Resources can be accessed using four basic operations provided by the HTTP protocol (GET, PUT, POST and DELETE)

 Not limited to sensor nodes!

Philipp Sommer, ETH Zurich @ BuildSys‘09

REST: Resource Discovery and Access  Example: Sensor Node Leds Red

Green

Node

Temperature

Collection

Blue

Member

GET /Leds/Red HTTP/1.1 All Data of the Member

Philipp Sommer, ETH Zurich @ BuildSys‘09

Response from the Sensor Node  JavaScript Object Notation (JSON) { "device": "temperature", "method": [ "G" ], "param": [ { "n": "celcius", "v": 26, "t": "i", "u": 0 } ]

// name of the resource // supported methods // of the resource (GET) // array with all parameters // // // //

name value data type (integer) updatable

}

Philipp Sommer, ETH Zurich @ BuildSys‘09

Pixie Prototyping Platform  Atmel ZigBit900 module •

Cheap and flexible platform for prototyping sensor networks



Atmega1281 microcontroller + ATRF212 radio transceiver



Various IO pins (GPIO, SPI, I2C, UART) 8 Kbytes RAM 128 Kbytes ROM IEEE 802.15.4

Philipp Sommer, ETH Zurich @ BuildSys‘09

TinyOS Implementation  We use blip: 6LoWPAN stack for TinyOS 2.1.1  Implemented a small HTTP web server on each sensor node  Service announcements using multicast DNS (mDNS) over UDP

Philipp Sommer, ETH Zurich @ BuildSys‘09

How does… … this help to make buildings smarter

Philipp Sommer, ETH Zurich @ BuildSys‘09

Integration into Smart Buildings  Central unit • Get information from the sensors • Control the actuators

 Web application • Listen to service announcements from nodes • Rule-based control of actuators

Philipp Sommer, ETH Zurich @ BuildSys‘09

Web Application

Philipp Sommer, ETH Zurich @ BuildSys‘09

Evaluation  Response time for HTTP requests to the sensor node • Performance improvement by using persistent TCP connections 450

Average Response Time [ms]

400 350 300 250 200 150 100 50 0 94 Bytes, Closed TCP Connection

94 Bytes, Estab. TCP Connection

201 Bytes, Closed TCP Connection

201 Bytes, Estab. TCP Connection

Philipp Sommer, ETH Zurich @ BuildSys‘09

335 Bytes, Closed TCP Connection

335 Bytes, Estab. TCP Connection

Summary  Connected sensor nodes using standard Internet protocols •

Lightweight web services based on REST/HTTP

 Zero-configuration approach • Service discovery using multicast DNS

Service: „_rest._tcp.local“ Hostname: sensor-1.local Address: 2001:db8:0:8d3:0:8a2e:70:7344

• Clients can fetch a list of services offered by a device

 And all this fits into less than 128kB ROM / 8kB RAM

Philipp Sommer, ETH Zurich @ BuildSys‘09