2013年10月30日星期三

Global ip what data structure stored ?


ip segments are used to record , as follows:

192.168.1.1/24 Beijing Telecom
125.223.254.0/23 Shanghai Telecom
125.224.0.0/13 Hubei Unicom
125.232.0.0/15 Hubei Telecom
125.253.128.0/17 Hubei wired communication


this ip what kind of data structure to store , can be more convenient CRUD ?

which to consider when updating need to merge , that is the same ip can not appear in a different segment , the design of such a data structure how good ?



------ Solution ------------------------------------ --------
IP points A grade, B grade , C grade segment
can be judged according to several former big vested units . .
look at it is a simple map,
If maintenance is relatively small , I mean if the individual to maintain a small part of the case , map is good.
As for the people there how the total server settings , do not know
------ Solution --------------------- -----------------------
as I expected , it really is a prefix tree

Specific reference

http://www.freidok.uni-freiburg.de/volltexte/6371/pdf/diss.pdf

suggestions
If the algorithm skills can directly build trie
then traverse
with the hash table
------ For reference only ------------------------------- --------
should be based on ip addresses to store . . Specific knowledge
------ For reference only --------------------------------- ------
otherwise establish a database can be, but is not preferred
frequent calls to the database

没有评论:

发表评论