Constrained Application Protocol: Difference between revisions

Content deleted Content added
DrTobbe (talk | contribs)
CoAP Fixed Header: Clarify that the first 4 bytes constitute the header which is why they are always required
DrTobbe (talk | contribs)
Message formats: Clarify message ID usage for acknowledgement/reset matching and token usage for request-response-matching
Line 145:
==== Message ID (16 bits) ====
 
:Used to detect message duplication and to match messages of type acknowledgement/reset to messages of type confirmable/non-confirmable. Response messages will have the same message ID as the request has.
 
=== Token ===
ThisEvery isrequest ancarries optionala fieldtoken whose(but sizeit ismay indicatedbe by the tokenzero length field,) whose valuesvalue iswas generated by the client. The server must echo every token value without any modification back to the client in the corresponding response. It is intended for use as a client-local identifier to providematch extrarequests contextand forresponses, certainespecially for concurrent transactionsrequests.
 
Matching requests and responses is not done with the message ID because a response may be sent in a different message than the acknowledgement (which uses the message ID for matching). For example, this could be done to prevent retransmissions if obtaining the result takes some time. Such a detached response is called "separate response". In contrast, transmitting the response directly in the acknowledgement is called "piggybacked response" which is expected to be preferred for efficiency reasons.
 
=== Option ===