Skip to main content
. 2019 Mar 17;19(6):1339. doi: 10.3390/s19061339
Algorithm 1 CoAP Request in cNAP
  • isProxyOption[coap_request]

  • coap_header[coap_request]

  • Token[coap_request]

  • request_type[coap_request]

  • ifrequest_type = = Confirmable then

  • sendemptyACKtorequestingclient

  • request_typeNon-confirmable

  • end if

  • ifisProxyOption = = true then

  • proxyURI[coap_request]

  • split_proxyURI(hostURI,port,resourceURI,query)

  • isObserveOption[coap_request]

  • applyrequestaggregation

  • requestnewcoap_packet()

  • requestcoap_header

  • requestinsertOption(hostURI,resourceURI)

  • if portandqueryarenotNULL then

  •   requestinsertOption(port)

  •   requestinsertOption(query)

  • end if

  • if isObserveOption = = true then

  •   applycoapobservealgorithm

  •   requestinsertObserveOption()

  • end if

  • if coap_requesthaspayload then

  •   requestinsertPayload()

  • end if

  • /possibilityofICNmulticast

  • multipleserverregisterforthisresource

  • /

  • creatependingICNpublicationListusingToken

  • SIDhostsha256_hash(hostURI)

  • SIDCOAP_SCOPE_ID+SIDhost

  • RIDgenerateRandomString()

  • ICN_IDSID+RID

  • updateICN_ID_to_client_token_list

  • publishrequesttoICNusingICNID

  • end if