Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

Re: PEP 3144: IP Address Manipulation Library for the Python Standard Library

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


python-3000 at udmvt

Sep 16, 2009, 2:08 AM

Post #1 of 3 (435 views)
Permalink
Re: PEP 3144: IP Address Manipulation Library for the Python Standard Library

On Wed, Aug 19, 2009 at 02:28:38PM -0400, Glyph Lefkowitz wrote:
> On Wed, Aug 19, 2009 at 2:20 PM, Eric Smith <eric [at] trueblade> wrote:
>
>
> > I think using .network and .broadcast are pretty well understood to be the
> > [0] and [-1] of the network address block. I don't think we want to start
> > creating new terms or access patterns here.
> >
> > +1 on leaving .network and .broadcast as-is (including returning a
> > IPvXAddress object).
> >
>
> -1. I think 'network.number' or 'network.zero' is a lot clearer than
> 'network.network'. Maybe '.broadcast' would be okay, as long as it *can* be
> adjusted for those unusual, or maybe even only hypothetical, networks where
> it is not the [-1].
Real life example: network with a /31 mask.
There are only two hosts: 0 and 1
first host configures the other's host as broadcast address and vice versa.
NOTE - broadcasts are different here!
Everything works, no one ever need to address "network" address, broadcasting
works as expected. It works well between two our routers.
What is wrong here? It just works for two Linuxes. It emulates point-to-point.
Well, some weird soft will not let you to configure that (on Windows?heh)? So
just let Python be off the shame list.

Another real life examples include /32 networks on PPP. Just a point-to-point.
No need for broadcasts and networks, a host just have one IP address and
send all traffic via point-to-point link, no addressing is required there.
This is a working dialup configuration, it works for me, it works for you, probably.
It is not weird, it is common, it is used for PPPoE, for ADSL, for dialup.


--
Alexey S.
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


martin at v

Sep 26, 2009, 11:19 AM

Post #2 of 3 (348 views)
Permalink
Re: PEP 3144: IP Address Manipulation Library for the Python Standard Library [In reply to]

>>> I think using .network and .broadcast are pretty well understood to be the
>>> [0] and [-1] of the network address block. I don't think we want to start
>>> creating new terms or access patterns here.
>>>
>>> +1 on leaving .network and .broadcast as-is (including returning a
>>> IPvXAddress object).
>>>
>> -1. I think 'network.number' or 'network.zero' is a lot clearer than
>> 'network.network'. Maybe '.broadcast' would be okay, as long as it *can* be
>> adjusted for those unusual, or maybe even only hypothetical, networks where
>> it is not the [-1].
> Real life example: network with a /31 mask.
> There are only two hosts: 0 and 1
> first host configures the other's host as broadcast address and vice versa.
> NOTE - broadcasts are different here!

This is RFC 3021. IIUC, it does not support directed broadcast; only
link-local broadcast can be used on that link.

So ISTM that .broadcast should raise an exception on a /31 network. Any
installation that configures the partner as the broadcast address is
broken (somebody correct me if I'm wrong).

> Another real life examples include /32 networks on PPP. Just a point-to-point.
> No need for broadcasts and networks, a host just have one IP address and
> send all traffic via point-to-point link, no addressing is required there.
> This is a working dialup configuration, it works for me, it works for you, probably.
> It is not weird, it is common, it is used for PPPoE, for ADSL, for dialup.

So where is that defined?

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


guido at python

Sep 26, 2009, 7:25 PM

Post #3 of 3 (349 views)
Permalink
Re: PEP 3144: IP Address Manipulation Library for the Python Standard Library [In reply to]

I realize I'm late to this party, but this is just a naming issue, right?

For any network, there are two special addresses, one with the last
bits all zeros, one with the last bits all ones. We can call them A
and B, or network and broadcast, or zeros and ones, or whatever we
care. But their definitions are two well-defined functions for all
networks (assuming a network is defined as an IP address and a number
of bits), even if in an extreme case the functions return the same
value.

What is actually configured on a particular host to be the broadcast
address is a separate issue, even if *by convention* in most cases it
is given by one of the above functions -- the network object doesn't
care, the configuration object is something else (and outside the
scope of this PEP).

IMO "real life examples" don't matter for the definitions of the
functions, and I would personally be happy to name them network and
broadcast, since I know their definitions and their typical uses and
these match pretty closely. The expectation should be clearly set that
these are pure functions though and do not imply knowledge of the
configuration of any given host.

--Guido

On Sat, Sep 26, 2009 at 11:19 AM, "Martin v. Löwis" <martin [at] v> wrote:
>>>> I think using .network and .broadcast are pretty well understood to be the
>>>> [0] and [-1] of the network address block. I don't think we want to start
>>>> creating new terms or access patterns here.
>>>>
>>>> +1 on leaving .network and .broadcast as-is (including returning a
>>>> IPvXAddress object).
>>>>
>>> -1.  I think 'network.number' or 'network.zero' is a lot clearer than
>>> 'network.network'.  Maybe '.broadcast' would be okay, as long as it *can* be
>>> adjusted for those unusual, or maybe even only hypothetical, networks where
>>> it is not the [-1].
>> Real life example: network with a /31 mask.
>> There are only two hosts: 0 and 1
>> first host configures the other's host as broadcast address and vice versa.
>> NOTE - broadcasts are different here!
>
> This is RFC 3021. IIUC, it does not support directed broadcast; only
> link-local broadcast can be used on that link.
>
> So ISTM that .broadcast should raise an exception on a /31 network. Any
> installation that configures the partner as the broadcast address is
> broken (somebody correct me if I'm wrong).
>
>> Another real life examples include /32 networks on PPP. Just a point-to-point.
>> No need for broadcasts and networks, a host just have one IP address and
>> send all traffic via point-to-point link, no addressing is required there.
>> This is a working dialup configuration, it works for me, it works for you, probably.
>> It is not weird, it is common, it is used for PPPoE, for ADSL, for dialup.
>
> So where is that defined?
>
> Regards,
> Martin
> _______________________________________________
> Python-Dev mailing list
> Python-Dev [at] python
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
>



--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.