Subject: [v6ops] IPv6 prefix to use to store IPv4 prefixes in an IPv6 IP Address Managment System?

From: Ray Hunter <[email-masked]>
Date: Tue, 17 May 2011 16:09:11 +0200

I recently coded a system where I handled the IPv4 addresses as IPv4 
mapped IPv6 addresses = ::ffff:a.b.c.d addresses in a single table for 
all prefixes for an application. It was convenient in the end, but it 
took quite a lot of code to handle the special human readable forms 
properly.

I can let you have the PERL library if you want.

I would certainly avoid use of deprecated addresses ::0000:a.b.c.d. 
There is some overlap e.g. ::1 & ::0

I also found some problems with libraries handling things like ::ffff:10.0

Another equally valid approach is to use completely separate tables for 
IPv4 and IPv6, depending on your application.

How, for example, in a firewall rules system, would you distinguish a 
match rule for an IPv4 mapped IPv6 address being carried over a native 
IPv6 packet, versus a normal native IPv4 encapsulated packet? You'd 
anyway need to keep track of the encapsulation on the wire.

http://tools.ietf.org/html/draft-itojun-v6ops-v4mapped-harmful-02

Sometimes it's just better to treat IPv4 and IPv6 as completely separate 
address families.

best regards,
RayH

> Subject:
> [v6ops] IPv6 prefix to use to store IPv4 prefixes in an IPv6 IP 
> Address Managment System?
> From:
> Mark Smith <[email-masked]>
> Date:
> Tue, 17 May 2011 20:44:23 +0930
>
> To:
> [email-masked]
>
> Content-Transfer-Encoding:
> 7bit
> Precedence:
> list
> MIME-Version:
> 1.0
> Message-ID:
> <[email-masked]>
> Content-Type:
> text/plain; charset=US-ASCII
> Message:
> 4
>
>
> Hi,
>
> It recently occurred to me that it could be useful to store IPv4 prefix
> information in an IPv6 IP address management system, so that both IPv4
> and IPv6 prefix information are kept in the same address
> management database.
>
> The only question I have about doing that is what IPv6 prefix to use
> for these IPv4 prefix entries. The deprecated IPv4-Compatible IPv6
> Address format would be convenient for this purpose as all bits
> preceding the IPv4 prefix are zeros, making these entries very easy to
> spot if you happen to be looking at the IPv6 form of them. Would that
> be safe and reasonable to use the ::/96 prefix? Would it be worth me
> writing up an ID proposing the recycing of this form of IPv6 address
> for this purpose?
>
> Thanks,
> Mark.
>
>

---

From: Mark Smith <[email-masked]>
Date: Wed, 18 May 2011 08:22:52 +0930

Hi Ray,

On Tue, 17 May 2011 16:09:11 +0200

> I can let you have the PERL library if you want.

Thanks for the offer. For me it is mostly a theoretical question,
although I know somebody who because of time constraints is having to
quickly write an IPv6 only IPAM. It was when I thought about some
of the IPv4 IPAM issues they have that it occurred to me that an IPv6
IPAM could hold IPv4 prefixes with an appropriate representation.

Is your PERL library on cpan?

(You may be interested in a PERL module that decodes IPv6 DHCPv6 DUIDs
that a college of mine wrote -  Net::DHCPv6::DUID::Parser)