CN113726594A - IPv6 address consistency checking method and device - Google Patents

IPv6 address consistency checking method and device Download PDF

Info

Publication number
CN113726594A
CN113726594A CN202110900640.8A CN202110900640A CN113726594A CN 113726594 A CN113726594 A CN 113726594A CN 202110900640 A CN202110900640 A CN 202110900640A CN 113726594 A CN113726594 A CN 113726594A
Authority
CN
China
Prior art keywords
address
registration
addresses
current
type
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
CN202110900640.8A
Other languages
Chinese (zh)
Other versions
CN113726594B (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.)
Unihub China Information Technology Co Ltd
Original Assignee
Unihub China Information 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 Unihub China Information Technology Co Ltd filed Critical Unihub China Information Technology Co Ltd
Priority to CN202110900640.8A priority Critical patent/CN113726594B/en
Publication of CN113726594A publication Critical patent/CN113726594A/en
Application granted granted Critical
Publication of CN113726594B publication Critical patent/CN113726594B/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
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/24Testing correct operation
    • H04L1/242Testing correct operation by comparing a transmitted test signal with a locally generated replica
    • H04L1/244Testing correct operation by comparing a transmitted test signal with a locally generated replica test sequence generators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] 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/5007Internet protocol [IP] addresses

Abstract

The invention discloses an IPv6 address consistency checking method and device, wherein the method comprises the following steps: acquiring an allocation or registration address and an original import address according to the current check node, comparing the current allocation or registration address one by one with the original import address range, comparing the current allocation or registration address with the original import address type, and storing the final correct allocation address and the final incorrect allocation address; comparing whether the current correct registration address is in the range of the correctly allocated address, and storing the final correct registration address and the final error registration address; carrying out address recalculation on the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address, and warehousing again; and returning error reasons after the checking is finished, and prompting the error reasons to the front end. The method and the device further check the existing use address through an organization interface and a planning condition to check out a corresponding error address.

Description

IPv6 address consistency checking method and device
Technical Field
The invention relates to the field of planning and control of IPv6 address use, in particular to a method and a device for checking consistency of IPv6 addresses.
Background
With the increase of network addresses, planning and control over the whole use of the IPv6 address are more, so that the use of addresses of various cities is unclear, and the used addresses have wrong addresses and are not reasonably distributed.
Disclosure of Invention
In order to solve the above problems in the prior art, the present invention provides a method and an apparatus for checking IPv6 address consistency, which further check the existing used address through organizing interfaces and planning conditions, and check out the corresponding error address.
In order to achieve the purpose, the invention adopts the following technical scheme:
in an embodiment of the present invention, a method for checking IPv6 address consistency is provided, where the method includes:
acquiring an allocation address and an original import address according to the current check node, comparing the current allocation address one by one to determine whether the current allocation address is in the range of the original import address, comparing the current allocation address type with the original import address type, and storing the final correct allocation address and the final incorrect allocation address;
acquiring a registration address and an original import address according to a current check node, comparing the current registration address one by one to determine whether the current registration address is in an original import address range, comparing the current registration address type with the original import address type, comparing the current correct registration address with the correctly allocated address range, and storing a final correct registration address and a final error registration address;
carrying out address recalculation on the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address, and warehousing again;
and returning error reasons after the checking is finished, and prompting the error reasons to the front end.
Further, before comparing the two address ranges, IPv6 address translation is required.
Further, the IPv6 address translation comprises the following steps:
calculating the number Sum of IPv6 addresses: if the number of bits of the current address segment is larger than 64 bits, processing according to 1 address, otherwise, the number Sum of the addresses is 264-prefixWhere prefix is the address field number of bits;
calculating a termination address according to the mask and the number of the addresses;
the format of the IPv6 address is converted into a start address-end address format.
Further, comparing the current distribution address one by one whether the current distribution address is in the range of the original import address and comparing the current distribution address type whether the current distribution address type is consistent with the original import address type comprises:
according to the original import address range, matching the current distribution addresses one by one, splitting the unmatched distribution addresses, only keeping the matched distribution addresses, removing the unmatched distribution addresses, and recording the unmatched distribution addresses in the wrongly distributed addresses;
and comparing the types of the matched distribution addresses with the original import addresses one by one, if the type of the original import address is null and the type of the matched distribution address is not null, considering the distribution addresses as correct distribution addresses, and if the type of the original import address exists, but is not consistent with the type of the matched distribution addresses and is not a subtype, considering the distribution addresses as wrong distribution addresses, and recording the final correct distribution addresses and the wrong distribution addresses.
Further, comparing the current registered address one by one whether the current registered address is in the range of the original imported address, comparing whether the current registered address type is consistent with the original imported address type, and comparing whether the current correct registered address is in the range of the correctly allocated address, the method comprises the following steps:
according to the original import address range, matching the current registration addresses one by one, splitting the unmatched registration addresses, only reserving the matched registration addresses, removing the unmatched registration addresses, and recording the unmatched registration addresses in the error registration addresses;
comparing the types of the matched registration addresses with the types of the original import addresses one by one, if the type of the original import address is empty and the type of the matched registration address is not empty, considering the registration address as a correct registration address, and if the type of the original import address exists, but is not consistent with the type of the matched registration address and is not a subtype, considering the registration address as an error registration address, and recording the final correct registration address and the error registration address;
and comparing the correct registered address and the correct distributed address one by one according to the record of the last step, if the current registered address is in the distributed address range, considering that the current registered address is correct, and if not, considering that the current registered address is wrong, returning and recording the wrong registered address.
Further, according to the original import address, recalculating the current correctly allocated address and the correctly registered address, calculating an idle address, and warehousing again, including:
removing the correctly allocated address and the correctly registered address from the original imported address, and marking as an unallocated free address;
removing the correct registration address from the correct distribution address, and marking the correct registration address as a distributed idle registration address;
and clearing the original idle address table and putting the marked idle address into the database again.
In an embodiment of the present invention, an IPv6 address consistency checking apparatus is further provided, where the apparatus includes:
the distributed address checking module is used for acquiring a distributed address and an original import address according to the current checking node, comparing the current distributed address one by one whether the current distributed address is in the range of the original import address or not, comparing the current distributed address type with the original import address type or not, and storing the final correct distributed address and the final wrongly distributed address;
the registration address checking module is used for acquiring a registration address and an original import address according to the current checking node, comparing the current registration address one by one to determine whether the current registration address is in the range of the original import address, comparing the current registration address type with the original import address type, comparing the current correct registration address with the correctly allocated address range, and storing the final correct registration address and the final error registration address;
the idle address recalculation module is used for recalculating the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address and warehousing the idle address again;
and the browsing query interface module is used for providing the overall verification information for the user to view the IPv6 address.
Further, before comparing the two address ranges, IPv6 address translation is required.
Further, the IPv6 address translation comprises the following steps:
calculating the number Sum of IPv6 addresses: if the number of bits of the current address segment is larger than 64 bits, processing according to 1 address, otherwise, the number Sum of the addresses is 264-prefixWhere prefix is the address field number of bits;
calculating a termination address according to the mask and the number of the addresses;
the format of the IPv6 address is converted into a start address-end address format.
Further, comparing the current distribution address one by one whether the current distribution address is in the range of the original import address and comparing the current distribution address type whether the current distribution address type is consistent with the original import address type comprises:
according to the original import address range, matching the current distribution addresses one by one, splitting the unmatched distribution addresses, only keeping the matched distribution addresses, removing the unmatched distribution addresses, and recording the unmatched distribution addresses in the wrongly distributed addresses;
and comparing the types of the matched distribution addresses with the original import addresses one by one, if the type of the original import address is null and the type of the matched distribution address is not null, considering the distribution addresses as correct distribution addresses, and if the type of the original import address exists, but is not consistent with the type of the matched distribution addresses and is not a subtype, considering the distribution addresses as wrong distribution addresses, and recording the final correct distribution addresses and the wrong distribution addresses.
Further, comparing the current registered address one by one whether the current registered address is in the range of the original imported address, comparing whether the current registered address type is consistent with the original imported address type, and comparing whether the current correct registered address is in the range of the correctly allocated address, the method comprises the following steps:
according to the original import address range, matching the current registration addresses one by one, splitting the unmatched registration addresses, only reserving the matched registration addresses, removing the unmatched registration addresses, and recording the unmatched registration addresses in the error registration addresses;
comparing the types of the matched registration addresses with the types of the original import addresses one by one, if the type of the original import address is empty and the type of the matched registration address is not empty, considering the registration address as a correct registration address, and if the type of the original import address exists, but is not consistent with the type of the matched registration address and is not a subtype, considering the registration address as an error registration address, and recording the final correct registration address and the error registration address;
and comparing the correct registered address and the correct distributed address one by one according to the record of the last step, if the current registered address is in the distributed address range, considering that the current registered address is correct, and if not, considering that the current registered address is wrong, returning and recording the wrong registered address.
Further, according to the original import address, recalculating the current correctly allocated address and the correctly registered address, calculating an idle address, and warehousing again, including:
removing the correctly allocated address and the correctly registered address from the original imported address, and marking as an unallocated free address;
removing the correct registration address from the correct distribution address, and marking the correct registration address as a distributed idle registration address;
and clearing the original idle address table and putting the marked idle address into the database again.
In an embodiment of the present invention, a computer device is further provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the aforementioned IPv6 address consistency checking method when executing the computer program.
In an embodiment of the present invention, a computer-readable storage medium is further provided, where a computer program for executing the IPv6 address consistency checking method is stored in the computer-readable storage medium.
Has the advantages that:
1. the invention carries out integral check on the address through page-friendly operation, judges whether the IPv6 address is reasonable or not, and gives a check result and error reasons, thereby achieving the purpose of automatically and reasonably managing the IPv6 address information of operators and domestic companies.
2. The invention provides a browsing and inquiring interface through the front end, so that a user can visually check the overall checking information of the IPv6 address.
3. The invention is divided into a plurality of sub-processes, and a plurality of processing modules are divided under the sub-processes, so that nested calling is realized among the modules, organic coupling is realized, and the processing logic is flexible.
4. The invention realizes flexible searching through IPv6 address conversion logic.
Drawings
Fig. 1 is a schematic flow chart of an IPv6 address consistency checking method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating an assigned address checking sub-process according to an embodiment of the invention;
FIG. 3 is a diagram illustrating a sub-process of checking a registered address according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an idle address recalculation sub-process according to an embodiment of the present invention;
FIG. 5 is a schematic view of a browse query interface provided by the front end in accordance with an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an IPv6 address consistency checking apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The principles and spirit of the present invention will be described below with reference to several exemplary embodiments, which should be understood to be presented only to enable those skilled in the art to better understand and implement the present invention, and not to limit the scope of the present invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, an IPv6 address consistency checking method and device are provided, an original import address is obtained according to a checking node, and the whole address is checked and divided again according to the use process of a subsequent address; currently only global programmatic checking and verification of IPv6 addresses is supported.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Fig. 1 is a flowchart illustrating an IPv6 address consistency checking method according to an embodiment of the present invention. As shown in fig. 1, the method includes:
acquiring an allocation address and an original import address according to the current check node, comparing the current allocation address one by one to determine whether the current allocation address is in the range of the original import address, comparing the current allocation address type with the original import address type, and storing the final correct allocation address and the final incorrect allocation address;
acquiring a registration address and an original import address according to a current check node, comparing the current registration address one by one to determine whether the current registration address is in an original import address range, comparing the current registration address type with the original import address type, comparing the current correct registration address with the correctly allocated address range, and storing a final correct registration address and a final error registration address;
carrying out address recalculation on the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address, and warehousing again;
and returning error reasons after the checking is finished, and prompting the error reasons to the front end.
In order to realize the IPv6 address overall check, the method comprises three sub-processes of distributed address check, registered address check and idle address recalculation, and specifically comprises the following steps:
FIG. 2 is a diagram illustrating an allocated address checking sub-process according to an embodiment of the invention. As shown in fig. 2, the assigned address check processing logic:
1. acquiring a distribution address and an original import address according to the current check node;
2. comparing the current distribution address one by one whether in the range of the original import address and comparing the current distribution address type whether consistent with the original import address type, the specific processing logic is as follows:
according to the original import address range, matching the current distribution addresses one by one, splitting the unmatched distribution addresses, only keeping the matched distribution addresses, removing the unmatched distribution addresses, and recording the unmatched distribution addresses in the wrongly distributed addresses;
comparing the types of the matched distribution addresses with the original import addresses one by one, if the type of the original import address is empty and the type of the matched distribution address is not empty, considering the distribution addresses as correct distribution addresses, and if the type of the original import address exists, but is not consistent with the type of the matched distribution addresses and is not a subtype, considering the distribution addresses as wrong distribution addresses, and recording the final correct distribution addresses and the wrong distribution addresses;
3. the final correctly allocated address is stored as well as the incorrectly allocated address.
Fig. 3 is a schematic diagram of a sub-process of checking a registered address according to an embodiment of the present invention. As shown in fig. 3, register address checking processing logic;
1. acquiring a registration address and an original import address according to the current check node;
2. comparing the current register address one by one whether in the original import address range, comparing the current register address type whether consistent with the original import address type, and comparing the current correct register address whether in the above correct distribution address range, the specific processing logic is as follows:
according to the original import address range, matching the current registration addresses one by one, splitting the unmatched registration addresses, only reserving the matched registration addresses, removing the unmatched registration addresses, and recording the unmatched registration addresses in the error registration addresses;
comparing the types of the matched registration addresses with the types of the original import addresses one by one, if the type of the original import address is empty and the type of the matched registration address is not empty, considering the registration address as a correct registration address, and if the type of the original import address exists, but is not consistent with the type of the matched registration address and is not a subtype, considering the registration address as an error registration address, and recording the final correct registration address and the error registration address;
comparing the correct registered address with the correct distributed address one by one according to the last record, if the current registered address is in the distributed address range, considering the current registered address to be correct, otherwise, considering the current registered address to be wrong, returning and recording the wrong registered address;
4. the final correct registration address is stored as well as the incorrect registration address.
Address type specification: different address applications are divided into different address types, for example: such as network address and user address, the address type is also a tree structure, for example: the network address can be divided into a mobile network or CN 2.
FIG. 4 is a flow diagram of an idle address recalculation sub-process according to an embodiment of the present invention. As shown in fig. 4, the address recalculation is performed on the current correctly allocated address and the correctly registered address according to the original import address, an idle address is calculated, and the idle address is put in storage again, and the specific processing logic is as follows:
1. removing the correctly allocated address and the correctly registered address from the original imported address, and marking as an unallocated free address;
2. removing the correct registration address from the correct distribution address, and marking the correct registration address as a distributed idle registration address;
3. and clearing the original idle address table and putting the marked idle address into the database again.
In order to compare the range between two addresses when subsequently checking consistency, namely, to prepare for whether the range is crossed, IPv6 address conversion is firstly carried out.
Format of IPv6 address: the A, B, C, D, E, F, G, H/prefix 8 segments have 128 bits, so that the character strings are correspondingly converted into a format of a starting address and an ending address, and the ending address can be calculated according to the mask and the number of the addresses.
And (4) calculating the number of addresses:
If prefix>64then
Sum=1
Else
Sum=264-prefix
description of the parameters:
prefix: the number of address field bits;
a, B, C, D, E, F, G, H: respectively representing 4-bit 16-system numbers separated by commas of the IPv6 address;
sum is the number of addresses, and addresses above 64 bits currently are processed by 1 address.
Fig. 5 is a schematic view of a browsing query interface provided by the front end according to an embodiment of the present invention. As shown in fig. 5, the end of checking returns an error reason and prompts to the front end, and the user can view the overall checking information of the IPv6 address through the interface.
It should be noted that although the operations of the method of the present invention have been described in the above embodiments and the accompanying drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the operations shown must be performed, to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
For a clearer explanation of the above-mentioned IPv6 address consistency checking method, a specific embodiment is described below, but it should be noted that the embodiment is only for better explaining the present invention and is not to be construed as an undue limitation to the present invention.
Example (b):
the original free address table data is as follows in table 1:
TABLE 1
Starting address Termination address
240E:037C:0000:0000:0000:0008:0000:0000 240E:037C:0000:0000:0000:000F:FFFF:FFFF
The address data is correctly allocated as follows in table 2:
TABLE 2
240E:037C:0000:0000:0000:000A:0000:0000 240E:037C:0000:0000:0000:000C:FFFF:FFFF
The correct registration address data is as follows in table 3:
TABLE 3
240E:037C:0000:0000:0000:000A:0000:0000 240E:037C:0000:0000:0000:000B:FFFF:FFFF
The processed free address table data is as follows in table 4:
TABLE 4
Starting address Termination address
240E:037C:0000:0000:0000:0008:0000:0000 240E:037C:0000:0000:0000:0009:FFFF:FFFF
240E:037C:0000:0000:0000:000C:0000:0000 240E:037C:0000:0000:0000:000F:FFFF:FFFF
Based on the same inventive concept, the invention also provides an IPv6 address consistency checking device. The implementation of the device can be referred to the implementation of the method, and repeated details are not repeated. The term "module," as used below, may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 6 is a schematic structural diagram of an IPv6 address consistency checking apparatus according to an embodiment of the present invention, shown in fig. 6, where the apparatus includes:
the distributed address checking module 101 is configured to obtain a distributed address and an original import address according to a current check node, compare, one by one, whether the current distributed address is within an original import address range, compare whether a current distributed address type is consistent with an original import address type, and store a final correctly distributed address and an erroneously distributed address; the method comprises the following specific steps:
acquiring a distribution address and an original import address according to the current check node;
according to the original import address range, matching the current distribution addresses one by one, splitting the unmatched distribution addresses, only keeping the matched distribution addresses, removing the unmatched distribution addresses, and recording the unmatched distribution addresses in the wrongly distributed addresses;
comparing the types of the matched distribution addresses with the original import addresses one by one, if the type of the original import address is empty and the type of the matched distribution address is not empty, considering the distribution addresses as correct distribution addresses, and if the type of the original import address exists, but is not consistent with the type of the matched distribution addresses and is not a subtype, considering the distribution addresses as wrong distribution addresses, and recording the final correct distribution addresses and the wrong distribution addresses;
the final correctly allocated address is stored as well as the incorrectly allocated address.
A registered address checking module 102, configured to obtain a registered address and an original import address according to a current checking node, compare, one by one, whether the current registered address is within an original import address range, compare whether a current registered address type is consistent with an original import address type, compare whether a current correct registered address is within the correctly allocated address range, and store a final correct registered address and a final incorrect registered address; the method comprises the following specific steps:
acquiring a registration address and an original import address according to the current check node;
according to the original import address range, matching the current registration addresses one by one, splitting the unmatched registration addresses, only reserving the matched registration addresses, removing the unmatched registration addresses, and recording the unmatched registration addresses in the error registration addresses;
comparing the types of the matched registration addresses with the types of the original import addresses one by one, if the type of the original import address is empty and the type of the matched registration address is not empty, considering the registration address as a correct registration address, and if the type of the original import address exists, but is not consistent with the type of the matched registration address and is not a subtype, considering the registration address as an error registration address, and recording the final correct registration address and the error registration address;
comparing the correct registered address with the correct distributed address one by one according to the last record, if the current registered address is in the distributed address range, considering the current registered address to be correct, otherwise, considering the current registered address to be wrong, returning and recording the wrong registered address;
the final correct registration address is stored as well as the incorrect registration address.
The idle address recalculation module 103 is used for recalculating the address of the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address and putting the idle address into a storage again; the method comprises the following specific steps:
removing the correctly allocated address and the correctly registered address from the original imported address, and marking as an unallocated free address;
removing the correct registration address from the correct distribution address, and marking the correct registration address as a distributed idle registration address;
and clearing the original idle address table and putting the marked idle address into the database again.
And the browsing query interface module 104 is used for providing the overall verification information for the user to view the IPv6 address.
In order to compare the range between two addresses when subsequently checking consistency, namely, to prepare for whether the range is crossed, IPv6 address conversion is firstly carried out.
Format of IPv6 address: the A, B, C, D, E, F, G, H/prefix 8 segments have 128 bits, so that the character strings are correspondingly converted into a format of a starting address and an ending address, and the ending address can be calculated according to the mask and the number of the addresses.
And (4) calculating the number of addresses:
If prefix>64then
Sum=1
Else
Sum=264-prefix
description of the parameters:
prefix: the number of address field bits;
a, B, C, D, E, F, G, H: respectively representing 4-bit 16-system numbers separated by commas of the IPv6 address;
sum is the number of addresses, and addresses above 64 bits currently are processed by 1 address.
It should be noted that although several modules of the IPv6 address consistency checking apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the modules described above may be embodied in one module according to embodiments of the invention. Conversely, the features and functions of one module described above may be further divided into embodiments by a plurality of modules.
Based on the aforementioned inventive concept, as shown in fig. 7, the present invention further provides a computer apparatus 200, which includes a memory 210, a processor 220, and a computer program 230 stored on the memory 210 and operable on the processor 220, wherein the processor 220 implements the aforementioned IPv6 address consistency checking method when executing the computer program 230.
Based on the foregoing inventive concept, the present invention also provides a computer-readable storage medium storing a computer program for executing the foregoing IPv6 address consistency checking method.
The IPv6 address consistency checking method and device provided by the invention carry out integral checking on the address through page-friendly operation, judge whether the IPv6 address is reasonable, and give a checking result and error reasons, so that automatic and reasonable management of IPv6 address information of operators and domestic companies is achieved; the front end provides a browsing and inquiring interface, so that a user can visually check the overall checking information of the IPv6 address; the method is divided into a plurality of sub-processes, a plurality of processing modules are divided under the sub-processes, nested calling is realized among the modules, organic coupling is realized, and processing logic is flexible; flexible lookup is achieved through IPv6 address translation logic.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
The limitation of the protection scope of the present invention is understood by those skilled in the art, and various modifications or changes which can be made by those skilled in the art without inventive efforts based on the technical solution of the present invention are still within the protection scope of the present invention.

Claims (14)

1. An IPv6 address consistency checking method, characterized in that the method comprises:
acquiring an allocation address and an original import address according to the current check node, comparing the current allocation address one by one to determine whether the current allocation address is in the range of the original import address, comparing the current allocation address type with the original import address type, and storing the final correct allocation address and the final incorrect allocation address;
acquiring a registration address and an original import address according to a current check node, comparing the current registration address one by one to determine whether the current registration address is in an original import address range, comparing the current registration address type with the original import address type, comparing the current correct registration address with the correctly allocated address range, and storing a final correct registration address and a final error registration address;
carrying out address recalculation on the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address, and warehousing again;
and returning error reasons after the checking is finished, and prompting the error reasons to the front end.
2. The IPv6 address consistency checking method of claim 1, wherein before comparing two address ranges, IPv6 address translation is required.
3. The IPv6 address consistency checking method of claim 2, wherein the IPv6 address translation includes:
calculating the number Sum of IPv6 addresses: if the number of bits of the current address segment is larger than 64 bits, processing according to 1 address, otherwise, the number Sum of the addresses is 264-prefixWhere prefix is the address field number of bits;
calculating a termination address according to the mask and the number of the addresses;
the format of the IPv6 address is converted into a start address-end address format.
4. The IPv6 address consistency checking method of claim 1, wherein comparing, item by item, whether a currently allocated address is within an original import address range, and comparing whether a currently allocated address type is consistent with its original import address type includes:
according to the original import address range, matching the current distribution addresses one by one, splitting the unmatched distribution addresses, only keeping the matched distribution addresses, removing the unmatched distribution addresses, and recording the unmatched distribution addresses in the wrongly distributed addresses;
and comparing the types of the matched distribution addresses with the original import addresses one by one, if the type of the original import address is null and the type of the matched distribution address is not null, considering the distribution addresses as correct distribution addresses, and if the type of the original import address exists, but is not consistent with the type of the matched distribution addresses and is not a subtype, considering the distribution addresses as wrong distribution addresses, and recording the final correct distribution addresses and the wrong distribution addresses.
5. The IPv6 address consistency checking method of claim 1, wherein comparing, on a case-by-case basis, whether a current registered address is within an original import address range, comparing whether a current registered address type is consistent with an original import address type, and comparing whether a current correct registered address is within the correctly allocated address range includes:
according to the original import address range, matching the current registration addresses one by one, splitting the unmatched registration addresses, only reserving the matched registration addresses, removing the unmatched registration addresses, and recording the unmatched registration addresses in the error registration addresses;
comparing the types of the matched registration addresses with the types of the original import addresses one by one, if the type of the original import address is empty and the type of the matched registration address is not empty, considering the registration address as a correct registration address, and if the type of the original import address exists, but is not consistent with the type of the matched registration address and is not a subtype, considering the registration address as an error registration address, and recording the final correct registration address and the error registration address;
and comparing the correct registered address and the correct distributed address one by one according to the record of the last step, if the current registered address is in the distributed address range, considering that the current registered address is correct, and if not, considering that the current registered address is wrong, returning and recording the wrong registered address.
6. The IPv6 address consistency checking method of claim 1, wherein the method includes performing address recalculation on a current correctly allocated address and a correctly registered address according to an original import address, calculating an idle address, and storing the idle address again in a storage device, including:
removing the correctly allocated address and the correctly registered address from the original imported address, and marking as an unallocated free address;
removing the correct registration address from the correct distribution address, and marking the correct registration address as a distributed idle registration address;
and clearing the original idle address table and putting the marked idle address into the database again.
7. An IPv6 address consistency checking apparatus, comprising:
the distributed address checking module is used for acquiring a distributed address and an original import address according to the current checking node, comparing the current distributed address one by one whether the current distributed address is in the range of the original import address or not, comparing the current distributed address type with the original import address type or not, and storing the final correct distributed address and the final wrongly distributed address;
the registration address checking module is used for acquiring a registration address and an original import address according to the current checking node, comparing the current registration address one by one to determine whether the current registration address is in the range of the original import address, comparing the current registration address type with the original import address type, comparing the current correct registration address with the correctly allocated address range, and storing the final correct registration address and the final error registration address;
the idle address recalculation module is used for recalculating the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address and warehousing the idle address again;
and the browsing query interface module is used for providing the overall verification information for the user to view the IPv6 address.
8. The IPv6 address consistency checking device of claim 7, wherein before comparing two address ranges, IPv6 address translation is required.
9. The IPv6 address consistency checking apparatus of claim 8, wherein the IPv6 address translation includes:
calculating the number Sum of IPv6 addresses: if the number of bits of the current address segment is larger than 64 bits, processing according to 1 address, otherwise, the number Sum of the addresses is 264-prefixWhere prefix is the address field number of bits;
calculating a termination address according to the mask and the number of the addresses;
the format of the IPv6 address is converted into a start address-end address format.
10. The IPv6 address consistency checking apparatus of claim 7, wherein comparing, on a per-item basis, whether a currently allocated address is within an original import address range, and comparing whether a currently allocated address type is consistent with its original import address type, includes:
according to the original import address range, matching the current distribution addresses one by one, splitting the unmatched distribution addresses, only keeping the matched distribution addresses, removing the unmatched distribution addresses, and recording the unmatched distribution addresses in the wrongly distributed addresses;
and comparing the types of the matched distribution addresses with the original import addresses one by one, if the type of the original import address is null and the type of the matched distribution address is not null, considering the distribution addresses as correct distribution addresses, and if the type of the original import address exists, but is not consistent with the type of the matched distribution addresses and is not a subtype, considering the distribution addresses as wrong distribution addresses, and recording the final correct distribution addresses and the wrong distribution addresses.
11. The IPv6 address consistency checking apparatus of claim 7, wherein comparing, item by item, whether a current registered address is within an original import address range, comparing whether a current registered address type is consistent with an original import address type, and comparing whether a current correct registered address is within the correctly allocated address range includes:
according to the original import address range, matching the current registration addresses one by one, splitting the unmatched registration addresses, only reserving the matched registration addresses, removing the unmatched registration addresses, and recording the unmatched registration addresses in the error registration addresses;
comparing the types of the matched registration addresses with the types of the original import addresses one by one, if the type of the original import address is empty and the type of the matched registration address is not empty, considering the registration address as a correct registration address, and if the type of the original import address exists, but is not consistent with the type of the matched registration address and is not a subtype, considering the registration address as an error registration address, and recording the final correct registration address and the error registration address;
and comparing the correct registered address and the correct distributed address one by one according to the record of the last step, if the current registered address is in the distributed address range, considering that the current registered address is correct, and if not, considering that the current registered address is wrong, returning and recording the wrong registered address.
12. The IPv6 address consistency checking apparatus according to claim 7, wherein the apparatus for recalculating the current correctly allocated address and the correctly registered address according to the original imported address, calculating an idle address, and warehousing again includes:
removing the correctly allocated address and the correctly registered address from the original imported address, and marking as an unallocated free address;
removing the correct registration address from the correct distribution address, and marking the correct registration address as a distributed idle registration address;
and clearing the original idle address table and putting the marked idle address into the database again.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of claims 1-7 when executing the computer program.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for performing the method of any one of claims 1-7.
CN202110900640.8A 2021-08-06 2021-08-06 IPv6 address consistency checking method and device Active CN113726594B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110900640.8A CN113726594B (en) 2021-08-06 2021-08-06 IPv6 address consistency checking method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110900640.8A CN113726594B (en) 2021-08-06 2021-08-06 IPv6 address consistency checking method and device

Publications (2)

Publication Number Publication Date
CN113726594A true CN113726594A (en) 2021-11-30
CN113726594B CN113726594B (en) 2023-02-10

Family

ID=78675121

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110900640.8A Active CN113726594B (en) 2021-08-06 2021-08-06 IPv6 address consistency checking method and device

Country Status (1)

Country Link
CN (1) CN113726594B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107104819A (en) * 2017-03-23 2017-08-29 武汉邮电科学研究院 Adaptive self-coordinating unified communications and communication means based on SDN
CN110011999A (en) * 2019-03-29 2019-07-12 东北大学 IPv6 network ddos attack detection system and method based on deep learning
CN111404878A (en) * 2020-02-26 2020-07-10 新浪网技术(中国)有限公司 Method and system for converting ipv4 address into ipv6 address
CN112532761A (en) * 2020-11-23 2021-03-19 中盈优创资讯科技有限公司 Management method and device for automatically reporting and recording public network address
CN112866425A (en) * 2019-11-28 2021-05-28 中盈优创资讯科技有限公司 Network equipment address pool allocation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107104819A (en) * 2017-03-23 2017-08-29 武汉邮电科学研究院 Adaptive self-coordinating unified communications and communication means based on SDN
CN110011999A (en) * 2019-03-29 2019-07-12 东北大学 IPv6 network ddos attack detection system and method based on deep learning
CN112866425A (en) * 2019-11-28 2021-05-28 中盈优创资讯科技有限公司 Network equipment address pool allocation method and device
CN111404878A (en) * 2020-02-26 2020-07-10 新浪网技术(中国)有限公司 Method and system for converting ipv4 address into ipv6 address
CN112532761A (en) * 2020-11-23 2021-03-19 中盈优创资讯科技有限公司 Management method and device for automatically reporting and recording public network address

Also Published As

Publication number Publication date
CN113726594B (en) 2023-02-10

Similar Documents

Publication Publication Date Title
CN107360224A (en) Sequence number generation method, system, equipment and storage medium in distributed system
CN105354255A (en) Data query method and apparatus
CN112565095B (en) Automatic discovery and analysis method and device for internet special line
CN105912601A (en) Partition storage method for distributed real-time memory database of energy management system
CN117238433B (en) Method for automatically isolating document data based on Libreoffice
CN112492056A (en) IP address use analysis method and device
CN113434482A (en) Data migration method and device, computer equipment and storage medium
CN101567014B (en) Equipment information retrieval method, device and cable fastener
CN114710469B (en) IPV4 address rationalization management method and device
CN111901451A (en) Method and device for combing reference relationship between private line user domain and address pool
CN108549688B (en) Data operation optimization method, device, equipment and storage medium
CN107807976B (en) IP home location query method and device
CN113726594B (en) IPv6 address consistency checking method and device
CN109219051B (en) False number determination method, device, equipment and readable storage medium
CN111651397A (en) Method and equipment for accessing peripheral module of PXIe
CN116414898A (en) Database access method and device, electronic equipment and storage medium
CN106201504A (en) Operating system version identification method and device
CN109101595B (en) Information query method, device, equipment and computer readable storage medium
CN116450607A (en) Data processing method, device and storage medium
CN106407470A (en) Fingerprint sharing method, terminal and server
CN115357598A (en) Data modification method and device, computer equipment and storage medium
CN114553819B (en) IPv6 address identification method and device
CN114942781A (en) Data format adaptation method and device for data reading
CN108984780B (en) Method and device for managing disk data based on data structure supporting repeated key value tree
CN107908500A (en) A kind of bad block identifying 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
CP02 Change in the address of a patent holder

Address after: 200000 room 702-2, No. 4811 Cao'an Road, Jiading District, Shanghai

Patentee after: CHINA UNITECHS

Address before: Room 1004-4, 10 / F, 1112 Hanggui Road, Anting Town, Jiading District, Shanghai

Patentee before: CHINA UNITECHS

CP02 Change in the address of a patent holder