<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MQTTSN with DTLS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41054/mqttsn-with-dtls</link><description>Hello, 
 
 There is a example for the nrf52840 for thread with mqttsn. Although this is just for my personal use I would love to use some kind of encryption for it. 
 So the idea was to use dtls for mqttsn. I already used tls with mqtt, but never worked</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Dec 2018 21:57:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41054/mqttsn-with-dtls" /><item><title>RE: MQTTSN with DTLS</title><link>https://devzone.nordicsemi.com/thread/160085?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 21:57:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0b9a0d4-f5f0-453a-96d4-999175ba6ede</guid><dc:creator>maxbachmann</dc:creator><description>&lt;p&gt;Hello Lukasz,&lt;/p&gt;
&lt;p&gt;Thank you for the fast response. I totally missed that the default version already uses AES-128 for encryption. I am totally with you that adding DTLS on top of that is unneeded.&lt;/p&gt;
&lt;p&gt;Max&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MQTTSN with DTLS</title><link>https://devzone.nordicsemi.com/thread/160070?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 19:00:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e665b0cf-0624-4e4b-b722-59a7b3eee5ac</guid><dc:creator>Lukasz Duda</dc:creator><description>&lt;p&gt;Hello Max,&lt;/p&gt;
&lt;p&gt;Glad to hear that you use nRF5 SDK for Thread. As you correctly spotted there is no example that shows MQTT-SN example with DTLS. Moreover this is the&amp;nbsp;thoughtful choice.&lt;/p&gt;
&lt;p&gt;If you look at the MQTT-SN specification (which is free and open-source) you can see that there are two virtual paths.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/960x720/__key/communityserver-discussions-components-files/4/5597741475988317477.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;1) from MQTT-SN clients (nRF52840) to a MQTT-SN Gateway (e.g. Raspberry pi) - over UDP&lt;/p&gt;
&lt;p&gt;2) from MQTT-SN Gateway to a MQTT broker over TCP&lt;/p&gt;
&lt;p&gt;The path number 1 is fully encrypted using AES-128 and Thread embedded encryption. So addition of DTLS between those MQTT-SN Clients and MQTT-SN Gateway seems to be unneeded and resource hungry.&lt;/p&gt;
&lt;p&gt;The path number 2 is based on regular MQTT (and TCP) which as you said you have some experienced with. Moreover if you log in to the Thread Border Router you can modify MQTT-SN Gateway configuration and use your favorite MQTT-SN Broker. You can also set up proper encryption there (TLS). Our MQTT-SN Gateway is based on the open source project Paho -&amp;nbsp;&lt;span style="font-family:inherit;"&gt;&lt;a href="https://github.com/eclipse/paho.mqtt-sn.embedded-c"&gt;https://github.com/eclipse/paho.mqtt-sn.embedded-c&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;However if I haven&amp;#39;t convinced you and you still want to use DTLS, this is possible but it would require significant changes both in MQTT-SN Gateway and in MQTT-SN Clients implementations. For later you would most likely need to expose DTLS API in OpenThread. Right now, there is public API for CoAPs only (you would like to cut it one line below - on plain UDP). Please see this file (&lt;a href="https://github.com/openthread/openthread/blob/master/src/core/coap/coap_secure.cpp)"&gt;github.com/.../coap_secure.cpp)&lt;/a&gt; to get understanding how to use internal DTLS API.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Hope that helps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>