Summary of the invention
The technical problem to be solved in the present invention provides method and the device of a kind of planning network IP address, to realize the automation planning to the IP address.
In order to solve the problems of the technologies described above, the invention provides the method for a kind of planning network IP address, comprising:
After receiving planning triggering message, generate the regional subnet tabulation of appointed area;
For each network number in the described regional subnet tabulation generates all corresponding available host number tabulations, go out untapped host number in described each subnet at the whole network inner analysis;
Choose the network number of the subnet with untapped host number and corresponding one or more untapped host number, consist of the IP address, give appointment network element in the described appointed area with described IP address assignment.
Further, said method also has following characteristics: the regional subnet tabulation of described generation appointed area comprises:
According to IP address and the mask of all network elements in the described appointed area, add up the network number of employed subnet;
The network number that counts is stored in the described regional subnet tabulation.
Further, said method also has following characteristics: the regional subnet tabulation of described generation appointed area comprises:
The network number of user's appointment is stored in the described regional subnet tabulation.
Further, said method also has following characteristics: described described IP address assignment is given after the equipment newly-increased in the described appointed area, also comprise:
After receiving user's modify instruction, show host number tabulation corresponding to each network number in the described appointed area;
Receive the user to the modification of described IP address.
Further, said method also has following characteristics: before the regional subnet tabulation of described generation appointed area, also comprise:
Carry out initialization process, empty regional subnet tabulation and the host number tabulation of local storage.
In order to address the above problem, the present invention also provides a kind of planning network IP system of address, comprising:
The first module after receiving planning triggering message, generates the regional subnet tabulation of appointed area;
The second module is used to each subnet in the described regional subnet tabulation to generate all corresponding available host number tabulations, goes out untapped host number in described each subnet at the whole network inner analysis;
The 3rd module is used for choosing the network number of the subnet with untapped host number and the one or more untapped host number of correspondence, consists of the IP address, gives equipment newly-increased in the described appointed area with described IP address assignment.
Further, said system also has following characteristics:
Described the first module, concrete for after receiving planning triggering message, according to IP address and the mask of all network elements in the described appointed area, add up the network number of employed subnet; The network number that counts is stored in the described regional subnet tabulation.
Further, said system also has following characteristics:
Described the first module, concrete be used for receiving planning and trigger message after, the network number of user's appointment is stored in the described regional subnet tabulation.
Further, said system also has following characteristics: also comprise:
Four module after being used for receiving user's modify instruction, shows host number tabulation corresponding to each network number in the described appointed area, receives the user to the modification of described IP address.
Further, said system also has following characteristics: described the first module, the regional subnet tabulation that generates the appointed area also is used for before: carry out initialization process, empty regional subnet tabulation and the host number tabulation of local storage.
To sum up, the invention provides method and the device of a kind of planning network IP address, the mistake that repeat the IP address that may occur in the time of can solving the complicated processes in IP address when planning and avoid manual allocation, the planning of IP address is realized automation, not only can realize automatically planning for the IP address of newly added equipment in a certain zone, also realize simultaneously planning for the whole IP address of carrying out in newly-increased zone.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, hereinafter in connection with accompanying drawing embodiments of the invention are elaborated.Need to prove that in the situation of not conflicting, the embodiment among the application and the feature among the embodiment be combination in any mutually.
Fig. 1 is the schematic diagram of the network management system IP address planning of the embodiment of the invention, as shown in Figure 1, network management system is divided into zone, subnet, network element (network management unit, be also referred to as equipment, in Fig. 4, Fig. 6, use abbreviation NE) three parts, now various piece is carried out simple declaration:
The zone: network management system such as geographical position, device type, is divided into a plurality of management areas with whole network according to some division rules.
Subnet: in each zone, can be divided into one or more subnet, generally, a subnet only exists in the zone, but also has a subnet to have the situation in a plurality of zones.
Network element: comprise one or more equipment in the subnet, these equipment use identical network number.
Fig. 2 is the schematic diagram of the network ip address planning system of the embodiment of the invention, and as shown in Figure 2, the system of present embodiment comprises: subnets analysis module, the automatic planning module of the whole network host number analysis module and IP address in the zone, wherein,
Subnets analysis module (corresponding the first module) in the zone, (the IP address is comprised of two parts for the network number that carries out the IP address of use in the zone, be network number and host number, network number sign be a subnet on the Internet (internet), and host number sign is certain main frame in the subnet) statistics, further determine subnet scoping.
The whole network host number analysis module (corresponding the second module) is used for the whole network host number statistics, draws host number and idle host number that each subnet in the zone has used.
The automatic planning module in IP address (corresponding the 3rd module), be used for the automatic planning of IP address of equipment (the IP address adds that by network number host number consists of) in the zone, according to the analysis result of subnets analysis module and regional subnet the whole network host number analysis module in the zone, newly added equipment in the zone is carried out the IP address automatically distribute.
The system of present embodiment can also comprise:
Four module after being used for receiving user's modify instruction, shows host number tabulation corresponding to each network number in the described appointed area, receives the user to the modification of described IP address.
Fig. 3 is the flow chart of the network ip address planning of the embodiment of the invention, as shown in Figure 3, comprises following step:
S301: after receiving planning triggering message, generate the regional subnet tabulation of appointed area;
S302: for each network number in the described regional subnet tabulation generates all corresponding available host number tabulations, go out untapped host number in described each subnet at the whole network inner analysis;
Each network number in the regional subnet tabulation is generated number tabulation of a network host.
The host number analysis times depends on subnets analysis result in the zone, can carry out once or repeatedly analysis.If subnets analysis is for only having used a network number in the zone, the host number analysis times is only to analyze once so; If subnets analysis is for having used N network number in the zone, the host number analysis times is for analyzing N time so.Each network number is carried out the analysis of the whole network host number, and the host number deletion from network host number tabulation with this network number has used obtains number tabulation of idle network host.
S303: choose the network number of the subnet with untapped host number and corresponding one or more untapped host number, consist of the IP address, give appointment network element in the described appointed area with described IP address assignment.
Wherein, can be one or more network number in the subnet tabulation of newly-increased network element range of distribution.After having determined network number, can choose one or more host number in number tabulation of corresponding network host, consist of the IP address.
Wherein, the IP address of equipment is that network number adds that host number consists of.
Tabulation be the network number of sky for network host number, and the IP address is divided timing automatically, does not select map network number, selects other network numbers.
Among the step S301, generate before the regional subnet tabulation of appointed area, also carry out initialization process, mainly comprise: (1) empties regional subnet tabulation; (2) deletion all-network host number tabulation.
Initialization procedure is for fear of the data that previous automatic distribution is added up variation to have occured, because the inaccurate impact of data automatic distribution next time.The reason that data change may be since manual allocation the IP address, and this address is not deleted in the network host number tabulation, so triggering each time the IP address distributes automatically, all whole network data be will again add up, new regional subnet tabulation and network host number tabulation generated.
Step 304: manual amendment IP address, this step are optional step.
When the user did not want with the automatic IP address of distributing, system supported that the user revises the IP address by hand.
Wherein, the network host number tabulation that each network number is corresponding can the interface display mode be presented to the user, reference when being used for manual IP address configuration.
Fig. 4 is the embodiment of the invention one network management system IP address planning chart, Fig. 5 carries out the flow chart that the IP address is distributed automatically to newly-increased network element in the zone among Fig. 4, in conjunction with Fig. 4, Fig. 5 newly-increased network element in the zone is carried out automatically planning situation of IP herein and describes.
As shown in Figure 4, comprise 4 zones in the network management system, wherein, comprised two subnets in the zone 1, there is identical subnet of ip address 10.1.1.0/24 in one of them subnet with zone 4.
The user is at zone 1 interior newly added equipment NE15, and the selection automatic IP address allocation, triggers the automatic allocation flow in IP address.Operating procedure comprises following step as shown in Figure 5:
S501, initialization procedure;
Concrete, regional subnet tabulation is emptied the tabulation of deletion all-network host number.
Wherein, initialization procedure is for fear of the data that previous automatic distribution is added up variation to have occured, because the inaccurate impact of data automatic distribution next time.The reason that data change may be since manual allocation the IP address, and in the network host number tabulation with this address deletion.Trigger each time the IP address and automatically distribute, all will again add up whole network data, to generate new regional subnet tabulation and network host number tabulation.
S502, regional subnets analysis process;
Concrete, by the analysis to IP address and mask in the zone, obtain using two subnets in the zone, be respectively 10.1.1.0/24 and 11.1.1.0/24, these two network numbers are added in the regional subnet tabulation.
S503, the tabulation of generating network host number, host number is all available host numbers in this network number;
Wherein, network host number tabulation 1, expression subnet 10.1.1.0/24, available host number is 1~255;
Network host number tabulation 2, expression subnet 11.1.1.0/24, available host number is 1~255.
S504, the whole network host number analytic process;
Concrete, by regional subnets analysis result, analyze the host number that uses 10.1.1.0/24 and 11.1.1.0/24 in the whole network, and the host number that will use deletion from network host number tabulation.
Wherein, in the analytic process of subnet 10.1.1.0/24, find to have this regional IP address in zone 1 and the zone 4, host number is respectively 1,2,3, with 1,2,3 deletions from network host number tabulation corresponding to subnet 10.1.1.0/24.
Further obtain, network host number tabulation 1, expression subnet 10.1.1.0/24, available host number is 4~255.
Wherein, in the analytic process of subnet 11.1.1.0/24, find to only have to have this regional IP address in the zone 1, host number is respectively 1,2, with 1,2 deletions from network host number tabulation corresponding to subnet 11.1.1.0/24.
Further obtain, network host number tabulation 2, expression subnet 11.1.1.0/24, available host number is 3~255.
S505, the automatic planning process in IP address;
Concrete, by regional subnet tabulation and network host number tabulation, give NE15 distributing IP address.
Wherein, network host number tabulation 1 non-NULL is judged by system, can be used for IP address assignment, and subnet 10.1.1.0/24 is distributed to NE15 as network number.
Further, Network Search host number tabulation 1, available host number is 4~255, host number 4 that can first is available is distributed to NE15, as the host number of NE15, draws the IP address of NE15, for network number adds host number, is 10.1.1.4/24.
Fig. 6 is the planning chart of the network management system IP address of the embodiment of the invention two, and Fig. 7 is the flow chart that newly-increased subnet is carried out the network planning.As shown in Figure 6, the user creates a zone 5, and at zone 5 interior establishments three equipment NE16, NE17, NE18, has specified simultaneously zone 5 subnets that use to be 10.1.1.0/24.Trigger the automatic allocation flow in IP address, as shown in Figure 7, comprise following step:
S701, initialization procedure;
Concrete, regional subnet tabulation is emptied the tabulation of deletion all-network host number.
S702, regional subnets analysis process;
This step is because the user has specified the subnet IP that uses to be 10.1.1.0/24, so do not need to do labor.
Concrete, network number 10.1.1.0/24 is added in the regional subnet tabulation, generating network host number tabulation 1, host number is all available host numbers in this network number.
Wherein, network host number tabulation 1, expression subnet 10.1.1.0/24, available host number is 1~255.
S703, the whole network host number analytic process;
Concrete, by regional subnets analysis result, analyze the host number that uses 10.1.1.0/24 in the whole network, and the host number that will use deletion from network host number tabulation.
Wherein, in the analytic process of subnet 10.1.1.0/24, find to have this regional IP address in zone 1 and the zone 4, host number is respectively 1,2,3,4, with 1,2,3,4 deletions from network host number tabulation corresponding to subnet 10.1.1.0/24, obtain network host number tabulation 1, expression subnet 10.1.1.0/24, available host number is 5~255.
S704, the automatic planning process in IP address;
Concrete, by regional subnet tabulation and network host number tabulation, give NE16, NE17, NE18 distributing IP address.
Wherein, network host number tabulation 1 non-NULL is judged by system, can be used for IP address assignment, and subnet 10.1.1.0/24 is distributed to NE16, NE17, NE18 as network number.
Further, Network Search host number tabulation 1, available host number is 5~255, front 3 available host numbers 5,6,7 is distributed to NE16, NE17, NE18, as the host number of NE16, NE17, NE18.
The IP address that draws NE16, NE17, NE18 is that network number adds host number, is respectively: NE16:10.1.1.5/24, NE17:10.1.1.6/24, NE18:10.1.1.7/24.
One of ordinary skill in the art will appreciate that all or part of step in the said method can come the instruction related hardware to finish by program, described program can be stored in the computer-readable recording medium, such as read-only memory, disk or CD etc.Alternatively, all or part of step of above-described embodiment also can realize with one or more integrated circuits.Correspondingly, each the module/unit in above-described embodiment can adopt the form of hardware to realize, also can adopt the form of software function module to realize.The present invention is not restricted to the combination of the hardware and software of any particular form.
Below only be the preferred embodiments of the present invention; certainly; the present invention also can have other various embodiments; in the situation that does not deviate from spirit of the present invention and essence thereof; those of ordinary skill in the art work as can make according to the present invention various corresponding changes and distortion, but these corresponding changes and distortion all should belong to the protection range of the appended claim of the present invention.