CN107465771A - A kind of network address section division methods and system - Google Patents

A kind of network address section division methods and system Download PDF

Info

Publication number
CN107465771A
CN107465771A CN201710854749.6A CN201710854749A CN107465771A CN 107465771 A CN107465771 A CN 107465771A CN 201710854749 A CN201710854749 A CN 201710854749A CN 107465771 A CN107465771 A CN 107465771A
Authority
CN
China
Prior art keywords
subnet
address
numbers
order
self
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710854749.6A
Other languages
Chinese (zh)
Other versions
CN107465771B (en
Inventor
王明仪
王文彦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN201710854749.6A priority Critical patent/CN107465771B/en
Publication of CN107465771A publication Critical patent/CN107465771A/en
Application granted granted Critical
Publication of CN107465771B publication Critical patent/CN107465771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/668Internet protocol [IP] address subnets
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

This application discloses a kind of network address section division methods and system, including:Receive the required IP numbers of IP address, mask, subnet division number and subnet that user inputs;Using the required IP numbers of subnet, the actually required IP numbers of subnet are obtained;Calculate 2 M minimum more than or equal to the actually required IP numbers of subnet[i]The even number of power, obtain the distribution IP numbers of subnet;Utilize the total bit of mask and the M of subnet[i], obtain subnet mask length and subnet mask;The order of actually required IP numbers from big to small according to subnet, generate the order of subnet;Using starting ip, the distribution IP numbers of subnet, the broadcast address of current sub network is calculated;Using the broadcast address and IP address of subnet, the start address of subnet is calculated.The application only needs the required IP numbers of user's input IP address, mask, subnet division number and subnet, can calculate the network segment address and subnet mask of subnet, so as to non-homogeneous division of quick, the accurate and automatic completion to network address section.

Description

A kind of network address section division methods and system
Technical field
The present invention relates to internet arena, more particularly to a kind of network address section division methods and system.
Background technology
In the today's society that communication is more and more flourishing, the construction of network becomes increasingly rapider, wherein the rule of network address Draw and networking design in an indispensable part, and automated network address planning can reduce network rule The time built and accuracy are drawn, in general, the network address planning of early stage is typically based on artificial calculate, network engineers Optimal address allocation plan is calculated according to the demand of reality, but with network size increase, it is necessary to the amount calculated just It is increasing.
Algorithm and software of the prior art can only carry out uniform sub-network division, and can not carry out subnet heterogeneous and draw Point.
Therefore, how quickly accurately to carry out sub-network division heterogeneous is that those skilled in the art need what is solved to ask Topic.
The content of the invention
In view of this, it is an object of the invention to provide a kind of network address section division methods and system, with realize it is quick, The network address of each subnet is calculated precisely and automatically, completes the non-homogeneous division to network address section.Its concrete scheme is such as Under:
A kind of network address section division methods, including:
Receive each self-corresponding required IP numbers of IP address, mask, subnet division number and each subnet of user's input;
Self-corresponding required IP numbers each to each subnet add 2, obtain each self-corresponding actually required IP numbers of each subnet;
2 minimum M of self-corresponding actually required IP numbers each more than or equal to each subnet is calculated respectively[i]The idol of power Number, obtains each self-corresponding distribution IP numbers of each subnet;
Each self-corresponding M of each subnet is subtracted using the total bit of mask[i], obtain each self-corresponding subnet of each subnet Mask-length and subnet mask;
It is right according to the order of actually required IP numbers from big to small using each self-corresponding actually required IP numbers of each subnet Each subnet is ranked up, and generates the order of each subnet;
Using the IP address and the mask phase with calculating starting ip, using the starting ip, current sub network and working as The distribution IP numbers of all-ones subnet before preceding subnet order, calculate the broadcast address of current sub network;
Whether the order for judging current sub network is 1, if it is, the start address of current sub network is equal to the IP address, If it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1.
Optionally, in addition to:
By each self-corresponding distribution IP numbers of each subnet and required IP numbers, unused IP numbers calculation formula is substituted into, is calculated every Individual subnet each corresponding to unused IP numbers;
Wherein, the unused IP numbers calculation formula is:
In formula, F[n]The unused IP numbers for the subnet that order is n are represented,Represent the distribution IP numbers for the subnet that order is n, Un Represent the required IP numbers for the subnet that order is n.
Optionally, in addition to:
According to the order of each subnet, it can distribute the total and each subnet in address allocated distribution IP number sums IP, generation Enter remaining ip address number calculation formula, calculate remaining ip address number corresponding to each subnet;
Wherein, the remaining ip address number calculation formula is:
In formula, G[i]The remaining ip address number for the subnet that order is i is represented, Y represents the length of the mask.
Optionally, in addition to:
Using each self-corresponding start address of each subnet and subnet mask length, each self-corresponding net of each subnet is obtained Sector address.
Optionally, in addition to:
Termination IP is calculated using IP calculation formula are terminated;
Wherein, the termination IP calculation formula are:H=X+232-Y-1;
In formula, H represents the termination IP.
Optionally, in addition to:
Using each self-corresponding start address of each subnet and broadcast address, obtain that each subnet is each self-corresponding to be distributed IP address range.
Optionally, in addition to:
Using default gateway calculation formula and each self-corresponding start address of each subnet is utilized, it is each to calculate each subnet Self-corresponding default gateway;
Wherein, the default gateway calculation formula is:E[i]=A[i]+1;
In formula, E[i]Represent the default gateway for the subnet that order is i, A[i]Represent the start address for the subnet that order is i.
Optionally, the distribution IP numbers using all-ones subnet before the starting ip, current sub network and current sub network order, The process of the broadcast address of current sub network is calculated, including:
By the distribution IP numbers of all-ones subnet before the starting ip, current sub network and current sub network order, broadcast is substituting to Address computation formula, calculate the broadcast address of current sub network;
Wherein, the broadcast address calculation formula is:
In formula, B[i]The broadcast address for the subnet that order is i is represented, X represents the starting ip,Order is i subnet Distribution IP numbers.
Optionally, whether the order for judging current sub network is 1, if it is, the start address of current sub network is equal to The IP address, if it is not, then the start address of current sub network adds 1 process equal to the broadcast address of previous subnet, including:
Using start address calculation formula, whether the order for judging current sub network is 1, if it is, current sub network is opened Beginning, address was equal to the IP address, if it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1;
Wherein, the start address calculation formula is:
In formula, A[i]The start address for the subnet that order is i is represented, IP represents the IP address, B[i-1]Expression order is i- The broadcast address of 1 subnet.
The invention also discloses a kind of network address section dividing system, including:
Receiving module, IP address, mask, subnet division number and each subnet for receiving user's input are each self-corresponding Required IP numbers;
Practical IP computing module, for adding 2 to each self-corresponding required IP numbers of each subnet, it is each right to obtain each subnet The actually required IP numbers answered;
IP computing modules are distributed, for calculating self-corresponding actually required IP numbers each more than or equal to each subnet respectively most 2 small M[i]The even number of power, obtain each self-corresponding distribution IP numbers of each subnet;
Subnet mask account module, for subtracting each self-corresponding M of each subnet using the total bit of mask[i], obtain every Individual subnet each corresponding subnet mask length and subnet mask;
Subnet order computing module, for utilizing each self-corresponding actually required IP numbers of each subnet, according to actually required The order of IP numbers from big to small, is ranked up to each subnet, generates the order of each subnet;
Broadcast address computing module, for utilizing the IP address and the mask phase and calculating starting ip, utilize institute The distribution IP numbers of all-ones subnet before starting ip, current sub network and current sub network order are stated, calculate the broadcast address of current sub network;
Start address computing module, for judging whether the order of current sub network is 1, if it is, current sub network is opened Beginning, address was equal to the IP address, if it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1.
In the present invention, network address section division methods, including:The IP address of reception user's input, mask, subnet division number With each self-corresponding required IP numbers of each subnet;Self-corresponding required IP numbers each to each subnet add 2, obtain each subnet each Corresponding actually required IP numbers;The 2 of self-corresponding actually required IP numbers minimum each more than or equal to each subnet are calculated respectively M[i]The even number of power, obtain each self-corresponding distribution IP numbers of each subnet;Each subnet is subtracted using the total bit of mask each Corresponding M[i], obtain each self-corresponding subnet mask length of each subnet and subnet mask;It is each self-corresponding using each subnet Actually required IP numbers, according to the order of actually required IP numbers from big to small, each subnet is ranked up, generates each subnet Order;Using IP address and mask phase with calculating starting ip, utilizing institute before starting ip, current sub network and current sub network order There are the distribution IP numbers of subnet, calculate the broadcast address of current sub network;Whether the order for judging current sub network is 1, if it is, The start address of current sub network is equal to IP address, if it is not, then the start address of current sub network is equal to the broadcast of previous subnet Address adds 1.
The present invention only needs user to input IP address, mask, subnet division number and each self-corresponding required IP numbers of each subnet, The actually required IP numbers of subnet can be obtained by the required IP numbers of subnet, be more than or equal to by calculating corresponding to subnet in fact 2 minimum M of IP numbers needed for border[i]The even number of power, each self-corresponding distribution IP numbers of subnet are obtained, utilize the total bit of mask And M[i], each self-corresponding subnet mask length of each subnet and subnet mask are obtained, generates each subnet according to actually required IP The order that number sorts from big to small, using starting ip and the distribution IP numbers of subnet, calculates the broadcast address of subnet, finally utilizes Broadcast address and IP address, obtain the start address of subnet, complete to the division of the network address section of subnet, so as to realize it is quick, The network address of each subnet is calculated precisely and automatically, completes the non-homogeneous division to network address section.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Disclosed a kind of network address section division methods schematic flow sheet in Fig. 1 is implemented for the present invention;
Disclosed a kind of network address section dividing system structural representation in Fig. 2 is implemented for the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
The embodiment of the invention discloses a kind of network address section division methods, shown in Figure 1, this method includes:
Step S11:IP address, mask, subnet division number and each subnet for receiving user's input are each self-corresponding required IP numbers.
For example, it is 202.12.3.0 that user, which inputs IP address, mask is/24, and subnet division number is 5, needed for the first subnet IP numbers are 23, and IP numbers needed for the second subnet are 16, and IP numbers needed for the 3rd subnet are 56, and IP numbers needed for the 4th subnet are 9, the 5th son IP numbers needed for net are 13.
It is understood that the initial number of subnet can automatically generate, obtained according to user's establishment order.
Step S12:Self-corresponding required IP numbers each to each subnet add 2, obtain each self-corresponding actual institute of each subnet Need IP numbers.
Specifically, because each subnet is required to a broadcast address and start address, and the two addresses be can not be by What subnet directly utilized, therefore, to meet each self-corresponding required IP numbers of each subnet, it is necessary to add 2 on required IP numbers, represent The broadcast address and start address of the subnet, each self-corresponding actually required IP numbers of each subnet are obtained, for example, IP needed for subnet Number is 56, and the actually required IP numbers of subnet are just 58.
Step S13:2 minimum M of self-corresponding actually required IP numbers each more than or equal to each subnet is calculated respectively[i] The even number of power, obtain each self-corresponding distribution IP numbers of each subnet.
It is understood that because the distribution of IP address is allocated using 2 systems, therefore, if the actual institute of subnet Need IP numbers be 2 power when, the distribution IP numbers of subnet will be greater than the actually required IP numbers of subnet.
Specifically, after the actually required IP numbers of subnet are obtained, the distribution that distribute to each subnet is calculated for each subnet IP numbers, calculate 2 minimum M of self-corresponding actually required IP numbers each more than or equal to each subnet[i]The even number of power, is obtained Each self-corresponding distribution IP numbers of each subnet, for example, the actually required IP numbers of subnet are 58, in 25With 26Between, i.e. 32≤ 58≤64, therefore the distribution IP numbers of subnet are 64, M[i]Value is 6.
Step S14:Each self-corresponding M of each subnet is subtracted using the total bit of mask[i], it is each right to obtain each subnet The subnet mask length and subnet mask answered.
Specifically, the total bit of mask, i.e. total length is 32, meanwhile, after learning the subnet mask length of subnet, i.e., The subnet mask of subnet can be calculated, therefore, each self-corresponding M of each subnet is subtracted using the total bit of mask[i], obtain each Each self-corresponding subnet mask length of subnet and subnet mask, for example, the M of subnet[i]Value is 6, then utilizes the total bit of mask 32 subtract the M of subnet[i], the subnet mask length for obtaining subnet is 26, subnet mask 255.255.255.192.
Wherein, subnet mask length can use j[i]=32-M[i]Represent, in formula, j[i]Represent the son for the subnet that order is i Net mask-length, 32 represent the total bit of mask.
Step S15:Using each self-corresponding actually required IP numbers of each subnet, according to actually required IP numbers from big to small Sequentially, each subnet is ranked up, generates the order of each subnet.
Specifically, because the numbering of each subnet is depending on the input sequence of user, accordingly, it is difficult to ensure numbering Order arranges from big to small according to actually required IP numbers, therefore, using each self-corresponding actually required IP numbers of each subnet, According to the order of actually required IP numbers from big to small, each subnet is ranked up, generates the order of each subnet, meanwhile, keep away Exempt from not in this order, if being allocated caused IP distribution there is situation about wasting, for example, IP numbers are needed for the first subnet 23, IP numbers needed for the second subnet are 16, and IP numbers needed for the 3rd subnet are 56, and IP numbers needed for the 4th subnet are 9, needed for the 5th subnet IP numbers are 13, then the order of the 3rd subnet is 1, and the order of the first subnet is 2, and the order of the second subnet is 3, time of the 5th subnet Sequence is 4, and the order of the 4th subnet is 5.
Step S16:Using IP address and mask phase with calculating starting ip, utilizing starting ip, current sub network and current son The distribution IP numbers of all-ones subnet before net order, calculate the broadcast address of current sub network.
Specifically, using IP address and mask phase with, calculate starting ip, for example, IP address is 202.12.3.0, mask For 255.255.255.0, IP address and mask are converted into 2 systems, every 8 phases with calculating starting ip is 202.12.3.0, after drawing starting ip, the distribution IP of all-ones subnet before recycling starting ip, current sub network and current sub network order Number, for example, starting ip is 202.12.3.0, the subnet that order is 3 is current sub network, and the distribution IP numbers of current sub network are 32, secondary The distribution IP numbers for the subnet that sequence is 2 are 32, and the distribution IP numbers for the subnet that order is 1 are 64, with calculating the broadcast of current sub network Location.
It is understood that the calculation of remaining subnet is consistent with the calculation of current sub network, it is each so as to calculate The broadcast address of individual subnet.
Step S17:Whether the order for judging current sub network is 1, if it is, the start address of current sub network is with being equal to IP Location, if it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1.
Each corresponded to it can be seen that the embodiment of the present invention only needs user to input IP address, mask, subnet division number and each subnet Required IP numbers, the actually required IP numbers of subnet can be obtained by the required IP numbers of subnet, by calculate be more than or equal to son The even number of minimum 2 M [i] power of actually required IP numbers corresponding to net, obtains each self-corresponding distribution IP numbers of subnet, using covering The total bit and M of code[i], obtain each self-corresponding subnet mask length of each subnet and subnet mask, generate each subnet according to The order that actually required IP numbers sort from big to small, using starting ip and the distribution IP numbers of subnet, with calculating the broadcast of subnet Location, finally using broadcast address and IP address, the start address of subnet is obtained, complete the network address section division to subnet, from And network address that is quick, accurate and automatically calculating each subnet is realized, complete the non-homogeneous division to network address section.
The embodiment of the invention discloses a kind of specific network address section division methods, relative to a upper embodiment, this reality Apply example and further instruction and optimization have been made to technical scheme.Specifically:
In the embodiment of the present invention, in order to further improve Consumer's Experience, more fully it can draw calculating network address field Divide related content, may include steps of S21 to step S28;Specifically,
Step S21:By each self-corresponding distribution IP numbers of each subnet and required IP numbers, unused IP numbers calculation formula is substituted into, Calculate each self-corresponding unused IP numbers of each subnet.
Wherein, unused IP numbers calculation formula is:
In formula, F[n]The unused IP numbers for the subnet that order is n are represented,Represent the distribution IP numbers for the subnet that order is n, Un Represent the required IP numbers for the subnet that order is n.
For example, order is 2 subnet, M[n]Equal to 5, UnEqual to 23, unused IP numbers are then equal to 7.
Step S22:According to the order of each subnet, it can distribute the total and each subnet in address allocated distribution IP numbers IP Sum, remaining ip address number calculation formula is substituted into, calculates remaining ip address number corresponding to each subnet.
Wherein, remaining ip address number calculation formula is:
In formula, G[i]The remaining ip address number for the subnet that order is i is represented, Y represents the length of mask.
For example, the distribution IP numbers for the subnet that order is 1 are 64, the distribution IP numbers for the subnet that order is 2 are 32, order 3 Subnet be current sub network, the length of mask is 24, substitutes into remaining ip address number calculation formula, draws the son that cut-off order is 3 Remaining ip address 128 after net.
Step S23:Using each self-corresponding start address of each subnet and subnet mask length, each subnet is obtained each Corresponding network segment address.
For example, the start address of subnet is 202.12.3.0, subnet mask length 26, the network segment address of the subnet is then 202.12.3.0/26, i.e. A[i]/j。
Step S24:Termination IP is calculated using IP calculation formula are terminated.
Wherein, terminating IP calculation formula is:H=X+232-Y-1;
In formula, H represents to terminate IP.
For example, starting ip is 202.12.3.0, mask-length 24, termination IP is 202.12.3.255.
Step S27:Using each self-corresponding start address of each subnet and broadcast address, obtain each subnet and each correspond to Distribute IP address range.
Specifically, each subnet distributes IP address range in each self-corresponding start address of each subnet and broadcast ground Between location, (A is can be expressed as with calculating formula[i]+ 1) to (B[i]- 1) between, for example, the start address of subnet is 202.12.3.0, the broadcast address of subnet is 202.12.3.63, then subnet distribute IP address range for 202.12.3.1 extremely 202.12.3.62。
Step S28:Using default gateway calculation formula and each self-corresponding start address of each subnet is utilized, calculate every The respective corresponding default gateway of individual subnet.
Wherein, default gateway calculation formula is:E[i]=A[i]+1;
In formula, E[i]Represent the default gateway for the subnet that order is i, A[i]Represent the start address for the subnet that order is i.
For example, the start address of subnet is 202.12.3.64, then the default gateway of the subnet is 202.12.3.65.
In the embodiment of the present invention, before the utilization starting ip, current sub network and current sub network order described in a upper embodiment The distribution IP numbers of all-ones subnet, calculate the process of the broadcast address of current sub network, can be specially:
By the distribution IP numbers of all-ones subnet before starting ip, current sub network and current sub network order, broadcast address is substituting to Calculation formula, calculate the broadcast address of current sub network;
Wherein, broadcast address calculation formula is:
In formula, B[i]The broadcast address for the subnet that order is i is represented, X represents starting ip,Order is point of i subnet With IP numbers.
Whether the order that current sub network is judged in a upper embodiment is 1, if it is, the start address of current sub network is equal to IP address, if it is not, then the start address of current sub network adds 1 process equal to the broadcast address of previous subnet, can be specific For:
Using start address calculation formula, whether the order for judging current sub network is 1, if it is, current sub network is opened Beginning, address was equal to IP address, if it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1;
Wherein, start address calculation formula is:
In formula, A[i]The start address for the subnet that order is i is represented, IP represents IP address, B[i-1]It is i-1's to represent order The broadcast address of subnet.
Further, result of calculation is consulted for the ease of user, improves Consumer's Experience, can be by each item data with form Form is exported and preserved, so that user checks, as shown in the address program advocacy table of table 1.
Table 1
Accordingly, the embodiment of the invention also discloses a kind of network address section dividing system, shown in Figure 2, the system Including:
Receiving module 11, IP address, mask, subnet division number and each subnet for receiving user's input each correspond to Required IP numbers;
Practical IP computing module 12, for adding 2 to each self-corresponding required IP numbers of each subnet, obtain each subnet each Corresponding actually required IP numbers;
IP computing modules 13 are distributed, for calculating self-corresponding actually required IP numbers each more than or equal to each subnet respectively 2 minimum M[i]The even number of power, obtain each self-corresponding distribution IP numbers of each subnet;
Subnet mask account module 14, for subtracting each self-corresponding M of each subnet using the total bit of mask[i], obtain Each each self-corresponding subnet mask length of subnet and subnet mask;
Subnet order computing module 15, for utilizing each self-corresponding actually required IP numbers of each subnet, according to actual institute The order of IP numbers from big to small is needed, each subnet is ranked up, generates the order of each subnet;
Broadcast address computing module 16, for using IP address and mask phase with, calculate starting ip, using starting ip, The distribution IP numbers of all-ones subnet before current sub network and current sub network order, calculate the broadcast address of current sub network;
Start address computing module 17, for judging whether the order of current sub network is 1, if it is, current sub network Start address is equal to IP address, if it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1.
Each corresponded to it can be seen that the embodiment of the present invention only needs user to input IP address, mask, subnet division number and each subnet Required IP numbers, the actually required IP numbers of subnet can be obtained by the required IP numbers of subnet, by calculate be more than or equal to son 2 minimum M of actually required IP numbers corresponding to net[i]The even number of power, each self-corresponding distribution IP numbers of subnet are obtained, using covering The total bit and M of code[i], obtain each self-corresponding subnet mask length of each subnet and subnet mask, generate each subnet according to The order that actually required IP numbers sort from big to small, using starting ip and the distribution IP numbers of subnet, with calculating the broadcast of subnet Location, finally using broadcast address and IP address, the start address of subnet is obtained, complete the network address section division to subnet, from And network address that is quick, accurate and automatically calculating each subnet is realized, complete the non-homogeneous division to network address section.
The embodiment of the present invention, it can also include:
Unused IP computing modules, for by each self-corresponding distribution IP numbers of each subnet and required IP numbers, substituting into unused IP Number calculation formula, calculates each self-corresponding unused IP numbers of each subnet;
Wherein, unused IP numbers calculation formula is:
In formula, F[n]The unused IP numbers for the subnet that order is n are represented,Represent the distribution IP numbers for the subnet that order is n, Un Represent the required IP numbers for the subnet that order is n.
Remaining IP computing modules, for the order according to each subnet, IP can be distributed to the total and each subnet in address and divided The distribution IP number sums matched somebody with somebody, remaining ip address number calculation formula is substituted into, calculates remaining ip address number corresponding to each subnet;
Wherein, remaining ip address number calculation formula is:
In formula, G[i]The remaining ip address number for the subnet that order is i is represented, Y represents the length of mask.
Network segment address computing module, for using each self-corresponding start address of each subnet and subnet mask length, obtaining To each self-corresponding network segment address of each subnet.
Terminate IP computing modules, for using terminate IP calculation formula calculate terminate IP;
Wherein, terminating IP calculation formula is:H=X+232-Y-1;
In formula, H represents to terminate IP.
Address realm computing module, for using each self-corresponding start address of each subnet and broadcast address, obtaining every Individual subnet is each corresponding can to distribute IP address range.
In the embodiment of the present invention, above-mentioned broadcast address module 16, it can be specifically used for starting ip, current sub network and current The distribution IP numbers of all-ones subnet, are substituting to broadcast address calculation formula before subnet order, with calculating the broadcast of current sub network Location;
Wherein, broadcast address calculation formula is:
In formula, B[i]The broadcast address for the subnet that order is i is represented, X represents starting ip,Order is point of i subnet With IP numbers.
Above-mentioned start address computing module 17, it can be specifically used for utilizing start address calculation formula, judge current sub network Order whether be 1, if it is, the start address of current sub network is equal to IP address, if it is not, then the beginning of current sub network The broadcast address that location is equal to previous subnet adds 1;
Wherein, start address calculation formula is:
In formula, A[i]The start address for the subnet that order is i is represented, IP represents IP address, B[i-1]It is i-1's to represent order The broadcast address of subnet.
Finally, it is to be noted that, herein, such as first and second or the like relational terms be used merely to by One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant meaning Covering including for nonexcludability, so that process, method, article or equipment including a series of elements not only include that A little key elements, but also the other element including being not expressly set out, or also include for this process, method, article or The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged Except other identical element in the process including the key element, method, article or equipment being also present.
Professional further appreciates that, with reference to the unit of each example of the embodiments described herein description And algorithm steps, can be realized with electronic hardware, computer software or the combination of the two, in order to clearly demonstrate hardware and The interchangeability of software, the composition and step of each example are generally described according to function in the above description.These Function is performed with hardware or software mode actually, application-specific and design constraint depending on technical scheme.Specialty Technical staff can realize described function using distinct methods to each specific application, but this realization should not Think beyond the scope of this invention.
A kind of network address section division methods provided by the present invention and system are described in detail above, herein Apply specific case to be set forth the principle and embodiment of the present invention, the explanation of above example is only intended to help Understand the method and its core concept of the present invention;Meanwhile for those of ordinary skill in the art, according to the thought of the present invention, There will be changes in specific embodiments and applications, in summary, this specification content should not be construed as to this The limitation of invention.

Claims (10)

  1. A kind of 1. network address section division methods, it is characterised in that including:
    Receive each self-corresponding required IP numbers of IP address, mask, subnet division number and each subnet of user's input;
    Self-corresponding required IP numbers each to each subnet add 2, obtain each self-corresponding actually required IP numbers of each subnet;
    2 minimum M of self-corresponding actually required IP numbers each more than or equal to each subnet is calculated respectively[i]The even number of power, is obtained To each self-corresponding distribution IP numbers of each subnet;
    Each self-corresponding M of each subnet is subtracted using the total bit of mask[i], obtain each self-corresponding subnet mask of each subnet Length and subnet mask;
    Using each self-corresponding actually required IP numbers of each subnet, according to the order of actually required IP numbers from big to small, to each Subnet is ranked up, and generates the order of each subnet;
    Using the IP address and the mask phase with calculating starting ip, utilizing the starting ip, current sub network and current son The distribution IP numbers of all-ones subnet before net order, calculate the broadcast address of current sub network;
    Whether the order for judging current sub network is 1, if it is, the start address of current sub network is equal to the IP address, if No, then the start address of current sub network adds 1 equal to the broadcast address of previous subnet.
  2. 2. network address section division methods according to claim 1, it is characterised in that also include:
    By each self-corresponding distribution IP numbers of each subnet and required IP numbers, unused IP numbers calculation formula is substituted into, calculates every height Net each self-corresponding unused IP numbers;
    Wherein, the unused IP numbers calculation formula is:
    In formula, F[n]The unused IP numbers for the subnet that order is n are represented,Represent the distribution IP numbers for the subnet that order is n, UnRepresent Order is the required IP numbers of n subnet.
  3. 3. network address section division methods according to claim 1, it is characterised in that also include:
    It according to the order of each subnet, can distribute the total and each subnet in address allocated distribution IP number sums IP, substitute into surplus Remaining IP address number calculation formula, calculate remaining ip address number corresponding to each subnet;
    Wherein, the remaining ip address number calculation formula is:
    In formula, G[i]The remaining ip address number for the subnet that order is i is represented, Y represents the length of the mask.
  4. 4. network address section division methods according to claim 1, it is characterised in that also include:
    Using each self-corresponding start address of each subnet and subnet mask length, with obtaining each self-corresponding network segment of each subnet Location.
  5. 5. network address section division methods according to claim 1, it is characterised in that also include:
    Termination IP is calculated using IP calculation formula are terminated;
    Wherein, the termination IP calculation formula are:H=X+232-Y-1;
    In formula, H represents the termination IP.
  6. 6. network address section division methods according to claim 1, it is characterised in that also include:
    Using each self-corresponding start address of each subnet and broadcast address, obtain each subnet it is each it is self-corresponding with distributing IP Location scope.
  7. 7. network address section division methods according to claim 1, it is characterised in that also include:
    Using default gateway calculation formula and each self-corresponding start address of each subnet is utilized, it is each right to calculate each subnet The default gateway answered;
    Wherein, the default gateway calculation formula is:E[i]=A[i]+1;
    In formula, E[i]Represent the default gateway for the subnet that order is i, A[i]Represent the start address for the subnet that order is i.
  8. 8. the network address section division methods according to any one of claim 1 to 7, it is characterised in that described in the utilization The distribution IP numbers of all-ones subnet, calculate the broadcast address of current sub network before starting ip, current sub network and current sub network order Process, including:
    By the distribution IP numbers of all-ones subnet before the starting ip, current sub network and current sub network order, broadcast address is substituting to Calculation formula, calculate the broadcast address of current sub network;
    Wherein, the broadcast address calculation formula is:
    In formula, B[i]The broadcast address for the subnet that order is i is represented, X represents the starting ip,Order is point of i subnet With IP numbers.
  9. 9. the network address section division methods according to any one of claim 1 to 7, it is characterised in that described to judge currently Whether the order of subnet is 1, if it is, the start address of current sub network is equal to the IP address, if it is not, then current sub network Start address be equal to previous subnet broadcast address add 1 process, including:
    Using start address calculation formula, whether the order for judging current sub network is 1, if it is, the beginning of current sub network Location is equal to the IP address, if it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1;
    Wherein, the start address calculation formula is:
    In formula, IP represents the IP address, B[i-1]Represent the broadcast address for the subnet that order is i-1.
  10. A kind of 10. network address section dividing system, it is characterised in that including:
    Receiving module, IP address, mask, subnet division number and each subnet for receiving user's input are each self-corresponding required IP numbers;
    Practical IP computing module, for adding 2 to each self-corresponding required IP numbers of each subnet, it is each self-corresponding to obtain each subnet Actually required IP numbers;
    IP computing modules are distributed, for calculating self-corresponding actually required IP numbers minimum each more than or equal to each subnet respectively 2 M[i]The even number of power, obtain each self-corresponding distribution IP numbers of each subnet;
    Subnet mask account module, for subtracting each self-corresponding M of each subnet using the total bit of mask[i], obtain every height Net each self-corresponding subnet mask length and subnet mask;
    Subnet order computing module, for utilizing each self-corresponding actually required IP numbers of each subnet, according to actually required IP numbers Order from big to small, each subnet is ranked up, generates the order of each subnet;
    Broadcast address computing module, for utilizing the IP address and the mask phase and calculating starting ip, utilize described The distribution IP numbers of all-ones subnet before beginning IP, current sub network and current sub network order, calculate the broadcast address of current sub network;
    Start address computing module, for judging whether the order of current sub network is 1, if it is, the beginning of current sub network Location is equal to the IP address, if it is not, then the broadcast address that the start address of current sub network is equal to previous subnet adds 1.
CN201710854749.6A 2017-09-20 2017-09-20 Network address segment dividing method and system Active CN107465771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710854749.6A CN107465771B (en) 2017-09-20 2017-09-20 Network address segment dividing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710854749.6A CN107465771B (en) 2017-09-20 2017-09-20 Network address segment dividing method and system

Publications (2)

Publication Number Publication Date
CN107465771A true CN107465771A (en) 2017-12-12
CN107465771B CN107465771B (en) 2020-05-19

Family

ID=60552709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710854749.6A Active CN107465771B (en) 2017-09-20 2017-09-20 Network address segment dividing method and system

Country Status (1)

Country Link
CN (1) CN107465771B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111163188A (en) * 2020-01-02 2020-05-15 北京同有飞骥科技股份有限公司 Subnet mask conversion method and system
CN111510441A (en) * 2020-04-08 2020-08-07 中山大学 Legal and efficient method for collecting IP address of common intranet
CN112437167A (en) * 2020-11-11 2021-03-02 北京天融信网络安全技术有限公司 Method and device for creating transmission channel, storage medium and electronic equipment
CN113472911A (en) * 2021-06-10 2021-10-01 新华三信息安全技术有限公司 Subnet dividing method and device
CN114301840A (en) * 2021-12-16 2022-04-08 山石网科通信技术股份有限公司 Geographic information base loading method and device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1325209A (en) * 2000-08-25 2001-12-05 深圳市中兴通讯股份有限公司 IP address allocation method for access server
CN1645825A (en) * 2005-01-11 2005-07-27 东南大学 Terminal to terminal running performance monitoring method based on sampling measurement
EP2779089A2 (en) * 2010-07-30 2014-09-17 Fundação D. Anna Sommer Champalimaud E Dr. Carlos Montez Champalimaud Systems and methods for segmentation and processing of tissue images and feature extraction from same for treating, diagnosing, or predicting medical conditions

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1325209A (en) * 2000-08-25 2001-12-05 深圳市中兴通讯股份有限公司 IP address allocation method for access server
CN1645825A (en) * 2005-01-11 2005-07-27 东南大学 Terminal to terminal running performance monitoring method based on sampling measurement
EP2779089A2 (en) * 2010-07-30 2014-09-17 Fundação D. Anna Sommer Champalimaud E Dr. Carlos Montez Champalimaud Systems and methods for segmentation and processing of tissue images and feature extraction from same for treating, diagnosing, or predicting medical conditions

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
韩军浩: "《IP 地址管理系统的研究与实现》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111163188A (en) * 2020-01-02 2020-05-15 北京同有飞骥科技股份有限公司 Subnet mask conversion method and system
CN111163188B (en) * 2020-01-02 2022-07-29 北京同有飞骥科技股份有限公司 Subnet mask conversion method and system
CN111510441A (en) * 2020-04-08 2020-08-07 中山大学 Legal and efficient method for collecting IP address of common intranet
CN111510441B (en) * 2020-04-08 2021-02-05 中山大学 Legal and efficient method for collecting common intranet IP address
CN112437167A (en) * 2020-11-11 2021-03-02 北京天融信网络安全技术有限公司 Method and device for creating transmission channel, storage medium and electronic equipment
CN113472911A (en) * 2021-06-10 2021-10-01 新华三信息安全技术有限公司 Subnet dividing method and device
CN114301840A (en) * 2021-12-16 2022-04-08 山石网科通信技术股份有限公司 Geographic information base loading method and device and electronic equipment
CN114301840B (en) * 2021-12-16 2024-02-13 山石网科通信技术股份有限公司 Method and device for loading geographic information base and electronic equipment

Also Published As

Publication number Publication date
CN107465771B (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN107465771A (en) A kind of network address section division methods and system
CN105335584B (en) Distribution network systems line chart generates optimization device and method
CN106228338A (en) A kind of distribution engineering intelligentized design integrated service system and using method
CN104462443B (en) Data processing method and device
CN109389297A (en) The automatic distributing method of work order and device based on telecommunication service
CN104346172A (en) Irregular DIV dynamic layout method
CN109687454A (en) A kind of distributed energy cluster Optimal Scheduling, method and device
CN105376151A (en) ABtest platform shunting method and system
CN111415062A (en) Crowdsourcing task allocation method and device, electronic equipment and storage medium
CN109144690B (en) Task processing method and device
CN114239960A (en) Distribution network project group progress management method and system based on dynamic resource optimization
CN108921522A (en) A kind of method and apparatus that the cloud data sharing based on business subcontract automatically processes
CN108847120A (en) A kind of method for drafting based on the distribution of fence map order thermodynamic chart
CN105322571B (en) Electric power system dispatching method based on two benches mixed integer programming
CN105100117A (en) Method and device for accessing combined services
CN105843601A (en) Android system-based screen self-adaptive adaptation technology
CN103763302B (en) Web service combination generating method
CN113378069B (en) Main and distribution network automatic drawing method based on intelligent recommendation algorithm
CN109494803A (en) A kind of the material configuration method and device of photovoltaic system
CN107681666A (en) A kind of rural power grids allocated radio low-voltage comprehensive processing method and device
CN109710314B (en) A method of based on graph structure distributed parallel mode construction figure
JP2000331041A (en) Three-dimensional equipment management system
CN104572604B (en) Word subfield processing method and processing device
CN108416145B (en) Mathematical model modeling method based on data analysis operation processing
CN103530447B (en) Automatic model generation method based on Simulink

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant