I'm using the Cloud Multi-Service app on nRF9160 to test the CoAP DTLS 1.2 CID support while connected to nRF Cloud to evaluate, and want to check the data size for messages sent to help estimate total data use over time. In coap_client.c I can see the size of the CoAP message layer sent and received, but I need to know how big the underlying DTLS overheads are.
1) In DTLS 1.2. CID - How big is the CID used by the nRF SDK 2.6.1 + Modem v1.3.6?
2) Using AT%XCONNSTAT to help check the message overheads for a CoAP POST (after DTLS has already connected)
Using AT%XCONNSTAT? to check the modem states (with AT%XCONNSTAT=1 just before temperature data sent) returns:
%XCONNSTAT: 0,0,0,0,139,97 - where: max_packet = 139, min_packet = 97
Where the coap POST (confirmable) len = 51 (for header_len=12(token=8), options len=11, data len=28).
Does this mean the total data pkt overhead = 139 - 51 = 88 bytes for this POST? And 97 bytes is the size for the Coap Ack (including overheads) ?
3) After a Google search on DTLS overheads - I had expected total data overheads for DTLS 1.2 CID + UDP/IP to be approx = ~57 bytes if CID length is say 16 bytes long.
Assuming IP(20) + UDP(8) + DTLS(13) + CID (16) = 57. So I'm not sure if the results from XCONNSTAT implies a much bigger CID length is being used?
In conclusion - Can you please confirm the actual data overheads for DTLS 1.2 CID with nRF SDK. This will be very helpful for estimating data use over time