Working on IPv6

3,414 views
Skip to first unread message

Juan Lang

unread,
Jun 18, 2009, 1:36:43 PM6/18/09
to android-platform
Hi all,

I'm working on an android project that requires IPv6 support. This
means that I may be working on adding it. If there's anyone also
working on it, feel free to contact me to exchange notes.

Note: I'm not committing to anything. Don't email me asking for
status updates or asking for help with it, I'll just ignore such
requests.

Thanks,
--Juan

simon

unread,
Jun 18, 2009, 5:40:41 PM6/18/09
to android-platform
I have experimented a little with IPv6 on Android, with some (limited)
success:

* Built a kernel from the cupcake/2.6.27 sources with IPv6 enabled.
* Built OpenVPN 2.1 with bridge-mode (tap) enabled.
* Built a new OpenSSL library with blowfish support (our VPN requires
that)

Then I fastbooted my kernel, remounted /system read-write, and copied
my OpenVPN binaries, modified OpenSSL library, and OpenVPN
configuration to the phone.

At this point, I can connect to my company's (L2 Open)VPN, and obtain
an IPv6 address on the tap interface from the router behind the VPN
gateway:

# cat /proc/net/if_inet6
00000000000000000000000000000001 01 80 10 80 lo
200106200000002580f315fffe10b7e4 08 40 00 00 tap0
fe8000000000000080f315fffe10b7e4 08 40 20 80 tap0
fe80000000000000021841fffec8dabe 07 40 20 80 tiwlan0

And when I ping that address, my phone responds over IPv6:

: leinen@diotima[leinen]; ping -s
2001:0620:0000:0025:80f3:15ff:fe10:b7e4
PING 2001:0620:0000:0025:80f3:15ff:fe10:b7e4: 56 data bytes
64 bytes from 2001:620:0:25:80f3:15ff:fe10:b7e4: icmp_seq=0.
time=170.135 ms
64 bytes from 2001:620:0:25:80f3:15ff:fe10:b7e4: icmp_seq=1.
time=101.517 ms
64 bytes from 2001:620:0:25:80f3:15ff:fe10:b7e4: icmp_seq=2.
time=132.371 ms
64 bytes from 2001:620:0:25:80f3:15ff:fe10:b7e4: icmp_seq=3.
time=59.364 ms
64 bytes from 2001:620:0:25:80f3:15ff:fe10:b7e4: icmp_seq=4.
time=71.567 ms
C-c C-c
----2001:0620:0000:0025:80f3:15ff:fe10:b7e4 PING Statistics----
6 packets transmitted, 5 packets received, 16% packet loss
round-trip (ms) min/avg/max/stddev = 59.364/106.991/170.135/45.234
: leinen@diotima[leinen];

(Feel free to ping the address, but it will go away as soon as the
WLAN is torn down by some power-saving thing.)
This worked fine both using OpenVPN over UMTS/GPRS and using OpenVPN
over WLAN.

What doesn't work? As far as I can tell, everything else.

* The phone's browser cannot access any IPv6-only URLs such as
http://ipv6.google.com/
* When I connected the WLAN interface to a WLAN that had IPv6, it
failed to obtain and IPv6 address. Maybe there's an issue with the
multicast implementation in the tiwlan driver; I haven't further
analyzed this, because I don't usually have access to IPv6-enabled
WLAN - I could only test it while on a business trip.

I haven't tried other tools such as ConnectBot. I don't know to what
extent Bionic and the Dalvik VM support IPv6. I just noticed that the
platform code sometimes defines IP address variables and arguments as
"int" :-(

So, I think this is quite a piece of work. But it's important work!
Good luck. I'd like to help, but I don't have much time.
--
Simon.

David Turner

unread,
Jun 18, 2009, 5:51:57 PM6/18/09
to android-...@googlegroups.com
On Thu, Jun 18, 2009 at 2:40 PM, simon <simon....@gmail.com> wrote:
I haven't tried other tools such as ConnectBot.  I don't know to what
extent Bionic and the Dalvik VM support IPv6.  I just noticed that the
platform code sometimes defines IP address variables and arguments as
"int" :-(

Bionic does support Ipv6, but the core system classes that come with Dalvik don't yet.
But work is being performed to add this feature. I don't know about the rest of the
network management daemons/tools though.
 

Juan Lang

unread,
Jun 18, 2009, 6:50:43 PM6/18/09
to android-...@googlegroups.com
Hi Simon,

> I have experimented a little with IPv6 on Android, with some (limited)
> success:

(snip)


> At this point, I can connect to my company's (L2 Open)VPN, and obtain
> an IPv6 address on the tap interface from the router behind the VPN
> gateway:

(snip)


> And when I ping that address, my phone responds over IPv6:

Cool! :)

> What doesn't work? As far as I can tell, everything else.
>
> * The phone's browser cannot access any IPv6-only URLs such as
> http://ipv6.google.com/

As David Turner points out, bionic supports IPv6, but dalvik does not.
The browser and the rest of the apps use dalvik, so this is a no-go
for now. Fortunately many are interested in IPv6, so with luck we'll
see it soon enough. I suspect part of the difficulty lies in
configuration and testing: the ADB doesn't support IPv6 either, and
adding that in order to test IPv6 from the emulator might take more
time than merely adding IPv6 to dalvik.
--Juan

Juan Lang

unread,
Jun 18, 2009, 7:42:52 PM6/18/09
to android-...@googlegroups.com
Hi Simon,

> Bionic does support Ipv6, but the core system classes that come with Dalvik
> don't yet. But work is being performed to add this feature.

Excellent news!

> I don't know about the rest of the
> network management daemons/tools though.

You mean, you know know whether they do support IPv6, or whether
work's being done on them? From what I've seen, they do not support
IPv6. ifconfig and ping at least do not. I personally have no need
for DHCPv6, but dhcpcd doesn't either.

Thanks,
--Juan

David Turner

unread,
Jun 18, 2009, 7:44:46 PM6/18/09
to android-...@googlegroups.com
On Thu, Jun 18, 2009 at 3:50 PM, Juan Lang <juan...@gmail.com> wrote:
As David Turner points out, bionic supports IPv6, but dalvik does not.
 The browser and the rest of the apps use dalvik, so this is a no-go
for now.  Fortunately many are interested in IPv6, so with luck we'll
see it soon enough.  I suspect part of the difficulty lies in
configuration and testing:  the ADB doesn't support IPv6 either, and
adding that in order to test IPv6 from the emulator might take more
time than merely adding IPv6 to dalvik.

technically speaking, ADB not supporting IPv6 is totally different from the emulator not supporting it.
I plan to add IPv6 support to the emulator, but it's really a non-trivial thing to do, given the state of the
QEMU internal firewall/NAT. Hope it will be available soon enough, but I don't promise anything at the
moment.
 

--Juan



Juan Lang

unread,
Jun 18, 2009, 7:53:45 PM6/18/09
to android-...@googlegroups.com
Hi David,

> technically speaking, ADB not supporting IPv6 is totally different from the
> emulator not supporting it.
> I plan to add IPv6 support to the emulator, but it's really a non-trivial
> thing to do, given the state of the
> QEMU internal firewall/NAT. Hope it will be available soon enough, but I
> don't promise anything at the
> moment.

Ah. Thank you, I was hoping people more knowledgeable than I would
speak up. I appreciate the clarification.
--Juan

Ard

unread,
Jun 29, 2009, 8:26:42 AM6/29/09
to android-platform
On Jun 18, 11:40 pm, simon <simon.lei...@gmail.com> wrote:
> * When I connected the WLAN interface to a WLAN that had IPv6, it
> failed to obtain and IPv6 address.  Maybe there's an issue with the
> multicast implementation in the tiwlan driver; I haven't further
> analyzed this, because I don't usually have access to IPv6-enabled
> WLAN - I could only test it while on a business trip.
As far as I can see with WLAN: it seems that radvd packets get mangled
by the wifi driver.
I can see nonsense packets coming in at the interval that radvd
advertises.
(With a multicast address as mac-source, and a nonsense unicast
address as mac-destination)
And ipv6 isn't a problem for any other system.
I will take a better look at that.

Ard

unread,
Jun 30, 2009, 2:04:46 AM6/30/09
to android-platform


On Jun 29, 2:26 pm, Ard <a...@kwaak.net> wrote:
> As far as I can see with WLAN: it seems that radvd packets get mangled
> by the wifi driver.
> I can see nonsense packets coming in at the interval that radvd
> advertises.

Forget that. I can see the same nonsense packets coming from an idle
wifi ap.
Probably it's some wifi specific packet that somehow passed up the
stack as a normal "ethernet" packet.

> (With a multicast address as mac-source, and a nonsense unicast
> address as mac-destination)
> And ipv6 isn't a problem for any other system.
> I will take a better look at that.

So you might be right that it's just the plain old multi-cast doesn't
work on wifi-drivers.
Reply all
Reply to author
Forward
0 new messages