Application Protocol - CoAP
Application Protocol - CoAP
Background of COAP
• Comfirmable message
• Non-comfirmable message
• Ack message
• Reset message
• Piggy-backed
• Seprate
CoAP/transport
• Message size
• Must fit in a single IP datagram
• Default MTU 1280 bytes
• 6LOWPAN 127 bytes
• WSN based on IEEE 802.15.4 127 bytes
COAP Messaging Basics
• Transport:
• (mainly) UDP binding
• Message Exchange between Endpoints
• Messages with 4 bytes header (shared by request and
responses) containing a message ID (16 bits)
• Reliable exchange through Confirmable Messages which
must be acknowledged (through ACK or Reset Messages).
• Simple Stop-and-Wait retransmission with exponential
backoff.
• Unreliable exchange through Non-Confirmable Message
• Duplicate detection for both confirmable and non-
confirmable messages (through message ID)
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.
COAP Messaging
Request/Response model
CoAP: Sub-layers
CoAP/RESTful
coap URI:
coap://example.se:5683/~sensors./temp1.xml
coaps URI:
coaps://myPAN.se/bike/lock
CoAP/Secure
• Contiki-2.6 / Erbium
• ETH Zurich
• 8.5 kB ROM
• 1.5 kB RAM
• Linux → libcoap
• TinyOs (libcoap)
• Firefox CoAP Copper Cu plugin – install an test.
• Wikipedia has an upated list. Check it!
CoAP/additional standards
• Sure, CoAP is
• A very efficient RESTful protocol
• Ideal for constrained devices and networks
• Specialized for M2M applications
• Easy to proxy to/from HTTP
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.