Re: inet increment w/ int8

From: "Sander Steffann" <steffann(at)nederland(dot)net>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>, "Douglas McNaught" <doug(at)mcnaught(dot)org>
Cc: "Patrick Welche" <prlw1(at)newn(dot)cam(dot)ac(dot)uk>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: inet increment w/ int8
Date: 2005-05-23 20:37:18
Message-ID: 002801c55fd7$a96c94c0$64c8a8c0@balefirehome
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

>> > I modified the TODO. I think we only need an INT4. I realize INT8
>> > would be for IPV6 but I can't imagine a network that has more than INT4
>> > hosts (not part of the network address).
>>
>> Actually "increment the host address" isn't a well-defined concept for
>> IPV6. The "host" part of the address (if you're on an Ethernet) is
>> generally the 64 bit MAC address.
>
> So if the network card dies the machine has a new IPv6 address and you
> just update your DNS? Do you update your routing tables?

There are standards defined for automatically determining the IPv6 address
of a host (Stateless Address Autoconfiguration). These include a standard
for "Privacy Extensions for Stateless Address Autoconfiguration in IPv6"
where the host-part of the IPv6 address changes over time to make it more
difficult to identify a single user. The net-part of the IPv6 address can be
determined by "Router Advertisements".

By default an IPv6 address is divided as follows:
first 32 bits: ISP
next 16 bits: customer
next 16 bits: subnet
rest (64 bits): host

So an ISP gets a /32 from ARIN/RIPE/LACNIC/APNIC/AfriNIC, which assigns a
/48 to a customer, which assigns a /64 to each separate network. There are
ISPs that have so many customers that they got more than a /32, and if a
customer needs more than 16 bits for subnets they can get a bigger block
than a /48. This addressing scheme means that even a home-user is a customer
and gets a /48 with 16 bits for subnetting. There are discussions going on
about giving home users a /56 block instead, but I haven't heard a final
decision about that yet (in the RIPE region).

>From
http://www.tcpipguide.com/free/t_IPv6InterfaceIdentifiersandPhysicalAddressMapping.htm:
The IEEE has also defined a format called the 64-bit extended unique
identifier, abbreviated EUI-64. It is similar to the 48-bit MAC format,
except that while the OUI remains at 24 bits, the device identifier
becomes 40 bits instead of 24. This provides gives each manufacturer
65,536 times as many device addresses within its OUI.

A form of this format, called modified EUI-64, has been adopted for
IPv6 interface identifiers. To get the modified EUI-64 interface ID
for a device, you simply take the EUI-64 address and change the 7th
bit from the left (the "universal/local" or "U/L" bit) from a zero to
a one.

Because the 7th bit is always a one with auto-configuration, addresses with
7th bit zero are still free to be manually assigned.

I hope this helps a little...
Sander.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2005-05-23 22:51:42 Re: [PATCHES] character type value is not padded with spaces
Previous Message Andrew Dunstan 2005-05-23 20:34:54 Re: Speeding up the Postgres lexer