SlideShare a Scribd company logo
1 of 14
Introduction to CoAP
The RESTful Protocol for IoT/M2M and LPWAN
EMQ TECHNOLOGIES CO., LTD.
contact@emqx.io
Twitter @emqtt
Introducing CoAP
CoAP
RFC 7252 Constrained Application Protocol
“The Constrained Application Protocol (CoAP) is a specialized web transfer
protocol for use with constrained nodes and constrained networks in
Key features of CoAP
► REST model for small devices: Like HTTP, CoAP is based on the wildly
successful REST model: Servers make resources available under a URL,
and clients access these resources using methods such as GET, PUT,
POST, and DELETE.
► Made for billions of nodes: The Internet of Things will need billions of nodes,
many of which will need to be inexpensive. CoAP has been designed to
work on microcontrollers with as low as 10 KiB of RAM and 100 KiB of code
space (RFC 7228).
CoAP vs MQTT
Protocols MQTT CoAP XMPP HTTP
Transport TCP UDP TCP TCP
Communicati
on
Pub/Sub Req/Resp Pub/Sub Req/Resp
时延 好 差 好 差
双向 好 差 好 差
传输效率 好 好 差 一般
功耗 低 低 高 高
QoS支持 是 否 否 否
Key features of CoAP
► Web protocol fulfilling M2M requirements in constrained environments
► UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests.
► Asynchronous message exchanges.
► Low header overhead and parsing complexity.
► URI and Content-type support.
► Simple proxy and caching capabilities.
► A stateless HTTP mapping, allowing proxies to be built providing access to CoAP resources via
HTTP in a uniform way or for HTTP simple interfaces to be realized alternatively over CoAP.
► Security binding to Datagram Transport Layer Security (DTLS)
Highlights of CoAP
► Existing skills transfer: From a developer point of view, CoAP feels very much
like HTTP. Obtaining a value from a sensor is not much different from obtaining
a value from a Web API.
► Ready for integration: Since HTTP and CoAP share the REST model, they can
easily be connected using application-agnostic cross-protocol proxies. A Web
client may not even notice that it just accessed a sensor resource!
► Choose your data model: Like HTTP, CoAP can carry different types of
payloads, and can identify which payload type is being used. CoAP integrates
with XML, JSON,CBOR, or any data format of your choice.
Highlights of CoAP (Cont.)
► Well-designed protocol: CoAP was developed as an Internet Standards
Document, RFC 7252. The protocol has been designed to last for decades.
Difficult issues such as congestion control have not been swept under the rug,
but have been addressed using the state of the art.
► Keep waste in check: CoAP is designed to use minimal resources, both on the
device and on the network. Instead of a complex transport stack, it gets by with
UDP on IP. A 4-byte fixed header and a compact encoding of options enables
small messages that cause no or little fragmentation on the link layer. Many
servers can operate in a completely stateless fashion.
Highlights of CoAP (Cont.)
► Secure: The Internet of Things cannot spread as long as it can be exploited
by hackers willy-nilly. CoAP does not just pay lip service to security, it
actually provides strong security. CoAP's default choice of DTLS parameters
is equivalent to 3072-bit RSA keys, yet still runs fine on the smallest nodes.
► Discovery integrated: The CoAP resource directory provides a way to
discover the properties of the nodes on your network.
CoAP Packets
CoAP URI
coap://[aaaa::c30c:0:0:1234]:5683/actuators/leds?color=b
Host Port Path Query
Confirmable request
Response back after a while
Observer
Resource Discovery

More Related Content

What's hot

Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
Chandra Meena
 
6lowpan 110828234426-phpapp01
6lowpan 110828234426-phpapp016lowpan 110828234426-phpapp01
6lowpan 110828234426-phpapp01
mrmr2010i
 
IEEE 802.11s - Wireless Mesh Network
IEEE 802.11s - Wireless Mesh NetworkIEEE 802.11s - Wireless Mesh Network
IEEE 802.11s - Wireless Mesh Network
Arunabh Mishra
 

What's hot (20)

OFDM Basics
OFDM BasicsOFDM Basics
OFDM Basics
 
IoT Coap
IoT Coap IoT Coap
IoT Coap
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message Queueing
 
Location Aided Routing (LAR)
Location Aided Routing (LAR) Location Aided Routing (LAR)
Location Aided Routing (LAR)
 
Wifi & 802.11 Standards
Wifi & 802.11 StandardsWifi & 802.11 Standards
Wifi & 802.11 Standards
 
Fisheye State Routing (FSR) - Protocol Overview
Fisheye State Routing (FSR) - Protocol OverviewFisheye State Routing (FSR) - Protocol Overview
Fisheye State Routing (FSR) - Protocol Overview
 
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
 
6lowpan
6lowpan6lowpan
6lowpan
 
Bgp protocol
Bgp protocolBgp protocol
Bgp protocol
 
Bluetooth low energy
Bluetooth low energyBluetooth low energy
Bluetooth low energy
 
Asynchronous transfer mode
Asynchronous transfer modeAsynchronous transfer mode
Asynchronous transfer mode
 
6LoWPAN.pptx
6LoWPAN.pptx6LoWPAN.pptx
6LoWPAN.pptx
 
6LoWPAN: An open IoT Networking Protocol
6LoWPAN: An open IoT Networking Protocol6LoWPAN: An open IoT Networking Protocol
6LoWPAN: An open IoT Networking Protocol
 
TCP/IP and UDP protocols
TCP/IP and UDP protocolsTCP/IP and UDP protocols
TCP/IP and UDP protocols
 
6lowpan
6lowpan 6lowpan
6lowpan
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
6lowpan 110828234426-phpapp01
6lowpan 110828234426-phpapp016lowpan 110828234426-phpapp01
6lowpan 110828234426-phpapp01
 
Mobile ipv6
Mobile ipv6Mobile ipv6
Mobile ipv6
 
IEEE 802.11s - Wireless Mesh Network
IEEE 802.11s - Wireless Mesh NetworkIEEE 802.11s - Wireless Mesh Network
IEEE 802.11s - Wireless Mesh Network
 
RPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy NetworksRPL - Routing Protocol for Low Power and Lossy Networks
RPL - Routing Protocol for Low Power and Lossy Networks
 

Similar to Introduction to CoAP

Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
Charles Gibbons
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
Charles Gibbons
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
Charles Gibbons
 
Embedded Web Services Report
Embedded Web Services ReportEmbedded Web Services Report
Embedded Web Services Report
Bernie Chiu
 
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
Aniruddha Chakrabarti
 
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
 
Internet-Of-Things-For-Smart-Cities
Internet-Of-Things-For-Smart-CitiesInternet-Of-Things-For-Smart-Cities
Internet-Of-Things-For-Smart-Cities
Sitakanta Mishra
 

Similar to Introduction to CoAP (20)

Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
 
Internet of Things: Protocols for M2M
Internet of Things: Protocols for M2MInternet of Things: Protocols for M2M
Internet of Things: Protocols for M2M
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
 
Protocols for internet of things
Protocols for internet of thingsProtocols for internet of things
Protocols for internet of things
 
APIs at the Edge
APIs at the EdgeAPIs at the Edge
APIs at the Edge
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
 
The new (is it really ) api stack
The new (is it really ) api stackThe new (is it really ) api stack
The new (is it really ) api stack
 
The constrained application protocol (coap)
The constrained application protocol (coap)The constrained application protocol (coap)
The constrained application protocol (coap)
 
Embedded Web Services Report
Embedded Web Services ReportEmbedded Web Services Report
Embedded Web Services Report
 
IoT Day 2013 - Madrid
IoT Day 2013 - MadridIoT Day 2013 - Madrid
IoT Day 2013 - Madrid
 
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
 
CoAP & HTTP Presentation.pdf
CoAP & HTTP Presentation.pdfCoAP & HTTP Presentation.pdf
CoAP & HTTP Presentation.pdf
 
IPv6 and IoT
IPv6 and IoTIPv6 and IoT
IPv6 and IoT
 
CoAPing with the Internet of Things
CoAPing with the Internet of ThingsCoAPing with the Internet of Things
CoAPing with the Internet of Things
 
Protocols for IoT
Protocols for IoTProtocols for IoT
Protocols for IoT
 
Towards constrained semantic web
Towards constrained semantic webTowards constrained semantic web
Towards constrained semantic web
 
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
 
Internet-Of-Things-For-Smart-Cities
Internet-Of-Things-For-Smart-CitiesInternet-Of-Things-For-Smart-Cities
Internet-Of-Things-For-Smart-Cities
 

More from EMQ (6)

Introduction to Snabbkaffe
Introduction to SnabbkaffeIntroduction to Snabbkaffe
Introduction to Snabbkaffe
 
An Introduction to Hamler
An Introduction to HamlerAn Introduction to Hamler
An Introduction to Hamler
 
Introduction to MQTT
Introduction to MQTTIntroduction to MQTT
Introduction to MQTT
 
Introduction to EMQ X Enterprise
Introduction to EMQ X EnterpriseIntroduction to EMQ X Enterprise
Introduction to EMQ X Enterprise
 
Introduction to EMQ
Introduction to EMQIntroduction to EMQ
Introduction to EMQ
 
EMQ Company Deck
EMQ Company DeckEMQ Company Deck
EMQ Company Deck
 

Recently uploaded

原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
ydyuyu
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Monica Sydney
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 

Recently uploaded (20)

Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu DhabiAbu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
Abu Dhabi Escorts Service 0508644382 Escorts in Abu Dhabi
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...Local Call Girls in Seoni  9332606886 HOT & SEXY Models beautiful and charmin...
Local Call Girls in Seoni 9332606886 HOT & SEXY Models beautiful and charmin...
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call GirlsMira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
Mira Road Housewife Call Girls 07506202331, Nalasopara Call Girls
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 

Introduction to CoAP

  • 1. Introduction to CoAP The RESTful Protocol for IoT/M2M and LPWAN EMQ TECHNOLOGIES CO., LTD. contact@emqx.io Twitter @emqtt
  • 2. Introducing CoAP CoAP RFC 7252 Constrained Application Protocol “The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained networks in
  • 3. Key features of CoAP ► REST model for small devices: Like HTTP, CoAP is based on the wildly successful REST model: Servers make resources available under a URL, and clients access these resources using methods such as GET, PUT, POST, and DELETE. ► Made for billions of nodes: The Internet of Things will need billions of nodes, many of which will need to be inexpensive. CoAP has been designed to work on microcontrollers with as low as 10 KiB of RAM and 100 KiB of code space (RFC 7228).
  • 4. CoAP vs MQTT Protocols MQTT CoAP XMPP HTTP Transport TCP UDP TCP TCP Communicati on Pub/Sub Req/Resp Pub/Sub Req/Resp 时延 好 差 好 差 双向 好 差 好 差 传输效率 好 好 差 一般 功耗 低 低 高 高 QoS支持 是 否 否 否
  • 5. Key features of CoAP ► Web protocol fulfilling M2M requirements in constrained environments ► UDP [RFC0768] binding with optional reliability supporting unicast and multicast requests. ► Asynchronous message exchanges. ► Low header overhead and parsing complexity. ► URI and Content-type support. ► Simple proxy and caching capabilities. ► A stateless HTTP mapping, allowing proxies to be built providing access to CoAP resources via HTTP in a uniform way or for HTTP simple interfaces to be realized alternatively over CoAP. ► Security binding to Datagram Transport Layer Security (DTLS)
  • 6. Highlights of CoAP ► Existing skills transfer: From a developer point of view, CoAP feels very much like HTTP. Obtaining a value from a sensor is not much different from obtaining a value from a Web API. ► Ready for integration: Since HTTP and CoAP share the REST model, they can easily be connected using application-agnostic cross-protocol proxies. A Web client may not even notice that it just accessed a sensor resource! ► Choose your data model: Like HTTP, CoAP can carry different types of payloads, and can identify which payload type is being used. CoAP integrates with XML, JSON,CBOR, or any data format of your choice.
  • 7. Highlights of CoAP (Cont.) ► Well-designed protocol: CoAP was developed as an Internet Standards Document, RFC 7252. The protocol has been designed to last for decades. Difficult issues such as congestion control have not been swept under the rug, but have been addressed using the state of the art. ► Keep waste in check: CoAP is designed to use minimal resources, both on the device and on the network. Instead of a complex transport stack, it gets by with UDP on IP. A 4-byte fixed header and a compact encoding of options enables small messages that cause no or little fragmentation on the link layer. Many servers can operate in a completely stateless fashion.
  • 8. Highlights of CoAP (Cont.) ► Secure: The Internet of Things cannot spread as long as it can be exploited by hackers willy-nilly. CoAP does not just pay lip service to security, it actually provides strong security. CoAP's default choice of DTLS parameters is equivalent to 3072-bit RSA keys, yet still runs fine on the smallest nodes. ► Discovery integrated: The CoAP resource directory provides a way to discover the properties of the nodes on your network.