SlideShare a Scribd company logo
CoAP Talk
Basuke Suzuki - @basuke
Kinoma
IoT Fest January 29, 2015 at MIT
Agenda
• What is CoAP?
• DEMO with KinomaJS on Create
• Behind the scene
• Dive into CoAP internals
• Possibility, Deficiency, Other Protocols, etc.
What is CoAP?
• Constraint Application Protocol
• Protocol for embedded devices, IoT, M2M.
• Defined in RFC 7252
• CoAP = Lightweight Fast HTTP
CoAP is Lightweight
• Message is simple binary format. Easy to parse. Space
efficient.
• Client and server share the internal structures, so easy to
implement both client and server compare to HTTP.
• RFC Document is just 112 pages. Seriously it’s short. With
the full example use case and the default values for timeout
or retry count, which is very valuable.
CoAP is Fast
• Implemented on top of UDP
• Stateless. No connection. Less overhead.
• Faster by omitting the protocol level reliability.
• Choices are yours
CoAP is HTTP (almost)
• Request and Response model
• RESTful design, GET/PUT/POST/DELETE
• Addressable by URL with query string
• Content-Type can be specified, but limited to pre-
defined types, text, json, xml, etc…
HTTP is Great, but…
• Reliability is based on the TCP.
• HTTP Headers are just text with structure, so easy to
read for human, but not for machine.
• 20+ years history and so many extensions to take care
of. Headers are always huge. 700-800 bytes average
today (Google SPDY report)
• Not the best choice for IoT world.
CoAP is NOT HTTP
• UDP instead of TCP
• No overhead of headers
• Limited Content-Types
• Headers are limited to pre-defined one
• Content size is limited to packet size. Depend on the
lower level stack. On UNIX, about 1K.
UDP is fast, simple
• Connection less, no handshake
• Used for Video-streaming, DNS, DHCP, RIP
• 1:N communication - Broadcast and Multicast
• Small overhead of packet
• UDP: 8 bytes < TCP: 20+ bytes
but UDP is Unreliable!
• Packet may deliver to the destination more than
once, or may not deliver at all
• Packets may not arrive in order of delivery
• Sender does not know if or when the packet is
delivered
• Application-layer must implement these features if
they need those reliabilities.
TCP is Reliable
• Sender knows the result of the delivery. If not delivered,
retransmit until it fails by timeout.
• If sender send A then B, receiver receive A and B in that
order.
• TCP is streaming transmission so that there are no limit of
data size.
• With its congestion control, bandwidth won’t filled by the re-
transmitted packets.
CoAP is reliable by itself
• Duplicate detection by 16bit Message ID
• Acknowledgement response with data
• Each request contains a token. The token is binary
data defined by the application. That same token
must be included in the response. The token is what
allows the requestor to match a response to a
request.
CoAP is reliable by itself
• Retransmission of message with exponentially
incrementing interval, to prevent congestion of the
network by transmission.
• These features are optional. If you really need
speed, you can choose to disable them.
(cont.)
HTTP is Infrastructure
• HTTP freed up developers from application
• For many years, protocols are only for specific
purpose. (SMTP, FTP, DNS, etc)
• HTTP was originally for delivery of information to
human, but now it is basic infrastructure of the
conversation of programs.
• So does CoAP, in IoT field.
“CoAP is the first UDP
protocol which has the
freedom of application level
usage.”
– Basuke Suzuki (2015)
DEMO
• CoAP Server and Client
• Share color information
Kinoma Create
• Kinoma Create is
the JavaScript-
powered
construction kit for
Internet of Things
devices and other
connected
electronics.
A lot of Pins
CoAP on KinomaJS
var client = new CoAP.Client();
client.onResponse = function(response) {
// success
};
client.onError(err) {
// failure
};
client.request(“coap://10.0.1.109/color”, ’GET’);
CoAP on KinomaJS
var client = new CoAP.Client();
client.request({
uri: “coap://10.0.1.109/color”,
method: ’GET’,
}).then(function(response) {
// success
}, function(err) {
// failure
});
CoAP in Depth
CoAP Message Format
• Minimum bytes are 4 bytes. (Empty Message)
• Must be fit inside UDP packet
Fixed Header
Version. Always 01.
Message Type. 2 bits.
Token Length
Token
• 0 to 8 bytes binary
• length is specified in the header
• Response must have same token value with request.
• The value of the token is defined by the application layer.
Protocol doesn’t care about the contents.
• Use case: request kind, sequence number, etc.
Options
• Option types are defined as integer index.
• Option format is defined for each Option type.
• Empty, Unsigned Integer, String, Binary
Payload
• Payload is optional. If it exists, Payload Marker (0xff)
must be exist to indicate the beginning of payload.
• Format is specified by Content-Format option.
• Available formats are: Text, JSON, XML, EXI,
Binary
Message Code
• 3 bits Class and 5 bits Detail
• Formatted to display like this: 2.05
• Method for Request
• Class = 0
• Result for Response
• Class = 2, 4, 5
Class Usage
0 Request
2 Success Response
4 Client Error Response
5 Server Error Response
Message ID
• Each Endpoint has its own IDs space
• 16 bit Unsigned Integer
• Sender endpoint assign new Message ID and
recipient respond with same Message ID
• Only for the retransmission management
Message Types
• Confirmable = 0x0
• Non-Confirmable = 0x1
• Acknowledgement = 0x2
• Reset = 0x3
Confirmable
Client Server
CON [0x1234]
ACK [0x1234]
Client Server
CON [0x1235]
ACK [0x1235]
2.05 “Hello” CON [0x8765]
2.05 “Hello”
Piggybacked Separate
ACK [0x8765]
Non-Confirmable
Client Server
NON [0x1234]
NON [0x9854]
2.05 “Hello”
Client Server
NON [0x1235]
CON [0x8765]
2.05 “Hello”
ACK [0x8765]
Retransmission
• 4 retransmissions.
• Interval is increase on
every re-transmit.
• Max time is 247 secs
Client Server
CON [0x1235]
CON [0x1235]
ACK [0x1235]
TIMEOUT!
x
Retransmission (cont.)
• Client doesn’t know if
request reached to server.
• Server logic will be
executed more than once
for same request. It should
be cached.
Client Server
CON [0x1235]
ACK [0x1235]
CON [0x1235]
ACK [0x1235]
TIMEOUT!
x
Retransmission (cont.)
• ACK may be delivered
after invocation of timeout.
• Server must send same
response, including
Piggybacked or not.
Client Server
CON [0x1235]
ACK [0x1235]
CON [0x1235]
ACK [0x1235]
TIMEOUT!
What is Reset?
• Endpoint has no context for the request.
Client
Server
CON [0x1235]
ACK [0x1235]
CON [0x8765]
2.05 “Hello”
x
RST [0x8765]
Crash!
or CoAP Ping
• Detecting the aliveness of
the other endpoint
• Minimum packet is used.
4 bytes each.
• Make up for the
unreliability of the Non-
Confirmable request
Client Server
CON [0x1234]
RST [0x1234]
- empty -
CoAP URI
• coap://example.com/hello?a=b&c=d
• “coap” for non-secure CoAP
• “coaps” for secure CoAP
• Encoded into several Options
Observe
• Initial request is called
Registration.
• Following responses are called
Notification
• Has sequence number
• Notification can be Confirmable
or Non-Confirmable
• Draft extension
Client Server
Registration
Notification
Notification
Notification
Response
Block-wise Transfer
• Big response can be sent as a small blocks with
sequence number.
• Client who receive blocks will regenerate the original
response.
• Preferred size will be sent from the client.
• Draft extension
Resource Discovery
/.well-known/core
CoRE Link Format
Copper(Cu) Firefox Add-on
http://mzl.la/1JNaB7v
Service Discovery
• UDP support Multicast.
• The multicast address for “All-CoAP-Server” is
defined.
• Request must be Non-Confirmable
• Server must not send Rest as error response.
Network Errors
• HTTP: Errors are handled in TCP layer. If error
happen, you can gave up very soon.
• CoAP Confirmable: Errors are handled in CoAP
protocol layer, usually library takes care of them.
Ordering problem may exist though.
• CoAP Non-Confiramable: Errors happens and
ignored. You just cannot get response.
6LoWPANs
• IPv6 over Low-Power Wireless Personal Area
Networks
• Slow, high error rate, small packet size
• less than 80 bytes
HTTP and CoAP Proxy
• Route the HTTP request to CoAP Server and send
back the CoAP response to HTTP Client
• Or vice versa
• Because of the similarity with HTTP
• Cache
• Well defined in RFC
Security
• DTLS = Datagram TLS
• Shared Key
• Public Key and Private Key pair
• Supported by major library: OpenSSL, NSS, …
• Both for encryption and authentication
Other IoT(?) protocols
• MQTT
• WebSocket
MQTT
• Publish/Subscribe model
• Broker is required on Internet
• Require long-living TCP connection.
WebSocket
• Connection phase is on HTTP protocol
• Once it accepted, the socket is took over by WebSocket client and
server and both endpoint are free to send packets.
• Disconnect detection,
• Protocol is defined in RFC.
• JavaScript APIs are well defined by W3C.
• Only for client side.
Summary
• Good: CoAP is fast, lightweight HTTP.
• Bad: Small data size, unreliability, less information.
• Apps take care of errors more than http.
• Limited implementations. Not enough use cases for
actual field.
• Extensions are still draft

More Related Content

What's hot

What is XMPP Protocol
What is XMPP ProtocolWhat is XMPP Protocol
What is XMPP Protocol
Hamidreza Soleimani
 
SMS Gateway
SMS GatewaySMS Gateway
Embedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseEmbedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 Course
FastBit Embedded Brain Academy
 
Ipv6 the next generation protocol
Ipv6 the next generation protocolIpv6 the next generation protocol
Ipv6 the next generation protocolPRADEEP Cheekatla
 
ARM CoAP Tutorial
ARM CoAP TutorialARM CoAP Tutorial
ARM CoAP Tutorial
zdshelby
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
Maitree Patel
 
SMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer ProtocolSMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer Protocol
SIDDARAMAIAHMC
 
TCP and BBR
TCP and BBRTCP and BBR
TCP and BBR
APNIC
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
Aung Thu Rha Hein
 
MQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of ThingsMQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of Things
Bryan Boyd
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
Peter R. Egli
 
MQTT
MQTTMQTT
MQTT
ESUG
 
Diameter Presentation
Diameter PresentationDiameter Presentation
Diameter Presentation
Beny Haddad
 
Eap intro
Eap introEap intro
Eap intro
Aditya Mehta
 
E mail protocol - SMTP
E mail protocol - SMTPE mail protocol - SMTP
E mail protocol - SMTP
Md Syed Ahamad
 
6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol
Samsung Open Source Group
 
IoT Coap
IoT Coap IoT Coap
IoT Coap
Rajanikanth U
 
Linux Native, HTTP Aware Network Security
Linux Native, HTTP Aware Network SecurityLinux Native, HTTP Aware Network Security
Linux Native, HTTP Aware Network Security
Thomas Graf
 
NTP Server - How it works?
NTP Server - How it works?NTP Server - How it works?
NTP Server - How it works?
Davoud Teimouri
 

What's hot (20)

What is XMPP Protocol
What is XMPP ProtocolWhat is XMPP Protocol
What is XMPP Protocol
 
SMS Gateway
SMS GatewaySMS Gateway
SMS Gateway
 
Embedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 CourseEmbedded System Programming on ARM Cortex M3 and M4 Course
Embedded System Programming on ARM Cortex M3 and M4 Course
 
Ipv6 the next generation protocol
Ipv6 the next generation protocolIpv6 the next generation protocol
Ipv6 the next generation protocol
 
ARM CoAP Tutorial
ARM CoAP TutorialARM CoAP Tutorial
ARM CoAP Tutorial
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
SMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer ProtocolSMTP Simple Mail Transfer Protocol
SMTP Simple Mail Transfer Protocol
 
TCP and BBR
TCP and BBRTCP and BBR
TCP and BBR
 
Link state routing protocol
Link state routing protocolLink state routing protocol
Link state routing protocol
 
MQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of ThingsMQTT - A practical protocol for the Internet of Things
MQTT - A practical protocol for the Internet of Things
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
 
MQTT
MQTTMQTT
MQTT
 
Diameter Presentation
Diameter PresentationDiameter Presentation
Diameter Presentation
 
Eap intro
Eap introEap intro
Eap intro
 
E mail protocol - SMTP
E mail protocol - SMTPE mail protocol - SMTP
E mail protocol - SMTP
 
6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol6LoWPAN: An Open IoT Networking Protocol
6LoWPAN: An Open IoT Networking Protocol
 
IoT Coap
IoT Coap IoT Coap
IoT Coap
 
Linux Native, HTTP Aware Network Security
Linux Native, HTTP Aware Network SecurityLinux Native, HTTP Aware Network Security
Linux Native, HTTP Aware Network Security
 
NTP Server - How it works?
NTP Server - How it works?NTP Server - How it works?
NTP Server - How it works?
 
Netflow slides
Netflow slidesNetflow slides
Netflow slides
 

Viewers also liked

Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
Julien Vermillard
 
Introduction to CoAP the REST protocol for M2M
Introduction to CoAP the REST protocol for M2MIntroduction to CoAP the REST protocol for M2M
Introduction to CoAP the REST protocol for M2M
Julien Vermillard
 
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
Vidhya Gholkar
 
A System for a Vehicle Based on CoAP
A System for a Vehicle Based on CoAPA System for a Vehicle Based on CoAP
A System for a Vehicle Based on CoAP
Marcos Soutullo Rodríguez
 
IETFにおけるM2M/IoTの動向
IETFにおけるM2M/IoTの動向IETFにおけるM2M/IoTの動向
IETFにおけるM2M/IoTの動向
Shoichi Sakane
 
The constrained application protocol (coap) part 2
The constrained application protocol (coap)  part 2The constrained application protocol (coap)  part 2
The constrained application protocol (coap) part 2
Hamdamboy (함담보이)
 
原中燕 第四周
原中燕 第四周原中燕 第四周
原中燕 第四周
June YUAN
 
A guided tour of Eclipse M2M - EclipseCon Europe 2013
A guided tour of Eclipse M2M - EclipseCon Europe 2013A guided tour of Eclipse M2M - EclipseCon Europe 2013
A guided tour of Eclipse M2M - EclipseCon Europe 2013Benjamin Cabé
 
CoAP master presentaion
CoAP master presentaionCoAP master presentaion
CoAP master presentaionTarik Sefiri
 
The constrained application protocol (CoAP)
The constrained application protocol (CoAP)The constrained application protocol (CoAP)
The constrained application protocol (CoAP)
Hamdamboy (함담보이)
 
MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)
MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)
MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)
Omnys
 
End year project: Monitoring a wireless sensors network with internet of things
End year project: Monitoring a wireless sensors network with internet of thingsEnd year project: Monitoring a wireless sensors network with internet of things
End year project: Monitoring a wireless sensors network with internet of thingsAmine Moula
 
Business Transformation with Microsoft Azure IoT
Business Transformation with Microsoft Azure IoTBusiness Transformation with Microsoft Azure IoT
Business Transformation with Microsoft Azure IoT
Ilyas F ☁☁☁
 
CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...
CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...
CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...
Matthias Kovatsch
 
CoAP, Copper, and Embedded Web Resources
CoAP, Copper, and Embedded Web ResourcesCoAP, Copper, and Embedded Web Resources
CoAP, Copper, and Embedded Web Resources
Matthias Kovatsch
 
Fonctionnalités et protocoles des couches applicatives
Fonctionnalités et protocoles des couches applicativesFonctionnalités et protocoles des couches applicatives
Fonctionnalités et protocoles des couches applicatives
fadelaBritel
 
Club SI & digital les objets connectés 20150227 v1.1
Club SI & digital les objets connectés 20150227 v1.1Club SI & digital les objets connectés 20150227 v1.1
Club SI & digital les objets connectés 20150227 v1.1
Hubert Herberstein
 

Viewers also liked (18)

Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
 
Introduction to CoAP the REST protocol for M2M
Introduction to CoAP the REST protocol for M2MIntroduction to CoAP the REST protocol for M2M
Introduction to CoAP the REST protocol for M2M
 
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
 
A System for a Vehicle Based on CoAP
A System for a Vehicle Based on CoAPA System for a Vehicle Based on CoAP
A System for a Vehicle Based on CoAP
 
IETFにおけるM2M/IoTの動向
IETFにおけるM2M/IoTの動向IETFにおけるM2M/IoTの動向
IETFにおけるM2M/IoTの動向
 
The constrained application protocol (coap) part 2
The constrained application protocol (coap)  part 2The constrained application protocol (coap)  part 2
The constrained application protocol (coap) part 2
 
原中燕 第四周
原中燕 第四周原中燕 第四周
原中燕 第四周
 
A guided tour of Eclipse M2M - EclipseCon Europe 2013
A guided tour of Eclipse M2M - EclipseCon Europe 2013A guided tour of Eclipse M2M - EclipseCon Europe 2013
A guided tour of Eclipse M2M - EclipseCon Europe 2013
 
CoAP master presentaion
CoAP master presentaionCoAP master presentaion
CoAP master presentaion
 
The constrained application protocol (CoAP)
The constrained application protocol (CoAP)The constrained application protocol (CoAP)
The constrained application protocol (CoAP)
 
MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)
MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)
MQTT: il protocollo che rende possibile l'Internet of Things (Ott. 2015)
 
End year project: Monitoring a wireless sensors network with internet of things
End year project: Monitoring a wireless sensors network with internet of thingsEnd year project: Monitoring a wireless sensors network with internet of things
End year project: Monitoring a wireless sensors network with internet of things
 
Business Transformation with Microsoft Azure IoT
Business Transformation with Microsoft Azure IoTBusiness Transformation with Microsoft Azure IoT
Business Transformation with Microsoft Azure IoT
 
CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...
CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...
CoAP for the Web of Things: From Tiny Resource-constrained Devices to the W...
 
CoAP, Copper, and Embedded Web Resources
CoAP, Copper, and Embedded Web ResourcesCoAP, Copper, and Embedded Web Resources
CoAP, Copper, and Embedded Web Resources
 
these_sample
these_samplethese_sample
these_sample
 
Fonctionnalités et protocoles des couches applicatives
Fonctionnalités et protocoles des couches applicativesFonctionnalités et protocoles des couches applicatives
Fonctionnalités et protocoles des couches applicatives
 
Club SI & digital les objets connectés 20150227 v1.1
Club SI & digital les objets connectés 20150227 v1.1Club SI & digital les objets connectés 20150227 v1.1
Club SI & digital les objets connectés 20150227 v1.1
 

Similar to CoAP Talk

Google QUIC
Google QUICGoogle QUIC
Google QUIC
Felipe Rayel
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
dejanb
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overview
My cp
 
Network latency - measurement and improvement
Network latency - measurement and improvementNetwork latency - measurement and improvement
Network latency - measurement and improvement
Matt Willsher
 
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
Amazon Web Services
 
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
RX-M Enterprises LLC
 
IP Signal Distribution
IP Signal DistributionIP Signal Distribution
IP Signal Distribution
rAVe [PUBS]
 
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
ECS19 - Ingo Gegenwarth -  Running Exchangein large environmentECS19 - Ingo Gegenwarth -  Running Exchangein large environment
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
European Collaboration Summit
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
Evan McGee
 
SOHO Network Setup Tutorial
SOHO Network Setup Tutorial SOHO Network Setup Tutorial
SOHO Network Setup Tutorial
junaidahmedsaba
 
pps Matters
pps Matterspps Matters
Networking basics PPT
Networking basics PPTNetworking basics PPT
Networking basics PPT
Ehsan Ullah Kakar
 
CH1-LECTURE_1.pdf
CH1-LECTURE_1.pdfCH1-LECTURE_1.pdf
CH1-LECTURE_1.pdf
TamiratDejene1
 
Java socket programming
Java socket programmingJava socket programming
Java socket programming
Mohammed Abdalla Youssif
 
Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
Patrick Meenan
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
Waqas Ahmed Nawaz
 
InternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptxInternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptx
20CE112YASHPATEL
 
TCP/IP
TCP/IPTCP/IP

Similar to CoAP Talk (20)

Google QUIC
Google QUICGoogle QUIC
Google QUIC
 
Messaging for IoT
Messaging for IoTMessaging for IoT
Messaging for IoT
 
Network performance overview
Network  performance overviewNetwork  performance overview
Network performance overview
 
Network latency - measurement and improvement
Network latency - measurement and improvementNetwork latency - measurement and improvement
Network latency - measurement and improvement
 
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
Accelerating and Securing your Applications in AWS. In-depth look at Solving ...
 
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
 
IP Signal Distribution
IP Signal DistributionIP Signal Distribution
IP Signal Distribution
 
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
ECS19 - Ingo Gegenwarth -  Running Exchangein large environmentECS19 - Ingo Gegenwarth -  Running Exchangein large environment
ECS19 - Ingo Gegenwarth - Running Exchange in large environment
 
SPDY Talk
SPDY TalkSPDY Talk
SPDY Talk
 
FreeSWITCH as a Microservice
FreeSWITCH as a MicroserviceFreeSWITCH as a Microservice
FreeSWITCH as a Microservice
 
SOHO Network Setup Tutorial
SOHO Network Setup Tutorial SOHO Network Setup Tutorial
SOHO Network Setup Tutorial
 
pps Matters
pps Matterspps Matters
pps Matters
 
Networking basics PPT
Networking basics PPTNetworking basics PPT
Networking basics PPT
 
CH1-LECTURE_1.pdf
CH1-LECTURE_1.pdfCH1-LECTURE_1.pdf
CH1-LECTURE_1.pdf
 
Java socket programming
Java socket programmingJava socket programming
Java socket programming
 
Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
 
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
CCNA (R & S) Module 01 - Introduction to Networks - Chapter 9
 
InternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptxInternetOFThings_network_communicqtionCoAP_.pptx
InternetOFThings_network_communicqtionCoAP_.pptx
 
Network
NetworkNetwork
Network
 
TCP/IP
TCP/IPTCP/IP
TCP/IP
 

More from Basuke Suzuki

初めての単体テスト
初めての単体テスト初めての単体テスト
初めての単体テスト
Basuke Suzuki
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntity
Basuke Suzuki
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntity
Basuke Suzuki
 
Kiosk / PHP
Kiosk / PHP Kiosk / PHP
Kiosk / PHP
Basuke Suzuki
 
PostgreSQLからMongoDBへ
PostgreSQLからMongoDBへPostgreSQLからMongoDBへ
PostgreSQLからMongoDBへ
Basuke Suzuki
 
iOS4時代の位置情報サービスの使い方
iOS4時代の位置情報サービスの使い方iOS4時代の位置情報サービスの使い方
iOS4時代の位置情報サービスの使い方
Basuke Suzuki
 
iPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケ
iPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケiPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケ
iPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケ
Basuke Suzuki
 

More from Basuke Suzuki (7)

初めての単体テスト
初めての単体テスト初めての単体テスト
初めての単体テスト
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntity
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntity
 
Kiosk / PHP
Kiosk / PHP Kiosk / PHP
Kiosk / PHP
 
PostgreSQLからMongoDBへ
PostgreSQLからMongoDBへPostgreSQLからMongoDBへ
PostgreSQLからMongoDBへ
 
iOS4時代の位置情報サービスの使い方
iOS4時代の位置情報サービスの使い方iOS4時代の位置情報サービスの使い方
iOS4時代の位置情報サービスの使い方
 
iPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケ
iPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケiPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケ
iPhoneのオモチャ箱 - 刊行記念イベント@ジュンク堂新宿 - バスケ
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 

CoAP Talk

  • 1. CoAP Talk Basuke Suzuki - @basuke Kinoma IoT Fest January 29, 2015 at MIT
  • 2. Agenda • What is CoAP? • DEMO with KinomaJS on Create • Behind the scene • Dive into CoAP internals • Possibility, Deficiency, Other Protocols, etc.
  • 3. What is CoAP? • Constraint Application Protocol • Protocol for embedded devices, IoT, M2M. • Defined in RFC 7252 • CoAP = Lightweight Fast HTTP
  • 4. CoAP is Lightweight • Message is simple binary format. Easy to parse. Space efficient. • Client and server share the internal structures, so easy to implement both client and server compare to HTTP. • RFC Document is just 112 pages. Seriously it’s short. With the full example use case and the default values for timeout or retry count, which is very valuable.
  • 5. CoAP is Fast • Implemented on top of UDP • Stateless. No connection. Less overhead. • Faster by omitting the protocol level reliability. • Choices are yours
  • 6. CoAP is HTTP (almost) • Request and Response model • RESTful design, GET/PUT/POST/DELETE • Addressable by URL with query string • Content-Type can be specified, but limited to pre- defined types, text, json, xml, etc…
  • 7. HTTP is Great, but… • Reliability is based on the TCP. • HTTP Headers are just text with structure, so easy to read for human, but not for machine. • 20+ years history and so many extensions to take care of. Headers are always huge. 700-800 bytes average today (Google SPDY report) • Not the best choice for IoT world.
  • 8. CoAP is NOT HTTP • UDP instead of TCP • No overhead of headers • Limited Content-Types • Headers are limited to pre-defined one • Content size is limited to packet size. Depend on the lower level stack. On UNIX, about 1K.
  • 9. UDP is fast, simple • Connection less, no handshake • Used for Video-streaming, DNS, DHCP, RIP • 1:N communication - Broadcast and Multicast • Small overhead of packet • UDP: 8 bytes < TCP: 20+ bytes
  • 10. but UDP is Unreliable! • Packet may deliver to the destination more than once, or may not deliver at all • Packets may not arrive in order of delivery • Sender does not know if or when the packet is delivered • Application-layer must implement these features if they need those reliabilities.
  • 11. TCP is Reliable • Sender knows the result of the delivery. If not delivered, retransmit until it fails by timeout. • If sender send A then B, receiver receive A and B in that order. • TCP is streaming transmission so that there are no limit of data size. • With its congestion control, bandwidth won’t filled by the re- transmitted packets.
  • 12. CoAP is reliable by itself • Duplicate detection by 16bit Message ID • Acknowledgement response with data • Each request contains a token. The token is binary data defined by the application. That same token must be included in the response. The token is what allows the requestor to match a response to a request.
  • 13. CoAP is reliable by itself • Retransmission of message with exponentially incrementing interval, to prevent congestion of the network by transmission. • These features are optional. If you really need speed, you can choose to disable them. (cont.)
  • 14. HTTP is Infrastructure • HTTP freed up developers from application • For many years, protocols are only for specific purpose. (SMTP, FTP, DNS, etc) • HTTP was originally for delivery of information to human, but now it is basic infrastructure of the conversation of programs. • So does CoAP, in IoT field.
  • 15. “CoAP is the first UDP protocol which has the freedom of application level usage.” – Basuke Suzuki (2015)
  • 16. DEMO • CoAP Server and Client • Share color information
  • 17. Kinoma Create • Kinoma Create is the JavaScript- powered construction kit for Internet of Things devices and other connected electronics.
  • 18. A lot of Pins
  • 19. CoAP on KinomaJS var client = new CoAP.Client(); client.onResponse = function(response) { // success }; client.onError(err) { // failure }; client.request(“coap://10.0.1.109/color”, ’GET’);
  • 20. CoAP on KinomaJS var client = new CoAP.Client(); client.request({ uri: “coap://10.0.1.109/color”, method: ’GET’, }).then(function(response) { // success }, function(err) { // failure });
  • 22. CoAP Message Format • Minimum bytes are 4 bytes. (Empty Message) • Must be fit inside UDP packet
  • 23. Fixed Header Version. Always 01. Message Type. 2 bits. Token Length
  • 24. Token • 0 to 8 bytes binary • length is specified in the header • Response must have same token value with request. • The value of the token is defined by the application layer. Protocol doesn’t care about the contents. • Use case: request kind, sequence number, etc.
  • 25. Options • Option types are defined as integer index. • Option format is defined for each Option type. • Empty, Unsigned Integer, String, Binary
  • 26. Payload • Payload is optional. If it exists, Payload Marker (0xff) must be exist to indicate the beginning of payload. • Format is specified by Content-Format option. • Available formats are: Text, JSON, XML, EXI, Binary
  • 27. Message Code • 3 bits Class and 5 bits Detail • Formatted to display like this: 2.05 • Method for Request • Class = 0 • Result for Response • Class = 2, 4, 5 Class Usage 0 Request 2 Success Response 4 Client Error Response 5 Server Error Response
  • 28. Message ID • Each Endpoint has its own IDs space • 16 bit Unsigned Integer • Sender endpoint assign new Message ID and recipient respond with same Message ID • Only for the retransmission management
  • 29. Message Types • Confirmable = 0x0 • Non-Confirmable = 0x1 • Acknowledgement = 0x2 • Reset = 0x3
  • 30. Confirmable Client Server CON [0x1234] ACK [0x1234] Client Server CON [0x1235] ACK [0x1235] 2.05 “Hello” CON [0x8765] 2.05 “Hello” Piggybacked Separate ACK [0x8765]
  • 31. Non-Confirmable Client Server NON [0x1234] NON [0x9854] 2.05 “Hello” Client Server NON [0x1235] CON [0x8765] 2.05 “Hello” ACK [0x8765]
  • 32. Retransmission • 4 retransmissions. • Interval is increase on every re-transmit. • Max time is 247 secs Client Server CON [0x1235] CON [0x1235] ACK [0x1235] TIMEOUT! x
  • 33. Retransmission (cont.) • Client doesn’t know if request reached to server. • Server logic will be executed more than once for same request. It should be cached. Client Server CON [0x1235] ACK [0x1235] CON [0x1235] ACK [0x1235] TIMEOUT! x
  • 34. Retransmission (cont.) • ACK may be delivered after invocation of timeout. • Server must send same response, including Piggybacked or not. Client Server CON [0x1235] ACK [0x1235] CON [0x1235] ACK [0x1235] TIMEOUT!
  • 35. What is Reset? • Endpoint has no context for the request. Client Server CON [0x1235] ACK [0x1235] CON [0x8765] 2.05 “Hello” x RST [0x8765] Crash!
  • 36. or CoAP Ping • Detecting the aliveness of the other endpoint • Minimum packet is used. 4 bytes each. • Make up for the unreliability of the Non- Confirmable request Client Server CON [0x1234] RST [0x1234] - empty -
  • 37. CoAP URI • coap://example.com/hello?a=b&c=d • “coap” for non-secure CoAP • “coaps” for secure CoAP • Encoded into several Options
  • 38. Observe • Initial request is called Registration. • Following responses are called Notification • Has sequence number • Notification can be Confirmable or Non-Confirmable • Draft extension Client Server Registration Notification Notification Notification Response
  • 39. Block-wise Transfer • Big response can be sent as a small blocks with sequence number. • Client who receive blocks will regenerate the original response. • Preferred size will be sent from the client. • Draft extension
  • 40. Resource Discovery /.well-known/core CoRE Link Format Copper(Cu) Firefox Add-on http://mzl.la/1JNaB7v
  • 41. Service Discovery • UDP support Multicast. • The multicast address for “All-CoAP-Server” is defined. • Request must be Non-Confirmable • Server must not send Rest as error response.
  • 42. Network Errors • HTTP: Errors are handled in TCP layer. If error happen, you can gave up very soon. • CoAP Confirmable: Errors are handled in CoAP protocol layer, usually library takes care of them. Ordering problem may exist though. • CoAP Non-Confiramable: Errors happens and ignored. You just cannot get response.
  • 43. 6LoWPANs • IPv6 over Low-Power Wireless Personal Area Networks • Slow, high error rate, small packet size • less than 80 bytes
  • 44. HTTP and CoAP Proxy • Route the HTTP request to CoAP Server and send back the CoAP response to HTTP Client • Or vice versa • Because of the similarity with HTTP • Cache • Well defined in RFC
  • 45. Security • DTLS = Datagram TLS • Shared Key • Public Key and Private Key pair • Supported by major library: OpenSSL, NSS, … • Both for encryption and authentication
  • 46. Other IoT(?) protocols • MQTT • WebSocket
  • 47. MQTT • Publish/Subscribe model • Broker is required on Internet • Require long-living TCP connection.
  • 48. WebSocket • Connection phase is on HTTP protocol • Once it accepted, the socket is took over by WebSocket client and server and both endpoint are free to send packets. • Disconnect detection, • Protocol is defined in RFC. • JavaScript APIs are well defined by W3C. • Only for client side.
  • 49. Summary • Good: CoAP is fast, lightweight HTTP. • Bad: Small data size, unreliability, less information. • Apps take care of errors more than http. • Limited implementations. Not enough use cases for actual field. • Extensions are still draft

Editor's Notes

  1. CoAPの軽量さをアピール。 パースのしやすさではHTTPとの対比を。数値も文字列、改行で区切り。CoAPでは長さは別にあり、数値もバイナリで納めるので、スペースの効率の面でもパース
  2. UDPについては後で話します。 reliabilityに関しても後で話します。
  3. TCP packet overhead = 20 bytes
  4. TCP must connect to the endpoint at first, every packet need 3 way communication