keith-cullen / FreeCoAP

An implementation of a CoAP client, a CoAP server and a HTTP/CoAP proxy with full DTLS support.
134 stars 38 forks source link

size data frame for DTLS FreeCoAP #31

Closed charlicruz closed 4 years ago

charlicruz commented 4 years ago

Dear all, I have implemented DTLS for CoAP implemented using GnuTLS on two Raspberry Pi. I ran test_client and test_server sample applications with CoAP/DTLS/IPv4 and the certificates were successfully installed. I would like to know the total data frame in bytes for the message that is sent to the serve and its response. Both boards are connected by using a wireless WiFi. I really appreciate any comment or suggestion. Thank you in advance. Cheers

keith-cullen commented 4 years ago

Use wireshark or tcpdump to measure packet size.

charlicruz commented 4 years ago

Thanks a lot for your response, a CoAP DTLS message size is set to 1024 bytes for the payload size. Your proposal under WiFi devices should uses a maximum transmission unit of 1500 bytes.I asked you because the packet size that is sent to the server captured doesn't correspond with the packed size selected in the consumer settings. I would kindly like to ask you where you setup the message you send to the server in the file: test_client IPV4.? Thank you A really appreciate your comments

keith-cullen commented 4 years ago

The only constraint on message size is in lib/include/coap_msg.h

define COAP_MSG_MAX_BUF_LEN 1152 /*< Maximum buffer length for header and payload /

This value is taken from RFC 7252, section 4.6. A CoAP message is passed to the DTLS library and the library adds overhead and performs fragmentation as it sees fit.