MQTT over UDP?

12,371 views
Skip to first unread message

Nicholas Humfrey

unread,
Oct 1, 2011, 4:59:29 AM10/1/11
to MQ Telemetry Transport
Hello,

Is anyone doing MQTT over UDP?

I was thinking that it might be easier for embedded devices sending a continuous stream of sensor readings?

Could the higher QOS levels be a replacement for TCP?


nick.

Sy

unread,
Oct 1, 2011, 7:12:06 AM10/1/11
to MQ Telemetry Transport
Hi Nick,

I'm don't think UDP is an option, UDP is a connection-less protocol.
MQTT needs to have a live connection in order to notify clients when a
topic changes.

UDP is faster than TCP, but UDP doesn't have any error correction or
flow control. You would typically use UDP for streaming data from one
point to another but not for two way dialog.


Regards,
Simon

Nicholas O'Leary

unread,
Oct 1, 2011, 12:31:17 PM10/1/11
to mq...@googlegroups.com
Hi Nick,

MQTT itself assumes a TCP network. But there is the MQTT-S (for Sensors) specification also linked to from http://mqtt.org/documentation

MQTT-S doesn't require the connection oriented transport provided by TCP, so is suited for use over UDP, Zigbee or a.n.other. It can crudely be thought of as MQTT with the bits added so we don't miss TCP, but there are some added features that are quite nice, such as auto-discovery of brokers and registration of topics to save even more bytes on the wire.

There currently aren't any public implementations of it, but anyone who has implemented MQTT wouldnt find it a stretch to do -S.

Regards,
Nick
> --
> To learn more about MQTT please visit http://mqtt.org
>
> To post to this group, send email to mq...@googlegroups.com
> To unsubscribe from this group, send email to
> mqtt+uns...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/mqtt
>

Sy

unread,
Oct 1, 2011, 1:14:33 PM10/1/11
to MQ Telemetry Transport
Thanks for the clarification, I'll take a look at the documentation.

On Oct 1, 9:59 am, Nicholas Humfrey <n...@aelius.com> wrote:

Nicholas Humfrey

unread,
Oct 1, 2011, 1:14:48 PM10/1/11
to mq...@googlegroups.com

> I'm don't think UDP is an option, UDP is a connection-less protocol.
> MQTT needs to have a live connection in order to notify clients when a
> topic changes.

Why can't the server just send packets back to the port that the client transmitted them from? This is what I have done with OSC in the past.


> UDP is faster than TCP, but UDP doesn't have any error correction or
> flow control. You would typically use UDP for streaming data from one
> point to another but not for two way dialog.

There are lots of UDP based protocols that perform two-way dialogs. DNS for example.


nick.

>
> On Oct 1, 9:59 am, Nicholas Humfrey <n...@aelius.com> wrote:
>> Hello,
>>
>> Is anyone doing MQTT over UDP?
>>
>> I was thinking that it might be easier for embedded devices sending a continuous stream of sensor readings?
>>
>> Could the higher QOS levels be a replacement for TCP?
>>
>> nick.
>

Nicholas J Humfrey

unread,
Oct 3, 2011, 4:02:32 AM10/3/11
to mq...@googlegroups.com
Ah, interesting. Thanks!

I really must try implementing a MQTT server in my ruby gem.

nick.

Reply all
Reply to author
Forward
0 new messages