SlideShare a Scribd company logo
CoAP
U & P U Patel Department of Computer Engineering
What Is CoAP Protocol?
• CoAP is an IoT protocol. CoAP stands for Constrained Application Protocol, and it is defined in RFC 7252.
• CoAP is a simple protocol with low overhead specifically designed for constrained devices (such as
microcontrollers) and constrained networks.
• Web transfer protocol for use with constrained nodes and networks.
• Designed for Machine to Machine (M2M) applications such as smart energy and building automation.
• Based on Request‐Response model between end‐points
• Client‐Server interaction is asynchronous over a datagram oriented transport protocol such as UDP
U & P U Patel Department of Computer Engineering
Features of CoAP protocols
• The main features of CoAP protocols are:
• Web protocol used in M2M with constrained requirements
• Asynchronous message exchange
• Low overhead and very simple to parse
• URI and content-type support
• Proxy and caching capabilities
U & P U Patel Department of Computer Engineering
Protocol Layers
• There are two different layers that make CoAp protocol:
Messages and Request/Response.
• The Messages layer deals with UDP and with
asynchronous messages.
• The Request/Response layer manages
request/response interaction based on
request/response messages.
• CoAP supports four different message types:
• Confirmable
• Non-confirmable
• Acknowledgment
• Reset
U & P U Patel Department of Computer Engineering
CoAP terminology
• Endpoint: An entity that participates in the CoAP protocol. Usually, an
Endpoint is identified with a host
• Sender: The entity that sends a message
• Recipient: The destination of a message
• Client: The entity that sends a request and the destination of the response
• Server: The entity that receives a request from a client and sends back a
response to the client
U & P U Patel Department of Computer Engineering
CoAP Messages Model
• This is the lowest layer of CoAP.
• This layer deals exchawith UDP nging messages between endpoints.
• Each CoAP message has a unique ID; this is useful to detect message
duplicates.
• A CoAP message is built by these parts:
• A binary header
• A compact options
• Payload
U & P U Patel Department of Computer Engineering
Confirmable message
Confirmable message
• A confirmable message is a reliable message.
• When exchanging messages between two endpoints,
these messages can be reliable.
• In CoAP, a reliable message is obtained using a
Confirmable message (CON).
• Using this kind of message, the client can be sure that
the message will arrive at the server.
• A Confirmable message is sent again and again until
the other party sends an acknowledge message (ACK).
• The ACK message contains the same ID of the
confirmable message (CON).
U & P U Patel Department of Computer Engineering
Rest message
• If the server has troubles
managing the incoming
request, it can send back a
Rest message (RST) instead of
the Acknowledge message
(ACK)
U & P U Patel Department of Computer Engineering
Non-confirmable messages
• The other message category is the Non-confirmable
(NON) messages.
• These are messages that don’t require an
Acknowledge by the server.
• They are unreliable messages or in other words
messages that do not contain critical information
that must be delivered to the server.
• To this category belongs messages that contain
values read from sensors.
• Even if these messages are unreliable, they have a
unique ID.
U & P U Patel Department of Computer Engineering
CoAp Request/Response Model
• The CoAP Request/Response is the second layer in the
CoAP abstraction layer.
• The request is sent using a Confirmable (CON) or Non-
Confirmable (NON) message.
• There are several scenarios depending on if the server
can answer immediately to the client request or the
answer if not available.
• If the server can answer immediately to the client
request, then if the request is carried using a
Confirmable message (CON), the server sends back to
the client an Acknowledge message containing the
response or the error code
• In the CoAP message, there is a Token. The Token is
different from the Message-ID and it is used to match
the request and the response.
U & P U Patel Department of Computer Engineering
CoAp Request/Response Model
• If the server can’t answer to the request coming
from the client immediately, then it sends an
Acknowledge message with an empty response.
• As soon as the response is available, then the
server sends a new Confirmable message to the
client containing the response.
• At this point, the client sends back an
Acknowledge message:
• If the request coming from the client is carried
using a NON-confirmable message, then the
server answer using a NON-confirmable message.
U & P U Patel Department of Computer Engineering
CoAp Message Format
Where:
• Ver: It is a 2 bit unsigned integer indicating the version
• T: it is a 2 length
• Code: It is the code bit unsigned integer indicating the message type: 0 confirmable, 1 non-
confirmable
• TKL: Token Length is the token 4 bit response (8 bit length)
• Message ID: It is the message ID expressed with 16 bit
U & P U Patel Department of Computer Engineering
References
https://dzone.com/articles/coap-protocol-step-by-step-guide
https://coap.technology/impls.html

More Related Content

PPSX
Modificateurs d'accès en java
PPTX
CoAP protocol -Internet of Things(iot)
PPTX
Fog & edge computing(coap )
PPT
The constrained application protocol (CoAP)
PPT
The constrained application protocol (coap)
PPTX
CoAP Talk
PPTX
CoAP - Web Protocol for IoT
PDF
An approximation delay between consecutive requests for congestion control in...
Modificateurs d'accès en java
CoAP protocol -Internet of Things(iot)
Fog & edge computing(coap )
The constrained application protocol (CoAP)
The constrained application protocol (coap)
CoAP Talk
CoAP - Web Protocol for IoT
An approximation delay between consecutive requests for congestion control in...

Similar to InternetOFThings_network_communicqtionCoAP_.pptx (20)

PPT
The constrained application protocol (co ap) part 3
PPT
The constrained application protocol (co ap) part 3
PPT
The constrained application protocol (coap) part 3
PPTX
IOT SEMINAR.pptxghfifiirijrkkrjjfkfkrjfj
PPTX
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
PPT
The constrained application protocol (coap) part 3
PPTX
Introduction to CoAP
 
PPT
IoT Coap
PPT
The constrained application protocol (co ap) part 2
PPT
The constrained application protocol (coap) part 2
PPT
The constrained application protocol (coap) part 2
PPTX
715677653-CPE-445-Internet-of-Things-Chapter-6.pptx
PPTX
715677653-CPE-445-Internet-of-Things-Chapter-6.pptx
PDF
CoAPing with the Internet of Things
PPT
Comparison of mqtt and coap protocol
PDF
CoAP & HTTP Presentation.pdf
PPTX
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
PPTX
iot-application-layer-protocols-v1-200125143512.pptx
PDF
Application Layer Protocols for the IoT
PPTX
Group 3 Presen.pptx
The constrained application protocol (co ap) part 3
The constrained application protocol (co ap) part 3
The constrained application protocol (coap) part 3
IOT SEMINAR.pptxghfifiirijrkkrjjfkfkrjfj
Edge to Cloud Protocol HTTP WEBSOCKET MQTT-SN MQTT.pptx
The constrained application protocol (coap) part 3
Introduction to CoAP
 
IoT Coap
The constrained application protocol (co ap) part 2
The constrained application protocol (coap) part 2
The constrained application protocol (coap) part 2
715677653-CPE-445-Internet-of-Things-Chapter-6.pptx
715677653-CPE-445-Internet-of-Things-Chapter-6.pptx
CoAPing with the Internet of Things
Comparison of mqtt and coap protocol
CoAP & HTTP Presentation.pdf
M2M Protocols for Constrained Environments in the Context of IoT: A Compariso...
iot-application-layer-protocols-v1-200125143512.pptx
Application Layer Protocols for the IoT
Group 3 Presen.pptx
Ad

More from 20CE112YASHPATEL (8)

PPTX
Data_Processing_and_communication_bluetooth.pptx
PPTX
DLP_Presentation.pptx
PPTX
Communication Technologies in IOT.pptx
PPTX
RFID.pptx
PPTX
Network_Layer_and_Internet_Protocols_IPv.pptx
PPTX
Project.pptx
PDF
Prolog PPT_merged.pdf
PPTX
Money Manager Presentation-2.pptx
Data_Processing_and_communication_bluetooth.pptx
DLP_Presentation.pptx
Communication Technologies in IOT.pptx
RFID.pptx
Network_Layer_and_Internet_Protocols_IPv.pptx
Project.pptx
Prolog PPT_merged.pdf
Money Manager Presentation-2.pptx
Ad

Recently uploaded (20)

PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Sustainable Sites - Green Building Construction
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
composite construction of structures.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
PPT on Performance Review to get promotions
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Geodesy 1.pptx...............................................
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
bas. eng. economics group 4 presentation 1.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CH1 Production IntroductoryConcepts.pptx
Internet of Things (IOT) - A guide to understanding
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Sustainable Sites - Green Building Construction
Model Code of Practice - Construction Work - 21102022 .pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
composite construction of structures.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Structs to JSON How Go Powers REST APIs.pdf
PPT on Performance Review to get promotions
Embodied AI: Ushering in the Next Era of Intelligent Systems
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Foundation to blockchain - A guide to Blockchain Tech
Geodesy 1.pptx...............................................
Arduino robotics embedded978-1-4302-3184-4.pdf

InternetOFThings_network_communicqtionCoAP_.pptx

  • 2. U & P U Patel Department of Computer Engineering What Is CoAP Protocol? • CoAP is an IoT protocol. CoAP stands for Constrained Application Protocol, and it is defined in RFC 7252. • CoAP is a simple protocol with low overhead specifically designed for constrained devices (such as microcontrollers) and constrained networks. • Web transfer protocol for use with constrained nodes and networks. • Designed for Machine to Machine (M2M) applications such as smart energy and building automation. • Based on Request‐Response model between end‐points • Client‐Server interaction is asynchronous over a datagram oriented transport protocol such as UDP
  • 3. U & P U Patel Department of Computer Engineering Features of CoAP protocols • The main features of CoAP protocols are: • Web protocol used in M2M with constrained requirements • Asynchronous message exchange • Low overhead and very simple to parse • URI and content-type support • Proxy and caching capabilities
  • 4. U & P U Patel Department of Computer Engineering Protocol Layers • There are two different layers that make CoAp protocol: Messages and Request/Response. • The Messages layer deals with UDP and with asynchronous messages. • The Request/Response layer manages request/response interaction based on request/response messages. • CoAP supports four different message types: • Confirmable • Non-confirmable • Acknowledgment • Reset
  • 5. U & P U Patel Department of Computer Engineering CoAP terminology • Endpoint: An entity that participates in the CoAP protocol. Usually, an Endpoint is identified with a host • Sender: The entity that sends a message • Recipient: The destination of a message • Client: The entity that sends a request and the destination of the response • Server: The entity that receives a request from a client and sends back a response to the client
  • 6. U & P U Patel Department of Computer Engineering CoAP Messages Model • This is the lowest layer of CoAP. • This layer deals exchawith UDP nging messages between endpoints. • Each CoAP message has a unique ID; this is useful to detect message duplicates. • A CoAP message is built by these parts: • A binary header • A compact options • Payload
  • 7. U & P U Patel Department of Computer Engineering Confirmable message Confirmable message • A confirmable message is a reliable message. • When exchanging messages between two endpoints, these messages can be reliable. • In CoAP, a reliable message is obtained using a Confirmable message (CON). • Using this kind of message, the client can be sure that the message will arrive at the server. • A Confirmable message is sent again and again until the other party sends an acknowledge message (ACK). • The ACK message contains the same ID of the confirmable message (CON).
  • 8. U & P U Patel Department of Computer Engineering Rest message • If the server has troubles managing the incoming request, it can send back a Rest message (RST) instead of the Acknowledge message (ACK)
  • 9. U & P U Patel Department of Computer Engineering Non-confirmable messages • The other message category is the Non-confirmable (NON) messages. • These are messages that don’t require an Acknowledge by the server. • They are unreliable messages or in other words messages that do not contain critical information that must be delivered to the server. • To this category belongs messages that contain values read from sensors. • Even if these messages are unreliable, they have a unique ID.
  • 10. U & P U Patel Department of Computer Engineering CoAp Request/Response Model • The CoAP Request/Response is the second layer in the CoAP abstraction layer. • The request is sent using a Confirmable (CON) or Non- Confirmable (NON) message. • There are several scenarios depending on if the server can answer immediately to the client request or the answer if not available. • If the server can answer immediately to the client request, then if the request is carried using a Confirmable message (CON), the server sends back to the client an Acknowledge message containing the response or the error code • In the CoAP message, there is a Token. The Token is different from the Message-ID and it is used to match the request and the response.
  • 11. U & P U Patel Department of Computer Engineering CoAp Request/Response Model • If the server can’t answer to the request coming from the client immediately, then it sends an Acknowledge message with an empty response. • As soon as the response is available, then the server sends a new Confirmable message to the client containing the response. • At this point, the client sends back an Acknowledge message: • If the request coming from the client is carried using a NON-confirmable message, then the server answer using a NON-confirmable message.
  • 12. U & P U Patel Department of Computer Engineering CoAp Message Format Where: • Ver: It is a 2 bit unsigned integer indicating the version • T: it is a 2 length • Code: It is the code bit unsigned integer indicating the message type: 0 confirmable, 1 non- confirmable • TKL: Token Length is the token 4 bit response (8 bit length) • Message ID: It is the message ID expressed with 16 bit
  • 13. U & P U Patel Department of Computer Engineering References https://dzone.com/articles/coap-protocol-step-by-step-guide https://coap.technology/impls.html