Confirmable (CON)
Requests an ACK and retries on timeout until acknowledged, reset, or abandoned. Choose it for message-receipt evidence, then inspect the operation result separately.
Progress saves as you read. Mark sections complete as you go; your progress appears in the sidebar.
Related reference: CoAP message types.
A valve applies a request, but its acknowledgement is lost. The client sees silence. Should it send again, and what would that second packet prove?
CoAP, the Constrained Application Protocol, defines message exchange rules for constrained devices. The client sends a request; the server answers it. The payload carries application data such as a valve target. Follow one lost reply to separate message receipt, the reported result, and the physical action.
A client sends a Confirmable (CON) request to set a valve target to 30%. CON asks the receiver to acknowledge the message. The request has Message ID (MID) 4102 for message acknowledgement and duplicate detection, and Token 7a to match the peer’s response to this request. These are example identifiers, not permanent command identities. The Code states the requested method or the reported result.
The valve applies the target and sends an Acknowledgment (ACK) with MID 4102. Assume the ACK also carries the operation response and Token 7a. The ACK is lost. After its timer expires, the client retransmits the original CON with MID 4102 and Token 7a. The server recognizes that message from that client as a duplicate and reuses its acknowledgement rather than treating the packet as a new action.
Setting a target describes a desired state. Repeating a dosing command could instead add another dose. Such an operation is non-idempotent: repetition can add an effect. Message duplicate handling protects a bounded exchange. An application command identifier with a stored outcome can protect a later attempt after that state expires, if the record survives the required retry period.
In Figure 2, compare the request and return arrows. A Non-confirmable (NON) message creates no ACK duty and has no CoAP message retransmission. A NON request can still receive an application response. A Reset (RST) signals that the receiver lacks the context to process the message; it is not a successful operation result.
Use Figure 1 to follow MID between a CON and its ACK, then Token between a request and its response. An ACK can carry the response, or it can be empty while the server prepares a later response. That distinction decides whether the client has a result or only message-receipt evidence.
Prove a Retry Does Not Repeat the Action
For the valve trace, predict before checking the logs: after the lost ACK, the same MID should appear again. At the server, look for duplicate detection and the recorded acknowledgement. Compare that decision with the valve action count. A packet trace alone cannot prove how many times the hardware moved.
Keep packet times, peer addresses, Type, Code, MID, Token, server decisions, and action evidence together. If no reply arrives before the client gives up, the outcome is unknown to the client: the request may have been lost, or the valve may have acted and every reply been lost. A timeout does not prove non-execution.
Transfer the reasoning later to a slow sensor. Once its empty ACK arrives, request retransmission stops, but the client still needs a response with the original Token. Decide what that next packet must contain before reading the answer.
After this page, you should be able to:
CoAP Message Types introduces the four types. Here, use them to diagnose the valve trace: Type and MID govern acknowledgement and duplicate handling; Code and Token express the request or result and connect a response to its request.
Keep three questions separate: did the peer receive this message, what result did it report, and what happened at the device? A delayed result, lost ACK, or reboot can make those answers differ.
In the valve trace, the messaging layer handles receipt and duplicates using Type and the 16-bit MID. The request/response layer uses Code for the method or result and Token for correlation with the request. A CON can carry a request or a response: Type does not identify its application meaning.
CON retransmission follows a timer if no ACK or RST arrives. NON creates no ACK duty and no CoAP message retransmission. An ACK echoes the CON MID. RST reports missing context, such as an unrecognized response after a reboot.
Read both layers: Type=CON, Code=0.01 is a confirmable GET request; Type=ACK, Code=2.05 carries a Content response in an ACK. Type=ACK, Code=0.00 is an empty ACK: it stops retransmission but carries no operation result or Token. Type=RST, Code=0.00 is an empty Reset. Do not infer valve success from an empty ACK.
For every packet, ask what Type requires and what Code reports. CON and NON can carry requests or responses. ACK and RST are CoAP messaging signals. A missing NON sample may be acceptable when a later reading replaces it; a missing command result still needs an application policy.
Inspect Figure 2 for the return packets each pattern requires. Predict which packet stops a retransmission and which carries the operation result.
The top row of Figure 2 contrasts Confirmable / Reliable, where a CON Request receives an ACK Response, with Non-Confirmable / Fire-and-forget, where the NON Message has no return arrow. The lower Piggybacked / Inline response exchange carries ACK 2.05 + Data in one return packet. By contrast, Separate / Deferred response first sends ACK (empty), later delivers CON 2.05 + Data, and requires a final ACK. Those sequences keep delivery timing separate from the GET or PUT meaning assigned at the request/response layer.
Requests an ACK and retries on timeout until acknowledged, reset, or abandoned. Choose it for message-receipt evidence, then inspect the operation result separately.
No ACK duty and no CoAP message retransmission. Replaceable readings can use it when the application tolerates gaps.
Confirms exactly one CON by echoing its Message ID. It may be empty, or it may piggyback the response.
Signals that a received message could not be processed for lack of context. It also answers a CoAP ping (an empty CON).
An Observe registration is stored subscription state for resource updates. A notification is one such update. In the next case, the rebooted client no longer recognizes that state.
Return to MID 4102. Suppose its first timeout is T = 2 s. With no ACK or RST, the client waits 2 s and retransmits, waits 4 s and retransmits again, then waits 8 s before the third retry. That retry is 14 s after the initial send. The intervals double; they are not all measured from the initial send.
For the RFC 7252 default schedule, use ACK_TIMEOUT = 2 s, ACK_RANDOM_FACTOR = 1.5, and MAX_RETRANSMIT = 4. Choose the initial timeout T in the 2–3 s window, then double that chosen timeout after each retransmission. The maximum default first-to-last-send span is MAX_TRANSMIT_SPAN = 45 s; the maximum default wait before abandonment is MAX_TRANSMIT_WAIT = 93 s. These are upper bounds, not exact durations for every trace.
The valve uses PUT /actuators/valve to request its target state. CON lets the controller check receipt, but a lost response leaves the reported outcome unknown. In this design, readings from /sensors/temp arrive every 10 seconds as NON, and the application accepts gaps because later readings replace earlier ones. That loss policy fits this stream; it does not establish a safe valve fallback deadline.
Record the initial timeout, retry limit, application deadline, and local fallback. Let CoAP manage this message’s retransmissions; a new application attempt needs a repeat-safety policy. NSTART limits outstanding interactions with a peer and defaults to 1. An unacknowledged CON occupies that limit. A request counts as outstanding while neither its response nor its acknowledgement has arrived. An empty ACK therefore ends that request’s outstanding interaction for NSTART, even though its separate response remains pending. For a CoAP ping, send an empty CON and expect RST: that checks peer reachability, not valve state.
If the valve result is ready promptly, a piggybacked response carries it inside the ACK. MID 4102 acknowledges the request message, and Token 7a identifies its response. Inspect the response Code for the reported result. For a GET, 2.05 Content reports returned content; it is not a generic valve-write success code.
Transfer the rule to a slow sensor GET. The server sends an empty ACK with the request MID and Code 0.00. Request retransmission stops, but sampling is still pending. A later separate response is a new CON or NON with its own MID and the original request Token. If it is CON, the client ACKs that new MID. The empty ACK contains no Token; correlation belongs to the later response.
The difference between a piggybacked and separate response becomes clear when Figure 1 is read with Message ID and Token as two distinct threads.
In Figure 1, first follow the Message ID that pairs a CON with its ACK. Then follow the Token that pairs the application response with the original request. A ready response can ride inside the ACK; a delayed response uses a new message exchange but retains the Token. This separation also explains why duplicate suppression is keyed at the message layer while application correlation survives across exchanges.
The valve server needs duplicate suppression: recognize a recent message by source endpoint and MID and reuse its acknowledgement rather than repeat a non-idempotent effect. Record the implementation’s retention period and MID reuse policy; this bounded state is not permanent command history. An idempotent operation has the same intended effect when repeated, such as setting the same target. Appending an entry or adding a dose may instead need an application command ID and a stored result that survives the required retry period.
ACK carries the response. Same Message ID as the request, Token matches. Used when the answer is immediate.
Empty ACK stops request retransmission. A new CON/NON carries the result with the original Token; match it in the peer’s request context.
A 16-bit field for duplicate detection and matching ACK to CON or RST to CON/NON. It is not a permanent application command ID.
Retain duplicate state for the exchange policy and reuse the acknowledgement for a recognized duplicate. Keep application replay protection for longer-lived side effects.
Before signing off a CoAP message-flow design, verify that:
Review the message types before the field layout, since the exchange contract depends on both type and matching fields.

Chapter
CoAP Message Format
Review the fields that carry Type, Code, Message ID, Token, options, and payload.

Chapter
CoAP Method Codes and Multicast Contracts
Connect message reliability to method safety, idempotency, and multicast behavior.

Chapter
CoAP Observe Registration and Freshness Contracts
Apply Message ID, Token, and RST behavior to long-running Observe relationships.

Chapter
CoAP Implementation Stack Trace Contracts
Check how library APIs expose retries, tokens, timeouts, and message types.
After you can read a message exchange at both layers, continue with CoAP Message Format to inspect the exact bits and option fields carried in each datagram.
Historical protected source blocks retained for the chapter preservation check.
The difference between a piggybacked and separate response becomes clear when Figure 1 is read with Message ID and Token as two distinct threads.
1A slow request arrives with a message number and token.
2An empty ACK stops request retransmission; it does not report the result.
3The sensor works. Bex keeps the request token safe.
4The result returns in a new message with the same token.
5If the result is CON, the client ACKs its new Message ID.
In Figure 1, first follow the Message ID that pairs a CON with its ACK. Then follow the Token that pairs the application response with the original request. A ready response can ride inside the ACK; a delayed response uses a new message exchange but retains the Token. This separation also explains why duplicate suppression is keyed at the message layer while application correlation survives across exchanges.
The valve server needs duplicate suppression: recognize a recent message by source endpoint and MID and reuse its acknowledgement rather than repeat a non-idempotent effect. Record the implementation’s retention period and MID reuse policy; this bounded state is not permanent command history. An idempotent operation has the same intended effect when repeated, such as setting the same target. Appending an entry or adding a dose may instead need an application command ID and a stored result that survives the required retry period.
ACK carries the response. Same Message ID as the request, Token matches. Used when the answer is immediate.
Empty ACK stops request retransmission. A new CON/NON carries the result with the original Token; match it in the peer’s request context.
A 16-bit field for duplicate detection and matching ACK to CON or RST to CON/NON. It is not a permanent application command ID.
Retain duplicate state for the exchange policy and reuse the acknowledgement for a recognized duplicate. Keep application replay protection for longer-lived side effects.

Knowledge check · self-test
__IOT_RELATED_TITLE__
__IOT_RELATED_DESCRIPTION__