The document discusses CoAP (Constrained Application Protocol), a protocol designed for resource-constrained devices. It describes CoAP's features like RESTful interaction, observing resources, and resource discovery. It also discusses integrating CoAP with the web through a CoAP implementation in Firefox called Copper. A user study found that most prefer a web browser for interacting with CoAP resources. The document envisions future work on enabling CoAP requests from browsers and scripting for physical mashups.
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
CoAP for the Web: Connecting Tiny Devices to the Browser
1. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 1|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Matthias Kovatsch
kovatsch@inf.ethz.ch
CoAP for the Web of Things:
From Tiny Resource-constrained Devices
to the Web Browser
Monday, 9 Sep 2013
4th International Workshop on the Web of Things (WoT 2013)
Zurich, Switzerland
2. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 2|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
The Web of Things
Electronic things are invading us...
Slide courtesy
of Vlad Trifa
3. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 3|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
The Web of Things – of Powerful Devices
Often mains-powered, capable of running Linux, or using application-level gateways
4. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 4|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Directly connecting to the Internet in a secure manner
Tiny Resource-constrained Devices
Target of
less than $1
Class 1 devices
~100kB ROM
~10kB RAM
5. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 5|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
6LoWPAN for seamless Internet integration
Custom WSN Protocols on the Retreat
TCP and HTTP
problematic in
low-power
networks
6. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 6|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
RESTful protocol designed from scratch
Transparent mapping to HTTP
Additional features for M2M scenarios
Constrained Application Protocol (CoAP)
Message Sub-layer
Reliability
UDP DTLS …
Request/Response Sub-layer
RESTful interaction
GET, POST, PUT, DELETE,
URIs, and Internet Media Types
Deduplication and
optional retransmissions (Confirmables)
CoAP
7. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 7|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Binary protocol
Low parsing complexity
Small message size
Header options
Numbers with IANA registry
Type-Length-Value
Special option header
marks payload if present
Constrained Application Protocol (CoAP)
0 – 8 Bytes Token
Exchange handle for client
4-byte Base Header
Version | T-len | Type | Code | ID
Header Options
Location, Max-Age, ETag, …
Marker
0xFF
Payload
Representation
8. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 8|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Observing Resources
Server
Client
Resource state at origin server
Replicated state at client
Notification
lost
Max-Age
Observe illustration courtesy of Klaus Hartke
9. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 9|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Observing Resources – CON Notifications
Server
Client
Resource state at origin server
Replicated state at client
Observe illustration courtesy of Klaus Hartke
10. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 10|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
RESTful Group Communication
all-lights.floor-d.example.com
GET /status/power
PUT /control/color
#00FF00
Enabled by IP multicast
11. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 11|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Based on Web Linking (RFC 5988)
Extended to CoRE Link Format (RFC 6690)
Multicast Discovery
Resource Directories
Resource Discovery
</config/groups>;rt="core.gp";ct=39,
</sensors/temperature>;rt="ucum.Cel";ct="0 41 50";obs,
</large>;rt="block";sz=1280;title="Large resource"
GET /.well-known/core (RFC 5785)
12. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 12|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Short Message Service (SMS)
Unstructured Supplementary
Service Data (USSD)
Addressable through URIs
(URI scheme not finalized)
Response possible over UDP/IP
through Return-Path option
Alternative Transports
*101#
coap+sms://+123456789/bananas/temperature
13. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 13|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Proposed Standard since 15 Jul 2013
draft-ietf-core-coap-18
In RFC Editor Queue: MISSREF
draft-ietf-tls-oob-pubkey (Raw Public Keys)
draft-mcgrew-tls-aes-ccm-ecc (Elliptic Curve Crypto)
In use by
OMA Lightweight M2M
IPSO Alliance
ETSI M2M
Accounting and monitoring for network operators
Lighting systems for smart cities
Status of CoAP
14. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 14|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
48 participants knowledgeable about CoAP and the IoT
Contiki and TinyOS communities (Wireless Sensor Networks)
ETSI M2M associates (M2M solutions)
IETF followers (Internet technology)
Differentiation checked with Wilcoxon rank-sum test
User Study
Academia
and
Hobbyists
(30+2)
Industry
(16)
0-4 years
experience
(33)
5+ years
(15)
15. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 15|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Agreement with our Hypotheses
Responses from 48 participants on the Likert scale
(0 = strongly disagree, 4 = strongly agree, error bars: +/- 1 std. dev.)
0
1
2
3
4
Internet protocols ease the
development of distributed
software for tiny devices.
Web patterns ease the
development of distributed
software for tiny devices.
CoAP in addition to HTTP is
a necessity for the Internet of
Things.
I prefer using a HTTP-CoAP
cross-proxy for accessing
devices.
Overall
Academia
Industry
Less than
5 years
5 years
and more
16. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 16|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
CoAP protocol handler
for Mozilla Firefox
Browsing and bookmarking
of CoAP URIs
Interaction with resource like
RESTClient1 or Poster2
Treat tiny devices like
normal RESTful Web services
CoAP Support in the Web Browser
1 https://addons.mozilla.org/en-US/refox/addon/poster/
2 https://addons.mozilla.org/en-US/refox/addon/restclient/
https://addons.mozilla.org/firefox/addon/copper-270430/
17. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 17|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Copper (Cu)
18. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 18|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Majority (N=41) prefers the
Web browser as CoAP client
for user interaction
Main use cases for Copper (Cu)
Debugging own implementation
Giving a demo
Browsing existing
CoAP Web services
Reasons for a different client
Automation and scripting (55%)
I do not use Firefox (8%)
Market Share of CoAP Clients
Copper (Cu)
41%
libcoap client
17%
Sensinode
NanoService
Java Client
5%
Californium (Cf)
GUI client
5%
Californium (Cf)
console client
10%
other
22%
19. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 19|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Web-like interaction with
tiny devices is preferable
People not as confident to see
native support in Web browsers
2.8 / 4 on the Likert scale
UDP and DTLS support through
Real-time communication
in Web browsers (RTCWeb)
Mozilla open for patches
Native CoAP Support in Web Browsers
Web browser
integration of CoAP
(77%)
standalone
(23%)
20. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 20|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Actinium (Ac) App-server for Cf
Server-side JavaScript
CoapRequest object API
Mashups in the background
Future work
Enable CoapRequest object
in the Web browser
Script interactions
Visualize data
Mashups with GUI
Scripting for Physical Mashups
22. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 22|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Application-agnostic Device Infrastructure
Erbium (Er) REST Engine
RESTful wrapper for hardware
Impact of radio duty cycling
on application-layer protocols
[A Low-Power CoAP for Contiki, MASS 2012]
Implementation guidance
[draft-kovatsch-lwig-coap-01, IETF 2013]
https://github.com/contiki-os/contiki
The Thin Server Architecture
23. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 23|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Application development outside of the embedded domain
Californium (Cf) framework
Unconstrained service back-end
[Moving Application Logic from the Firmware to
the Cloud: Towards the Thin Server Architecture
for the Internet of Things, IMIS 2012]
DTLS 1.2 implementation
IETF “running code”
ETSI Plugtests
[Industry Adoption of the Internet of Things:
A Constrained Application Protocol Survey,
SOCNE 2012]
https://github.com/mkovatsc/Californium
Application Logic in the Cloud
24. CoAP for the Web of Things: From Tiny Resource-constrained Devices to the Web Browser 24|
Matthias Kovatsch
http://people.inf.ethz.ch/mkovatsc
Customization for SMEs and consumers
Actinium (Ac) App-server for Cf
Server-side JavaScript
CoapRequest object API
Feasibility study of scripting for
IoT applications
[Actinium: A RESTful Runtime Container for
Scriptable Internet of Things Applications,
IoT 2012]
https://github.com/mkovatsc/Actinium
Scripting for End-user Mashups