[zeromq-dev] PGM: multiple listener behavior?

Steven McCoy steven.mccoy at miru.hk
Thu Aug 9 18:20:19 CEST 2012


On 9 August 2012 11:33, CFK <cfkaran2 at gmail.com> wrote:

> Steven, this is all VERY interesting to me, because just like Stuart,
> I was planning on creating a bus as well.


Bus across the network works as of this commit three years ago:

https://github.com/zeromq/zeromq2-x/commit/85cbd7f83c10c70da8fa44fe767314
3703f9710d

Bus on a single socket is not supported: i.e. send and receive like TIBCO
Rendezvous.

I probably made a mistake before.


>  Since that won't work, I
> thought of a quick hack, but I want to see if it is supported; can you
> connect multiple multicast addresses to the same interface in ZMQ?  My
> thought is to make a pseudo-bus, where each member of a smallish set
> (10-15 nodes) publishes on its own address, but subscribes to all
> addresses in the set.


This is certainly supported: it is called asymmetric multicast.


>  Is it possible to connect the same interface to
> multiple multicast addresses, without causing any problems?  If so, is
> the following acceptable code?
>
> Assume that the following interfaces own the following addresses:
>
> 192.168.1.10  <-> 239.168.1.10
> 192.168.1.11  <-> 239.168.1.11
> 192.168.1.12  <-> 239.168.1.12
> 192.168.1.13  <-> 239.168.1.13
>
> Using the same port will multiply the received messages on Linux due to
how socket routing is implemented.

The alternative form is using a single PGM socket:

subscriber.connect("epgm://192.168.1.10;239.168.1.11,<http://239.168.1.13:5000/>
239.168.1.12, <http://239.168.1.13:5000/>239.168.1.13,<http://239.168.1.13:5000/>
239.168.1.10:5000 <http://239.168.1.13:5000/>")

This receives on .11, .12, .13 and sends on .10.

subscriber.connect("epgm://192.168.1.1
<http://192.168.1.10/>1;239.168.1.10,<http://239.168.1.13:5000/>
239.168.1.12, <http://239.168.1.13:5000/>239.168.1.13,<http://239.168.1.13:5000/>
239.168.1.11:5000 <http://239.168.1.13:5000/>")
subscriber.connect("epgm://192.168.1.1
<http://192.168.1.10/>2;239.168.1.10,<http://239.168.1.13:5000/>
239.168.1.11, <http://239.168.1.13:5000/>239.168.1.13,<http://239.168.1.13:5000/>
239.168.1.12:5000 <http://239.168.1.13:5000/>")
subscriber.connect("epgm://192.168.1.1
<http://192.168.1.10/>3;239.168.1.10,<http://239.168.1.13:5000/>
239.168.1.12, <http://239.168.1.13:5000/>239.168.1.11,<http://239.168.1.13:5000/>
239.168.1.12:5000 <http://239.168.1.13:5000/>")

This tends to be easier with IPv6.

If this won't work in ZMQ, does anyone know if OpenPGM will support
> it?  I know that ZMQ's PGM/EPGM layer is built on OpenPGM, but I don't
> know if bus limitation is due to OpenPGM, or if it is because of how
> ZMQ uses it.  If OpenPGM can handle the above directly, I'll switch
> this chunk of my code to using it directly.


OpenPGM handles bus topology on the socket, it is designed to replicate and
enhance functionality of TIBCO Rendezvous.  However I think enough
functionality should be exposed with 0MQ to satisfy your requirements.

-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120809/0f803302/attachment.htm>


More information about the zeromq-dev mailing list