You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Andrew Stitcher <as...@redhat.com> on 2011/08/11 16:59:35 UTC

IPv6 support for Java for 0.14?

I've been spending much of my time in the past few weeks getting support
for IPv6 in to the C++ and python code bases, and I expect to get it in
the code base in the next few days (unless someone can see a problem not
yet noticed with the code).

I've created an umbrella Jira - QPID-3404 to track IPv6 work with a
bunch of sub-tasks to track the details.

It'd be great if we can announce full IPv6 support for the 0.14 release:
Does anyone more qualified than me want to take on the work for the Java
code base? I'd be happy to advise or even do the work if no one else
steps forward, but I suspect that someone more familiar with the Java
code would be better suited.

So I'm really appealing for volunteers for QPID-3408  -
https://issues.apache.org/jira/browse/QPID-3408

Note that in general there are two issues in IPv6 support that have
emerged so far:

1. Actually listening/connecting to IPv6 sockets (including the correct
reconnect and multiple listening socket logic)

2. Adding literal IPv6 support to any URL parsing.

They are separable and 1 is useful without 2, but 2 is necessary to have
complete IPv6 support.

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: IPv6 support for Java for 0.14?

Posted by Andrew Stitcher <as...@redhat.com>.
On Fri, 2011-08-12 at 11:50 +0100, Gordon Sim wrote:
> On 08/11/2011 09:03 PM, Andrew Stitcher wrote:
> > That is correct, you can use an IPv6 socket to accept IPv4 connections
> > too, but there are good reasons you might want to create separate v4 and
> > v6 only listening sockets. Essentially this gives you stronger control
> > over the protocols individually if you need that
> 
> Could you elaborate on that a little? You mean you can decide whether or 
> not to enable one or other protocol? Or some other aspect of control?

That is pretty much what I mean, sorry for being obscure.

In the new C++ code we create a v6 only listening socket and a v4
listening socket so that we could disable one or the other individually
- that functionality isn't there now, but I think it's very likely to be
needed.

Doing this also means that any v4 connections get obvious v4 addresses
and not v6 addresses in the v4mapped format in the log and management
interfaces without having to inspect the returned v6 address in code and
change it if it is v4 mapped.

>From the Java docs you references it looks like you can't do the same
for Java v6 listening sockets, ie they can't be v6 only.

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: IPv6 support for Java for 0.14?

Posted by Gordon Sim <gs...@redhat.com>.
On 08/11/2011 09:03 PM, Andrew Stitcher wrote:
> That is correct, you can use an IPv6 socket to accept IPv4 connections
> too, but there are good reasons you might want to create separate v4 and
> v6 only listening sockets. Essentially this gives you stronger control
> over the protocols individually if you need that

Could you elaborate on that a little? You mean you can decide whether or 
not to enable one or other protocol? Or some other aspect of control?

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: IPv6 support for Java for 0.14?

Posted by Andrew Stitcher <as...@redhat.com>.
On Thu, 2011-08-11 at 20:10 +0100, Gordon Sim wrote:
> http://download.oracle.com/javase/1.5.0/docs/guide/net/ipv6_guide/index.html
> 
> Which claims: "With Java you can run any Java applications, client or 
> server, on an IPv6-enabled platform using J2SE 1.4 or later, and that 
> application will automagically become IPv6-enabled."
> 
> It also states:
> 
> "that on a dual-stack machine, since one socket, the IPv6 socket, will 
> be able to access both IPv4 and IPv6 protocol stacks, you only need to 
> create one socket"
> 
> does this mean on Linux we don't need to create multiple sockets to 
> listen on?

That is correct, you can use an IPv6 socket to accept IPv4 connections
too, but there are good reasons you might want to create separate v4 and
v6 only listening sockets. Essentially this gives you stronger control
over the protocols individually if you need that, although this
rationale in c/c++ might not fully exist in Java - I don't understand
the details there fully.

In order to do this with a single socket though it needs to be a v6
socket.

Reading that doc briefly it looks like the reconnect logic might be
transparent to the application which would be nice and explain why I
didn't see it anywhere.

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: IPv6 support for Java for 0.14?

Posted by Gordon Sim <gs...@redhat.com>.
On 08/11/2011 06:40 PM, Andrew Stitcher wrote:
> On Thu, 2011-08-11 at 12:27 -0400, Andrew Stitcher wrote:
>> On Thu, 2011-08-11 at 11:08 -0400, Rajith Attapattu wrote:
>>> ...
>>>> 1. Actually listening/connecting to IPv6 sockets (including the correct
>>>> reconnect and multiple listening socket logic)
>>>
>>> My understanding is that since Java 1.4, there have been support for IPv6.
>>> AFAIK this is transparent and code wise we don't really have to do
>>> anything special.
>>> But of course we have to test this out and see.
>>
>> I doubt this is the case unless thought has gone into it initially, as
>> you have to do things differently to get v6 sockets as opposed to v4.
>> I'll go and look at code to see if I can substantiate.
>
> I retract that. From what I can see in the code it looks like IPv6
> addresses will get correctly resolved and connected to. However I'm
> couldn't see anywhere which would do the correct retry logic if say the
> first resolved address wasn't available.

http://download.oracle.com/javase/1.5.0/docs/guide/net/ipv6_guide/index.html

Which claims: "With Java you can run any Java applications, client or 
server, on an IPv6-enabled platform using J2SE 1.4 or later, and that 
application will automagically become IPv6-enabled."

It also states:

"that on a dual-stack machine, since one socket, the IPv6 socket, will 
be able to access both IPv4 and IPv6 protocol stacks, you only need to 
create one socket"

does this mean on Linux we don't need to create multiple sockets to 
listen on?

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: IPv6 support for Java for 0.14?

Posted by Andrew Stitcher <as...@redhat.com>.
On Thu, 2011-08-11 at 12:27 -0400, Andrew Stitcher wrote:
> On Thu, 2011-08-11 at 11:08 -0400, Rajith Attapattu wrote:
> > ...
> > > 1. Actually listening/connecting to IPv6 sockets (including the correct
> > > reconnect and multiple listening socket logic)
> > 
> > My understanding is that since Java 1.4, there have been support for IPv6.
> > AFAIK this is transparent and code wise we don't really have to do
> > anything special.
> > But of course we have to test this out and see.
> 
> I doubt this is the case unless thought has gone into it initially, as
> you have to do things differently to get v6 sockets as opposed to v4.
> I'll go and look at code to see if I can substantiate.

I retract that. From what I can see in the code it looks like IPv6
addresses will get correctly resolved and connected to. However I'm
couldn't see anywhere which would do the correct retry logic if say the
first resolved address wasn't available.

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: IPv6 support for Java for 0.14?

Posted by Andrew Stitcher <as...@redhat.com>.
On Thu, 2011-08-11 at 11:08 -0400, Rajith Attapattu wrote:
> ...
> > 1. Actually listening/connecting to IPv6 sockets (including the correct
> > reconnect and multiple listening socket logic)
> 
> My understanding is that since Java 1.4, there have been support for IPv6.
> AFAIK this is transparent and code wise we don't really have to do
> anything special.
> But of course we have to test this out and see.

I doubt this is the case unless thought has gone into it initially, as
you have to do things differently to get v6 sockets as opposed to v4.
I'll go and look at code to see if I can substantiate.

Andrew



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


Re: IPv6 support for Java for 0.14?

Posted by Rajith Attapattu <ra...@gmail.com>.
On Thu, Aug 11, 2011 at 10:59 AM, Andrew Stitcher <as...@redhat.com> wrote:
> I've been spending much of my time in the past few weeks getting support
> for IPv6 in to the C++ and python code bases, and I expect to get it in
> the code base in the next few days (unless someone can see a problem not
> yet noticed with the code).
>
> I've created an umbrella Jira - QPID-3404 to track IPv6 work with a
> bunch of sub-tasks to track the details.
>
> It'd be great if we can announce full IPv6 support for the 0.14 release:
> Does anyone more qualified than me want to take on the work for the Java
> code base? I'd be happy to advise or even do the work if no one else
> steps forward, but I suspect that someone more familiar with the Java
> code would be better suited.
>
> So I'm really appealing for volunteers for QPID-3408  -
> https://issues.apache.org/jira/browse/QPID-3408
>
> Note that in general there are two issues in IPv6 support that have
> emerged so far:
>
> 1. Actually listening/connecting to IPv6 sockets (including the correct
> reconnect and multiple listening socket logic)

My understanding is that since Java 1.4, there have been support for IPv6.
AFAIK this is transparent and code wise we don't really have to do
anything special.
But of course we have to test this out and see.

>
> 2. Adding literal IPv6 support to any URL parsing.

This is where I suspect we will need some work. The URL parser **may**
fail when we use a IPv6 address.
If it does not, then that would be a real bonus.
I will test this out today and see.

> They are separable and 1 is useful without 2, but 2 is necessary to have
> complete IPv6 support.
>
> Andrew
>
>
>
> ---------------------------------------------------------------------
> Apache Qpid - AMQP Messaging Implementation
> Project:      http://qpid.apache.org
> Use/Interact: mailto:dev-subscribe@qpid.apache.org
>
>

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org