CoAP Request and Response Rules

   CoAP specification (at the time of this writing, draft-18) does not clearly set out rules that define what would be a response for a given CON or a NON request. Embedded within the specification are various rules that are outlined. While many rules are still open and not clearly defined, the table below is a guidance that we have started following. Please note, this should be treated only as a guidance and not as something that is clearly defined by the CoAP Specifications.

Client SendsMessage Successfully Parsed and Understood By ServerServer Has all Information to Process the Request and can Successfully ProcessServer Sends Message TypeServer Sends Message CodeRemarks
CON YES YES ACK One of success response codes Happy day scenario
CON YES NO ACK One of failed response codes URI path in request is wrong and 4.04 not found is sent in ACK
CON NO NO RST One of failed response codes e.g. Unknown message code
NON YES YES     No response sent back
NON YES YES NON One of success response codes Response sent back as NON message
NON YES NO RST One of failed response codes URI path in request is wrong and 4.04 not found is sent in RST
NON NO NO RST One of failed response codes e.g. Unknown message code
NON YES YES CON One of request codes e.g. Previous NON request was for a data that requires confirmation from the sender on whether it reached the client or not

posted on 2016-04-07 18:34  jianqi2010  阅读(530)  评论(0编辑  收藏  举报

导航