multicast IPv4-mapped IPv6 addressing

Antonio Querubin tony@lava.net
Wed, 21 Mar 2001 17:43:19 -1000 (HST)


I'm not sure if this has come up for discussion before but is there any
set convention for handling multicast IPv4-mapped IPv6 addresses?  In a
unicast application program originally written for IPv4 a programmer can
easily convert the IPv4 socket calls to IPv6 socket calls and use
IPv4-mapped IPv6 unicast addresses.  The IPv6 API (RFC-2133 or RFC-2553)
specifies that when IPv4-mapped addresses are used, the connection is made
using IPv4.  Unless it's dealing with low-level calls, the program doesn't
need to know whether it's really using IPv4 or IPv6.  It just has access
to an open socket.

For example, let's say I have an application that I want to convert to
using IPv6 sockets and that I normally pass it an IPv4 unicast
name/address on the command line for example.  If this were an IPv4
unicast program, it might typically do a gethostname to obtain the IP
address and then open up a connection.  Converted to using IPv6, the
gethostname() (or getipnodename()) would return an IPv4-mapped address
looking something like ::ffff:192.168.1.1.  The IPv6 socket API handles
this automatically and makes an IPv4 connection.

But when it's a multicast program, the gethostname() will still return an
IPv4-mapped address, however it's not useable.  If for example, I specify
sap.mcast.net (224.2.127.254) on the command line to this multicast
program, when it does the gethostbyname() it gets back
::ffff:224.2.127.254.  But this doesn't appear to be a useable multicast
address.  The socket calls up to where one sets the multicast TTL or joins
the multicast groups work.  But once I try to set the multicast TTL or
join the group, the ::ffff:224.2.127.254 address is rejected as invalid.
The only way I've found to make this work is to create the socket using
IPv4 socket calls only.

Well at least that's how Linux and gcc have been behaving so far for me.
But if this is not system-specific then it seems that the handling of
IPv4-mapped multicast addresses was something left out of either the IPv6
socket API or perhaps an IPv4-mapped multicast address should be defined?
For example, 224.2.127.254 might be mapped to ff0e::ffff:224.2.127.254
instead of ::ffff:224.2.127.254?