LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 22 Feb 2007 18:19:32 -0700
Reply-To:     Alan Churchill <SASL001@SAVIAN.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Alan Churchill <SASL001@SAVIAN.NET>
Subject:      Re: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP
              Addresses
Comments: To: Don Henderson <donaldjhenderson@HOTMAIL.COM>
In-Reply-To:  <000001c756e3$65949630$0201a8c0@8300xpserver>
Content-Type: text/plain; charset="iso-8859-1"

A long time ago, a birdie told me that you start to lose efficiencies of the format when the count goes above a couple hundred thousand. Not sure if that still holds true but that is what I recall and I try to hold that in mind when dealing with formats.

Alan

Alan Churchill Savian "Bridging SAS and Microsoft Technologies" www.savian.net

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Don Henderson Sent: Thursday, February 22, 2007 5:42 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP Addresses

Toby,

Regardless of whether you can create a large format table, I have to agree with David that converting the IPs to continuous numeric integer values and then checking a simple range is much preferred to creating a table of all the possible IPs. You are right that the format table can be loaded and used. But the approach David is suggesting also allows you to deal with the issue that is it very unlikely, for the original problem, that you would have exceptions in the range for example implied by the last node or the last two nodes or the last three nodes.

The proposed solution actually integrates "business knowledge" about how the values are constructed and used to make the implementation more robust and flexible. And I further suspect that the same will be true once we go to IPv6.

-don

> -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of toby > dunn > Sent: Thursday, February 22, 2007 7:15 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP > Addresses > > Not likely David. I have loaded up millions of values into a format with > no > problems what so ever and we only had 512 megs of memory available. > > > > Toby Dunn > > To sensible men, every day is a day of reckoning. ~John W. Gardner > > The important thing is this: To be able at any moment to sacrifice that > which we are for what we could become. ~Charles DuBois > > Don't get your knickers in a knot. Nothing is solved and it just makes you > walk funny. ~Kathryn Carpenter > > > > > > > From: "Johnson, David" <David.Johnson@CBA.COM.AU> > Reply-To: "Johnson, David" <David.Johnson@CBA.COM.AU> > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP > Addresses > Date: Fri, 23 Feb 2007 09:59:28 +1100 > > I'm afraid it's not that easy. I'm a little concerned about your > statement "generate a list of all of the private IP addresses and make a > format out of them". If you do this without using numeric ranging you > will create a very very large table to load to your format. It is > unlikely that format would even load because of memory problems. > > The CNTLIN table for your format creation needs to utilise ranging as > much as possible, which is why the numeric conversion is my preference. > > Kind regards > > David > > /* - - - - - - - - - - - - - - - - - - - - - > It is a capital mistake to theorize before one has data. > Insensibly one begins to twist facts to suit theories, instead of > theories to suit facts. > -Sir Arthur Conan Doyle > - - - - - - - - - - - - - - - - - - - - - */ > > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > Matt Pettis > Sent: Friday, 23 February 2007 3:22 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP > Addresses > > The private IP addresses are fixed for IPv4 (I'm not sure for IPv6, as > one other respondent alluded to)... I could generate a list of all of > the private IP addresses and make a format out of them, but, since the > ranges are fixed, it still seems reasonable to convert to integers and > check ranges... I'm thinking it would be a memory/cpu tradeoff in the 2 > different approaches. > > Thanks, > matt > > -----Original Message----- > From: toby dunn [mailto:tobydunn@hotmail.com] > Sent: Thursday, February 22, 2007 10:16 AM > To: Pettis, Matthew (Thomson); SAS-L@LISTSERV.UGA.EDU > Subject: Re: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP > Addresses > > Ahhh yes my brain was having a senior moment and didnt think through the > ascii sequence far enough when SAS would make a comaprison. Still hard > coding the values rubs me wrong. Almost seems like there should be away > to get a list of the private IP address. Then create a format with > those and the whole problem solves itself everytime without haveing to > hard code the values muchless convert them to numeric. > > > > Toby Dunn > > To sensible men, every day is a day of reckoning. ~John W. Gardner > > The important thing is this: To be able at any moment to sacrifice that > which we are for what we could become. ~Charles DuBois > > Don't get your knickers in a knot. Nothing is solved and it just makes > you walk funny. ~Kathryn Carpenter > > > > > > > From: Matt Pettis <matt.pettis@THOMSON.COM> > Reply-To: matt.pettis@THOMSON.COM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP > > Addresses > Date: Thu, 22 Feb 2007 10:05:06 -0600 > > Hi Toby, > > I ran your code with a larger test set, and I got: > > 1 10.0.0.0 Private > 2 10.0.12.0 Private > 3 10.255.255.255 Private > 4 172.16.0.0 Private > 5 172.22.155.8 Private > 6 172.31.255.255 Private > 7 192.168.0.0 Private > 8 192.168.55.89 Public > 9 192.168.255.255 Private > 10 20.4.88.6 Public > > Obs 8 should be Private, not Public. I think the most bug-free is to > convert to integers and check ranges of those. > > Thanks for the input, > matt > > > -----Original Message----- > From: toby dunn [mailto:tobydunn@hotmail.com] > Sent: Thursday, February 22, 2007 9:53 AM > To: Pettis, Matthew (Thomson); SAS-L@LISTSERV.UGA.EDU > Subject: RE: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP > Addresses > > Have I missed something or would not this work: > > Proc Format ; > Value $IPFmt > '10.0.0.0' - '10.255.255.255' , > '172.16.0.0' - '172.31.255.255' , > '192.168.0.0' - '192.168.255.255' = 'Private' > Other = 'Public ' ; Run ; > > data one; > input ip :$15.; > cards; > 10.0.0.0 > 10.1.0.0 > 172.16.0.0 > 111.222.333.444 > 192.168.0.0 > 192.168.255.255 > ; > run; > > > Data Two ; > Set One ; > > NewIP = Put( IP , $IPFmt. ) ; > Run ; > > Proc Print > Data = Two ; > Run ; > > > > > Toby Dunn > > To sensible men, every day is a day of reckoning. ~John W. Gardner > > The important thing is this: To be able at any moment to sacrifice that > which we are for what we could become. ~Charles DuBois > > Don't get your knickers in a knot. Nothing is solved and it just makes > you walk funny. ~Kathryn Carpenter > > > > > > > From: Matt Pettis <matt.pettis@THOMSON.COM> > Reply-To: Matt Pettis <matt.pettis@THOMSON.COM> > To: SAS-L@LISTSERV.UGA.EDU > Subject: REPOST/CROSSPOST: SAS Format: Determining Public/Private IP > > Addresses > Date: Wed, 21 Feb 2007 11:15:03 -0500 > > I saw in the google groups threads that posts to it were not getting to > SAS-L, so forgive me if it's working and this is redundant... > > ================== > > Before I go off and write something kludgy... > > Has anyone used SAS in processing data with IP addresses in any way? > I am parsing weblogs, and I want to separate out requests that come from > private IP addresses because I know that that is internal traffic. > > What I'd like to do is feed it a length 15 string of the ip address > (x.x.x.x), and return either the address itself if it is a public IP > address, or the word 'Internal' if it is in the private IP range. For > reference, the private IP ranges are: > > 10.0.0.0 through 10.255.255.255 > 172.16.0.0 through 172.31.255.255 > 192.168.0.0 through 192.168.255.255 > > anyone done this? > > thanks, > Matt > > _________________________________________________________________ > The average US Credit Score is 675. The cost to see yours: $0 by > Experian. > http://www.freecreditreport.com/pm/default.aspx?sc=660600&bcd=EMAILFOOTE > RAVERAGE > > _________________________________________________________________ > Don't miss your chance to WIN 10 hours of private jet travel from > Microsoft(r) > Office Live http://clk.atdmt.com/MRT/go/mcrssaub0540002499mrt/direct/01/ > > ************** IMPORTANT MESSAGE ***************************** > This e-mail message is intended only for the addressee(s) and contains > information which may be > confidential. > If you are not the intended recipient please advise the sender by return > email, do not use or > disclose the contents, and delete the message and any attachments from > your > system. Unless > specifically indicated, this email does not constitute formal advice or > commitment by the sender > or the Commonwealth Bank of Australia (ABN 48 123 123 124) or its > subsidiaries. > We can be contacted through our web site: commbank.com.au. > If you no longer wish to receive commercial electronic messages from us, > please reply to this > e-mail by typing Unsubscribe in the subject line. > ************************************************************** > > _________________________________________________________________ > With tax season right around the corner, make sure to follow these few > simple tips. > http://articles.moneycentral.msn.com/Taxes/PreparationTips/PreparationTips > .aspx?icid=HMFebtagline


Back to: Top of message | Previous page | Main SAS-L page