SlideShare ist ein Scribd-Unternehmen logo
1 von 44
CoAP
6LowPAN &
Raspberry Pi
M2M Community

Cristina Peña Alcega
Carlos Ralli Ucendo
Telefónica Digital
19.12.2013

(@CrisisP)
(@carlosralli)
Index
I

II

DIY Scenarios & Solutions

• Intro
• Scenario #1: z-wave + REST
• Scenario #2: 6LoWPAN + CoAP

Behind the scenes: Constrained Application Protocol

• Introduction and CoAP Architecture
• Messaging Model, Sub-layers, Reliability, Request/Response rules, and
• Proxying and Caching
• Endpoints and URIs
• Discovery
• Multicast
• Security
• Status, advantages and limitations
• Available implementations

Message Format.
I. DIY Scenarios
& Solutions
01

How it all started…
Things (Devices) are getting smarter, from Class-1 to Consumer Electronics.
If a Thing is an Internet node, it’s subject of APIzation.
REST is the most successful Internet/Web API.

CoRE /CoAP
So we decided to start ourselves investing some 480€ to play with:
- 4 6LowPAN capable Motes (360€), 2 Raspberry PI (120€).
- Plus lots of hours of DIY “fun”!
M2M Community
Telefónica Digital

4
02

Is CoAP Rocket Science? No, it’s just REST
Traditional REST WEB APIs relays on HTTP-TCP-IP
CoRE/CoAP = REST APIs over UDP-IP

M2M Community
Telefónica Digital

5
03

Scenario1: Building a CoAP (IoT) Gateway

M2M Community
Telefónica Digital

6
04

Scenario1: Software Architecture

M2M Community
Telefónica Digital

7
05

Scenario1: Step 1

1.1) Install & compile ccoap in your laptop
https://github.com/ipflavors/ccoap/tree/master/doc

M2M Community
Telefónica Digital

?
8
06

Scenario1: Step 2

1.2) Install Firefox Navigator plus Copper (CU) Plugin
https://addons.mozilla.org/en-US/firefox/addon/copper-270430/

M2M Community
Telefónica Digital

?
9
07

Scenario1: Step 3

1.3) Test Firefox Copper with a CoAP server available in the Internet:
coap://vs0.inf.ethz.ch:5683/

M2M Community
Telefónica Digital

10
08

Scenario1: Step 3b

1.3b) GET operation (of a long resource: 5x64bytes blocks):
coap://vs0.inf.ethz.ch:5683/

M2M Community
Telefónica Digital

11
09

Scenario1: Steps 4 & 5

1.4) Install z-way-server & configure z-wave devices w/ RaspberryPI.
pi@raspberrypi:~$ wget -q -O - razberry.z-wave.me/install | sudo bash

To test installation: http://[IP_address]:8083

1.5) Install libcoap4.0.1 run server example in RaspberryPI.
Download libcoap-4.0.1.tar.gz - http://sourceforge.net/projects/libcoap/
pi@raspberrypi:~$ tar xvzf libcoap-4.0.1.tar.gz
pi@raspberrypi:~$ cd libcoap-4.0.1
pi@raspberrypi:~$ ./configure
pi@raspberrypi:~$make

M2M Community
Telefónica Digital

12
10

Scenario1: Steps 4 & 5

1.6) Run CoAP server example in RaspberryPI.

M2M Community
Telefónica Digital

13
11

Scenario1: Step 6
1.6) Test against our RasPI server with Firefox Copper:
coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/

M2M Community
Telefónica Digital

14
12

Scenario1: Step 6b

1.6b) Discover resources of our CoAP-RasPI server with Firefox Copper:
coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/

M2M Community
Telefónica Digital

15
13

Scenario1: Step 6c

1.6c) GET operation (Firefox Copper):
coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/

M2M Community
Telefónica Digital

16
14

Scenario1: Step 6d

1.6d) OBSERVE operation (PUSH Notifications) (Firefox Copper):
coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/

M2M Community
Telefónica Digital

17
15

Scenario1: Step 7

1.7) Modify server example to create CoAP resources based on z-wave dev:

- Follow IPSO Alliance Recs:
http://www.ipso-alliance.org/wp-content/media/draft-ipso-app-framework-04.pdf

M2M Community
Telefónica Digital

18
16

Scenario1: Implementing all this in FI-WARE

We are updating some FI-WARE IoT Ges to support this:
- “FIGWAY” SW to export CoAP resources too.

https://github.com/telefonicaid/fiware-raspberryPI-M2M-Gateway
M2M Community
Telefónica Digital

19
17

Scenario1: A nice Project out there

WEBIPOI – Exports RasPI GPIO (wired) devices (CoRE & REST)
http://code.google.com/p/webiopi/wiki/INTRODUCTION

M2M Community
Telefónica Digital

?
20
18

Scenario2: CoAP (6LowPAN) Devices!
Two (or more) Contiki-supported motes

…

http://www.contiki-os.org/hardware.html
http://www.advanticsys.com/
http://www.zolertia.com
http://www.libelium.com (own Stack / OS)

“Nooliberry” -> 6LowPAN RasPI GPIO card
Your laptop
- MACOSX, Linux, Windows…

Install Instant-Contiki VM in your Laptop
http://www.contiki-os.org/start.html

App coding:
- Device: expose REST Resources over CoAP
- Client: consume REST Resources (CoAP or HTTP)
Web development as usual! Examples:
https://github.com/contiki-os/contiki/blob/master/examples/rest-example/coap?
M2M Community
Telefónica Digital

client-server-example.csc
21
19

Scenario2: How it looks like?

M2M Community
Telefónica Digital

22
20

Scenario2: Who’re already on board?

“Talking at CES today, Cerf described his home's
sensor network, which uses IPv6 radios and the
Arch Rock PhyNet smart grid system to track
information like light levels, temperature, and
humidity. This is important for a wine cellar…”

M2M Community
Telefónica Digital

23
II. Constrained
Application
Protocol
01

CoAP: Constrained Application Protocol
Internet
Constrained Enviroments




Low-power
Lossy, high packet error rates
Low thtoughpunt of 10s of kbps

Sensor
Resources

CoAP

HTTP

Proxy

Server

HTTP

Client

CoAP
UDP
6LoWPAN
802.15.4





Contiki, Tiny OS, …
8-bit microcontrollers
Aprox. 100KB of RAM for code,
heap, data…
No filesystem

CoAP is an application layer protocol that enables web services for even the
most constrained devices and networks, while integrating with the web
architecture and HTTP.
M2M Community
Telefónica Digital

25
02

CoAP: Designed for M2M

•

CoAP implements the REST architectural style:
 can be transparently mapped to HTTP

•

CoAP goes beyond HTTP providing:






M2M Community
Telefónica Digital

Very low over-head, avoids the need of IPv6 fragmentation
Built-in discovery of services and resources
Multicast support
Asynchronous messages exchanges
Native push notification

26
02

CoAP: The Web Architecture vs CoAP Architecture
The interaction model of CoAP is similar to the client/server model of
the Web. However, M2M interactions typically result in a CoAP
implementation acting in both client and server roles.

M2M Community
Telefónica Digital

27
03

CoAP: Messaging Model

•
•
•
•

•
•

•

Short fixed-length binary header (4bytes)
Messages must fit in a single IP datagram
 Default IP: 1280bytes,
 6LoWPAN and IEEE802.15.4 127bytes

Messages can be confirmable (CON) or non confirmable (NON).
Naturally runs over UDP and supports :
 multicast IP destination addresses
 DTLS security

Piggy-backed REST request/response
 The response to a CON message is carried in the ACK

Request methods: GET, PUT, POST, and DELETE almost as in
HTTP.
Response methods: 2.xx (success), 4.xx (client error), 5.xx (server
error).

M2M Community
Telefónica Digital

28
04

CoAP: Sub-layers

Source: Matthias Kovatsch

M2M Community
Telefónica Digital

29
05

CoAP: Unreliable Transmission

•
•
•

Tipically, repeated readings from a sensor
If server lacks context to answer the request, sends Reset (RST)
Client can send the same mesage several times to ensure it reaches
the server

M2M Community
Telefónica Digital

30
06

CoAP: Observing resources without reliability
Source: Klaus Hartke

M2M Community
Telefónica Digital

31
07

CoAP: Reliable Transmission

•

Normally bounded to non-reliable transport protocols, CoAP
implements a lightweight reliability mechanism based on:
 Stop&wait retransmisssion for CON
 Duplicated detection for CON and NON

M2M Community
Telefónica Digital

32
08

CoAP: Observing resources with reliability
Source: Klaus Hartke

M2M Community
Telefónica Digital

33
09

CoAP:
Request/Response
Rules

M2M Community
Telefónica Digital

Source: http://www.coapsharp.com
34
10

CoAP: Message Format

Source: Matthias Kovatsch
M2M Community
Telefónica Digital

35
11

CoAP: Proxying and Caching

•

CoAP supports caching





Cacheability determined by response code
An option number mask determines if it is a cache key.
Max-age option indicates cache lifetime
Validity checked using the Etag Option

•

Caching can be at endpoint or intermediary (proxy).

•

Proxy can be used to
 Improve performance (reduce network load)
 Access sleeping nodes
 Security reasons

•

Very easy mapping CoAP (Cross-protocol-proxy)HTTP

M2M Community
Telefónica Digital

36
12

CoAP: Proxying and Caching

M2M Community
Telefónica Digital

37
13

CoAP: Endpoints and URIs

•
•
•
•
•

A CoAP endpoint is a source or destination of a message.
URI representations for resources:
 coap-URI = "coap:" "//" <HOST> [ ":" <PORT> ] <PATH> [ "?" <QUERY> ]
 coaps-URI = "coaps:" "//" <HOST> [ ":" <PORT> ] <PATH> [ "?" <QUERY> ]

HOST can be an IP address or a registered name.
PORT where CoAP server is located (default CoAP port: 5683)
Example: coap://example.com:436/sensors/temp?min=10





M2M Community
Telefónica Digital

Host: example.com
Port: 436
Path: sensors/temp
Query: min=10

38
14

CoAP: Service and Resource Discovery
1. Discovering the servers:
 If unknown, the client has to learn HOST server

2. Discovering the resources
 The client queries the well known URI of the server on port 5683
 The server returns the list of resources in CoRE Link Format
GET /.well-known/core
<sensors/temp>;sz=512;title=Temperature Sensor;ct=50,
<actuators/jack>;sz=256;title=Hydraulic Jacks;ct=50

3. Both steps can be merged, querying the well known URI of “all
4.

CoAP nodes” using multicast address FF0X:0:0:0:0:0:0:C0A7
Resource Directories can be used
Related spec:
• RFC 5785 defines the a path prefix for "well-known locations“
• RFC 5988 defines the types of web links and a registry for them
• RFC 6690 defines a link format for user Web Link in CORE.

M2M Community
Telefónica Digital

39
15

CoAP: RESTful Group Communication

•

CoAP supports making requests to IP multicast groups in NON

•
•

Leisure time
CoAP does not support yet the use of multicast with security

M2M Community
Telefónica Digital

40
16

CoAP: Security

•
•

•
•
•
•

•

CoAP is secured using Datagram TLS (RFC6347) over UDP.
The endpoint initiates session to the server and, after the DTLS
handshake, it can send the 1st CoAP request.
All CoAP messages are sent as DTLS “application data”.
DTLS adds a limited per-datagram overhead of aprox 13 bytes.
Security info (e.g. keys, ACLs) must be provided during the
provisioning of the device.
The device can be in 1 of 4 security modes:
 NoSec: DTLS is disabled. Can be combined with alternative security
(e.g. IPSEC)
 PreSharedKey: DTLS enabled, preshared keys authenticate peers or
groups of peers.
 RawPublicKey: DTLS enabled, asymmetric keys without certificate.
 Certificate: DTLS enabled, asymmetric keys with x.509 certificate.

DTLS is not appropriate to group keying (multicast).

M2M Community
Telefónica Digital

41
17

CoAP: Status, Advantages and Limitations

•

Proposed standard since July, 2013: draft-ietf-core-coap-18.

•

Advantages:





•

Designed for M2M, IoT
Easily mapped to HTTP, compatible with Proxy infrastructures.
Easy to map legacy protocols to CoAP
Extensions: push notifications, discovery and Multicast.

Limitations and work in progress:
 End to end secure connection required for CoAP/HTTP mapping at a
proxy using DTLS/TLS.
 Securing multicast communications.
 Semantics should be standardized.
 Caching of requests should also be allowed

M2M Community
Telefónica Digital

42
18

CoAP: available implementations

•

Implementations







•

•

Contiki-2.6: Erbium http://www.contiki-os.org/
C: libcoap http://sourceforge.net/projects/libcoap/develop
.NET (C#): CoAPSharp http://www.coapsharp.com/
Python: http://sourceforge.net/projects/coapy
JAVA: Californium https://github.com/mkovatsc/Californium
Firefox JavaScript browser plugin: Copper
https://github.com/mkovatsc/Copper,
https://addons.mozilla.org/de/firefox/addon/copper-270430/

Proxies:
 Squid 3.1.9 with transparent HTTP-CoAP mapping module
http://telecom.dei.unipd.it/pages/read/90/
 jcoap Proxy http://code.google.com/p/jcoap/
 Californium cf-proxy https://github.com/mkovatsc/Californium

Updated List:
http://en.wikipedia.org/wiki/Constrained_Application_Protocol#Implementati
ons

M2M Community
Telefónica Digital

43
CoAP Course for m2m and Internet of Things scenarios

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction MQTT in English
Introduction MQTT in EnglishIntroduction MQTT in English
Introduction MQTT in EnglishEric Xiao
 
Message queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatMessage queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatHamdamboy (함담보이)
 
Network address translation
Network address translationNetwork address translation
Network address translationVarsha Honde
 
IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)
IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)
IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)PeterNiblett
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes EverythingLori MacVittie
 
Ns3 implementation wifi
Ns3 implementation wifiNs3 implementation wifi
Ns3 implementation wifiSalah Amean
 
Lecture application layer
Lecture application layerLecture application layer
Lecture application layerHasam Panezai
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)Kruti Niranjan
 
Basics of HTTP - Nafis Fuad
Basics of HTTP - Nafis FuadBasics of HTTP - Nafis Fuad
Basics of HTTP - Nafis FuadCefalo
 
Introduction To Webrtc
Introduction To WebrtcIntroduction To Webrtc
Introduction To WebrtcKnoldus Inc.
 
mpeg2ts1_es_pes_ps_ts_psi
mpeg2ts1_es_pes_ps_ts_psimpeg2ts1_es_pes_ps_ts_psi
mpeg2ts1_es_pes_ps_ts_psihexiay
 

Was ist angesagt? (20)

OSI Layers
OSI LayersOSI Layers
OSI Layers
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
Introduction MQTT in English
Introduction MQTT in EnglishIntroduction MQTT in English
Introduction MQTT in English
 
Message queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message formatMessage queuing telemetry transport (mqtt) message format
Message queuing telemetry transport (mqtt) message format
 
WebRTC presentation
WebRTC presentationWebRTC presentation
WebRTC presentation
 
Network address translation
Network address translationNetwork address translation
Network address translation
 
IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)
IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)
IAB-5039 : MQTT: A Protocol for the Internet of Things (InterConnect 2015)
 
HTTP/2 Changes Everything
HTTP/2 Changes EverythingHTTP/2 Changes Everything
HTTP/2 Changes Everything
 
WebRTC Seminar Report
WebRTC  Seminar ReportWebRTC  Seminar Report
WebRTC Seminar Report
 
MQTT
MQTTMQTT
MQTT
 
Ns3 implementation wifi
Ns3 implementation wifiNs3 implementation wifi
Ns3 implementation wifi
 
Lecture application layer
Lecture application layerLecture application layer
Lecture application layer
 
Icmp V4 And Icmp V6
Icmp V4 And Icmp V6Icmp V4 And Icmp V6
Icmp V4 And Icmp V6
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
IoT Coap
IoT Coap IoT Coap
IoT Coap
 
Basics of HTTP - Nafis Fuad
Basics of HTTP - Nafis FuadBasics of HTTP - Nafis Fuad
Basics of HTTP - Nafis Fuad
 
Socket programming
Socket programmingSocket programming
Socket programming
 
Introduction To Webrtc
Introduction To WebrtcIntroduction To Webrtc
Introduction To Webrtc
 
RabbitMQ & Kafka
RabbitMQ & KafkaRabbitMQ & Kafka
RabbitMQ & Kafka
 
mpeg2ts1_es_pes_ps_ts_psi
mpeg2ts1_es_pes_ps_ts_psimpeg2ts1_es_pes_ps_ts_psi
mpeg2ts1_es_pes_ps_ts_psi
 

Andere mochten auch

Sap sap so h 2013
Sap sap so h 2013Sap sap so h 2013
Sap sap so h 2013deepersnet
 
Internet of Things (IoT) protocols COAP MQTT OSCON2014
Internet of Things (IoT) protocols  COAP MQTT OSCON2014Internet of Things (IoT) protocols  COAP MQTT OSCON2014
Internet of Things (IoT) protocols COAP MQTT OSCON2014Vidhya Gholkar
 
Predictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use CasesPredictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use CasesKimberley Mitchell
 
Blockchain in IoT and Other Considerations by Dinis Guarda
Blockchain in IoT and Other Considerations by Dinis GuardaBlockchain in IoT and Other Considerations by Dinis Guarda
Blockchain in IoT and Other Considerations by Dinis GuardaDinis Guarda
 
CBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primerCBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primerBlockstrap.com
 

Andere mochten auch (6)

Sap sap so h 2013
Sap sap so h 2013Sap sap so h 2013
Sap sap so h 2013
 
Internet of Things (IoT) protocols COAP MQTT OSCON2014
Internet of Things (IoT) protocols  COAP MQTT OSCON2014Internet of Things (IoT) protocols  COAP MQTT OSCON2014
Internet of Things (IoT) protocols COAP MQTT OSCON2014
 
Predictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use CasesPredictive Analytics: Context and Use Cases
Predictive Analytics: Context and Use Cases
 
Blockchain in IoT and Other Considerations by Dinis Guarda
Blockchain in IoT and Other Considerations by Dinis GuardaBlockchain in IoT and Other Considerations by Dinis Guarda
Blockchain in IoT and Other Considerations by Dinis Guarda
 
Supply Chain Strategy
Supply Chain StrategySupply Chain Strategy
Supply Chain Strategy
 
CBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primerCBGTBT - Part 1 - Workshop introduction & primer
CBGTBT - Part 1 - Workshop introduction & primer
 

Ähnlich wie CoAP Course for m2m and Internet of Things scenarios

Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and CaliforniumJulien Vermillard
 
Practice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China MobilePractice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China MobileDataWorks Summit
 
How to run a bank on Apache CloudStack
How to run a bank on Apache CloudStackHow to run a bank on Apache CloudStack
How to run a bank on Apache CloudStackgjdevos
 
The constrained application protocol (coap)
The constrained application protocol (coap)The constrained application protocol (coap)
The constrained application protocol (coap)Hamdamboy
 
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoTMphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoTAniruddha Chakrabarti
 
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...gogo6
 
Generic network architecture discussion
Generic network architecture discussionGeneric network architecture discussion
Generic network architecture discussionARCFIRE ICT
 
Event Detection Pipelines with Apache Kafka
Event Detection Pipelines with Apache KafkaEvent Detection Pipelines with Apache Kafka
Event Detection Pipelines with Apache KafkaDataWorks Summit
 
Deploying IPv6 in OpenStack Environments
Deploying IPv6 in OpenStack EnvironmentsDeploying IPv6 in OpenStack Environments
Deploying IPv6 in OpenStack EnvironmentsShannon McFarland
 
Intro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networkingIntro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networkingPacket
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the EdgeRed Hat
 
Scaling the Container Dataplane
Scaling the Container Dataplane Scaling the Container Dataplane
Scaling the Container Dataplane Michelle Holley
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftRX-M Enterprises LLC
 
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Jakub Botwicz
 
Building the Internet of Things with Eclipse IoT - IoTBE meetup
Building the Internet of Things with Eclipse IoT - IoTBE meetupBuilding the Internet of Things with Eclipse IoT - IoTBE meetup
Building the Internet of Things with Eclipse IoT - IoTBE meetupBenjamin Cabé
 

Ähnlich wie CoAP Course for m2m and Internet of Things scenarios (20)

Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
 
KONG-APIGateway.pptx
KONG-APIGateway.pptxKONG-APIGateway.pptx
KONG-APIGateway.pptx
 
Practice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China MobilePractice of large Hadoop cluster in China Mobile
Practice of large Hadoop cluster in China Mobile
 
How to run a bank on Apache CloudStack
How to run a bank on Apache CloudStackHow to run a bank on Apache CloudStack
How to run a bank on Apache CloudStack
 
The constrained application protocol (coap)
The constrained application protocol (coap)The constrained application protocol (coap)
The constrained application protocol (coap)
 
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoTMphasis Digital POV - Emerging Open Standard Protocol stack for IoT
Mphasis Digital POV - Emerging Open Standard Protocol stack for IoT
 
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
IoT Field Area Network Solutions & Integration of IPv6 Standards by Patrick G...
 
Generic network architecture discussion
Generic network architecture discussionGeneric network architecture discussion
Generic network architecture discussion
 
Event Detection Pipelines with Apache Kafka
Event Detection Pipelines with Apache KafkaEvent Detection Pipelines with Apache Kafka
Event Detection Pipelines with Apache Kafka
 
Deploying IPv6 in OpenStack Environments
Deploying IPv6 in OpenStack EnvironmentsDeploying IPv6 in OpenStack Environments
Deploying IPv6 in OpenStack Environments
 
Intro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networkingIntro to Project Calico: a pure layer 3 approach to scale-out networking
Intro to Project Calico: a pure layer 3 approach to scale-out networking
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
 
Scaling the Container Dataplane
Scaling the Container Dataplane Scaling the Container Dataplane
Scaling the Container Dataplane
 
Building high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache ThriftBuilding high performance microservices in finance with Apache Thrift
Building high performance microservices in finance with Apache Thrift
 
CoAP - Web Protocol for IoT
CoAP - Web Protocol for IoTCoAP - Web Protocol for IoT
CoAP - Web Protocol for IoT
 
DevCon 5 (July 2013) - WebSockets
DevCon 5 (July 2013) - WebSocketsDevCon 5 (July 2013) - WebSockets
DevCon 5 (July 2013) - WebSockets
 
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
Cotopaxi - IoT testing toolkit (Black Hat Asia 2019 Arsenal)
 
Kafka talk
Kafka talkKafka talk
Kafka talk
 
Haystack + DASH7 Security
Haystack + DASH7 SecurityHaystack + DASH7 Security
Haystack + DASH7 Security
 
Building the Internet of Things with Eclipse IoT - IoTBE meetup
Building the Internet of Things with Eclipse IoT - IoTBE meetupBuilding the Internet of Things with Eclipse IoT - IoTBE meetup
Building the Internet of Things with Eclipse IoT - IoTBE meetup
 

Kürzlich hochgeladen

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

CoAP Course for m2m and Internet of Things scenarios

  • 1. CoAP 6LowPAN & Raspberry Pi M2M Community Cristina Peña Alcega Carlos Ralli Ucendo Telefónica Digital 19.12.2013 (@CrisisP) (@carlosralli)
  • 2. Index I II DIY Scenarios & Solutions • Intro • Scenario #1: z-wave + REST • Scenario #2: 6LoWPAN + CoAP Behind the scenes: Constrained Application Protocol • Introduction and CoAP Architecture • Messaging Model, Sub-layers, Reliability, Request/Response rules, and • Proxying and Caching • Endpoints and URIs • Discovery • Multicast • Security • Status, advantages and limitations • Available implementations Message Format.
  • 3. I. DIY Scenarios & Solutions
  • 4. 01 How it all started… Things (Devices) are getting smarter, from Class-1 to Consumer Electronics. If a Thing is an Internet node, it’s subject of APIzation. REST is the most successful Internet/Web API. CoRE /CoAP So we decided to start ourselves investing some 480€ to play with: - 4 6LowPAN capable Motes (360€), 2 Raspberry PI (120€). - Plus lots of hours of DIY “fun”! M2M Community Telefónica Digital 4
  • 5. 02 Is CoAP Rocket Science? No, it’s just REST Traditional REST WEB APIs relays on HTTP-TCP-IP CoRE/CoAP = REST APIs over UDP-IP M2M Community Telefónica Digital 5
  • 6. 03 Scenario1: Building a CoAP (IoT) Gateway M2M Community Telefónica Digital 6
  • 7. 04 Scenario1: Software Architecture M2M Community Telefónica Digital 7
  • 8. 05 Scenario1: Step 1 1.1) Install & compile ccoap in your laptop https://github.com/ipflavors/ccoap/tree/master/doc M2M Community Telefónica Digital ? 8
  • 9. 06 Scenario1: Step 2 1.2) Install Firefox Navigator plus Copper (CU) Plugin https://addons.mozilla.org/en-US/firefox/addon/copper-270430/ M2M Community Telefónica Digital ? 9
  • 10. 07 Scenario1: Step 3 1.3) Test Firefox Copper with a CoAP server available in the Internet: coap://vs0.inf.ethz.ch:5683/ M2M Community Telefónica Digital 10
  • 11. 08 Scenario1: Step 3b 1.3b) GET operation (of a long resource: 5x64bytes blocks): coap://vs0.inf.ethz.ch:5683/ M2M Community Telefónica Digital 11
  • 12. 09 Scenario1: Steps 4 & 5 1.4) Install z-way-server & configure z-wave devices w/ RaspberryPI. pi@raspberrypi:~$ wget -q -O - razberry.z-wave.me/install | sudo bash To test installation: http://[IP_address]:8083 1.5) Install libcoap4.0.1 run server example in RaspberryPI. Download libcoap-4.0.1.tar.gz - http://sourceforge.net/projects/libcoap/ pi@raspberrypi:~$ tar xvzf libcoap-4.0.1.tar.gz pi@raspberrypi:~$ cd libcoap-4.0.1 pi@raspberrypi:~$ ./configure pi@raspberrypi:~$make M2M Community Telefónica Digital 12
  • 13. 10 Scenario1: Steps 4 & 5 1.6) Run CoAP server example in RaspberryPI. M2M Community Telefónica Digital 13
  • 14. 11 Scenario1: Step 6 1.6) Test against our RasPI server with Firefox Copper: coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/ M2M Community Telefónica Digital 14
  • 15. 12 Scenario1: Step 6b 1.6b) Discover resources of our CoAP-RasPI server with Firefox Copper: coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/ M2M Community Telefónica Digital 15
  • 16. 13 Scenario1: Step 6c 1.6c) GET operation (Firefox Copper): coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/ M2M Community Telefónica Digital 16
  • 17. 14 Scenario1: Step 6d 1.6d) OBSERVE operation (PUSH Notifications) (Firefox Copper): coap://[2a02:9113:****:1f00:b***:****:****:***f]:5683/ M2M Community Telefónica Digital 17
  • 18. 15 Scenario1: Step 7 1.7) Modify server example to create CoAP resources based on z-wave dev: - Follow IPSO Alliance Recs: http://www.ipso-alliance.org/wp-content/media/draft-ipso-app-framework-04.pdf M2M Community Telefónica Digital 18
  • 19. 16 Scenario1: Implementing all this in FI-WARE We are updating some FI-WARE IoT Ges to support this: - “FIGWAY” SW to export CoAP resources too. https://github.com/telefonicaid/fiware-raspberryPI-M2M-Gateway M2M Community Telefónica Digital 19
  • 20. 17 Scenario1: A nice Project out there WEBIPOI – Exports RasPI GPIO (wired) devices (CoRE & REST) http://code.google.com/p/webiopi/wiki/INTRODUCTION M2M Community Telefónica Digital ? 20
  • 21. 18 Scenario2: CoAP (6LowPAN) Devices! Two (or more) Contiki-supported motes … http://www.contiki-os.org/hardware.html http://www.advanticsys.com/ http://www.zolertia.com http://www.libelium.com (own Stack / OS) “Nooliberry” -> 6LowPAN RasPI GPIO card Your laptop - MACOSX, Linux, Windows… Install Instant-Contiki VM in your Laptop http://www.contiki-os.org/start.html App coding: - Device: expose REST Resources over CoAP - Client: consume REST Resources (CoAP or HTTP) Web development as usual! Examples: https://github.com/contiki-os/contiki/blob/master/examples/rest-example/coap? M2M Community Telefónica Digital client-server-example.csc 21
  • 22. 19 Scenario2: How it looks like? M2M Community Telefónica Digital 22
  • 23. 20 Scenario2: Who’re already on board? “Talking at CES today, Cerf described his home's sensor network, which uses IPv6 radios and the Arch Rock PhyNet smart grid system to track information like light levels, temperature, and humidity. This is important for a wine cellar…” M2M Community Telefónica Digital 23
  • 25. 01 CoAP: Constrained Application Protocol Internet Constrained Enviroments    Low-power Lossy, high packet error rates Low thtoughpunt of 10s of kbps Sensor Resources CoAP HTTP Proxy Server HTTP Client CoAP UDP 6LoWPAN 802.15.4     Contiki, Tiny OS, … 8-bit microcontrollers Aprox. 100KB of RAM for code, heap, data… No filesystem CoAP is an application layer protocol that enables web services for even the most constrained devices and networks, while integrating with the web architecture and HTTP. M2M Community Telefónica Digital 25
  • 26. 02 CoAP: Designed for M2M • CoAP implements the REST architectural style:  can be transparently mapped to HTTP • CoAP goes beyond HTTP providing:      M2M Community Telefónica Digital Very low over-head, avoids the need of IPv6 fragmentation Built-in discovery of services and resources Multicast support Asynchronous messages exchanges Native push notification 26
  • 27. 02 CoAP: The Web Architecture vs CoAP Architecture The interaction model of CoAP is similar to the client/server model of the Web. However, M2M interactions typically result in a CoAP implementation acting in both client and server roles. M2M Community Telefónica Digital 27
  • 28. 03 CoAP: Messaging Model • • • • • • • Short fixed-length binary header (4bytes) Messages must fit in a single IP datagram  Default IP: 1280bytes,  6LoWPAN and IEEE802.15.4 127bytes Messages can be confirmable (CON) or non confirmable (NON). Naturally runs over UDP and supports :  multicast IP destination addresses  DTLS security Piggy-backed REST request/response  The response to a CON message is carried in the ACK Request methods: GET, PUT, POST, and DELETE almost as in HTTP. Response methods: 2.xx (success), 4.xx (client error), 5.xx (server error). M2M Community Telefónica Digital 28
  • 29. 04 CoAP: Sub-layers Source: Matthias Kovatsch M2M Community Telefónica Digital 29
  • 30. 05 CoAP: Unreliable Transmission • • • Tipically, repeated readings from a sensor If server lacks context to answer the request, sends Reset (RST) Client can send the same mesage several times to ensure it reaches the server M2M Community Telefónica Digital 30
  • 31. 06 CoAP: Observing resources without reliability Source: Klaus Hartke M2M Community Telefónica Digital 31
  • 32. 07 CoAP: Reliable Transmission • Normally bounded to non-reliable transport protocols, CoAP implements a lightweight reliability mechanism based on:  Stop&wait retransmisssion for CON  Duplicated detection for CON and NON M2M Community Telefónica Digital 32
  • 33. 08 CoAP: Observing resources with reliability Source: Klaus Hartke M2M Community Telefónica Digital 33
  • 35. 10 CoAP: Message Format Source: Matthias Kovatsch M2M Community Telefónica Digital 35
  • 36. 11 CoAP: Proxying and Caching • CoAP supports caching     Cacheability determined by response code An option number mask determines if it is a cache key. Max-age option indicates cache lifetime Validity checked using the Etag Option • Caching can be at endpoint or intermediary (proxy). • Proxy can be used to  Improve performance (reduce network load)  Access sleeping nodes  Security reasons • Very easy mapping CoAP (Cross-protocol-proxy)HTTP M2M Community Telefónica Digital 36
  • 37. 12 CoAP: Proxying and Caching M2M Community Telefónica Digital 37
  • 38. 13 CoAP: Endpoints and URIs • • • • • A CoAP endpoint is a source or destination of a message. URI representations for resources:  coap-URI = "coap:" "//" <HOST> [ ":" <PORT> ] <PATH> [ "?" <QUERY> ]  coaps-URI = "coaps:" "//" <HOST> [ ":" <PORT> ] <PATH> [ "?" <QUERY> ] HOST can be an IP address or a registered name. PORT where CoAP server is located (default CoAP port: 5683) Example: coap://example.com:436/sensors/temp?min=10     M2M Community Telefónica Digital Host: example.com Port: 436 Path: sensors/temp Query: min=10 38
  • 39. 14 CoAP: Service and Resource Discovery 1. Discovering the servers:  If unknown, the client has to learn HOST server 2. Discovering the resources  The client queries the well known URI of the server on port 5683  The server returns the list of resources in CoRE Link Format GET /.well-known/core <sensors/temp>;sz=512;title=Temperature Sensor;ct=50, <actuators/jack>;sz=256;title=Hydraulic Jacks;ct=50 3. Both steps can be merged, querying the well known URI of “all 4. CoAP nodes” using multicast address FF0X:0:0:0:0:0:0:C0A7 Resource Directories can be used Related spec: • RFC 5785 defines the a path prefix for "well-known locations“ • RFC 5988 defines the types of web links and a registry for them • RFC 6690 defines a link format for user Web Link in CORE. M2M Community Telefónica Digital 39
  • 40. 15 CoAP: RESTful Group Communication • CoAP supports making requests to IP multicast groups in NON • • Leisure time CoAP does not support yet the use of multicast with security M2M Community Telefónica Digital 40
  • 41. 16 CoAP: Security • • • • • • • CoAP is secured using Datagram TLS (RFC6347) over UDP. The endpoint initiates session to the server and, after the DTLS handshake, it can send the 1st CoAP request. All CoAP messages are sent as DTLS “application data”. DTLS adds a limited per-datagram overhead of aprox 13 bytes. Security info (e.g. keys, ACLs) must be provided during the provisioning of the device. The device can be in 1 of 4 security modes:  NoSec: DTLS is disabled. Can be combined with alternative security (e.g. IPSEC)  PreSharedKey: DTLS enabled, preshared keys authenticate peers or groups of peers.  RawPublicKey: DTLS enabled, asymmetric keys without certificate.  Certificate: DTLS enabled, asymmetric keys with x.509 certificate. DTLS is not appropriate to group keying (multicast). M2M Community Telefónica Digital 41
  • 42. 17 CoAP: Status, Advantages and Limitations • Proposed standard since July, 2013: draft-ietf-core-coap-18. • Advantages:     • Designed for M2M, IoT Easily mapped to HTTP, compatible with Proxy infrastructures. Easy to map legacy protocols to CoAP Extensions: push notifications, discovery and Multicast. Limitations and work in progress:  End to end secure connection required for CoAP/HTTP mapping at a proxy using DTLS/TLS.  Securing multicast communications.  Semantics should be standardized.  Caching of requests should also be allowed M2M Community Telefónica Digital 42
  • 43. 18 CoAP: available implementations • Implementations       • • Contiki-2.6: Erbium http://www.contiki-os.org/ C: libcoap http://sourceforge.net/projects/libcoap/develop .NET (C#): CoAPSharp http://www.coapsharp.com/ Python: http://sourceforge.net/projects/coapy JAVA: Californium https://github.com/mkovatsc/Californium Firefox JavaScript browser plugin: Copper https://github.com/mkovatsc/Copper, https://addons.mozilla.org/de/firefox/addon/copper-270430/ Proxies:  Squid 3.1.9 with transparent HTTP-CoAP mapping module http://telecom.dei.unipd.it/pages/read/90/  jcoap Proxy http://code.google.com/p/jcoap/  Californium cf-proxy https://github.com/mkovatsc/Californium Updated List: http://en.wikipedia.org/wiki/Constrained_Application_Protocol#Implementati ons M2M Community Telefónica Digital 43