Re: inet increment w/ int8

Started by Bruce Momjianover 20 years ago5 messages
#1Bruce Momjian
pgman@candle.pha.pa.us

Patrick Welche wrote:

On Fri, May 20, 2005 at 11:12:54PM -0400, Bruce Momjian wrote:

Added to TODO:

* Allow INET + INT4/INT8 to increment the host part of the address, or
throw an error on overflow

I have not heard any use-case for adding to the network value if INET,
and by not using it, we can have an easy operator API.

Thanks - I'll look at the code that was posted..

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).

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#2Douglas McNaught
doug@mcnaught.org
In reply to: Bruce Momjian (#1)

Bruce Momjian <pgman@candle.pha.pa.us> writes:

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.

-Doug

#3Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Douglas McNaught (#2)

Douglas McNaught wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

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?

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#4Stephen Frost
sfrost@snowman.net
In reply to: Bruce Momjian (#3)

* Bruce Momjian (pgman@candle.pha.pa.us) wrote:

Douglas McNaught wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

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?

Generally routing isn't done to the last 48 bits (dunno where 64 bit
came from, but MAC's are 48 last I checked :).

DNS to that level would need to be changed though, yes.. :/

(I'm not exactly a big fan of this development, in fact, I think it's a
bunch of poo, but then, I don't write the standards).

Stephen

#5Sander Steffann
steffann@nederland.net
In reply to: Bruce Momjian (#3)

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.