-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: introduce cov:confirmable vocabulary term #392
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -210,6 +210,56 @@ <h3>Requests/Responses</h3> | |||||||||||||||||
} | ||||||||||||||||||
} | ||||||||||||||||||
</pre> | ||||||||||||||||||
<p> | ||||||||||||||||||
In CoAP over UDP or DTLS [[RFC7252]], requests and responses can either be confirmable (CON) or non-confirmable (NON). | ||||||||||||||||||
In contrast to non-confirmable messages, confirmable messages are required to be acknowledged by the receiving endpoint and are otherwise retransmitted until an acknowledgement has been received. | ||||||||||||||||||
Using non-confirmable requests can be useful for sensor data (that gets sent repeatedly and therefore does not need to be transmitted reliably), while confirmable requests provide a certain reliability that is useful for retrieving values or invoking actions that should not fail. | ||||||||||||||||||
</p> | ||||||||||||||||||
<p> | ||||||||||||||||||
To provide a hint whether CON or NON requests should be used for accessing a CoAP resource associated with a form, the vocabulary term `cov:confirmable` can be used. | ||||||||||||||||||
A value of `true` indicates that a CON request SHOULD be used by the Consumer, while a value of `false` indicates that a NON request SHOULD be used instead (for potential usages of the vocabulary term see [[[#example-request-con-non]]]). | ||||||||||||||||||
However, as the vocabulary term is just a hint, the consumer is not bound to this recommendation. | ||||||||||||||||||
When `cov:confirmable` is absent from a CoAP form, the consumer can choose freely between CON and NON requests as there is no default value defined. | ||||||||||||||||||
Comment on lines
+219
to
+222
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A "hint" seems rather less powerful than the SHOULD (which looks like RFC2119, to me).
Suggested change
|
||||||||||||||||||
</p> | ||||||||||||||||||
<p> | ||||||||||||||||||
When using reliable transport protocols (such as TCP) that ensure that messages are delivered, the distinction between confirmable and non-confirmable messages is not being made at the protocol level. | ||||||||||||||||||
Therefore, when using one of these CoAP variants, the vocabulary term `cov:confirmable` is simply ignored by a WoT consumer. | ||||||||||||||||||
</p> | ||||||||||||||||||
<pre id="example-request-con-non" class="example" title="A Thing Description containing CoAP forms with hints for confirmable and non-confirmable requests."> | ||||||||||||||||||
{ | ||||||||||||||||||
"@context": "https://www.w3.org/2022/wot/td/v1.1", | ||||||||||||||||||
... | ||||||||||||||||||
"properties": { | ||||||||||||||||||
"currentTemperature": { | ||||||||||||||||||
"title": "Latest temperature value", | ||||||||||||||||||
"description": "Returns the latest temperature value recorded.", | ||||||||||||||||||
"type": "number", | ||||||||||||||||||
"forms": [ | ||||||||||||||||||
{ | ||||||||||||||||||
"href": "coap://[2001:DB8::1]/currentTemperature", | ||||||||||||||||||
"cov:confirmable": true, | ||||||||||||||||||
"op": "readproperty" | ||||||||||||||||||
} | ||||||||||||||||||
] | ||||||||||||||||||
} | ||||||||||||||||||
}, | ||||||||||||||||||
"action": { | ||||||||||||||||||
"recordTemperature": { | ||||||||||||||||||
"title": "Record temperature value", | ||||||||||||||||||
"description": "Record a temperature value (e.g., from a sensor node).", | ||||||||||||||||||
"input": { | ||||||||||||||||||
"type": "number" | ||||||||||||||||||
}, | ||||||||||||||||||
"forms": [ | ||||||||||||||||||
{ | ||||||||||||||||||
"href": "coap://[2001:DB8::1]/recordTemperature", | ||||||||||||||||||
"cov:confirmable": false | ||||||||||||||||||
} | ||||||||||||||||||
] | ||||||||||||||||||
} | ||||||||||||||||||
} | ||||||||||||||||||
} | ||||||||||||||||||
</pre> | ||||||||||||||||||
<p> | ||||||||||||||||||
The <code>contentType</code> and <code>contentCoding</code> members of a form specify the CoAP content format of the request and/or response. | ||||||||||||||||||
In <abbr title="Constrained Application Protocol">CoAP</abbr>, combinations of content type and content coding are encoded using standardized values listed in the <a href="https://www.iana.org/assignments/core-parameters/#content-formats">IANA CoAP Content-Formats registry</a>. | ||||||||||||||||||
|
@@ -563,6 +613,16 @@ <h3>Form terms</h3> | |||||||||||||||||
<a href="http://www.w3.org/2001/XMLSchema#string">string</a> (e.g., <code>GET</code>, <code>PUT</code>, <code>POST</code>, <code>DELETE</code>, <code>FETCH</code>, <code>iPATCH</code>, or <code>PATCH</code>)<p>(See the <a href="https://www.iana.org/assignments/core-parameters/#method-codes">CoAP Method Codes</a> registry for the set of possible values.)</p> | ||||||||||||||||||
</td> | ||||||||||||||||||
</tr> | ||||||||||||||||||
<tr> | ||||||||||||||||||
<td><code>cov:confirmable</code></td> | ||||||||||||||||||
<td> | ||||||||||||||||||
Provides a hint for Consumers to use confirmable (`true`) or non-confirmable (`false`) requests with a particular resource. Only applicable to CoAP over UDP/DTLS [[RFC7252]]. | ||||||||||||||||||
</td> | ||||||||||||||||||
<td>optional</td> | ||||||||||||||||||
<td> | ||||||||||||||||||
<a href="http://www.w3.org/2001/XMLSchema#boolean">boolean</a> | ||||||||||||||||||
</td> | ||||||||||||||||||
</tr> | ||||||||||||||||||
<tr> | ||||||||||||||||||
<td><code>cov:minPollingInterval</code></td> | ||||||||||||||||||
<td> | ||||||||||||||||||
|
@@ -670,10 +730,10 @@ <h3>BlockWiseTransferParameters</h3> | |||||||||||||||||
<!-- Blockwise terms from the ontology--> | ||||||||||||||||||
<tr> | ||||||||||||||||||
<td> | ||||||||||||||||||
<code>cov:block2Size</code> | ||||||||||||||||||
<code>cov:block1Size</code> | ||||||||||||||||||
</td> | ||||||||||||||||||
<td> | ||||||||||||||||||
Indicates the largest block size that may be used in a Block2 or Q-Block2 Option | ||||||||||||||||||
Indicates the largest block size that may be used in a Block1 or Q-Block1 Option | ||||||||||||||||||
</td> | ||||||||||||||||||
<td>optional</td> | ||||||||||||||||||
<td> | ||||||||||||||||||
|
@@ -682,10 +742,10 @@ <h3>BlockWiseTransferParameters</h3> | |||||||||||||||||
</tr> | ||||||||||||||||||
<tr> | ||||||||||||||||||
<td> | ||||||||||||||||||
<code>cov:block1Size</code> | ||||||||||||||||||
<code>cov:block2Size</code> | ||||||||||||||||||
</td> | ||||||||||||||||||
<td> | ||||||||||||||||||
Indicates the largest block size that may be used in a Block1 or Q-Block1 Option | ||||||||||||||||||
Indicates the largest block size that may be used in a Block2 or Q-Block2 Option | ||||||||||||||||||
</td> | ||||||||||||||||||
<td>optional</td> | ||||||||||||||||||
<td> | ||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -210,6 +210,56 @@ <h3>Requests/Responses</h3> | |||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
</pre> | ||||||||||||||||||||||||||||||
<p> | ||||||||||||||||||||||||||||||
In CoAP over UDP or DTLS [[RFC7252]], requests and responses can either be confirmable (CON) or non-confirmable (NON). | ||||||||||||||||||||||||||||||
In contrast to non-confirmable messages, confirmable messages are required to be acknowledged by the receiving endpoint and are otherwise retransmitted until an acknowledgement has been received. | ||||||||||||||||||||||||||||||
Using non-confirmable requests can be useful for sensor data (that gets sent repeatedly and therefore does not need to be transmitted reliably), while confirmable requests provide a certain reliability that is useful for retrieving values or invoking actions that should not fail. | ||||||||||||||||||||||||||||||
</p> | ||||||||||||||||||||||||||||||
<p> | ||||||||||||||||||||||||||||||
To provide a hint whether CON or NON requests should be used for accessing a CoAP resource associated with a form, the vocabulary term `cov:confirmable` can be used. | ||||||||||||||||||||||||||||||
A value of `true` indicates that a CON request SHOULD be used by the Consumer, while a value of `false` indicates that a NON request SHOULD be used instead (for potential usages of the vocabulary term see [[[#example-request-con-non]]]). | ||||||||||||||||||||||||||||||
However, as the vocabulary term is just a hint, the consumer is not bound to this recommendation. | ||||||||||||||||||||||||||||||
Comment on lines
+215
to
+221
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestions made against this content in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI: the duplication comes from the fact that based on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That would be true only if Lacking anything highlighting the differences between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a render script in place that uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
We are slowly getting there as that was also what @lu-zero suggested :) Btw, this is the same in wot-thing-description repository. Sorry for the confusion and thank you for reviewing! |
||||||||||||||||||||||||||||||
When `cov:confirmable` is absent from a CoAP form, the consumer can choose freely between CON and NON requests as there is no default value defined. | ||||||||||||||||||||||||||||||
</p> | ||||||||||||||||||||||||||||||
<p> | ||||||||||||||||||||||||||||||
When using reliable transport protocols (such as TCP) that ensure that messages are delivered, the distinction between confirmable and non-confirmable messages is not being made at the protocol level. | ||||||||||||||||||||||||||||||
Therefore, when using one of these CoAP variants, the vocabulary term `cov:confirmable` is simply ignored by a WoT consumer. | ||||||||||||||||||||||||||||||
</p> | ||||||||||||||||||||||||||||||
<pre id="example-request-con-non" class="example" title="A Thing Description containing CoAP forms with hints for confirmable and non-confirmable requests."> | ||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||
"@context": "https://www.w3.org/2022/wot/td/v1.1", | ||||||||||||||||||||||||||||||
... | ||||||||||||||||||||||||||||||
"properties": { | ||||||||||||||||||||||||||||||
"currentTemperature": { | ||||||||||||||||||||||||||||||
"title": "Latest temperature value", | ||||||||||||||||||||||||||||||
"description": "Returns the latest temperature value recorded.", | ||||||||||||||||||||||||||||||
"type": "number", | ||||||||||||||||||||||||||||||
"forms": [ | ||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||
"href": "coap://[2001:DB8::1]/currentTemperature", | ||||||||||||||||||||||||||||||
"cov:confirmable": true, | ||||||||||||||||||||||||||||||
"op": "readproperty" | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
] | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||
"action": { | ||||||||||||||||||||||||||||||
"recordTemperature": { | ||||||||||||||||||||||||||||||
"title": "Record temperature value", | ||||||||||||||||||||||||||||||
"description": "Record a temperature value (e.g., from a sensor node).", | ||||||||||||||||||||||||||||||
"input": { | ||||||||||||||||||||||||||||||
"type": "number" | ||||||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||||||
"forms": [ | ||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||
"href": "coap://[2001:DB8::1]/recordTemperature", | ||||||||||||||||||||||||||||||
"cov:confirmable": false | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
] | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||
</pre> | ||||||||||||||||||||||||||||||
<p> | ||||||||||||||||||||||||||||||
The <code>contentType</code> and <code>contentCoding</code> members of a form specify the CoAP content format of the request and/or response. | ||||||||||||||||||||||||||||||
In <abbr title="Constrained Application Protocol">CoAP</abbr>, combinations of content type and content coding are encoded using standardized values listed in the <a href="https://www.iana.org/assignments/core-parameters/#content-formats">IANA CoAP Content-Formats registry</a>. | ||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a TD we want to tell the TD consumer how to interact with the Thing, so this is about CoAP requests that the consumer sends to the Thing, right?
I would assume that if a TD consumer knows what it is doing (e.g. transmitting sensor data, retrieving a value, or invoking an action) it also knows whether it is best to do it with a CON or NON. Maybe the consumer just needs to give the CoAP driver a hint as to what it is doing?
Or what are the cases where a TD consumer is doing something and also knows what it is doing, but does not know whether to use CON or NON, and so the TD should tell it (or overrule what it would normally do)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, yeah, these are good points. Maybe a better example could be sleepy devices that were also discussed in the context of #389? Although I am still not completely sure how to model that. Perhaps another use case could be resource constraints in general, where using NON could be slightly more efficient (although not that much when piggybacked acknowledgments are being used).
Do you see a better motivation here? (Also pinging @mkovatsc as we discussed this potential addition to the vocabulary during WoT week.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sleepy devices are interesting because a TD consumer may spend a lot of time trying to reach a device that is unreachable, draining the resources of the network infrastructure, which may also be resource constrained. It would therefore be very desirable if a TD could give a consumer hints on how best to reach the sleepy device. Is the choice between CON and NON enough? Is the sleepy device awake at regular intervals so that the TD consumer only has to synchronize its schedule once and can then communicate at the fixed interval that is specified in the TD? This would then no longer be CoAP-specific but would go in the direction of the generic terms mentioned by @danielpeintner.