← Back to the chapter · Next detail →

Technical detail · CoAP Methods and Multicast

Separate responses and uncertain record creation

A CoAP tank-alarm example shows how packet receipt, a stored setting and a newly created record provide different evidence.

The fixed-setting example changes a tank alarm limit from 80 to 90, with no other writer. Its PUT request, which assigns a desired value, uses Message ID 100 and Token a1. Message ID matches acknowledgements and detects duplicate messages; Token matches a response to its request. An acknowledgement is abbreviated ACK; a Confirmable (CON) message requests one. An empty ACK carries code 0.00, Message ID 100 and no Token. That confirms the request message, not successful storage.

Later, the separate CON response carries 2.04 Changed, Message ID 101 and Token a1. The client acknowledges that response with an empty ACK for Message ID 101. If the response is lost, the request’s empty ACK leaves completion uncertain. A fresh same-value PUT, its correlated successful response and a fresh GET read returning 2.05 Content with 90 establish stored configuration. They do not prove physical alarm operation.

For contrast, POST asks a resource to process supplied data: send payload offset=2 to /calibrations. A 2.01 Created response reports creation. Location-Path is the option carrying the created resource’s path. When it identifies /calibrations/17, that path and a readback of the record identify the created result. A fresh POST after a missing response may create another record. Neither correlation field supplies durable application deduplication: remembering an operation so a fresh request cannot repeat it.

Choose delivery effort per interaction. Bounded retries can still fail. Record what missing completion means and what the application will do about it. A successful response and verified state are separate evidence from packet receipt.

← Back to the chapter · Next detail →