[nanomsg] Mangos changes today (API breakage)

  • From: "Garrett D'Amore" <garrett@xxxxxxxxxx>
  • To: "nanomsg@xxxxxxxxxxxxx" <nanomsg@xxxxxxxxxxxxx>
  • Date: Mon, 9 Nov 2015 19:11:19 -0800

All,

If you use mangos, you should be aware that I’ve knowingly made changes
today which could break client applications. Probably not many, but still
possible.

Here’s what you need to know.

First off, variables / constants that had Tls or Ttl in the name have
changed to use TLS or TTL. So OptionTTL not OptionTtl. This is per Go
recommendations.

Secondly, if you use STAR, you need to be aware that I’ve changed the wire
protocol — a hop count is now added, and it honors OptionTTL. (The TTL is
enforced at the receiver.) This should make STAR immune infinite loops,
and hence a little safer. (It can still trash your network since a packet
and loop through the entire network TTL hops * #nodes. So loops are still
a *bad* idea; this just ensures that the packet storm from such a
misconfiguration *will end*.

The default TTL for STAR is 8, just like REQ/REP. I’d be happy to be
convinced it should be much smaller, like say 2, if others agree. The
maximum it can be set to is 255; if you have more hops than that in your
network you’re doing it wrong.

The wire protocol, in case you’re curious, is to add 4 bytes, which consist
of 3 reserved 0 values, and followed by the single hop count a byte. The
rationale here is to still keep things nicely dword aligned, rather than
trying to be a scrooge for a couple of bytes. Those bytes *must* be zero
or the packet will be dropped.

At some point I’ll probably write an RFC for this protocol. Maybe even
implement it in libnanomsg — though to be honest I’d welcome and effort to
do so from someone else. :-)

- Garrett


- Garrett

Other related posts:

  • » [nanomsg] Mangos changes today (API breakage) - Garrett D'Amore