This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1352P7: Wi-SUN CoAP node message request

Part Number: CC1352P7

Tool/software:

Hi,

I am digging a little in the ns_coap_node code and I'd like to ask 2 questions about coap_message_handler_request_send function:

1. One of the function's parameter is sn_coap_content_format_e which can take, among other values, COAP_CT_TEXT_PLAIN or COAP_CT_JSON. If I want to send a group of data in the JSON format, what would be the difference between them? What is the correct format that I need to set when using TEXT_PLAIN and using JSON?

2. When sending a confirmable message, coap_message_handler_request_send can set a function to handle acknowledgments. Is there a timeout in the request send function that would send data again if no ACK is received? How does the delivery guarantee works in this case?

Thank you in advance.

BR,
Eduardo.

  • Hi Eduardo,

    1. I believe your answers are to be found in the following document: https://www.ietf.org/rfc/rfc7252.txt

       CoAP does not include a separate way to convey content-encoding
       information with a request or response, and for that reason the
       content-encoding is also specified for each identifier (if any).  If
       multiple content-encodings will be used with a media type, then a
       separate Content-Format identifier for each is to be registered.
       Similarly, other parameters related to an Internet media type, such
       as level, can be defined for a CoAP Content-Format entry.
    
       Initial entries in this sub-registry are as follows:
    
       +--------------------------+----------+----+------------------------+
       | Media type               | Encoding | ID | Reference              |
       +--------------------------+----------+----+------------------------+
       | text/plain;              | -        |  0 | [RFC2046] [RFC3676]    |
       | charset=utf-8            |          |    | [RFC5147]              |
       | application/link-format  | -        | 40 | [RFC6690]              |
       | application/xml          | -        | 41 | [RFC3023]              |
       | application/octet-stream | -        | 42 | [RFC2045] [RFC2046]    |
       | application/exi          | -        | 47 | [REC-exi-20140211]     |
       | application/json         | -        | 50 | [RFC7159]              |
       +--------------------------+----------+----+------------------------+

           As far as I know, it will simply populate some bytes in the header. No filtering occurs

    2. It seems like you can set the re transmission interval by yourself, according to sn_coap_protocol_set_retransmission_parameters

    Regards,

    Arthur

  • Hi Arthur,

    1. Thank you, looks like there is no big difference using text or json indeed.

    2. And what happens if the number of attempts sending the message is higher than SN_COAP_MAX_ALLOWED_RESENDING_COUNT? The message will be deleted and will not be delivered or it resets and keep trying until the node has received it?

    Best regards,
    Eduardo.

  • Hi Eduardo,

    It seems like it will just give up and not try sending:

    If you are worried about that, you should try increasing the counter.

    Regards,

    Arthur

  • Hi Arthur,

    My concern about increasing too much the counter is that maybe it could highly increase the network traffic in a large network. Do you suggest any value that I could have more guarantee of data delivering but would not cause heavy traffic? Considering a network of 50 devices with 4 hops.

    Regards,
    Eduardo.

  • Hi Eduardo,

    Please allow me to answer this question.

    I believe you should not be that concerned about increasing the resend counter. We have an LNT PER test set up on a 100 node, 10 hop network with less than 1% Packet Error Rate, so a 50 device network should not see much of a difference there.

    Best Regards,

    Simeon 

  • Hi Simeon,

    Thank you. I've also seen that the timeout is 40 seconds, so it seems like it's indeed unlikely that there would be no delivering in these contexts. About this LNT PER test, what is the average time that the last hops need to get a confirmable answer from border router?

    Best regards,
    Eduardo.

  • Hi Eduardo,

    For a 10 hop network round trip latency will be around 1600ms on the last zone (10th hop).

    We will be releasing an app note, which will feature all of test results in the coming months.

    Best Regards,

    Simeon

  • Thank you very much Simeon and Arthur for the support! All my questions have been cleared.

    Best regards.