[zeromq-dev] [PATCH] IPv4/IPv6 wiring for 3.0

Steven McCoy steven.mccoy at miru.hk
Mon Aug 8 06:33:59 CEST 2011


On 8 August 2011 11:57, Steven McCoy <steven.mccoy at miru.hk> wrote:

> What I'm going to do is run a Java test application to inspect what the
> Java options do then document them for 0MQ, followed by a new series of
> patches that start from a clean 3.0 clone.  The documentation first so the
> code can be vetted against the definition of the options.
>
> The ZMQ_PREFER_IPV4_STACK is reasonably clear.  The "prefer" implies IPv6
> can be used in some circumstances though.  Is the implication that you can
> connect to IPv6 services but everything else will default to IPv4-only.
>
> Both ZMQ_IPV6ONLY and ZMQ_PREFER_IPV6_ADDRESSES are perversly non-specific
> and I will look for something better noting the dual-stack relationship.
>
>
Oracle's Java 7 documentation clears up the confusion with the previous
descriptions.

http://download.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html

Subsequently,

ZMQ_PREFER_IPV4_STACK could actually be ZMQ_IPV4ONLY, there is no
"preference" included.

ZMQ_PREFER_IPV6_ADDRESSES refers to that all sockets are internally IPv6
sockets and if serialized the setting determines whether an IPv4 address
should appear as an IPv4 address or its native IPv4-in-IPv6 mapped address.

There is no address-to-string conversions within 0mq to the application so
this second configuration parameter is a no-op and is not required.

Conclusion:

   - Within 0mq use IPv6 sockets by default unless the platform has only
   IPv4 support.
   - Drop down to IPv4 sockets if the option ZMQ_IPV4ONLY is set.
   - Force dual-stack behaviour in order to enumerate IPv4 interfaces for
   binding.

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


More information about the zeromq-dev mailing list