24
A Resource Oriented Architecture for the Web of Things Dominique Guinard (ETH / SAP Research / MIT Auto- ID Labs) Vlad Trifa (ETH Zurich / SAP Research) Erik Wilde (UC Berkeley)

A ROA for the WOT

Embed Size (px)

DESCRIPTION

A resource oriented architecture for the Web of Things

Citation preview

Page 1: A ROA for the WOT

A Resource Oriented Architecture for the Web of ThingsDominique Guinard (ETH / SAP Research / MIT Auto-ID Labs)Vlad Trifa (ETH Zurich / SAP Research)Erik Wilde (UC Berkeley)

Page 2: A ROA for the WOT

2Dominique Guinard ETH / SAP / MIT

INTRODUCTION AND MOTIVATION

What’s the Web of Things? What is it good for?

Dec. 1, 2010

[http://www.flickr.com/photos/moragcasey/]

Page 3: A ROA for the WOT

3Dominique Guinard ETH / SAP / MITDec. 1, 2010

The Embedded Systems Era

Ubiquitous: Home appliances Industries Smart Cities

Connected: Zigbee, Bluetooth, Wifi

Application Integration?

Page 4: A ROA for the WOT

4Dominique Guinard ETH / SAP / MIT

Finding an Application Integration Platform

Question: How do we enable tech savvys and

companies to create applications on top of this eco-system?

Hundreds of different platforms Web?

Scalable (7000 Facebook p/sec.)

Ubiquitous (from mobile to desktop)

Well-understood (1.73 Bio. users)

Thesis: Re-use and develop Web-standards to

build a Things Universal API.

Dec. 1, 2010

Page 5: A ROA for the WOT

5Dominique Guinard ETH / SAP / MIT

WEB OF THINGS ARCHITECTURE

Building a Web of Things, piece by piece…

Dec. 1, 2010

[http://www.flickr.com/photos/julianbleecker]

Page 6: A ROA for the WOT

6Dominique Guinard ETH / SAP / MIT

REST: The Core of the Web

REST: architecture with 5 constraints

1. Identify resources and links: A resource: something, that can and that’s worth, getting a URI and

links

2. Design respresentations

3. Use the uniform interface

4. Bring things to the Internet&Web

Dec. 1, 2010

[2] Architectural styles…

[1] RESTful Web Services.

Page 7: A ROA for the WOT

7Dominique Guinard ETH / SAP / MIT

Case Study with Sun Spots1) Resources and Links

Thanks to their atomicity services on embedded devices are quite adapted to Resource-Oriented Architectures. Resources:

Spots: http://webofthings.com/spots Spot 2: http://webofthings.com/spots/2 Light Sensor: http://webofthings.com/spots/2/sensors/light Led Actuator:

http://webofthings.com/spots/2/actuators/led

Resource Identification Hypermedia

Dec. 1, 2010

Page 8: A ROA for the WOT

8Dominique Guinard ETH / SAP / MIT

2) Representation Design

HTML as default, ideal for browsing: http://webofthings.com/spots

JSON & JSONp, ideal for mashups

XML, ideal for integration with business systems

Self-Describing Messages Hypermedia

Dec. 1, 2010

Page 9: A ROA for the WOT

9Dominique Guinard ETH / SAP / MIT

3) Interface Design

Leverage content negotiation: Accept: application/json

Use the HTTP Verbs extensively: GET, PUT, POST, DELETE GET http://webofthings.com/spots/2/sensors/temperature PUT http://webofthings.com/spots/2/actuators/led/1

Map status codes: 200 OK, 201 Created, 400 Bad Request

Dec. 1, 2010

Uniform Interface Self-Describing Messages

Page 10: A ROA for the WOT

10Dominique Guinard ETH / SAP / MIT

4) Bringing Things to the Internet&Web: Smart Gateways

6lowpan coming quickly: Cisco, IPSO, OpenPicus

HTTP Reverse Proxy Hiding IoT proprietary protocols

(Zigbee, Bluetooth, etc.): Dongle based

OSGi modularity

Installed on residential gateways: Wireless routers (OpenWrt)

NAT

RESTful Design Process can be (partially) automated

Dec. 1, 2010

[3] Facilitating Integration of

Services for WoT

Page 11: A ROA for the WOT

11Dominique Guinard ETH / SAP / MIT

APPLICATIONS

What can we build on top of the Web of Things?

Dec. 1, 2010

[http://www.flickr.com/photos/docman]

Page 12: A ROA for the WOT

12Dominique Guinard ETH / SAP / MIT

Typical WoT Architecture: « Energie Visible »

Project for a private foundation for sustainability (cudrefin02.ch)

Goal: an easily deployable system for better understanding consumption: Cross-platform

Web access

Uses the Plogg sensor nodes Smart Gateway provides

RESTful API

Dec. 1, 2010

Page 13: A ROA for the WOT

13Dominique Guinard ETH / SAP / MIT

« Energie Visible »: Mashup and UIs

Web UI / Mashup using Javascript (GWT): www.webofthings.com/energievisible

E-Meter iPhone App

Dec. 1, 2010

[http://www.vs.inf.ethz.ch/res/show.html?what=emeter_demo]

[4] Increasing Energy Awareness Through Web-enabled Power Outlets.

Page 14: A ROA for the WOT

14Dominique Guinard ETH / SAP / MIT

Physical Mashup Editors

• Clickscript:– Javascript (JQuery / DOJO) based

visual language.

• Added wrappers for WoT devices:

– SunSPOT, Ploggs, RFID reader

Dec. 1, 2010

[http://www.clickscript.ch]

[5] Mashing up Your Web-Enabled Home

Page 15: A ROA for the WOT

15Dominique Guinard ETH / SAP / MIT

EVALUATION

Ok, it’s easier to build apps upon, but is the WoT really feasible?

Dec. 1, 2010

[ http://www.flickr.com/photos/myfwc]

Page 16: A ROA for the WOT

16Dominique Guinard ETH / SAP / MIT

Quantitative Evaluation

10’000 requests on the Sun SPOTs

1) Embedded Webserver: 205 ms (97 – 8500)

2) Smart Gateway: Sync-based (caching)

4 ms (2 – 49)

Age max: 300 ms

Good enough for most sub-second use cases.

Dec. 1, 2010

Page 17: A ROA for the WOT

17Dominique Guinard ETH / SAP / MIT

BEYOND REST

What is the Web of Things good for?

Dec. 1, 2010

[http://www.flickr.com/photos/brapke/]

Page 18: A ROA for the WOT

18Dominique Guinard ETH / SAP / MIT

Beyond Client-Server: Real-Time Web

Client-server paradigm not really natural for sensing application.

Need for sensor push. First step:

Atom (cleaner RSS) / AtomPub

Real push Pubsubhubbub

HTML 5 Web Sockets

Server-sent events

RESTful XMPP

Dec. 1, 2010

Page 19: A ROA for the WOT

19Dominique Guinard ETH / SAP / MIT

Beyond HTML: Discovering Services

Service Discovery: Microformats HTML5 Microdata RDFa Google Custom Engine Yahoo Search Monkey Dyser

Dec. 1, 2010

Page 20: A ROA for the WOT

20Dominique Guinard ETH / SAP / MIT

Thanks a lot for your attention

Contact us if you want to use our APIs in your projects: Dominique Guinard

www.guinard.org

www.webofthings.com

Special thanks to: Simon Mayer, Lukas Naef and Thomas Pham.

Dec. 1, 2010

Page 21: A ROA for the WOT

21Dominique Guinard ETH / SAP / MIT

References

1. L. Richardson and S. Ruby. RESTful Web Services. O'Reilly Media, Inc., 2007

2. R. Fielding: “Architectural styles and the design of network-based software architectures”, 2000

3. S. Mayer, D. Guinard, V. Trifa: “Facilitating Integration and Interaction of Real-World Services for WoT” Urban IoT 2010

4. M. Weiss, D. Guinard: “Increasing Energy Awareness Through Web-enabled Power Outlets” MUM 2010

5. D. Guinard: “Mashing up Your Web-Enabled Home”, Touch the Web 2010

Dec. 1, 2010

Page 22: A ROA for the WOT

22Dominique Guinard ETH / SAP / MIT

Backup

Dec. 1, 2010

Page 23: A ROA for the WOT

23Dominique Guinard ETH / SAP / MIT

Qualitative Evaluation

Plogg RESTful API & Sun SPOT API used by 6 independent research labs.

Early feedback: Easy to understand and use Straightforward testing & Web-integration

Currently evaluating with 80 students.

Dec. 1, 2010

Page 24: A ROA for the WOT

24Dominique Guinard ETH / SAP / MIT

Age of Cache

Dec. 1, 2010