CoAP, Copper, and Embedded Web Resources
-
Upload
matthias-kovatsch -
Category
Technology
-
view
115 -
download
1
description
Transcript of CoAP, Copper, and Embedded Web Resources
Tuesday, 03 Apr 2012
CoAP, Copper, and Embedded Web Resources
Matthias Kovatsch [email protected]
Internet of Things Zurich Meetup, Zurich, Switzerland
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
What About Really Cheap Platforms?
2
Smart
Dust
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
Outcome
3
Wireless Sensor Networks
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
IP Connectivity through 6LoWPAN
4
IP router
Web server
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
Constrained Application Protocol (CoAP)
A new Web-like protocol based on REST
5
URIs
Internet Media Types
Extensible option headers
GET, PUT, POST, DELETE
Interoperability
Common
programming model
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
The CoAP Universe
IETF working group «Constrained RESTful Environments» RESTful Web services for mote-class devices
Transparent mapping to HTTP
Observing Resources publish/subscribe
Group communication IP multicast
CoRE Link Format Web linking RFC, discovery
Caching proxies RESTful caching
Resource directories sleepy nodes
Blockwise transfers bulky data
…
6
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
CoAP is Optimized, Binary…
7
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
Copper (Cu) CoAP user-agent
8
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
Embedded Web Resources
9
/consumption
/consumption/consumed
/consumption/generated
/max/power
/max/current
/max/voltage
/meter/power
/meter/current
/meter/voltage
/meter/frequency
/meter/phase
/meter/reactive
/reset
/switch
/debug/…
/config/date
/config/mode
/config/time
/debug/…
/sensors/battery
/sensors/temp
/sensors/user
/set/valve
/set/target
/actuators/leds
/debug/channel
/debug/neighbors
/debug/observers
/debug/routes
/sensors/batter
y /sensors/button
/sensors/humidity
/sensors/light
/sensors/temperature
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
Profiles for Embedded Web Resources
10
IPSO Profile
Pure RESTful design
Treats CoAP and HTTP equally
Currently still cryptic identifiers
due to size optimizations
(e.g., /lt for light)
Smart Energy Profile 2.0
SOAP-like service design
over REST
Currently only defined for
HTTP, CoAP in the draft
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
CoAP Open Source Implementations*
11
Erbium for Contiki
REST Engine
For embedded devices
Enables thin server
architecture
Copper for Firefox
CoAP user-agent
For user interaction
Integration and testing
tool
Californium in Java
CoAP framework
For the back-end
Clients, servers,
and proxies
Available on GitHub: https://github.com/mkovatsc
Successfully tested at the ETSI IoT CoAP Plugtests, Paris, France, Mar 2012: http://www.etsi.org/plugtests/coap/coap.htm *
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
THANK YOU
Questions?
12
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
Protocol Stack
13
Layer Protocol
Application CoAP
Transport UDP
Network IPv6 / RPL
Adaption 6LoWPAN
MAC CSMA / link-layer bursts
Radio Duty Cycling IEEE 802.15.4e / ContikiMAC
Physical IEEE 802.15.4
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
CoAP Message Format
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|Ver| T | OC | Code | Message ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Options (if any) ... | (Terminator) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Payload (if any) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
14
CoAP, Copper, and Embedded Web Resources Matthias Kovatsch – ETH Zürich
CoAP Option Encoding
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| Option Delta | Length | for 0..14
+---+---+---+---+---+---+---+---+
| Option Value ...
+---+---+---+---+---+---+---+---+
for 15..270
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| Option Delta | 1 1 1 1 | Length - 15 |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| Option Value ...
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
15