0% found this document useful (0 votes)
64 views1 page

Constrained Application Protocol: Link Format .Well-Known/core

The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks. CoAP uses request/response interactions similar to HTTP, with a simple request/response message format and optional block-wise transfers to provide support for larger payloads. CoAP also defines optional features like observing and caching for constrained environments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views1 page

Constrained Application Protocol: Link Format .Well-Known/core

The Constrained Application Protocol (CoAP) is a specialized web transfer protocol for use with constrained nodes and constrained (e.g., low-power, lossy) networks. CoAP uses request/response interactions similar to HTTP, with a simple request/response message format and optional block-wise transfers to provide support for larger payloads. CoAP also defines optional features like observing and caching for constrained environments.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Constrained Application Protocol | 4.

12 (140, 0x8C) | Precondition Failed


| 4.13 (141, 0x8D) | Request Entity Too Large
|
|
|
|
| MAX_RETRANSMIT
| NSTART
| 4
| 1
|
|
| 4.15 (143, 0x8F) | Unsupported Content-Format | | | DEFAULT_LEISURE | 5 seconds |
(RFC 6690, RFC 7252, RFC 7959, RFC 7641) +------------------+------------------------------+--------------+ | PROBING_RATE | 1 Byte/second |
| 5.00 (160, 0xA0) | Internal Server Error | Server Error | +-------------------+---------------+
| 5.01 (161, 0xA1) | Not Implemented | |
The Constrained Application Protocol (CoAP) is a specialized web | 5.02 (162, 0xA2) | Bad Gateway | |
| 5.03 (163, 0xA3) | Service Unavailable | |
transfer protocol for use with constrained nodes and constrained | 5.04 (164, 0xA4) | Gateway Timeout
| 5.05 (165, 0xA5) | Proxying Not Supported
|
|
|
|
Link Format .well-known/core
(e.g., low-power, lossy) networks. +------------------+------------------------------+--------------+ Link format can be used to describe hosted resources, their
attributes, and other relationships between links.
CoAP Message Format Example:
0 1 2 3 Options
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 0 1 2 3 4 5 6 7 REQ: GET /.well-known/core
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +---------------+---------------+
|Ver| T | TKL | Code | Message ID | | Option Delta | Option Length | 1 byte RES: 2.05 Content
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +---------------+---------------+
| Token (if any, TKL bytes) ... / Option Delta / 0-2 bytes </sensors>;ct=40;title="Sensor Index",
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ \ (extended) \ </sensors/temp>;rt="temperature-c";if="sensor",
| Options (if any) ... +-------------------------------+ </sensors/light>;rt="light-lux";if="sensor",
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ / Option Length / 0-2 bytes <http://www.example.com/sensors/t123>;anchor="/sensors/temp";rel="describedby",
|1 1 1 1 1 1 1 1| Payload (if any) ... \ (extended) \ </t>;anchor="/sensors/temp";rel="alternate"
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-------------------------------+
/ Option Value / 0 or more bytes

Ver: Version, T: Type, TKL: Token Length


+-------------------------------+
Block
+-----+----+---+---+---+----------------+--------+--------+-------------+ In order to transfer larger payloads with CoAP − for instance, for
Message types | No. | C | U | N | R | Name | Format | Length | Default |
+-----+----+---+---+---+----------------+--------+--------+-------------+
firmware updates − the Block option can be used.
+------+-----------------+ | 1 | x | | | x | If-Match | opaque | 0-8 | (none) |
| Type | Name | | 3 | x | x | - | | Uri-Host | string | 1-255 | (see note 1)| +-----+---+---+---+---+----------------+--------+--------+----------+
+------+-----------------+ | 4 | | | | x | ETag | opaque | 1-8 | (none) | | No. | C | U | N | R | Name | Format | Length | Default |
| 0 | CONfirmable | | 5 | x | | | | If-None-Match | empty | 0 | (none) | +-----+---+---+---+---+----------------+--------+--------+----------+
| 1 | NON-confirmable | | 7 | x | x | - | | Uri-Port | uint | 0-2 | (see note 1)| | 23 | x | x | - | - | Block2 | uint | 0-3 B | (none) |
| 2 | ACKnowledgement | | 8 | | | | x | Location-Path | string | 0-255 | (none) | | 27 | x | x | - | - | Block1 | uint | 0-3 B | (none) |
| 3 | ReSeT | | 11 | x | x | - | x | Uri-Path | string | 0-255 | (none) | +-----+---+---+---+---+----------------+--------+--------+----------+
+------+-----------------+ | 12 | | | | | Content-Format | uint | 0-2 | (none) |
| 14 | | x | - | | Max-Age | uint | 0-4 | 60 |
| 15 | x | x | - | x | Uri-Query | string | 0-255 | (none) | 0
0 1 2 3 4 5 6 7
Method codes | 17 | x |
| 20 | |
|
|
| | Accept | uint | 0-2 | (none)
| x | Location-Query | string | 0-255 | (none)
|
| +-+-+-+-+-+-+-+-+
| NUM |M| SZX |
+------+--------+ | 28 | | | x | | Size2 | uint | 0-4 | (none) |
| 35 | x | x | - | | Proxy-Uri | string | 1-1034 | (none) | +-+-+-+-+-+-+-+-+
| Code | Name |
+------+--------+ | 39 | x | x | - | | Proxy-Scheme | string | 1-255 | (none) |
| 60 | | | x | | Size1 | uint | 0-4 | (none) | 0 1
| 0.00 | EMPTY |
+-----+----+---+---+---+----------------+--------+--------+-------------+ 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+------+--------+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0.01 | GET |
| NUM |M| SZX |
| 0.02 | POST |
| 0.03 | PUT | C=Critical, U=Unsafe, N=No-Cache-Key, R=Repeatable +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0.04 | DELETE | Note 1: taken from destination address/port of request message 0 1 2
+------+--------+
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
Content-Formats +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| NUM |M| SZX |
Response codes +--------------------------+-----+
| Media type | Id. |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

0 +--------------------------+-----+
0 1 2 3 4 5 6 7 | text/plain;charset=utf-8 | 0 |
+-+-+-+-+-+-+-+-+ | application/link-format | 40 | Observe
|class| detail | | application/xml | 41 |
+-+-+-+-+-+-+-+-+ | application/octet-stream | 42 | In order to follow state changes of CoAP resources the Observe
| application/exi | 47 |
| application/json | 50 |
option can be used.
+------------------+------------------------------+--------------+ | application/cbor | 60 |
| Code | Description | | +--------------------------+-----+ +-----+---+---+---+---+---------+------------+-----------+---------+
+------------------+------------------------------+--------------+
| No. | C | U | N | R | Name | Format | Length | Default |
| 2.01 (65, 0x41) | Created | Success |
+-----+---+---+---+---+---------+------------+-----------+---------+
| 2.02 (66, 0x42) | Deleted | |
| 2.03 (67, 0x43) | Valid
| 2.04 (68, 0x44) | Changed
|
|
|
|
URI schemes | 6 | | x | - | | Observe | uint | 0-3 B | (none) |
+-----+---+---+---+---+---------+------------+-----------+---------+
| 2.05 (69, 0x45) | Content | | coap-URI = "coap:" "//" host [ ":" port ] path-abempty [ "?" query ]
| 2.31 (95, 0x5F) | Continue | | coaps-URI = "coaps:" "//" host [ ":" port ] path-abempty [ "?" query ]
+------------------+------------------------------+--------------+
| 4.00 (128, 0x80) | Bad Request | Client Error |
References
| 4.01 (129, 0x81) | Unauthorized
| 4.02 (130, 0x82) | Bad Option
|
|
|
| Transmission parameters This cheatsheet is based on and heavily stole from the following
| 4.03 (131, 0x83) | Forbidden | | +-------------------+---------------+ documents:
| 4.04 (132, 0x84) | Not Found | | | name | default value | Link-format: http://tools.ietf.org/html/rfc6690
| 4.05 (133, 0x85) | Method Not Allowed | | +-------------------+---------------+ CoAP: http://tools.ietf.org/html/rfc7252
| 4.06 (134, 0x86) | Not Acceptable | | | ACK_TIMEOUT | 2 seconds | Block: http://tools.ietf.org/html/rfc7959
| 4.08 (136, 0x88) | Request Entity Incomplete | | | ACK_RANDOM_FACTOR | 1.5 | Observe: http://tools.ietf.org/html/rfc7641

You might also like