[arin-tech-discuss] zero-padded IP addresses in "startAddress" and "endAddress" values
Dani Roisman
droisman at softlayer.com
Fri Mar 30 09:46:19 EDT 2012
Andy - thanks for considering this. David mentioned earlier in the thread that it's always been this way - is that really accurate? I don't have historical examples, but when we first coded to the RESTful API late in 2011, we didn't see the zero-padding of IPs.
----
Dani Roisman
VP, Network Operations
droisman at softlayer.com
(281) 714-3714 direct
(818) 481-5581 cell
| -----Original Message-----
| From: arin-tech-discuss-bounces at arin.net [mailto:arin-tech-discuss-
| bounces at arin.net] On Behalf Of Andy Newton
| Sent: Friday, March 30, 2012 07:54
| To: Seth Mattinen
| Cc: <arin-tech-discuss at arin.net>
| Subject: Re: [arin-tech-discuss] zero-padded IP addresses in "startAddress"
| and "endAddress" values
|
|
| On Mar 30, 2012, at 4:06 AM, Seth Mattinen wrote:
|
| > I personally treat IP addresses as unsigned integers (or double/float
| > for IPv6). It never occurred to me to treat an IP as a string since it's
| > supposed to represent a 32-bit or 128-bit number. Integer comparisons
| > are, IMO, easier.
|
| Seth,
|
| Interpretation of IP addresses as numbers makes complete sense. But I will
| note that some languages do not have unsigned integers and double and
| float on many platforms, languages, and databases are only 64 bits. Float can
| be particularly troublesome as IEEE 754 interpretations of it only give 56 bits
| of precision.
|
| Comparison as a numeric type is also natural, but in a database where an IP
| address column is indexed that difference is only important for an r-tree
| index which are not very common. Additionally in a database context,
| substring matching can be used for prefix queries, though admittedly only on
| octet boundaries.
|
| Like you, my first inclination as a programmer is to treat IP addresses as
| numbers. And when I first encountered the usage of zero-padded IP address
| strings, doing so had never occurred to me. That being said, in my career
| ARIN is not the first place I have seen this, and in the ARIN codebases we
| have found this pattern many times, implemented by multiple coders in
| many subsystems, going back to code that well predates ARIN.
|
| That long-winded explanation aside, we can certainly take steps to make
| programming against the Reg-RWS interface easier if the community desires.
| New elements can be added that do not have the zero-padded IP addresses.
| I do not recommend modifying the current elements as we may break code
| that counts on the zero padding. And, as David stated, we should update our
| documentation. Would adding new elements containing IP addresses that
| are not zero-padded be helpful?
|
| Andy Newton
| _______________________________________________
| arin-tech-discuss mailing list
| arin-tech-discuss at arin.net
| http://lists.arin.net/mailman/listinfo/arin-tech-discuss
More information about the arin-tech-discuss
mailing list