This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

CoAP, CoAPS and UDP

Hi,

I use example projects  Thread: CoAP Client and  Thread: CoAP Server . I can send and receive data over CoAP. My purpose is to use CoAP, CoAPS and UDP tohether. If client send UDP message, server can reply with UDP payload or client send CoAPs, server reply same manner. How can I accomplish to send CoAPs and UDP data?

Parents
  • I'm not sure, what you exactly mean. Let me try to explain, how coap and coaps is handled in scenarios I know. coaps uses dtls the create encrypted coap-message as udp messages, while coap send the coap-message unencrypted directly over udp. This includes, that the client uses different "coap-endpoint", setup to sent the coap-message direct or encrpyted. Such a client-coap-endpoint is bound to a local port. The results in two coap-endpoints with different ports on the client. The server usually does the same, it offers on 5683 plain coap and on 5684 coaps (coap-dtls-udp). Some implementations (e.g. Eclipse/Californium) offer a (client-side) endpoint manager for that. Once setup, the client may just use either coap or coaps as scheme and the the coap-client will do the magic for you.

    So in short: use different coap-endpoints with different ports and different configurations.

Reply
  • I'm not sure, what you exactly mean. Let me try to explain, how coap and coaps is handled in scenarios I know. coaps uses dtls the create encrypted coap-message as udp messages, while coap send the coap-message unencrypted directly over udp. This includes, that the client uses different "coap-endpoint", setup to sent the coap-message direct or encrpyted. Such a client-coap-endpoint is bound to a local port. The results in two coap-endpoints with different ports on the client. The server usually does the same, it offers on 5683 plain coap and on 5684 coaps (coap-dtls-udp). Some implementations (e.g. Eclipse/Californium) offer a (client-side) endpoint manager for that. Once setup, the client may just use either coap or coaps as scheme and the the coap-client will do the magic for you.

    So in short: use different coap-endpoints with different ports and different configurations.

Children
Related