Re: inet increment w/ int8 - Mailing list pgsql-hackers

From Sander Steffann
Subject Re: inet increment w/ int8
Date
Msg-id 002801c55fd7$a96c94c0$64c8a8c0@balefirehome
Whole thread Raw
In response to Re: inet increment w/ int8  (Bruce Momjian <pgman@candle.pha.pa.us>)
List 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
formatcalled the 64-bit extended unique identifier, abbreviated EUI-64. It is similar to the 48-bit MAC format, except
thatwhile the OUI remains at 24 bits, the device identifier becomes 40 bits instead of 24. This provides gives each
manufacturer65,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-64interface 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.




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Speeding up the Postgres lexer
Next
From: Tatsuo Ishii
Date:
Subject: Re: [PATCHES] character type value is not padded with spaces