Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: RFC: CPAN module Net::IP::Correct

by del (Pilgrim)
on Jun 29, 2005 at 16:37 UTC ( [id://471094]=note: print w/replies, xml ) Need Help??


in reply to RFC: CPAN module Net::IP::Correct

Consider this a vote of encouragement.

I would certainly welcome and appreciate such a module. Minimizing the number of routing entries required in configurations, describing address spaces to other parties, or even network documentation come to mind as useful applications of what you propose.

(How about Net::IP::Range::Minimize?)

Replies are listed 'Best First'.
Re^2: RFC: CPAN module Net::IP::Correct
by arc_of_descent (Hermit) on Jun 29, 2005 at 17:27 UTC

    Thanks for your comments and suggestions!

    But isn't splitting an IP range into its constituent valid IP blocks actually maximising the number of routing entries? (assuming this exercise is for a route table).

    I do think Net::IP::Range::Split (thanks to Smylers again) is appropriate for what this module will try to achive. i.e. split an IP range into its constituent valid IP blocks. The caller could use arguments to indicate whether she wants IP blocks smallest first or largest first.

    Module implementation aside, I'm now confused as how to go ahead with CPAN. I did send a request to register a namespace using PAUSE, but I was informed by various good folks that its not a needed step. Do I need a certain number of votes here on Perlmonks to get the go ahead?

    All help will be much appreciated!

      But isn't splitting an IP range into its constituent valid IP blocks actually maximising the number of routing entries? (assuming this exercise is for a route table).

      I was actually thinking in terms of minimal and usable. Your initial example included the range 192.168.1.0 - 192.168.1.5. That range cannot be expressed as a single entity using CIDR or network masks, as you allude to, so it can't be used as a routing entry.

      One approach I frequently see is this:

      192.168.0.0 255.255.255.0
      192.168.1.0 255.255.255.0
      192.168.2.0 255.255.255.0
      192.168.3.0 255.255.255.0
      192.168.4.0 255.255.255.0
      192.168.5.0 255.255.255.0
      

      With your proposed module, I was imagining that same range could be programmatically rewritten as this:

      192.168.0.0 255.255.252.0  ( /22 )
      192.168.4.0 255.255.254.0  ( /23 )
      

      In these scenarios, I see this as a way of reducing the number of entries in a routing table.

      Module implementation aside, I'm now confused as how to go ahead with CPAN. I did send a request to register a namespace using PAUSE, but I was informed by various good folks that its not a needed step. Do I need a certain number of votes here on Perlmonks to get the go ahead?

      A monk vote shouldn't be needed. I think you were on the right track with PAUSE, as described here.

        Ooops. Those rewritten ranges have incorrect subnet masks. They should be 255.255.252.0 and 255.255.254.0, respectively.
      Module implementation aside, I'm now confused as how to go ahead with CPAN. I did send a request to register a namespace using PAUSE, but I was informed by various good folks that its not a needed step. Do I need a certain number of votes here on Perlmonks to get the go ahead?
      Please don't, until you explain how it isn't actually the same as Net::IP::ip_range_to_prefix. We don't need a whole module to do what's already done as a subroutine in another module, unless there's something very broken about that implementation.

      Then again, if you just want to go pollute the CPAN, I'm really not the one to cast stones. {grin}

      -- Randal L. Schwartz, Perl hacker
      Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://471094]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-04-24 20:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found