CN113612864A - Method, system, equipment and medium for generating IPv6 address - Google Patents

Method, system, equipment and medium for generating IPv6 address Download PDF

Info

Publication number
CN113612864A
CN113612864A CN202110807972.1A CN202110807972A CN113612864A CN 113612864 A CN113612864 A CN 113612864A CN 202110807972 A CN202110807972 A CN 202110807972A CN 113612864 A CN113612864 A CN 113612864A
Authority
CN
China
Prior art keywords
ipv6 address
random number
timestamp
generating
issued
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
CN202110807972.1A
Other languages
Chinese (zh)
Other versions
CN113612864B (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.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data 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 Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202110807972.1A priority Critical patent/CN113612864B/en
Publication of CN113612864A publication Critical patent/CN113612864A/en
Application granted granted Critical
Publication of CN113612864B publication Critical patent/CN113612864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/5046Resolving address allocation conflicts; Testing of addresses
    • 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/5092Address allocation by self-assignment, e.g. picking addresses at random and testing if they are already in use
    • 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/618Details of network addresses
    • H04L2101/659Internet protocol version 6 [IPv6] addresses

Landscapes

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

Abstract

The invention discloses a method, a system, equipment and a storage medium for generating an IPv6 address, wherein the method comprises the following steps: acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp; carrying out format conversion on the random number, and carrying out AND operation on the converted random number and an IP mask to generate an IPv6 address; judging whether the IPv6 address conflicts with the issued IPv6 address or not; and responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address. The invention generates the random number through the timestamp, generates the IPv6 address according to the random number, can quickly generate the effective IPv6 address, reduces the IPAM addressing time, has simple and easy use and simplifies the algorithm complexity because the time sequence type random number algorithm depends on the computer timestamp.

Description

Method, system, equipment and medium for generating IPv6 address
Technical Field
The present invention relates to the internet field, and more particularly, to a method, a system, a computer device, and a readable medium for generating an IPv6 address.
Background
In the era of cloud computing which 5G is great, IPv4 address resources are limited, so that the requirements of various services and devices cannot be met, and therefore IPv6 is produced at present. IPv6 is an abbreviation of "Internet Protocol Version 6 (Internet Protocol Version 6)" in english, and is a next-generation IP Protocol designed by the Internet Engineering Task Force (IETF) to replace IPv4, and the number of addresses can be called as one address for each sand grain worldwide. The biggest problem of the IPv4 is that the network address resource is insufficient, and the application and the development of the Internet are severely restricted. The use of the IPv6 not only solves the problem of the number of network address resources, but also solves the obstacle of connecting various access devices to the Internet. However, current IPAM (IP Address Management) mainly manages IPv4 addresses, and has insufficient capability of managing IPv6 addresses.
Disclosure of Invention
In view of this, an object of the embodiments of the present invention is to provide a method, a system, a computer device, and a computer readable storage medium for generating an IPv6 address, where the present invention generates a random number through a timestamp, and generates an IPv6 address according to the random number, so that an effective IPv6 address can be generated quickly, an IPAM addressing time is reduced, a time-series random number algorithm depends on the computer timestamp, and is simple and easy to use, and thus, the algorithm complexity is simplified, the speed of examining and verifying an IP address by an IPAM is increased, and at the same time, the storage space of the IP address is reduced.
Based on the above purpose, an aspect of the embodiments of the present invention provides a method for generating an IPv6 address, including the following steps: acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp; carrying out format conversion on the random number, and carrying out AND operation on the converted random number and an IP mask to generate an IPv6 address; judging whether the IPv6 address conflicts with the issued IPv6 address or not; and responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
In some embodiments, said generating a random number according to said first timestamp comprises: judging whether the current generation of the random number is the first generation; and in response to the random number being generated for the first time at present, generating the random number according to the first time stamp and the default time stamp by adopting a normal distribution random number generation algorithm.
In some embodiments, said generating a random number according to said first timestamp comprises: and in response to the fact that the random number is not generated for the first time at present, generating the random number according to the first time stamp and a second time stamp of the random number generated last time by adopting a normal distribution random number generation algorithm.
In some embodiments, the method further comprises: and in response to the IPv6 address conflicting with the issued IPv6 address, updating the second timestamp of the last generated random number to the first timestamp, and generating the random number again based on the first timestamp and the updated second timestamp to generate a new IPv6 address.
In some embodiments, said storing said IPv6 address comprises: compressing the IPV6 address, storing the compressed IPv6 address in a persistent store, and updating the second timestamp.
In some embodiments, the determining whether the IPv6 address conflicts with the already issued IPv6 address includes: checking whether the IPv6 address identical to the IPv6 address exists in the issued IPv6 address pool.
In some embodiments, the format converting the random number comprises: and converting the random number into hexadecimal data, and arranging the converted data according to one group of every four bits.
In another aspect of the embodiments of the present invention, a system for generating an IPv6 address is provided, including: the random number module is configured to acquire a first timestamp corresponding to the current moment and generate a random number according to the first timestamp; the calculation module is configured to perform format conversion on the random number, and perform and operation on the converted random number and an IP mask to generate an IPv6 address; the judging module is configured to judge whether the IPv6 address conflicts with the issued IPv6 address or not; and the storage module is configured to store the IPv6 address in response to the IPv6 address not conflicting with the issued IPv6 address.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: the random number is generated through the timestamp, the IPv6 address is generated according to the random number, the effective IPv6 address can be generated quickly, the addressing time of the IPAM is reduced, the time sequence type random number algorithm depends on the computer timestamp, the method is simple and easy to use, the algorithm complexity is simplified, the verification speed of the IPAM on the IP address is accelerated, and meanwhile, the storage space of the IP address is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
Fig. 1 is a schematic diagram of an embodiment of a method for generating an IPv6 address provided by the present invention;
FIG. 2 is a schematic hardware structure diagram of an embodiment of a computer device for generating an IPv6 address provided by the invention;
FIG. 3 is a schematic diagram of an embodiment of a computer storage medium for generating an IPv6 address provided by the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In a first aspect of the embodiments of the present invention, an embodiment of a method for generating an IPv6 address is provided. Fig. 1 is a schematic diagram illustrating an embodiment of a method for generating an IPv6 address provided by the present invention.
As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp;
s2, converting the format of the random number, and performing AND operation on the converted random number and an IP mask to generate an IPv6 address;
s3, judging whether the IPv6 address conflicts with the issued IPv6 address or not; and
s4, responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
IPAM is an abbreviation of IP Address Management, i.e., IP Address Management, used to discover, monitor, audit, and manage the IP Address space used on enterprise networks. The method comprises a time-sequence random algorithm, an IPAM IPv6 application, an IPv6 address check and an IPv6 address storage. Generating a random number according to the current system time stamp by adopting a time sequence type random algorithm; the IPAM converts the random number into a 16-system number according to the IPv6 address format; the IPAM generates an IPv6 address after being processed by adopting an IP mask; the IPAM verifies the generated IPv6 address and performs IPv6 conflict check; the valid IPv6 is stored in combination with a mask.
The invention is mainly applied to the address management of the local area network IPv6, can quickly generate an effective IPv6 address, reduces the addressing time of the IPAM, has the advantages of simple and easy use, simplifies the algorithm complexity and accelerates the IP address audit of the IPAM because the time sequence type random number algorithm depends on the computer time stamp. The invention can ensure that the IPAM manages the IPv6 address, effectively quickens the IPv6 address addressing time and also reduces the address storage space of the IP address space.
And acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp. The probability of collisions can be greatly reduced by generating random numbers using timestamps.
In some embodiments, said generating a random number according to said first timestamp comprises: judging whether the current generation of the random number is the first generation; and in response to the random number being generated for the first time at present, generating the random number according to the first time stamp and the default time stamp by adopting a normal distribution random number generation algorithm. For example, the first time stamp t0 at the current time is obtained, the default time stamp is t1, a random number generation algorithm with positive distribution is adopted, the average value is (t0+ t1)/2, the standard deviation is (t0-t1)/2, and a random number conforming to the normal distribution is randomly generated.
In some embodiments, said generating a random number according to said first timestamp comprises: and in response to the fact that the random number is not generated for the first time at present, generating the random number according to the first time stamp and a second time stamp of the random number generated last time by adopting a normal distribution random number generation algorithm. For example, a first time stamp t0 of the current time is obtained, a second time stamp of the last generation of the random number is t1, a positive-distribution random number generation algorithm is adopted, the average value is (t0+ t1)/2, the standard deviation is (t0-t1)/2, and a random number conforming to the normal distribution is randomly generated.
And converting the format of the random number, and performing AND operation on the converted random number and an IP mask to generate the IPv6 address.
In some embodiments, the format converting the random number comprises: and converting the random number into hexadecimal data, and arranging the converted data according to one group of every four bits. The random number is converted into 16-system data, the data is divided into 8 groups by 4-bit groups according to the IPv6 format, and the converted random number and an IP mask are subjected to AND operation to generate an IPv6 address.
And judging whether the IPv6 address conflicts with the issued IPv6 address.
In some embodiments, the determining whether the IPv6 address conflicts with the already issued IPv6 address includes: checking whether the IPv6 address identical to the IPv6 address exists in the issued IPv6 address pool.
And responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
In some embodiments, said storing said IPv6 address comprises: compressing the IPV6 address, storing the compressed IPv6 address in a persistent store, and updating the second timestamp.
In some embodiments, the method further comprises: and in response to the IPv6 address conflicting with the issued IPv6 address, updating the second timestamp of the last generated random number to the first timestamp, and generating the random number again based on the first timestamp and the updated second timestamp to generate a new IPv6 address. The IPAM checks the IPv6 address, compares the address with the issued IP to prevent IP collision, and if there is a collision, updates the second timestamp of the last generation of the random number to the first timestamp, and generates the random number again to generate a new IPv6 address, that is, the average value is (t0+ t0)/2, and the standard deviation is (t0-t0)/2, and randomly generates a random number.
The invention provides an IPAM design for managing IPv6 addresses, so that the IPAM can rapidly apply for IPv6 addresses. The invention does not acquire the effective IP in an exhaustive manner, saves the storage space of the IPAM, and seriously wastes the storage space by exhaustively acquiring the IPv6 address, thereby influencing the performance of the IPAM. The invention generates random numbers by a time sequence type random algorithm, converts the random numbers into effective IP addresses according to the IP mask, combines the effective IP addresses with the IP mask to store the effective IP addresses, and avoids IP conflict of the IPAM application by traversing the released addresses.
The invention generates the random number through the timestamp, generates the IPv6 address according to the random number, can quickly generate the effective IPv6 address, reduces the addressing time of the IPAM, has simple and easy use because the time sequence type random number algorithm depends on the computer timestamp, simplifies the algorithm complexity, accelerates the verification speed of the IPAM on the IP address, and simultaneously reduces the storage space of the IP address.
It should be particularly noted that, the steps in the embodiments of the method for generating an IPv6 address described above may be intersected, replaced, added, or deleted, and therefore, these methods for generating an IPv6 address that are reasonably transformed by permutation and combination should also belong to the scope of the present invention, and should not limit the scope of the present invention to the embodiments.
In view of the above object, a second aspect of the embodiments of the present invention provides a system for generating an IPv6 address, including: the random number module is configured to acquire a first timestamp corresponding to the current moment and generate a random number according to the first timestamp; the calculation module is configured to perform format conversion on the random number, and perform and operation on the converted random number and an IP mask to generate an IPv6 address; the judging module is configured to judge whether the IPv6 address conflicts with the issued IPv6 address or not; and the storage module is configured to store the IPv6 address in response to the IPv6 address not conflicting with the issued IPv6 address.
In some embodiments, the random number module is configured to: judging whether the current generation of the random number is the first generation; and in response to the random number being generated for the first time at present, generating the random number according to the first time stamp and the default time stamp by adopting a normal distribution random number generation algorithm.
In some embodiments, the random number module is configured to: and in response to the fact that the random number is not generated for the first time at present, generating the random number according to the first time stamp and a second time stamp of the random number generated last time by adopting a normal distribution random number generation algorithm.
In some embodiments, the system further comprises an update module configured to: and in response to the IPv6 address conflicting with the issued IPv6 address, updating the second timestamp of the last generated random number to the first timestamp, and generating the random number again based on the first timestamp and the updated second timestamp to generate a new IPv6 address.
In some embodiments, the storage module is configured to: compressing the IPV6 address, storing the compressed IPv6 address in a persistent store, and updating the second timestamp.
In some embodiments, the determining module is configured to: checking whether the IPv6 address identical to the IPv6 address exists in the issued IPv6 address pool.
In some embodiments, the computing module is configured to: and converting the random number into hexadecimal data, and arranging the converted data according to one group of every four bits.
The random number is generated through the timestamp, the IPv6 address is generated according to the random number, the effective IPv6 address can be generated quickly, the addressing time of the IPAM is reduced, the time sequence type random number algorithm depends on the computer timestamp, the method is simple and easy to use, the algorithm complexity is simplified, the verification speed of the IPAM on the IP address is accelerated, and meanwhile, the storage space of the IP address is reduced.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp; s2, converting the format of the random number, and performing AND operation on the converted random number and an IP mask to generate an IPv6 address; s3, judging whether the IPv6 address conflicts with the issued IPv6 address or not; and S4, responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
And acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp. The probability of collisions can be greatly reduced by generating random numbers using timestamps.
In some embodiments, said generating a random number according to said first timestamp comprises: judging whether the current generation of the random number is the first generation; and in response to the random number being generated for the first time at present, generating the random number according to the first time stamp and the default time stamp by adopting a normal distribution random number generation algorithm. For example, the first time stamp t0 at the current time is obtained, the default time stamp is t1, a random number generation algorithm with positive distribution is adopted, the average value is (t0+ t1)/2, the standard deviation is (t0-t1)/2, and a random number conforming to the normal distribution is randomly generated.
In some embodiments, said generating a random number according to said first timestamp comprises: and in response to the fact that the random number is not generated for the first time at present, generating the random number according to the first time stamp and a second time stamp of the random number generated last time by adopting a normal distribution random number generation algorithm. For example, a first time stamp t0 of the current time is obtained, a second time stamp of the last generation of the random number is t1, a positive-distribution random number generation algorithm is adopted, the average value is (t0+ t1)/2, the standard deviation is (t0-t1)/2, and a random number conforming to the normal distribution is randomly generated.
And converting the format of the random number, and performing AND operation on the converted random number and an IP mask to generate the IPv6 address.
In some embodiments, the format converting the random number comprises: and converting the random number into hexadecimal data, and arranging the converted data according to one group of every four bits. The random number is converted into 16-system data, the data is divided into 8 groups by 4-bit groups according to the IPv6 format, and the converted random number and an IP mask are subjected to AND operation to generate an IPv6 address.
And judging whether the IPv6 address conflicts with the issued IPv6 address.
In some embodiments, the determining whether the IPv6 address conflicts with the already issued IPv6 address includes: checking whether the IPv6 address identical to the IPv6 address exists in the issued IPv6 address pool.
And responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
In some embodiments, said storing said IPv6 address comprises: compressing the IPV6 address, storing the compressed IPv6 address in a persistent store, and updating the second timestamp.
In some embodiments, the method further comprises: and in response to the IPv6 address conflicting with the issued IPv6 address, updating the second timestamp of the last generated random number to the first timestamp, and generating the random number again based on the first timestamp and the updated second timestamp to generate a new IPv6 address. The IPAM checks the IPv6 address, compares the address with the issued IP to prevent IP collision, and if there is a collision, updates the second timestamp of the last generation of the random number to the first timestamp, and generates the random number again to generate a new IPv6 address, that is, the average value is (t0+ t0)/2, and the standard deviation is (t0-t0)/2, and randomly generates a random number.
The invention provides an IPAM design for managing IPv6 addresses, so that the IPAM can rapidly apply for IPv6 addresses. The invention does not acquire the effective IP in an exhaustive manner, saves the storage space of the IPAM, and seriously wastes the storage space by exhaustively acquiring the IPv6 address, thereby influencing the performance of the IPAM. The invention generates random numbers by a time sequence type random algorithm, converts the random numbers into effective IP addresses according to the IP mask, combines the effective IP addresses with the IP mask to store the effective IP addresses, and avoids IP conflict of the IPAM application by traversing the released addresses.
The invention generates the random number through the timestamp, generates the IPv6 address according to the random number, can quickly generate the effective IPv6 address, reduces the addressing time of the IPAM, has simple and easy use because the time sequence type random number algorithm depends on the computer timestamp, simplifies the algorithm complexity, accelerates the verification speed of the IPAM on the IP address, and simultaneously reduces the storage space of the IP address.
Fig. 2 is a schematic hardware structural diagram of an embodiment of the computer device for generating an IPv6 address provided in the present invention.
Taking the apparatus shown in fig. 2 as an example, the apparatus includes a processor 201 and a memory 202, and may further include: an input device 203 and an output device 204.
The processor 201, the memory 202, the input device 203 and the output device 204 may be connected by a bus or other means, and fig. 2 illustrates the connection by a bus as an example.
The memory 202, which is a non-volatile computer-readable storage medium, may be used for storing non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for generating IPv6 addresses in the embodiment of the present application. The processor 201 executes various functional applications of the server and data processing, i.e., implements a method of generating an IPv6 address, by executing nonvolatile software programs, instructions, and modules stored in the memory 202. The method comprises the following steps: acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp; carrying out format conversion on the random number, and carrying out AND operation on the converted random number and an IP mask to generate an IPv6 address; judging whether the IPv6 address conflicts with the issued IPv6 address or not; and responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
In some embodiments, said generating a random number according to said first timestamp comprises: judging whether the current generation of the random number is the first generation; and in response to the random number being generated for the first time at present, generating the random number according to the first time stamp and the default time stamp by adopting a normal distribution random number generation algorithm.
In some embodiments, said generating a random number according to said first timestamp comprises: and in response to the fact that the random number is not generated for the first time at present, generating the random number according to the first time stamp and a second time stamp of the random number generated last time by adopting a normal distribution random number generation algorithm.
In some embodiments, the method further comprises: and in response to the IPv6 address conflicting with the issued IPv6 address, updating the second timestamp of the last generated random number to the first timestamp, and generating the random number again based on the first timestamp and the updated second timestamp to generate a new IPv6 address.
In some embodiments, said storing said IPv6 address comprises: compressing the IPV6 address, storing the compressed IPv6 address in a persistent store, and updating the second timestamp.
In some embodiments, the determining whether the IPv6 address conflicts with the already issued IPv6 address includes: checking whether the IPv6 address identical to the IPv6 address exists in the issued IPv6 address pool.
In some embodiments, the format converting the random number comprises: and converting the random number into hexadecimal data, and arranging the converted data according to one group of every four bits.
The memory 202 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the method of generating the IPv6 address, and the like. Further, the memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 202 may optionally include memory located remotely from processor 201, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 203 may receive information such as a user name and a password that are input. The output device 204 may include a display device such as a display screen.
Program instructions/modules corresponding to one or more methods of generating an IPv6 address are stored in the memory 202 and, when executed by the processor 201, perform a method of generating an IPv6 address in any of the above-described method embodiments.
Any embodiment of a computer device executing the method for generating an IPv6 address described above may achieve the same or similar effects as any of the preceding method embodiments corresponding thereto.
The present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor, performs a method of generating an IPv6 address. The method comprises the following steps: acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp; carrying out format conversion on the random number, and carrying out AND operation on the converted random number and an IP mask to generate an IPv6 address; judging whether the IPv6 address conflicts with the issued IPv6 address or not; and responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
In some embodiments, said generating a random number according to said first timestamp comprises: judging whether the current generation of the random number is the first generation; and in response to the random number being generated for the first time at present, generating the random number according to the first time stamp and the default time stamp by adopting a normal distribution random number generation algorithm.
In some embodiments, said generating a random number according to said first timestamp comprises: and in response to the fact that the random number is not generated for the first time at present, generating the random number according to the first time stamp and a second time stamp of the random number generated last time by adopting a normal distribution random number generation algorithm.
In some embodiments, the method further comprises: and in response to the IPv6 address conflicting with the issued IPv6 address, updating the second timestamp of the last generated random number to the first timestamp, and generating the random number again based on the first timestamp and the updated second timestamp to generate a new IPv6 address.
In some embodiments, said storing said IPv6 address comprises: compressing the IPV6 address, storing the compressed IPv6 address in a persistent store, and updating the second timestamp.
In some embodiments, the determining whether the IPv6 address conflicts with the already issued IPv6 address includes: checking whether the IPv6 address identical to the IPv6 address exists in the issued IPv6 address pool.
In some embodiments, the format converting the random number comprises: and converting the random number into hexadecimal data, and arranging the converted data according to one group of every four bits.
The invention generates the random number through the timestamp, generates the IPv6 address according to the random number, can quickly generate the effective IPv6 address, reduces the addressing time of the IPAM, has simple and easy use because the time sequence type random number algorithm depends on the computer timestamp, simplifies the algorithm complexity, accelerates the verification speed of the IPAM on the IP address, and simultaneously reduces the storage space of the IP address.
Fig. 3 is a schematic diagram of an embodiment of a computer storage medium for generating an IPv6 address according to the present invention. Taking the computer storage medium as shown in fig. 3 as an example, the computer readable storage medium 3 stores a computer program 31 which, when executed by a processor, performs the method as described above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate that all or part of the processes in the methods of the above embodiments can be implemented by a computer program to instruct related hardware, and the program of the method for generating an IPv6 address can be stored in a computer readable storage medium, and when executed, the program can include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method of generating an IPv6 address, comprising the steps of:
acquiring a first time stamp corresponding to the current time, and generating a random number according to the first time stamp;
carrying out format conversion on the random number, and carrying out AND operation on the converted random number and an IP mask to generate an IPv6 address;
judging whether the IPv6 address conflicts with the issued IPv6 address or not; and
and responding to the fact that the IPv6 address does not conflict with the issued IPv6 address, and storing the IPv6 address.
2. The method of claim 1, wherein the generating a random number according to the first timestamp comprises:
judging whether the current generation of the random number is the first generation; and
and responding to the current first generation of the random number, and generating the random number according to the first time stamp and the default time stamp by adopting a normal distribution random number generation algorithm.
3. The method of claim 2, wherein the generating a random number according to the first timestamp comprises:
and in response to the fact that the random number is not generated for the first time at present, generating the random number according to the first time stamp and a second time stamp of the random number generated last time by adopting a normal distribution random number generation algorithm.
4. The method of claim 3, further comprising:
and in response to the IPv6 address conflicting with the issued IPv6 address, updating the second timestamp of the last generated random number to the first timestamp, and generating the random number again based on the first timestamp and the updated second timestamp to generate a new IPv6 address.
5. The method of claim 4, wherein the storing the IPv6 address comprises:
compressing the IPV6 address, storing the compressed IPv6 address in a persistent store, and updating the second timestamp.
6. The method of claim 1, wherein the determining whether the IPv6 address conflicts with the IPv6 address that has been issued comprises:
checking whether the IPv6 address identical to the IPv6 address exists in the issued IPv6 address pool.
7. The method of claim 1, wherein the format converting the random number comprises:
and converting the random number into hexadecimal data, and arranging the converted data according to one group of every four bits.
8. A system for generating an IPv6 address, comprising:
the random number module is configured to acquire a first timestamp corresponding to the current moment and generate a random number according to the first timestamp;
the calculation module is configured to perform format conversion on the random number, and perform and operation on the converted random number and an IP mask to generate an IPv6 address;
the judging module is configured to judge whether the IPv6 address conflicts with the issued IPv6 address or not; and
a storage module configured to store the IPv6 address in response to the IPv6 address not conflicting with an already issued IPv6 address.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110807972.1A 2021-07-16 2021-07-16 Method, system, equipment and medium for generating IPv6 address Active CN113612864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110807972.1A CN113612864B (en) 2021-07-16 2021-07-16 Method, system, equipment and medium for generating IPv6 address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110807972.1A CN113612864B (en) 2021-07-16 2021-07-16 Method, system, equipment and medium for generating IPv6 address

Publications (2)

Publication Number Publication Date
CN113612864A true CN113612864A (en) 2021-11-05
CN113612864B CN113612864B (en) 2023-09-26

Family

ID=78337741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110807972.1A Active CN113612864B (en) 2021-07-16 2021-07-16 Method, system, equipment and medium for generating IPv6 address

Country Status (1)

Country Link
CN (1) CN113612864B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710467A (en) * 2022-03-25 2022-07-05 阿里巴巴(中国)有限公司 IP address storage method, device and hardware gateway

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060077908A1 (en) * 2004-10-07 2006-04-13 Park So H Method for generating and authenticating address automatically in IPv6-based internet and data structure thereof
CN101719937A (en) * 2009-11-30 2010-06-02 中兴通讯股份有限公司 Method and system for updating terminal device
CN102204220A (en) * 2008-11-03 2011-09-28 林肯环球股份有限公司 Method of discovery and communication with industrial equipment
CN105323329A (en) * 2015-06-30 2016-02-10 清华大学 IPv6 address generating method and device, and IPv6 address analyzing method and device
CN105516381A (en) * 2014-10-14 2016-04-20 中国电信股份有限公司 Method, device and system for generating IPv6 address
CN106161662A (en) * 2015-03-24 2016-11-23 中兴通讯股份有限公司 A kind of method and apparatus generating internet protocol address prefix
CN107301546A (en) * 2017-05-03 2017-10-27 北京众享比特科技有限公司 Generating random number and methods for using them and device
CN108810193A (en) * 2018-07-18 2018-11-13 赛尔网络有限公司 A kind of generation of the addresses IPv6, source tracing method and electronic equipment based on CERID
CN111161072A (en) * 2019-12-30 2020-05-15 山东爱城市网信息技术有限公司 Block chain-based random number generation method, equipment and storage medium
CN111708538A (en) * 2020-05-29 2020-09-25 平安医疗健康管理股份有限公司 Transaction circulation method, device, computer equipment and computer readable storage medium
CN112671947A (en) * 2020-12-25 2021-04-16 香港中文大学(深圳) IPv6 address generation method and device and load balancer

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060077908A1 (en) * 2004-10-07 2006-04-13 Park So H Method for generating and authenticating address automatically in IPv6-based internet and data structure thereof
CN102204220A (en) * 2008-11-03 2011-09-28 林肯环球股份有限公司 Method of discovery and communication with industrial equipment
CN101719937A (en) * 2009-11-30 2010-06-02 中兴通讯股份有限公司 Method and system for updating terminal device
CN105516381A (en) * 2014-10-14 2016-04-20 中国电信股份有限公司 Method, device and system for generating IPv6 address
CN106161662A (en) * 2015-03-24 2016-11-23 中兴通讯股份有限公司 A kind of method and apparatus generating internet protocol address prefix
CN105323329A (en) * 2015-06-30 2016-02-10 清华大学 IPv6 address generating method and device, and IPv6 address analyzing method and device
CN107301546A (en) * 2017-05-03 2017-10-27 北京众享比特科技有限公司 Generating random number and methods for using them and device
CN108810193A (en) * 2018-07-18 2018-11-13 赛尔网络有限公司 A kind of generation of the addresses IPv6, source tracing method and electronic equipment based on CERID
CN111161072A (en) * 2019-12-30 2020-05-15 山东爱城市网信息技术有限公司 Block chain-based random number generation method, equipment and storage medium
CN111708538A (en) * 2020-05-29 2020-09-25 平安医疗健康管理股份有限公司 Transaction circulation method, device, computer equipment and computer readable storage medium
CN112671947A (en) * 2020-12-25 2021-04-16 香港中文大学(深圳) IPv6 address generation method and device and load balancer

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
T. NARTEN等: "Privacy Extensions for Stateless Address Autoconfiguration in IPv6", 《IETF RFC3041》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114710467A (en) * 2022-03-25 2022-07-05 阿里巴巴(中国)有限公司 IP address storage method, device and hardware gateway
CN114710467B (en) * 2022-03-25 2024-03-12 阿里巴巴(中国)有限公司 IP address storage method and device and hardware gateway

Also Published As

Publication number Publication date
CN113612864B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
US8713177B2 (en) Remote management of networked systems using secure modular platform
US8676914B2 (en) Synchronizing services across network nodes
CN111181991B (en) Method and device for constructing terminal access platform of Internet of things
CN112804722A (en) Method for realizing micro-service gateway dynamic routing
CN110677383B (en) Firewall wall opening method and device, storage medium and computer equipment
CN112445865B (en) Method and device for automatically deploying block chain network and cloud computing platform
CN112187491A (en) Server management method, device and equipment
WO2012089166A1 (en) Software downloading method and device
US20080183878A1 (en) System And Method For Dynamic Patching Of Network Applications
CN113612864A (en) Method, system, equipment and medium for generating IPv6 address
CN110545230B (en) Method and device for forwarding VXLAN message
US8224933B2 (en) Method and apparatus for case-based service composition
CN103535015A (en) Management method of public network address resource, terminal control protocol server and client
CN104350717B (en) Via the means of communication of the server between two clients and client, server and network
CN111885190B (en) Service request processing method and system
CN111988440B (en) Network address translation method and system
CN114422164B (en) Five-tuple table entry issuing device and method
CN113691650B (en) IPv4/IPv6 stateless segmented safety mapping method and control system
US9077635B2 (en) Method and apparatus for network subnet discovery
CN112511440B (en) Message forwarding method, system, storage medium and electronic equipment
CN113918326A (en) Request processing method and device
KR20180054112A (en) Method, apparatus and computer program for managing a network function virtualization system
CN108055305B (en) Storage expansion method and storage expansion device
CN112019653A (en) Access switch, IP address deployment method, device and readable storage medium
CN111866122A (en) Micro-service processing method and device and client terminal

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