CN115460173B - Virtual private cloud network subnet network address generation method and device - Google Patents

Virtual private cloud network subnet network address generation method and device Download PDF

Info

Publication number
CN115460173B
CN115460173B CN202210865705.4A CN202210865705A CN115460173B CN 115460173 B CN115460173 B CN 115460173B CN 202210865705 A CN202210865705 A CN 202210865705A CN 115460173 B CN115460173 B CN 115460173B
Authority
CN
China
Prior art keywords
network
subnet
virtual private
private cloud
length
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.)
Active
Application number
CN202210865705.4A
Other languages
Chinese (zh)
Other versions
CN115460173A (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.)
Inspur Communication Technology Co Ltd
Original Assignee
Inspur Communication Technology Co Ltd
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 Inspur Communication Technology Co Ltd filed Critical Inspur Communication Technology Co Ltd
Priority to CN202210865705.4A priority Critical patent/CN115460173B/en
Publication of CN115460173A publication Critical patent/CN115460173A/en
Application granted granted Critical
Publication of CN115460173B publication Critical patent/CN115460173B/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
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]

Landscapes

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

Abstract

The invention provides a method and a device for generating a virtual private cloud network subnet network address, comprising the following steps: generating a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network; the second length is not less than the first length. The invention greatly saves the time for creating the VPC sub-network by the user, ensures the accuracy of the sub-network address data, simplifies the creation flow of the VPC sub-network, improves the creation efficiency of the VPC sub-network and improves the user experience.

Description

Virtual private cloud network subnet network address generation method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for generating a network address of a virtual private cloud network subnet.
Background
Virtual private cloud (Virtual Private Cloud, VPC) networks establish a logically isolated piece of virtual network space for users over public cloud networks. The subnet is an internet protocol (Internet Protocol, IP) address block within the VPC, and may divide a network segment of the VPC network into several blocks, and the subnet division may help users to reasonably plan IP address resources.
However, in the prior art, in the process of selecting a VPC network and creating a VPC network subnet, a user needs to manually calculate a specific subnet network address, and because of complex calculation, the subnet creation process is complicated in operation and easy to make mistakes, so that the efficiency of creating the VPC subnet is low.
Disclosure of Invention
The invention provides a method and a device for generating a virtual private cloud network subnet network address, which are used for solving the defects that the subnet creation process in the prior art is complex in operation and easy to make mistakes, so that the efficiency of creating a VPC subnet is low.
The invention provides a virtual private cloud network subnet network address generation method, which comprises the following steps:
generating a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network;
the second length is not less than the first length.
According to the method for generating the subnet network addresses of the virtual private cloud network provided by the invention, based on the network address of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network and the second length of the network identification bit in the subnet mask of the virtual private cloud network, a plurality of subnet network addresses of the virtual private cloud network are generated, and the method comprises the following steps:
Determining a first target number and a first numerical step based on the first length and the second length, if it is determined that the first length is greater than a first threshold and less than or equal to a second threshold, and the second length is greater than the first threshold and less than or equal to the second threshold; the first target number is the number of network range segment values in a subnet network address of the virtual private cloud network;
determining a first data set of a network range segment in the subnet network address based on the value of the network range segment in the network address of the virtual private cloud network, the first target number and the first value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment, the value of the network bit segment, and the value of the host bit segment in the network address of the virtual private cloud network, and the first data set of the network range segment in the subnet network address;
the network address includes a network type segment, a network range segment, a network bit segment, and a host bit segment.
According to the method for generating the subnet network addresses of the virtual private cloud network provided by the invention, after generating a plurality of subnet network addresses of the virtual private cloud network, the method further comprises the following steps:
Receiving a first input from a user, the first input for selecting a target subnet network address from the plurality of subnet network addresses;
in response to the first input, creating a subnetwork of the virtual private cloud network based on the target subnetwork network address.
According to the method for generating the subnet network addresses of the virtual private cloud network provided by the invention, the generating of the subnet network addresses of the virtual private cloud network based on the network addresses of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises the following steps:
in the case that the first length is determined to be greater than the first threshold and less than or equal to the second threshold and the second length is determined to be greater than the second threshold and less than or equal to a third threshold, determining the first target number and a second numerical step based on the first length and the second threshold and determining a second target number and a third numerical step based on the second length; the second target number is the number of network bit segment values in the subnet network address;
Determining a second data set of network range segments in the subnet network address based on the values of the network range segments in the network address of the virtual private cloud network, the first target number and the second value step, and determining a first data set of network bit segments in the subnet network address based on the values of the network bit segments in the network address of the virtual private cloud network, the second target number and the third value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment and the value of the host bit segment in the network address of the virtual private cloud network, the second data set of the network range segment in the subnet network address, and the first data set of the network bit segment in the subnet network address.
According to the method for generating the subnet network addresses of the virtual private cloud network provided by the invention, the generating of the subnet network addresses of the virtual private cloud network based on the network addresses of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises the following steps:
Determining the second target number and a fourth numerical step based on the second threshold and the third threshold, if it is determined that the first length is greater than the first threshold and less than or equal to the second threshold, and the second length is greater than the third threshold and less than or equal to a fourth threshold; and determining a third target number and a fifth numerical step based on the second length; the third target number is the number of host bit segment values in the subnet network address;
determining a second data set of network bit segments in the subnet network address based on the value of the network bit segments in the network address of the virtual private cloud network, the second target number and the fourth value step, and determining a first data set of host bit segments in the subnet network address based on the value of the host bit segments in the network address of the virtual private cloud network, the third target number and the fifth value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on a value of a network type segment in a network address of the virtual private cloud network, a second data set of a network range segment in the subnet network address, a second data set of a network bit segment in the subnet network address, and a first data set of a host bit segment in the subnet network address.
According to the method for generating the subnet network addresses of the virtual private cloud network provided by the invention, the generating of the subnet network addresses of the virtual private cloud network based on the network addresses of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises the following steps:
determining the second target number and a sixth numerical step based on the first length and the second length, if it is determined that the first length is greater than the second threshold and less than or equal to a third threshold and the second length is greater than the second threshold and less than or equal to the third threshold;
determining a third data set of the network bit segment in the subnet network address based on the value of the network bit segment in the network address of the virtual private cloud network, the second target number and the sixth value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment, the value of the network range segment, and the value of the host bit segment in the network address of the virtual private cloud network, and the third data set of the network bit segment in the subnet network address.
According to the method for generating the subnet network addresses of the virtual private cloud network provided by the invention, the generating of the subnet network addresses of the virtual private cloud network based on the network addresses of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises the following steps:
determining the second target number and a seventh numerical step based on the first length and the third threshold, and determining the third target number and an eighth numerical step based on the second length, if the first length is determined to be greater than the second threshold and less than or equal to a third threshold and the second length is determined to be greater than the third threshold and less than or equal to the fourth threshold;
determining a fourth data set of network bit segments in the subnet network address based on the value of the network bit segments in the network address of the virtual private cloud network, the second target number and the seventh value step, and determining a second data set of host bit segments in the subnet network address based on the value of the host bit segments in the network address of the virtual private cloud network, the third target number and the eighth value step;
Generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment and the value of the network range segment in the network address of the virtual private cloud network, the fourth data set of the network bit segment in the subnet network address, and the second data set of the host bit segment in the subnet network address.
The invention also provides a device for generating the network address of the virtual private cloud network subnet, which comprises the following steps:
a generating module, configured to generate a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network;
the second length is not less than the first length.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes any one of the virtual private cloud network subnet network address generating methods when executing the program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a virtual private cloud network subnet network address generating method as any one of the above.
The invention also provides a computer program product comprising a computer program which when executed by a processor implements a method of generating a virtual private cloud network subnet network address according to any one of the above.
According to the virtual private cloud network subnet network address generation method and device, the VPC network, the mask of the VPC network and the subnet mask of the VPC network are selected by a user, so that the multiple subnet IP addresses of the VPC network can be generated according to the IP addresses of the VPC network, the length of the network identification bit in the mask of the VPC network and the length of the network identification bit in the subnet mask of the VPC network, the user can conveniently establish the VPC subnet by selecting the subnet IP addresses from the multiple subnet IP addresses, the time for establishing the VPC subnet by the user is greatly saved, the accuracy of the subnet website data is guaranteed, the establishment flow of the VPC subnet is simplified, the establishment efficiency of the VPC subnet is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a method for generating a network address of a virtual private cloud network subnet provided by the invention;
fig. 2 is a diagram of a virtual private cloud network subnet network address generating device provided by the present invention;
fig. 3 is a schematic diagram of an entity structure of an electronic device according to the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the invention, it should be noted that, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention can be understood by those of ordinary skill in the art according to the specific circumstances.
The method and apparatus for generating a virtual private cloud network subnet network address according to the present invention are described below with reference to fig. 1 to 3.
Fig. 1 is a flow chart of a method for generating a network address of a virtual private cloud network subnet, which is provided in the present invention, as shown in fig. 1, and includes:
step 110, generating a plurality of subnet network addresses of the virtual private cloud network based on the network address of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network, and the second length of the network identification bit in the subnet mask of the virtual private cloud network;
the second length is not less than the first length.
Specifically, the network address described in the embodiment of the present invention refers to an IP address, and may specifically be an IPv4 address.
It should be noted that, in the embodiment of the present invention, the mask is described by using a prefix expression method, that is, a "/" symbol and numbers from 8 to 24 are added to the IP address, where the numbers represent the length of the network identification bits in the mask. For example, an IP address field is 192.168.1.1/20, then the mask for that IP address field is "/20", which indicates that the length of the network identification bits in the mask is 20 bits.
The first length described in the embodiment of the present invention refers to the length of the network identification bit in the mask of the VPC network, and the unit is a bit.
The second length described in the embodiment of the present invention refers to the length of the network identification bit in the subnet mask of the VPC network, and the unit is a bit.
It should be noted that, in the embodiment of the present invention, when the first length ranges from 8 bits to 24 bits, it is recommended to use the network segment of the VPC network as "10.0.0.0"; when the first length ranges from 12 bits to 24 bits, it is recommended that the network segment using the VPC network is "172.16.0.0"; when the first length ranges from 16 bits to 24 bits, it is recommended that the network segment using the VPC network is "192.168.0.0".
In an embodiment of the present invention, after receiving an input from a user selecting a VPC network, the IP address of the VPC network and the first length of the network identification bit in the mask of the VPC network may be obtained. Likewise, upon receiving input from a user selecting a VPC network subnet mask, a second length of network identification bits in the subnet mask of the VPC network may be obtained.
It will be appreciated that an IPv4 address is divided by a 32-bit binary number into four digits, typically represented by 4 decimal numbers, each segment not exceeding 255 at maximum. The IP address consists of a network type, a network range, a network bit and a host bit, i.e. the IP address specifically comprises a network type segment, a network range segment, a network bit segment and a host bit segment 4-segment number. For example, the IP address is denoted as 192.168.1.1, and the values on the network type segment, the network range segment, the network bit segment, and the host bit segment in the IP address are 192, 168, 1, respectively.
The 1 st bit to 8 th bit in the 32 bit IP address is a network type segment; the 9 th bit to the 16 th bit are network range segments; the 17 th bit to the 24 th bit are network bit sections; bits 25 to 32 are the host bit segments.
Further, in an embodiment of the present invention, after obtaining the IP address of the VPC network, the first length of the network identification bit in the mask of the VPC network, and the second length of the network identification bit in the subnet mask of the VPC network, the optional values on each segment of the subnet IP address may be automatically calculated according to the IP address of the VPC network, the first length of the network identification bit in the mask of the VPC network, and the second length of the network identification bit in the subnet mask of the VPC network, so as to generate a plurality of subnet IP addresses of the VPC network, and the user may select the subnet IP address from the plurality of subnet IP addresses to create a subnet of the VPC network.
According to the virtual private cloud network subnet network address generation method, through selecting the VPC network, the mask of the VPC network and the subnet mask of the VPC network by a user, the length of the network identification bit in the mask of the VPC network and the length of the network identification bit in the subnet mask of the VPC network can be automatically calculated to generate a plurality of subnet IP addresses of the VPC network, so that the user can conveniently establish the VPC subnet by selecting the subnet IP addresses from the subnet IP addresses, the time for establishing the VPC subnet by the user is greatly saved, the accuracy of the subnet website data is ensured, the establishment flow of the VPC subnet is simplified, the establishment efficiency of the VPC subnet is improved, and the user experience is improved.
Based on the foregoing embodiments, as an optional embodiment, generating a plurality of subnet network addresses of the vpn based on the network address of the vpn, the first length of the network identification bit in the mask of the vpn, and the second length of the network identification bit in the subnet mask of the vpn, includes:
determining a first target number and a first numerical step based on the first length and the second length, if the first length is determined to be greater than the first threshold and less than or equal to the second threshold, and the second length is determined to be greater than the first threshold and less than or equal to the second threshold; the first target number is the number of network range segment values in a subnet network address of the virtual private cloud network;
determining a first data set of the network range segment in the subnet network address based on the value of the network range segment in the network address of the virtual private cloud network, the first target number and the first value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment, the value of the network bit segment, and the value of the host bit segment in the network address of the virtual private cloud network, and the first data set of the network range segment in the subnet network address;
The network address includes a network type segment, a network range segment, a network bit segment, and a host bit segment.
Specifically, the first threshold described in the embodiment of the present invention refers to the most significant bit in the network type segment in the IP address, that is, the first threshold may specifically take a value of 8.
The second threshold described in the embodiment of the present invention may be the highest bit in the network range segment in the IP address, that is, the second threshold may specifically be 16.
The first target number described in the embodiments of the present invention refers to the number of network range segment values in the subnet IP address of the VPC network. In the case where it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the first threshold and equal to or less than the second threshold, the first target number may be determined according to the first length and the second length.
The first numerical step described in the embodiments of the present invention refers to a numerical step calculated based on the second length when it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the first threshold and equal to or less than the second threshold. Which is used to calculate the value of the network range segment in the subnet IP address.
It should be noted that, in the embodiment of the present invention, the specific calculation formula of the numerical step is λ=2 (8-(n%8==08:n%8)) N represents a numerical parameter, which is a positive integer, which may be a second length or a second threshold. Wherein the formula term "n% 8= 08:n%8" represents: if n is divided by 8, the formula term takes the value of 8; if n is not divisible by 8, the equation term takes the remainder of n divided by 8.
Further, in the embodiment of the present invention, the first threshold may be 8, and the second threshold may be 16, which indicates that the values of the network identifier bit length in the mask of the VPC network and the network identifier bit length in the subnet mask thereof are both on the network range segment when the first length is greater than 8 and less than or equal to 16 and the second length is greater than 8 and less than or equal to 16, and only the value of the network range segment in the subnet IP address needs to be calculated, then the first target number and the first value step may be calculated based on the first length and the second length.
In the embodiment of the invention, assuming that the IP address of the VPC network is 10.0.0.1, the first length is 9 bits, the second length is 15 bits, the first target number N 1 =2 15-9 =64, first value step λ 1 =2 (8-(15%8==08:15%8)) =2。
Further, a first data set of network range segments in the sub-network IP address is determined based on the value of the network range segments in the IP address of the VPC network, the first target number and the first value step. Specifically, the IP address of the VPC network is 10.0.0.1, then it The value of the network range segment is 0. Further, according to the calculated first target number 64 and the calculated first value step length 2, a first data set A of the network range segment in the subnet network address can be calculated 1 ={0,2,4,6,…,126}。
Further, a plurality of subnet network addresses for the VPC are generated based on the value of the network type segment, the value of the network bit segment, and the value of the host bit segment in the IP address of the VPC network, and the first data set of the network range segment in the subnet IP address. That is, when the IP address of the VPC network is 10.0.0.1, the value of the network type segment, the value of the network bit segment, and the value of the host bit segment in the IP address of the VPC network are 10, 0, and 1, respectively; first data set A of network range segment in subnet network address 1 = {0,2,4,6, …,126}, an IP address set consisting of a plurality of subnet IP addresses of the VPC network may be obtained, which may be denoted as 10.A 1 0.1, {10.0.0.1,10.2.0.1,10.4.0.1, …,10.126.0.1}, which contains 64 subnet IP addresses, i.e., 64 subnet IP addresses can be generated.
According to the method, when the values of the network identification bit length in the mask of the VPC network and the network identification bit length in the subnet mask are both in the network range section, the values of the network range section in the subnet IP address are calculated, so that a plurality of subnet IP addresses of the VPC network can be quickly and automatically generated for selection by a user, the time for creating the VPC subnet by the user can be saved, and the creation efficiency of the VPC subnet is improved.
Based on the foregoing embodiment, as an optional embodiment, after generating the plurality of subnet network addresses of the virtual private cloud network, the method further includes:
receiving a first input from a user, the first input for selecting a target subnet network address from a plurality of subnet network addresses;
in response to the first input, a subnetwork of the virtual private cloud network is created based on the target subnetwork network address.
Specifically, the target subnet network address described in the embodiment of the present invention refers to a subnet IP address selected by a user from a plurality of subnet IP addresses for creating a VPC subnet.
In an embodiment of the present invention, the first input by the user may be represented as at least one of:
first, it may be presented as touch input, including but not limited to editing operations such as click input, slide input, and press input. In this embodiment, receiving the first input by the user may be in the form of receiving input by the user in the electronic device display selecting a target subnet network address from a plurality of subnet network addresses.
And secondly, the method can be expressed as physical key input.
In this embodiment, an external expansion device, such as a mouse, may be used to receive the input from the user, where receiving the first input from the user may be represented by the terminal receiving the input from the user pressing the physical key corresponding to the external expansion device.
Of course, in other embodiments, the input of the user may also take other forms, which may be specifically determined according to actual needs, and the embodiment of the present invention is not limited thereto.
Further, in an embodiment of the present invention, by receiving a first input from a user, a target subnet network address selected by the user from a plurality of subnet network addresses may be acquired in response to the first input, so that a subnet of the VPC network may be automatically created according to the target subnet network address.
After generating a plurality of subnet IP addresses of the VPC network, the user can conveniently select the required subnet IP address from the plurality of subnet IP addresses and create the VPC subnet, so that the flow of creating the VPC network subnet is simplified and the user experience is improved.
Based on the foregoing embodiment, as an alternative embodiment, generating a plurality of subnet network addresses of the VPC network based on the network address of the VPC network, the first length of the network identification bit in the mask of the VPC network, and the second length of the network identification bit in the subnet mask of the VPC network includes:
determining a first target number and a second numerical step based on the first length and the second threshold value, and determining a second target number and a third numerical step based on the second length, when the first length is determined to be greater than the first threshold value and less than or equal to the second threshold value and the second length is determined to be greater than the second threshold value and less than or equal to the third threshold value; the second target number is the number of network bit segment values in the subnet network address;
Determining a second data set of the network range segment in the subnet network address based on the value of the network range segment in the network address of the VPC network, the first target number and the second value step, and determining a first data set of the network bit segment in the subnet network address based on the value of the network bit segment in the network address of the VPC network, the second target number and the third value step;
generating a plurality of subnet network addresses of the VPC network based on the value of the network type segment and the value of the host bit segment in the network address of the VPC network, the second data set of the network range segment in the subnet network address, and the first data set of the network bit segment in the subnet network address.
Specifically, the third threshold described in the embodiment of the present invention refers to the most significant bit in the network bit segment in the IP address, that is, the third threshold may specifically take on a value of 24.
In an embodiment of the present invention, in a case where it is determined that the first length is greater than the first threshold value and equal to or less than the second threshold value, and the second length is greater than the second threshold value and equal to or less than the third threshold value, the first target number may be determined according to the first length and the second threshold value.
The second numerical step described in the embodiments of the present invention refers to a numerical step calculated based on a second threshold when it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the second threshold and equal to or less than the third threshold. Which is used to calculate the value of the network range segment in the subnet IP address.
In an embodiment of the present invention, the second target number refers to the number of network bit segment values in the subnet IP address. In the case where it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the second threshold and equal to or less than the third threshold, the second target number may be determined according to the second length.
The third numerical step described in the embodiments of the present invention refers to a numerical step calculated based on the second length when it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the second threshold and equal to or less than the third threshold. Which is used to calculate the value of the network bit segment in the subnet IP address.
Further, in the embodiment of the present invention, the first threshold may be 8, the second threshold may be 16, and the third threshold may be 24, so when it is determined that the first length is greater than 8 and less than or equal to 16, and the second length is greater than 16 and less than or equal to 24, it is indicated that the values of the network identification bit length in the mask of the VPC network and the network identification bit length in the subnet mask thereof are on different segments of the IP address, and at this time, the value of the network range segment and the value of the network bit segment in the subnet IP address need to be calculated, then the first target number and the second value step may be determined based on the first length and the second threshold, and the second target number and the third value step may be determined based on the second length.
In the embodiment of the invention, assuming that the IP address of the VPC network is 10.0.0.1, the first length is 9 bits, the second length is 17 bits, the first target number N 1 =2 16-9 =128, second value step λ 2 =2 (8-(16%8==08:16%8)) =1; calculating a second target number N based on the second length 2 =2 17%8 =2, third value step λ 3 =2 (8-(17%8==08:17%8)) =128。
Further, a second data set of network range segments in the subnet network address is determined based on the value of the network range segment in the IP address of the VPC network, the first target number and the second value step, and a first data set of network bit segments in the subnet network address is determined based on the value of the network bit segment in the network address of the VPC network, the second target number and the third value step. Specifically, the IP address of the VPC network is 10.0.0.1, and the value of the network range segment is 0, and the value of the network bit segment is 0. Further, according to the calculated first target number being 128 and the second value step being 1, the second data set of the network range segment in the subnet IP address can be calculatedA 2 = {0,1,2,3, …,127,128}; from the calculated second target number of 2 and the calculated third value step of 128, the first data set B of the network bit segment in the subnet IP address can be calculated 1 ={0,128}。
Further, a plurality of subnet IP addresses for the VPC network may be generated based on the value of the network type segment and the value of the host bit segment in the IP address of the VPC network, the second data set of the network range segment in the subnet network address, and the first data set of the network bit segment in the subnet network address. That is, when the IP address of the VPC network is 10.0.0.1, the values of the network type segment and the host bit segment in the IP address of the VPC network are 10 and 1, respectively, then the second data set a of the network range segment in the subnet IP address 2 First data set B of network bit segment in subnet IP address = {0,1,2,3, …,127,128} 1 = {0,128}, then an IP address set consisting of a plurality of subnet IP addresses of the VPC network can be obtained, which can be denoted as 10.A 2 .B 1 1, i.e., {10.0.0.1,10.1.0.1,10.2.0.1, …,10.128.0.1,10.0.128.1,10.1.128.1, …,10.128.128.1}, contains 256 subnet IP addresses, i.e., 256 subnet IP addresses are generated.
According to the method, when the value of the network identification bit length in the mask of the VPC network is in the IP address network range section and the value of the network identification bit length in the subnet mask is in the IP address network bit section, a plurality of subnet IP addresses of the VPC network can be quickly and automatically generated for selection by a user by calculating the values of the network range section and the network bit section in the subnet IP address, so that the time for creating the VPC subnet by the user can be saved, and the creation efficiency of the VPC subnet can be improved.
Based on the foregoing embodiment, as an alternative embodiment, generating a plurality of subnet network addresses of the VPC network based on the network address of the VPC network, the first length of the network identification bit in the mask of the VPC network, and the second length of the network identification bit in the subnet mask of the VPC network includes:
Determining a second target number and a fourth numerical step based on the second threshold and the third threshold, if it is determined that the first length is greater than the first threshold and less than or equal to the second threshold, and the second length is greater than the third threshold and less than or equal to the fourth threshold; determining a third target number and a fifth numerical step based on the second length; the third target number is the number of host bit segment values in the subnet network address;
determining a second data set of the network bit segment in the subnet network address based on the value of the network bit segment in the network address of the VPC network, the second target number and the fourth value step, and determining a first data set of the host bit segment in the subnet network address based on the value of the host bit segment in the network address of the VPC network, the third target number and the fifth value step;
generating a plurality of subnet network addresses for the VPC network based on the value of the network type segment in the network address of the VPC network, the second data set of the network range segment in the subnet network address, the second data set of the network bit segment in the subnet network address, and the first data set of the host bit segment in the subnet network address.
Specifically, the fourth threshold described in the embodiments of the present invention refers to a segment bit in the host bit segment in the IP address, which may specifically take on a value of 29.
In an embodiment of the present invention, in a case where it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the third threshold and equal to or less than the fourth threshold, the second target number may be determined according to the second threshold and the third threshold.
The fourth numerical step described in the embodiments of the present invention refers to a numerical step calculated based on the third threshold when it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the third threshold and equal to or less than the fourth threshold. Which is used to calculate the value of the network bit segment in the subnet IP address.
The fifth numerical step described in the embodiments of the present invention refers to a numerical step calculated based on the second length in the case where it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the third threshold and equal to or less than the fourth threshold. Which is used to calculate the value of the host bit segment in the subnet IP address.
In an embodiment of the present invention, the third target number refers to the number of host bit segment values in the subnet IP address. In the case where it is determined that the first length is greater than the first threshold and equal to or less than the second threshold, and the second length is greater than the third threshold and equal to or less than the fourth threshold, the third target number may be determined according to the second length.
Further, in an embodiment of the present invention, the first threshold may be 8, the second threshold may be 16, the third threshold may be 24, and the fourth threshold may be 29, and in a case where it is determined that the first length is greater than 8 and equal to or less than 16, and the second length is greater than 24 and equal to or less than 29, the second target number and the fourth numerical step are determined based on the second threshold and the third threshold; and determining a third target number and a fifth numerical step based on the second length.
In the embodiment of the invention, assuming that the IP address of the VPC network is 10.0.0.1, the first length is 9 bits, and the second length is 25 bits, the second target number N is calculated according to the second threshold and the third threshold 2 =2 24-16 =256, fourth value step λ 4 =2 (8-(24%8==08:24%8)) =1; meanwhile, according to the second length, a third target number N may be calculated 3 =2 25%8 =2, fifth numerical step λ 5 =2 (8-(25%8==08:25%8)) =128。
Further, a second data set of network bits in the subnet IP address is determined based on the value of the network bits in the IP address of the VPC network, the second target number and the fourth value step, and a first data set of host bits in the subnet IP address is determined based on the value of the host bits in the IP address of the VPC network, the third target number and the fifth value step. That is, when the IP address of the VPC network is 10.0.0.1, the values of the network bit segment and the host bit segment in the IP address of the VPC network are 0 and 1, respectively, then the second data set B of the network bit segment in the subnet IP address 2 First data set C of host bit segment in subnet IP address = {0,1,2,3, …,254,255} 1 ={1,129}。
Further, in an embodiment of the present invention, the values, sub-values of the network type segments in the IP address of the VPC network are based onSecond data set A of network range segment in network IP address 2 Second data set B of network bit segments in subnet IP address 2 And a first data set C of host bit segments in a subnet network address 1 An IP address set consisting of a plurality of subnet IP addresses of the VPC network is obtained, which can be denoted as 10.A 2 .B 2 .C 1 I.e., {10.0.0.1,10.1.0.1,10.2.0.1, …,10.128.255.129}, which contains 65536 subnet IP addresses, i.e., 65536 subnet IP addresses are generated.
According to the method, when the value of the network identification bit length in the mask of the VPC network is in the IP address network range section and the value of the network identification bit length in the subnet mask is in the IP address host section, a plurality of subnet IP addresses of the VPC network can be quickly and automatically generated for selection by a user by calculating the values of the network range section, the network bit section and the host bit section in the subnet IP address, so that the time for creating the VPC subnet by the user can be effectively saved, and the creation efficiency of the VPC subnet can be improved.
Based on the foregoing embodiment, as an alternative embodiment, generating a plurality of subnet network addresses of the VPC network based on the network address of the VPC network, the first length of the network identification bit in the mask of the VPC network, and the second length of the network identification bit in the subnet mask of the VPC network includes:
Determining a second target number and a sixth numerical step based on the first length and the second length, if the first length is determined to be greater than the second threshold and less than or equal to the third threshold, and the second length is determined to be greater than the second threshold and less than or equal to the third threshold;
determining a third data set of the network bit segment in the subnet network address based on the value of the network bit segment in the network address of the VPC network, the second target number and the sixth value step;
a plurality of subnet network addresses for the VPC network are generated based on the values of the network type segment, the values of the network range segment, and the values of the host bit segment in the network address of the VPC network, and the third data set of the network bit segment in the subnet network address.
Specifically, in the embodiment of the present invention, in the case where it is determined that the first length is greater than the second threshold and equal to or less than the third threshold, and the second length is greater than the second threshold and equal to or less than the third threshold, the second target number may be determined according to the first length and the third threshold, and the third target number may be determined according to the first length and the second length.
The sixth numerical step described in the embodiments of the present invention refers to a numerical step calculated based on the second length in the case where it is determined that the first length is greater than the second threshold and equal to or less than the third threshold, and the second length is greater than the second threshold and equal to or less than the third threshold. Which is used to calculate the value of the network bit segment in the subnet IP address.
Further, in an embodiment of the present invention, the second threshold may be 16, the third threshold may be 24, and in a case where it is determined that the first length is greater than 16 and equal to or less than 24, and the second length is greater than 16 and equal to or less than 24, the second target number and the sixth numerical step are determined based on the first length and the second length.
In the embodiment of the invention, assuming that the IP address of the VPC network is 10.0.0.1, the first length is 17 bits, and the second length is 20 bits, the second target number N is calculated according to the first length and the second length 2 =2 20-17 =8, sixth numerical step λ 6 =2 (8-(20%8==08:20%8)) =16。
Further, in an embodiment of the invention, a third data set of network bit segments in the subnet IP address is calculated based on the value of the network bit segment in the IP address of the VPC network, the second target number and the sixth numerical step. That is, when the IP address of the VPC network is 10.0.0.1, the third data set B of the network bit segment in the subnet IP address 3 ={0,16,32,…,96,112}。
Further, in an embodiment of the present invention, the third data set B is based on the values of the network type segment, the network range segment and the host bit segment in the IP address of the VPC network, and the network bit segment in the subnet IP address 3 An IP address set consisting of a plurality of subnet IP addresses of the VPC network is obtained, which can be denoted as 10.0.B 3 1, i.e. {10.0.0.1,10.0.16.1,10.0.32.1, … ]10.0.96.1,10.0.112.1, which contains 8 subnet IP addresses, i.e., 8 subnet IP addresses can be generated.
According to the method provided by the embodiment of the invention, when the values of the network identification bit length in the mask of the VPC network and the network identification bit length in the subnet mask are both in the IP address network bit section, a plurality of subnet IP addresses of the VPC network can be quickly and automatically generated by calculating the values of the network bit sections in the subnet IP addresses for selection by a user, so that the time for creating the VPC subnet by the user can be effectively saved, and the creation efficiency of the VPC subnet can be improved.
Based on the foregoing embodiment, as an alternative embodiment, generating a plurality of subnet network addresses of the VPC network based on the network address of the VPC network, the first length of the network identification bit in the mask of the VPC network, and the second length of the network identification bit in the subnet mask of the VPC network includes:
determining a second target number and a seventh numerical step based on the first length and the third threshold value, and determining a third target number and an eighth numerical step based on the second length, when the first length is determined to be greater than the second threshold value and less than or equal to the third threshold value and the second length is determined to be greater than the third threshold value and less than or equal to the fourth threshold value;
Determining a fourth data set of the network bit segment in the subnet network address based on the value of the network bit segment in the network address of the VPC network, the second target number and the seventh value step, and determining a second data set of the host bit segment in the subnet network address based on the value of the host bit segment in the network address of the VPC network, the third target number and the eighth value step;
generating a plurality of subnet network addresses for the VPC network based on the value of the network type segment and the value of the network range segment in the network address of the VPC network, the fourth data set of the network bit segment in the subnet network address, and the second data set of the host bit segment in the subnet network address.
Specifically, in the embodiment of the present invention, in the case where it is determined that the first length is greater than the second threshold and equal to or less than the third threshold, and the second length is greater than the third threshold and equal to or less than the fourth threshold, the second target number may be determined according to the first length and the third threshold, and the third target number may be determined according to the second length.
The seventh numerical step described in the embodiments of the present invention refers to a numerical step calculated based on the third threshold when it is determined that the first length is greater than the second threshold and equal to or less than the third threshold, and the second length is greater than the third threshold and equal to or less than the fourth threshold. Which is used to calculate the value of the network bit segment in the subnet IP address.
The eighth numerical step described in the embodiments of the present invention refers to a numerical step calculated based on the second length in the case where it is determined that the first length is greater than the second threshold and equal to or less than the third threshold, and the second length is greater than the third threshold and equal to or less than the fourth threshold. Which is used to calculate the value of the host bit segment in the subnet IP address.
Further, in an embodiment of the present invention, the second threshold may be 16, the third threshold may be 24, and the fourth threshold may be 29, and if it is determined that the first length is greater than 16 and equal to or less than 24 and the second length is greater than 24 and equal to or less than 29, the second target number and the seventh numerical step are determined based on the first length and the third threshold, and the third target number and the eighth numerical step are determined based on the second length.
In the embodiment of the invention, assuming that the IP address of the VPC network is 10.0.0.1, the first length is 17 bits, and the second length is 25 bits, the second target number N is calculated according to the first length and the third threshold value 2 =2 24-17 =128, seventh numerical step λ 7 =2 (8-(24%8==08:24%8)) =1; and according to the second length, calculating a third target number N 3 =2 25%8 =2, eighth value step λ 7 =2 (8-(25%8==08:25%8)) =128。
Further, in an embodiment of the present invention, a fourth dataset of network bit segments in the IP address of the subnet is determined based on the value of the network bit segment in the IP address of the VPC network, the second target number and the seventh value step, and a host bit segment in the IP address of the subnet is determined based on the value of the host bit segment in the IP address of the VPC network, the third target number and the eighth value step Is included in the first data set. That is, the fourth data set B of the network bit segment in the subnet IP address when the IP address of the VPC network is 10.0.0.1 4 = {0,1,2,3, …,127}, second data set C of host bit segment in subnet IP address 2 ={1,129}。
Further, in an embodiment of the present invention, the fourth data set B of the network bit segment in the subnet IP address is based on the value of the network type segment and the value of the network range segment in the IP address of the VPC network 4 And a second data set C of host bit segments in the subnet IP address 2 An IP address set consisting of a plurality of subnet IP addresses of the VPC network is obtained, which can be denoted as 10.0.B 4 .C 2 I.e., {10.0.0.1,10.0.1.1,10.0.2.1, …,10.0.127.129}, which contains 256 subnet IP addresses, i.e., 256 subnet IP addresses are generated.
According to the method, when the value of the network identification bit length in the mask of the VPC network is in the IP address network bit section and the value of the network identification bit length in the subnet mask is in the IP address host bit section, a plurality of subnet IP addresses of the VPC network can be quickly and automatically generated for selection by a user by calculating the values of the network bit section and the host bit section in the subnet IP address, so that the time for creating the VPC subnet by the user can be effectively saved, and the creation efficiency of the VPC subnet can be improved.
The device for generating the virtual private cloud network subnet network address provided by the invention is described below, and the device for generating the virtual private cloud network subnet network address described below and the method for generating the virtual private cloud network subnet network address described above can be correspondingly referred to each other.
Fig. 2 is a network address generation device of a virtual private cloud network subnet provided by the present invention, as shown in fig. 2, including:
a generating module 210, configured to generate a plurality of subnet network addresses of the vpn based on a network address of the vpn, a first length of a network identification bit in a mask of the vpn, and a second length of a network identification bit in a subnet mask of the vpn;
the second length is not less than the first length.
The device for generating the virtual private cloud network subnet network address in the embodiment may be used to execute the embodiment of the method for generating the virtual private cloud network subnet network address, and the principle and the technical effect are similar, and are not repeated here.
According to the virtual private cloud network subnet network address generating device, the VPC network, the mask of the VPC network and the subnet mask of the VPC network are selected by a user, so that the length of the network identification bit in the mask of the VPC network and the length of the network identification bit in the subnet mask of the VPC network can be automatically calculated, a plurality of subnet IP addresses of the VPC network are generated, the user can conveniently establish the VPC subnet by only selecting the subnet IP address from the subnet IP addresses, the time for establishing the VPC subnet by the user is greatly saved, the accuracy of the subnet website data is ensured, and the VPC subnet is simplified.
Fig. 3 is a schematic physical structure of an electronic device according to the present invention, and as shown in fig. 3, the electronic device may include: processor 310, communication interface (Communications Interface) 320, memory 330 and communication bus 340, wherein processor 310, communication interface 320, memory 330 accomplish communication with each other through communication bus 340. The processor 310 may invoke logic instructions in the memory 330 to perform the virtual private cloud network subnet network address generation method provided by the methods described above, the method comprising: generating a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network; the second length is not less than the first length.
Further, the logic instructions in the memory 330 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute a method for generating a virtual private cloud network subnet network address provided by the above methods, and the method includes: generating a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network; the second length is not less than the first length.
In yet another aspect, the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, is implemented to perform the method for generating a virtual private cloud network subnet network address provided by the above methods, the method comprising: generating a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network; the second length is not less than the first length.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. The virtual private cloud network subnet network address generation method is characterized by comprising the following steps of:
generating a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network;
the second length is not less than the first length;
wherein generating a plurality of subnet network addresses of the virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network, comprises:
Determining a first target number and a first numerical step based on the first length and the second length, if it is determined that the first length is greater than a first threshold and less than or equal to a second threshold, and the second length is greater than the first threshold and less than or equal to the second threshold; the first target number is the number of network range segment values in a subnet network address of the virtual private cloud network;
determining a first data set of a network range segment in the subnet network address based on the value of the network range segment in the network address of the virtual private cloud network, the first target number and the first value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment, the value of the network bit segment, and the value of the host bit segment in the network address of the virtual private cloud network, and the first data set of the network range segment in the subnet network address;
the network address includes a network type segment, a network range segment, a network bit segment, and a host bit segment.
2. The method for generating a subnet network address of a virtual private cloud network according to claim 1, further comprising, after generating a plurality of subnet network addresses of the virtual private cloud network:
Receiving a first input from a user, the first input for selecting a target subnet network address from the plurality of subnet network addresses;
in response to the first input, creating a subnetwork of the virtual private cloud network based on the target subnetwork network address.
3. The method for generating a subnet network address of a virtual private cloud network according to claim 1, wherein generating the plurality of subnet network addresses of the virtual private cloud network based on the network address of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network, and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises:
in the case that the first length is determined to be greater than the first threshold and less than or equal to the second threshold and the second length is determined to be greater than the second threshold and less than or equal to a third threshold, determining the first target number and a second numerical step based on the first length and the second threshold and determining a second target number and a third numerical step based on the second length; the second target number is the number of network bit segment values in the subnet network address;
Determining a second data set of network range segments in the subnet network address based on the values of the network range segments in the network address of the virtual private cloud network, the first target number and the second value step, and determining a first data set of network bit segments in the subnet network address based on the values of the network bit segments in the network address of the virtual private cloud network, the second target number and the third value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment and the value of the host bit segment in the network address of the virtual private cloud network, the second data set of the network range segment in the subnet network address, and the first data set of the network bit segment in the subnet network address.
4. The method for generating a subnet network address of a virtual private cloud network according to claim 3, wherein generating the plurality of subnet network addresses of the virtual private cloud network based on the network address of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network, and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises:
Determining the second target number and a fourth numerical step based on the second threshold and the third threshold, if it is determined that the first length is greater than the first threshold and less than or equal to the second threshold, and the second length is greater than the third threshold and less than or equal to a fourth threshold; and determining a third target number and a fifth numerical step based on the second length; the third target number is the number of host bit segment values in the subnet network address;
determining a second data set of network bit segments in the subnet network address based on the value of the network bit segments in the network address of the virtual private cloud network, the second target number and the fourth value step, and determining a first data set of host bit segments in the subnet network address based on the value of the host bit segments in the network address of the virtual private cloud network, the third target number and the fifth value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on a value of a network type segment in a network address of the virtual private cloud network, a second data set of a network range segment in the subnet network address, a second data set of a network bit segment in the subnet network address, and a first data set of a host bit segment in the subnet network address.
5. The method for generating a subnet network address of a virtual private cloud network according to claim 3, wherein generating the plurality of subnet network addresses of the virtual private cloud network based on the network address of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network, and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises:
determining the second target number and a sixth numerical step based on the first length and the second length, if it is determined that the first length is greater than the second threshold and less than or equal to a third threshold and the second length is greater than the second threshold and less than or equal to the third threshold;
determining a third data set of the network bit segment in the subnet network address based on the value of the network bit segment in the network address of the virtual private cloud network, the second target number and the sixth value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment, the value of the network range segment, and the value of the host bit segment in the network address of the virtual private cloud network, and the third data set of the network bit segment in the subnet network address.
6. The method for generating a subnet network address of a virtual private cloud network according to claim 4, wherein generating the plurality of subnet network addresses of the virtual private cloud network based on the network address of the virtual private cloud network, the first length of the network identification bit in the mask of the virtual private cloud network, and the second length of the network identification bit in the subnet mask of the virtual private cloud network comprises:
determining the second target number and a seventh numerical step based on the first length and the third threshold, and determining the third target number and an eighth numerical step based on the second length, if the first length is determined to be greater than the second threshold and less than or equal to a third threshold and the second length is determined to be greater than the third threshold and less than or equal to the fourth threshold;
determining a fourth data set of network bit segments in the subnet network address based on the value of the network bit segments in the network address of the virtual private cloud network, the second target number and the seventh value step, and determining a second data set of host bit segments in the subnet network address based on the value of the host bit segments in the network address of the virtual private cloud network, the third target number and the eighth value step;
Generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment and the value of the network range segment in the network address of the virtual private cloud network, the fourth data set of the network bit segment in the subnet network address, and the second data set of the host bit segment in the subnet network address.
7. A virtual private cloud network subnet network address generating device, comprising:
a generating module, configured to generate a plurality of subnet network addresses of a virtual private cloud network based on a network address of the virtual private cloud network, a first length of a network identification bit in a mask of the virtual private cloud network, and a second length of a network identification bit in a subnet mask of the virtual private cloud network;
the second length is not less than the first length;
the generating module is specifically configured to:
determining a first target number and a first numerical step based on the first length and the second length, if it is determined that the first length is greater than a first threshold and less than or equal to a second threshold, and the second length is greater than the first threshold and less than or equal to the second threshold; the first target number is the number of network range segment values in a subnet network address of the virtual private cloud network;
Determining a first data set of a network range segment in the subnet network address based on the value of the network range segment in the network address of the virtual private cloud network, the first target number and the first value step;
generating a plurality of subnet network addresses of the virtual private cloud network based on the value of the network type segment, the value of the network bit segment, and the value of the host bit segment in the network address of the virtual private cloud network, and the first data set of the network range segment in the subnet network address;
the network address includes a network type segment, a network range segment, a network bit segment, and a host bit segment.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the virtual private cloud network subnet network address generation method of any one of claims 1 to 6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the virtual private cloud network subnet network address generation method of any of claims 1 to 6.
CN202210865705.4A 2022-07-21 2022-07-21 Virtual private cloud network subnet network address generation method and device Active CN115460173B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210865705.4A CN115460173B (en) 2022-07-21 2022-07-21 Virtual private cloud network subnet network address generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210865705.4A CN115460173B (en) 2022-07-21 2022-07-21 Virtual private cloud network subnet network address generation method and device

Publications (2)

Publication Number Publication Date
CN115460173A CN115460173A (en) 2022-12-09
CN115460173B true CN115460173B (en) 2023-09-26

Family

ID=84295948

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210865705.4A Active CN115460173B (en) 2022-07-21 2022-07-21 Virtual private cloud network subnet network address generation method and device

Country Status (1)

Country Link
CN (1) CN115460173B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110913037A (en) * 2019-12-04 2020-03-24 杭州东方通信软件技术有限公司 C-type address allocation method based on binary tree
CN114363167A (en) * 2021-12-20 2022-04-15 北京百度网讯科技有限公司 Network segment information processing method, device, electronic equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2841715A1 (en) * 2002-06-28 2004-01-02 Thomson Licensing Sa METHOD OF GENERATING ADDRESS IN A DEVICE CONNECTED TO A NETWORK AND A DEVICE HAVING SUCH A METHOD

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110913037A (en) * 2019-12-04 2020-03-24 杭州东方通信软件技术有限公司 C-type address allocation method based on binary tree
CN114363167A (en) * 2021-12-20 2022-04-15 北京百度网讯科技有限公司 Network segment information processing method, device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
IP Address Space Management using Aggregated Fixed Length Subnet Masking;M.R. Sabir;《2007 International Conference on Electrical Engineering》;全文 *
划分子网的方法及相关计算;张越;;科技传播(15);全文 *

Also Published As

Publication number Publication date
CN115460173A (en) 2022-12-09

Similar Documents

Publication Publication Date Title
CN109218467B (en) Network address conversion method and chip
CN110689084B (en) Abnormal user identification method and device
EP3179382A1 (en) Two-dimensional filter generation method, query method and device
CN108875006B (en) Method and device for determining IP address region
CN111553670A (en) Transaction processing method and device and computer readable storage medium
CN115460173B (en) Virtual private cloud network subnet network address generation method and device
CN103117864B (en) The method of a kind of subnet merging and device
CN114363167B (en) Network segment information processing method and device, electronic equipment and storage medium
CN110334103B (en) Recommendation service updating method, providing device, access device and recommendation system
WO2021218984A1 (en) Data routing method and related apparatus
CN116962438B (en) Gradient data synchronization method, system, electronic equipment and readable storage medium
CN103957211B (en) Data communications method and device between client and front end page
CN113824813A (en) IPv6 subnet range obtaining method and query system
CN110266834B (en) Area searching method and device based on internet protocol address
CN112235134B (en) Router ownership detection method and system based on IP connection probability classification
CN115270176A (en) Radix estimation method, system, computing device and computer storage medium
CN110502611B (en) Character string retrieval method and device
CN112187743A (en) Network policy matching method and system based on IP address longest prefix
CN112417326A (en) URL conversion method and device, electronic equipment and storage medium
CN116301721B (en) Random number generation method and device, electronic equipment and medium
CN117014318B (en) Method, device, equipment and medium for adding links between multi-scale network nodes
CN113873055B (en) Method, device, system and medium for automatically generating network numbers and aggregating addresses
CN112637379B (en) mac address hash operation method, device, equipment and storage medium
WO2019017806A1 (en) An apparatus and method for identifying haplotypes
CN112579566B (en) Distributed ID generation method and device

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