<div class="gmail_quote">On Sat, Sep 26, 2009 at 4:57 PM, DrKJam <span dir="ltr">&lt;<a href="mailto:drkjam@gmail.com">drkjam@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote">2009/9/26 Daniel Stutzbach <span dir="ltr">&lt;<a href="mailto:daniel@stutzbachenterprises.com" target="_blank">daniel@stutzbachenterprises.com</a>&gt;</span><br><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><div class="gmail_quote">On Sat, Sep 26, 2009 at 2:07 PM, DrKJam <span dir="ltr">&lt;<a href="mailto:drkjam@gmail.com" target="_blank">drkjam@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div class="gmail_quote"><div>The current version of the PEP and reference implementation do not mention or deal with IPv4
classful addressing (A, B, C, D and E). It would be good to
know if any of this (admittedly older yet no less important) functionality is going to be supported. If the library is to concentrate solely on classless addressing (i.e.
CIDR) please can this be stated in future revisions of the PEP.
</div></div></blockquote></div><br></div>
Classful addressing was deprecated more than 15 years ago!<br><br>Quoting RFC 4632: &quot;With the full deployment      of CIDR on the Internet, such scenarios are no longer      operationally relevant.&quot;</blockquote>

</div><div><br>Interesting as evidence of classful IPv4
behaviour seems fairly pervasive in current IP stacks and software that supports IPv4 addressing (e.g. PostgreSQL inet and cidr data types).<br></div></div></blockquote><div><br>PostgreSQL&#39;s inet type stores a host address and optionally a network mask.  It&#39;s cidr type stores a network address and mask.  Neither of them are classful.<br>
 </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div>Here&#39;s an excerpt from the &#39;ifconfig&#39; man page (taken from an Ubuntu 9.04 install) :-<br>

netmask addr<br><br>Set
the IP network mask for this interface. This value defaults to the
usual class A, B or C network mask (as derived from the interface IP
address). but it can be set to any value.<br></div></div></blockquote><div><br>Since the network mask can be set to any legal value, that means it&#39;s stored as CIDR.  It falls back on the classful network mask as a default.  Undoubtedly that was useful  when ifconfig was updated for CIDR.  There were still many classful networks and it needed to retain backward compatibility.  After all, ifconfig is around 25 years old, and CIDR is only 16.<br>
<br>Today, all IP networks are classless (CIDR), and a system administrator would have to do extra work to figure out if the default value happened to be just right for the network they&#39;re setting up.<br></div><div> </div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote"><div> The point being that you can&#39;t always assume /32 implicitly for all use cases.<br>
</div></div></blockquote><div><br>Certainly, which is why the user can explicitly set the netmask.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="gmail_quote"><div>Here is how IP addresses without an explicit prefix or netmask are currently handled :-<br>
<br>&gt;&gt;&gt; import ipaddr<br>&gt;&gt;&gt; ipaddr.IPv4Network(&#39;10.0.0.1&#39;)<br>IPv4Network(&#39;<a href="http://10.0.0.1/32" target="_blank">10.0.0.1/32</a>&#39;)<br><br>It may not be something we want to support (you could always force the end user to specify a prefix or netmask explicitly). This is fair enough, but let&#39;s indicate that it&#39;s a considered choice. Somewhere in the PEP text is might be a good place for treatment of this topic.<br>

</div></div></blockquote><br></div>+1 on forcing the user to specify a netmask explicitly and documenting it.<br><blockquote style="margin: 1.5em 0pt;">--<br>
Daniel Stutzbach, Ph.D.<br>
President, <a href="http://stutzbachenterprises.com">Stutzbach Enterprises, LLC</a>
</blockquote>