CN110830603B - IPV6 address summarizing method and device - Google Patents

IPV6 address summarizing method and device Download PDF

Info

Publication number
CN110830603B
CN110830603B CN201910986515.6A CN201910986515A CN110830603B CN 110830603 B CN110830603 B CN 110830603B CN 201910986515 A CN201910986515 A CN 201910986515A CN 110830603 B CN110830603 B CN 110830603B
Authority
CN
China
Prior art keywords
ipv6
ipv6 address
addresses
address
summarized
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910986515.6A
Other languages
Chinese (zh)
Other versions
CN110830603A (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 CN201910986515.6A priority Critical patent/CN110830603B/en
Publication of CN110830603A publication Critical patent/CN110830603A/en
Application granted granted Critical
Publication of CN110830603B publication Critical patent/CN110830603B/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/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
    • 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 provides a method and a device for summarizing and processing an IPV6 address, wherein the method comprises the following steps: acquiring an IPV6 address to be summarized; converting the IPV6 address to be summarized into a decimal IPV6 address, and then performing grouping processing to obtain at least one group of decimal IPV6 addresses; converting each decimal IPV6 address into binary IPV6 address, and then converting into 128 bit IPV6 address; the following operations are performed on each group of 128-bit IPV6 addresses to obtain the summary address of the IPV6 corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; and obtaining the summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number. The technical scheme realizes high-efficiency and accurate collection and processing of the IPV6 address.

Description

IPV6 address summarizing method and device
Technical Field
The invention relates to the technical field of network address processing, in particular to a method and a device for summarizing and processing an IPV6 address.
Background
In the implementation process of the network project, the summary processing of the IPV6 addresses currently adopts a manual processing mode. Manual summary of IPV6 addresses the general process is: firstly, all 128-bit IPV6 addresses are manually converted into binary form, then common parts of all IPV6 addresses are compared one by one, the common parts are extracted and converted into 16-bit, if the number of the common parts is less than 8,:' and prefix are supplemented, and finally, an address form of a network address + prefix is formed for standby. The above is a general case, if the data size of the issued IPV6 address is large, the address is irregular, and the representation form is not uniform, for example, there is use' < simplify show, there are enough 8 sets of 128 bit displays, etc., which will further increase the difficulty of summarizing the IPV6 address, the time for a general person to convert two 128 bit IPV6 addresses into binary is about 5 minutes according to normal statistics, then the same binary parts are compared, about 30 seconds to one minute is used, the obtained summary result is complemented with 128 bits again and is divided into 16 bits according to 16 bits, about 5 minutes is used, the total time for summarizing the two IPV6 addresses is about 11 minutes, if the whole process is faced with hundreds of thousands sets of IPV6 addresses, the difficulty and the time for manually summarizing IPV6 will further increase. In addition, when a large amount of data is processed, some errors may occur due to visual fatigue and the like in a long-time operation, so that some routes are not issued, and certain risks exist.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method for summarizing and processing an IPV6 address, which is used for efficiently and accurately summarizing and processing the IPV6 address and comprises the following steps:
acquiring an IPV6 address to be summarized;
converting the IPV6 addresses to be summarized into decimal IPV6 addresses, and performing grouping processing on the decimal IPV6 addresses to obtain at least one group of decimal IPV6 addresses;
converting each set of decimal IPV6 addresses to binary IPV6 addresses, and each set of binary IPV6 addresses to 128-bit IPV6 addresses;
the following operations are performed on each group of 128-bit IPV6 addresses to obtain the summary address of the IPV6 corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; and obtaining the summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number.
The embodiment of the invention also provides a device for summarizing the IPV6 address, which is used for efficiently and accurately summarizing the IPV6 address, and comprises the following components:
the obtaining unit is used for obtaining an IPV6 address to be summarized;
the grouping processing unit is used for converting the IPV6 addresses to be summarized into decimal IPV6 addresses and grouping the decimal IPV6 addresses to obtain at least one group of decimal IPV6 addresses;
an address conversion unit for converting each set of decimal IPV6 addresses into binary IPV6 addresses and each set of binary IPV6 addresses into 128-bit IPV6 addresses;
the summary processing unit is configured to perform the following operation on each group of 128-bit IPV6 addresses to obtain an IPV6 summary address corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; and obtaining the summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for summarizing and processing the IPV6 address is implemented.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program for executing the above-mentioned IPV6 address summarization processing method.
The technical scheme provided by the embodiment of the invention comprises the following steps: acquiring an IPV6 address to be summarized; converting the IPV6 addresses to be summarized into decimal IPV6 addresses, and performing grouping processing on the decimal IPV6 addresses to obtain at least one group of decimal IPV6 addresses; converting each set of decimal IPV6 addresses to binary IPV6 addresses, and each set of binary IPV6 addresses to 128-bit IPV6 addresses; the following operations are performed on each group of 128-bit IPV6 addresses to obtain the summary address of the IPV6 corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; according to the IPV6 address network number and the length of the IPV6 address network number, the summarized IPV6 address is obtained, the IPV6 address is efficiently and accurately summarized and processed, and the summarizing and processing efficiency and accuracy of the IPV6 address are improved.
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 embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic flow chart of a summary processing method of an IPV6 address in an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a method for summarizing an IPV6 address according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a summary processing device of IPV6 addresses in the embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As the inventor finds the technical problems mentioned in the background art, an IPV6 address automatic summary processing scheme based on Python (a programming language, which is similar to common C language) is provided. IPV6(Internet Protocol Version 6, Version 6 of the Internet Protocol) is used as a next-generation Internet technology, that is, a large area is deployed and applied, there is a certain limit for an Internet backbone network to receive a metropolitan area network route, and one of the routes is that the metropolitan area network issues a route to the backbone network which cannot be too detailed, so that summary is required, and IPV6 has 128 bits in total, and manual operation has a certain difficulty and low efficiency. Therefore, the inventor proposes an IPV6 address automatic summary processing scheme in Python, which utilizes the powerful and fast processing capability of a computer, uses its own split column technology through Python language programs to separate IPV6 addresses from their corresponding prefixes, automatically calculates the common part (the same part) of all IPV6 addresses through an effective logic algorithm, stores the common part into a list NEW, forms final network addresses through logic filling, 16-bit splitting, and the like, stores the final network addresses into a list NEW1, and uses the length of the list NEW as a prefix, and combines the common part and the final quick and accurate summary address generating IPV6 for routing and issuing the addresses, and for hundreds of IPV6 address summaries, the whole process can be controlled within one minute, so as to save a lot of time, thereby improving the work efficiency and reducing the error rate.
Specifically, the scheme mainly comprises the following steps: firstly, acquiring all IPV6 addresses needing to be summarized; the program reads txt text stored in the IPV6 address line by line, separates the IPV6 address and its prefix to form a single IPV6 address (without prefix) by split column technology, then judges the expression form of the IPV6 address, for example, the expression form with ': is processed according to one mode, but not according to the other mode, both modes need to use': as a separator, divide several segments, convert all 16-system in the segments into 2-system, then fill 128 bits uniformly, compare the common part of all IPV6 addresses, the common part is the network address to be summarized, the length of the list is the prefix of the summarized address, and finally store the result for standby (manual route distribution). Therefore, the scheme helps a network engineer to quickly and accurately generate the summary IPV6 address in the project implementation process, and improves the working efficiency. The technical problem that a network engineer manually summarizes a large number of IPV6 routes in the project implementation process, so that the efficiency is low and errors are possible is solved. The summary processing scheme for the IPV6 address is described in detail below.
Fig. 1 is a schematic flowchart of a summary processing method of IPV6 addresses in the embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step 101: acquiring an IPV6 address to be summarized;
step 102: converting the IPV6 addresses to be summarized into decimal IPV6 addresses, and performing grouping processing on the decimal IPV6 addresses to obtain at least one group of decimal IPV6 addresses;
step 103: converting each set of decimal IPV6 addresses to binary IPV6 addresses, and each set of binary IPV6 addresses to 128-bit IPV6 addresses;
step 104: the following operations are performed on each group of 128-bit IPV6 addresses to obtain the summary address of the IPV6 corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; and obtaining the summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number.
The technical scheme provided by the embodiment of the invention realizes high-efficiency and accurate summary processing of the IPV6 address, and improves the summary processing efficiency and accuracy of the IPV6 address.
In one embodiment, obtaining the IPV6 address to be aggregated may include:
acquiring all IPV6 addresses needing to be summarized at an exit of a metropolitan area network and storing the addresses into a txt file;
reading the txt file line by line, and performing column division processing on IPV6 address character strings extracted by using a first preset delimiter to obtain all IPV6 addresses which do not contain prefixes;
and performing column division processing on all IPV6 addresses without the prefixes by using a second preset separator, filling 0 for the address with the length less than 8, formatting the address into an IPV6 address in a standard format, and simultaneously filling the prefixes to obtain the IPV6 addresses to be summarized.
In specific implementation, the processing mode of obtaining the IPV6 addresses to be summarized further improves the efficiency and accuracy of summarizing the IPV6 addresses.
In one embodiment, converting the IPV6 addresses to be summarized into decimal IPV6 addresses, and grouping the decimal IPV6 addresses to obtain at least one set of decimal IPV6 addresses may include:
converting the IPV6 address to be summarized into a hexadecimal IPV6 address;
converting the hexadecimal IPV6 address to a decimal IPV6 address;
traversing each decimal IPV6 address, subtracting the previous IPV6 address from the next decimal IPV6 address, and grouping the IPV6 addresses with the result of 1 to obtain at least one decimal IPV6 address group with continuous addresses.
In specific implementation, in order to facilitate the grouping processing, the hexadecimal IPV6 address is converted into the decimal IPV6 address, and the grouping processing mode further improves the summarizing processing efficiency and accuracy of the IPV6 address.
In one embodiment, converting each set of decimal IPV6 addresses to binary IPV6 addresses and each set of binary IPV6 addresses to 128-bit IPV6 addresses may include:
ranking each set of decimal IPV6 addresses using a second preset separator to obtain a plurality of sections of decimal IPV6 addresses;
converting each decimal IPV6 address into a binary IPV6 address, and filling with 0 to obtain a binary IPV6 address with 16 bits in each segment;
the 16-bit binary IPV6 address is filled with 0's, resulting in a 128-bit IPV6 address.
In specific implementation, in order to obtain the same part of each IPV6 address through subsequent comparison and calculation, the IPV6 address is converted into a binary IPV6 address, and the processing mode of converting the binary IPV6 address further improves the summarizing efficiency and accuracy of the IPV6 address.
In one embodiment, 128-bit IPV6 addresses are compared to obtain the same portion of the IPV6 address as the aggregated IPV6 address network number; obtaining the summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number may include:
traversing 128-bit IPV6 addresses, using the first 128-bit IPV6 address as a reference, comparing with other 128-bit IPV6 addresses, and intercepting the same part as a summarized IPV6 address network number;
taking the length of the IPV6 address network number as a prefix of a summarized IPV6 address, and supplementing the prefix to the back of an IPV6 address network number to obtain a preliminarily summarized IPV6 address;
padding the preliminary summarized IPV6 address with 0 to obtain a 128-bit summarized IPV6 address;
the 128-bit aggregated IPV6 address is converted to hexadecimal, resulting in the aggregated IPV6 address.
In specific implementation, the processing mode of obtaining the final summarized IPV6 address further improves the efficiency and accuracy of summarizing the IPV6 address.
The following description is given as an example with reference to fig. 2 in order to understand how the invention may be implemented.
Taking the example of the exit device of the metro network publishing IPV6 addresses in a summary manner, the whole process of IPV6 address summary is described in more detail:
step S201: firstly, acquiring all IPV6 addresses needing to be summarized at an exit of a metropolitan area network and storing the addresses into a specified txt file; the collected demo.txt file is assumed to store information as follows:
240e:0400::1/32
240e:0401::2/32
240e:0402::3/32
240e:0503::/32。
step S202: reading the demo.txt file row by row, performing column division operation on the character strings extracted from each row by using '/' as a separator, wherein all IPV6 addresses do not contain prefixes any more after the operation, and the completed [0] data is:
240e:0400::1
240e:0401::2
240e:0402::3
240e:0503::。
step S203: using': as a separator, the values in [0] are again column-divided, padded with zeros for address lengths less than 8, formatted to the standard format of IPV6, while storing prefixes.
240e:0400:0000:0000:0000:0000:0000:0001/32
240e:0401:0000:0000:0000:0000:0000:0002/32
240e:0402:0000:0000:0000:0000:0000:0003/32
240e:0503:0000:0000:0000:0000:0000:0000/32。
Step S204: each entry is traversed, the prefix length is truncated from left to right using the prefix length (/32) and converted to decimal for storage, the data conversion process is:
truncated 16-ary:
240e0400/32
240e0401/32
240e0402/32
240e0503/32;
the converted 10-system:
604898304/32
604898305/32
604898306/32
604898563/32。
step S205: for loop traversal compares each item, using the latter item to subtract the former item, and dividing the result into a group of 1, storing the continuous addresses that can be summarized respectively, and storing the discontinuous other independent storage, for example, the first three items as a group, processing in the first loop, and the last item without being summarized, storing alone:
240e:0400/32
240e:0401/32
0402/32// or more, stored in a list;
0503/32// single group.
Step S206: using the string value': ' column division is carried out as a separator, a plurality of sections after column division are all converted into 2-system, zero is used for filling, all sections locally meet 16 bits such as [ '0010010000001110' ], a list lista is used for storage, and the output result is:
['0010010000001110','0000010000000000']
['0010010000001110','0000010000000001']
[ '0010010000001110', '0000010000000011' ]// the above group;
['0010010000001110','0000010100000011']。
step S207: filling the list of the storage fields in the S206 with zeros, so that the overall length of the list lista is equal to 8, and outputting a result that:
['0010010000001110','0000010000000000','0000000000000000',....]
['0010010000001110','0000010000000001','0000000000000000',....]
[ '0010010000001110', '0000010000000011', '0000000000000000', ] read. ]// the above group;
['0010010000001110','0000010100000011','0000000000000000',....]。
step S208: the NEW list NEW is used to store this 128-bit value (not including ':') in S207, ending the FOR loop, and the NEW list NEW will store a number of 128-bit fields, outputting the result:
['00100100000011100000010000000000000...,'0010010000001110000001....'];
['001001000000111000000101000000110000000000000000....']。
step S209: traversing the list NEW by using an FOR loop, using the first element in the list as a reference value, comparing other elements in the NEW list with the first element, intercepting the same part of the NEW list, using the part as the network number of the IPV6 address summarized at the last, storing by using a NEW2 list, using the length of the part as the prefix of the address summarized at the last IPV6, and ending the FOR loop;
the same parts of the two are cut:
001001000000111000000100000000/30// summarized in the first group;
00100100000011100000010100000011/32。
step S210: zero padding the NEW2 list to meet 128 bits, and partitioning, from left to right, into segments every 16 bits and adding': less than 16 bits are padded with zeros to make the NEW2 list equal to 16 per segment length:
0010010000001110:0000010000000000:0000000000000000:.../30;
0010010000001110:0000010100000011:0000000000000000:.../32。
step S211: converting the result into a 16-system, intercepting the result once according to every 4 bits, adding an IPV6 prefix to the result to obtain 8 groups of 16-bit IPV6 summary addresses of each group, and finally manually issuing the result as a summary route at an exit of the metropolitan area network:
240e:0400:0000:0000:0000:0000:0000:0000/30。
step S212: finally, other addresses which cannot be summarized are output (can be counted as a group):
240e:0503:0000:0000:0000:0000:0000:0000/32。
based on the same inventive concept, an apparatus for summarizing IPV6 addresses is also provided in the embodiments of the present invention, as described in the following embodiments. Because the principle of solving the problem of the summary processing device for the IPV6 address is similar to the summary processing method for the IPV6 address, the implementation of the summary processing device for the IPV6 address can refer to the implementation of the summary processing method for the IPV6 address, and repeated details are not described again. As used hereinafter, the term "unit" or "module" 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. 3 is a schematic structural diagram of a summary processing device of IPV6 addresses in the embodiment of the present invention, and as shown in fig. 3, the device includes:
the obtaining unit 01 is used for obtaining an IPV6 address to be summarized;
the grouping processing unit 02 is used for converting the IPV6 addresses to be summarized into decimal IPV6 addresses, and grouping the decimal IPV6 addresses to obtain at least one group of decimal IPV6 addresses;
an address conversion unit 03, configured to convert each set of decimal IPV6 addresses into binary IPV6 addresses, and convert each set of binary IPV6 addresses into 128-bit IPV6 addresses;
the summary processing unit 04 is configured to perform the following operation on each group of 128-bit IPV6 addresses to obtain an IPV6 summary address corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; and obtaining the summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number.
In an embodiment, the obtaining unit may be specifically configured to:
acquiring all IPV6 addresses needing to be summarized at an exit of a metropolitan area network and storing the addresses into a txt file;
reading the txt file line by line, and performing column division processing on IPV6 address character strings extracted by using a first preset delimiter to obtain all IPV6 addresses which do not contain prefixes;
and performing column division processing on all IPV6 addresses which do not contain prefixes by using a second preset separator, filling 0 for the address with the length less than 8, formatting the IPV6 address into a standard format, and simultaneously filling in the prefixes to obtain the IPV6 addresses to be summarized.
In an embodiment, the packet processing unit may be specifically configured to:
converting the IPV6 address to be summarized into a hexadecimal IPV6 address;
converting the hexadecimal IPV6 address to a decimal IPV6 address;
traversing each decimal IPV6 address, subtracting the previous IPV6 address from the next decimal IPV6 address, and grouping the IPV6 addresses with the result of 1 to obtain at least one decimal IPV6 address group with continuous addresses.
In an embodiment, the address translation unit 03 may specifically be configured to:
dividing the addresses of the IPV6 of each decimal group into rows and columns by using a second preset separator to obtain a plurality of sections of decimal IPV6 addresses;
converting each decimal IPV6 address into a binary IPV6 address, and filling with 0 to obtain a binary IPV6 address with 16 bits in each segment;
the 16-bit binary IPV6 address is filled with 0's, resulting in a 128-bit IPV6 address.
In an embodiment, the summary processing unit 04 may be specifically configured to:
traversing 128-bit IPV6 addresses, using the first 128-bit IPV6 address as a reference, comparing with other 128-bit IPV6 addresses, and intercepting the same part as a summarized IPV6 address network number;
taking the length of the IPV6 address network number as a prefix of a summarized IPV6 address, and supplementing the prefix to the back of an IPV6 address network number to obtain a preliminarily summarized IPV6 address;
the preliminary summary IPV6 addresses are filled with 0 to obtain a 128-bit summary IPV6 address;
the 128-bit aggregated IPV6 address is converted to hexadecimal, resulting in the aggregated IPV6 address.
The embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the method for summarizing and processing the IPV6 address is implemented.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program for executing the above-mentioned IPV6 address summarization processing method.
The technical scheme provided by the embodiment of the invention has the following beneficial technical effects: the IPV6 addresses are efficiently and accurately summarized and processed, and the summarizing and processing efficiency and accuracy of the IPV6 addresses are improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A method for processing the summary of IPV6 addresses is characterized by comprising the following steps:
acquiring an IPV6 address to be summarized;
converting the IPV6 addresses to be summarized into decimal IPV6 addresses, and performing grouping processing on the decimal IPV6 addresses to obtain at least one group of decimal IPV6 addresses;
converting each set of decimal IPV6 addresses to binary IPV6 addresses, and each set of binary IPV6 addresses to 128-bit IPV6 addresses;
the following operations are performed on each group of 128-bit IPV6 addresses to obtain the summary address of the IPV6 corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; obtaining a summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number;
obtaining an IPV6 address to be aggregated, including: acquiring all IPV6 addresses needing to be summarized at an exit of a metropolitan area network and storing the addresses into a txt file; reading the txt file line by line, and performing column division processing on IPV6 address character strings extracted by using a first preset delimiter to obtain all IPV6 addresses which do not contain prefixes; and performing column division processing on all IPV6 addresses without the prefixes by using a second preset separator, filling 0 for the address with the length less than 8, formatting the address into an IPV6 address in a standard format, and simultaneously filling the prefixes to obtain the IPV6 addresses to be summarized.
2. The IPV6 address summarization processing method of claim 1, wherein converting IPV6 addresses to be summarized into decimal IPV6 addresses, and grouping the decimal IPV6 addresses to obtain at least one decimal IPV6 address group, the method comprising:
converting the IPV6 address to be summarized into a hexadecimal IPV6 address;
converting the hexadecimal IPV6 address to a decimal IPV6 address;
traversing each decimal IPV6 address, subtracting the previous IPV6 address from the next decimal IPV6 address, and grouping the IPV6 addresses with the result of 1 to obtain at least one decimal IPV6 address group with continuous addresses.
3. The aggregate processing method of IPV6 addresses of claim 1, wherein converting each decimal IPV6 address into a binary IPV6 address and each binary IPV6 address into a 128-bit IPV6 address comprises:
ranking each set of decimal IPV6 addresses using a second preset separator to obtain a plurality of sections of decimal IPV6 addresses;
converting each decimal IPV6 address into a binary IPV6 address, and filling with 0 to obtain a binary IPV6 address with 16 bits in each segment;
the 16-bit binary IPV6 address is filled with 0's, resulting in a 128-bit IPV6 address.
4. The aggregate processing method of IPV6 addresses of claim 1, wherein comparing 128-bit IPV6 addresses yields the same portion of IPV6 addresses as an aggregate IPV6 address network number; obtaining a summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number, wherein the summarized IPV6 address comprises the following steps:
traversing 128-bit IPV6 addresses, using the first 128-bit IPV6 address as a reference, comparing with other 128-bit IPV6 addresses, and intercepting the same part as a summarized IPV6 address network number;
taking the length of the IPV6 address network number as a prefix of a summarized IPV6 address, and supplementing the prefix to the back of an IPV6 address network number to obtain a preliminarily summarized IPV6 address;
padding the preliminary summarized IPV6 address with 0 to obtain a 128-bit summarized IPV6 address;
the 128-bit aggregated IPV6 address is converted to hexadecimal, resulting in the aggregated IPV6 address.
5. An apparatus for summary processing of IPV6 addresses, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an IPV6 address to be summarized;
the grouping processing unit is used for converting the IPV6 addresses to be summarized into decimal IPV6 addresses and grouping the decimal IPV6 addresses to obtain at least one group of decimal IPV6 addresses;
an address conversion unit for converting each set of decimal IPV6 addresses into binary IPV6 addresses and each set of binary IPV6 addresses into 128-bit IPV6 addresses;
the summary processing unit is configured to perform the following operation on each group of 128-bit IPV6 addresses to obtain an IPV6 summary address corresponding to each group: comparing 128-bit IPV6 addresses to obtain the same part of the IPV6 address as a summarized IPV6 address network number; obtaining a summarized IPV6 address according to the IPV6 address network number and the length of the IPV6 address network number;
the obtaining unit is specifically configured to: acquiring all IPV6 addresses needing to be summarized at an exit of a metropolitan area network and storing the addresses into a txt file; reading the txt file line by line, and performing column division processing on IPV6 address character strings extracted by using a first preset delimiter to obtain all IPV6 addresses which do not contain prefixes; and performing column division processing on all IPV6 addresses without the prefixes by using a second preset separator, filling 0 for the address with the length less than 8, formatting the address into an IPV6 address in a standard format, and simultaneously filling the prefixes to obtain the IPV6 addresses to be summarized.
6. The aggregate processing device of IPV6 addresses of claim 5, wherein the packet processing unit is specifically configured to:
converting the IPV6 address to be summarized into a hexadecimal IPV6 address;
converting the hexadecimal IPV6 address to a decimal IPV6 address;
traversing each decimal IPV6 address, subtracting the previous IPV6 address from the next decimal IPV6 address, and grouping the IPV6 addresses with the result of 1 to obtain at least one decimal IPV6 address group with continuous addresses.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 4.
CN201910986515.6A 2019-10-17 2019-10-17 IPV6 address summarizing method and device Active CN110830603B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910986515.6A CN110830603B (en) 2019-10-17 2019-10-17 IPV6 address summarizing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910986515.6A CN110830603B (en) 2019-10-17 2019-10-17 IPV6 address summarizing method and device

Publications (2)

Publication Number Publication Date
CN110830603A CN110830603A (en) 2020-02-21
CN110830603B true CN110830603B (en) 2022-05-13

Family

ID=69549605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910986515.6A Active CN110830603B (en) 2019-10-17 2019-10-17 IPV6 address summarizing method and device

Country Status (1)

Country Link
CN (1) CN110830603B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114553819B (en) * 2020-11-23 2023-07-25 中盈优创资讯科技有限公司 IPv6 address identification method and device
CN113504930B (en) * 2021-07-28 2024-03-12 中移(杭州)信息技术有限公司 Determination method, terminal equipment and medium for newly added object

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6401130B1 (en) * 1999-01-08 2002-06-04 Nortel Networks Limited Auto aggregation method for IP prefix/length pairs
CN103117864A (en) * 2011-11-16 2013-05-22 阿里巴巴集团控股有限公司 Subnet combination method and device
CN106487939A (en) * 2015-08-26 2017-03-08 阿里巴巴集团控股有限公司 A kind of method and apparatus determining User IP subnet, a kind of electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6401130B1 (en) * 1999-01-08 2002-06-04 Nortel Networks Limited Auto aggregation method for IP prefix/length pairs
CN103117864A (en) * 2011-11-16 2013-05-22 阿里巴巴集团控股有限公司 Subnet combination method and device
CN106487939A (en) * 2015-08-26 2017-03-08 阿里巴巴集团控股有限公司 A kind of method and apparatus determining User IP subnet, a kind of electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
IP地址聚合算法的研究与分析;阮晓龙等;《微型电脑应用》;20170630;第33卷(第6期);正文第1节 *
基于APNIC Whois自动提取IP地址列表;肖锘等;《计算机与现代化 2008年》;20081031(第10期);正文第2-3节 *

Also Published As

Publication number Publication date
CN110830603A (en) 2020-02-21

Similar Documents

Publication Publication Date Title
CN110688377B (en) Method and device for updating state Merck tree
CN110830603B (en) IPV6 address summarizing method and device
JP3672242B2 (en) PATTERN SEARCH METHOD, PATTERN SEARCH DEVICE, COMPUTER PROGRAM, AND STORAGE MEDIUM
CN103049709B (en) Based on password recovery system and the restoration methods thereof of generator expansion rainbow table
CN111008201B (en) Method and apparatus for parallel modification and reading of state trees
GB2575952A (en) Blockchain for open scientific research
US20150046475A1 (en) Hardware implementation of a tournament tree sort algorithm
EP3361393A1 (en) Encoding method and device
CN105956492B (en) A kind of file storage encryption method and device
CN109815226B (en) Block chain-based data storage method, device, equipment and storage medium
CN102970043A (en) GZIP (GNUzip)-based hardware compressing system and accelerating method thereof
CN106712928A (en) Big data rainbow table based decryption method and device
CN106843820A (en) Code process method and apparatus
CN105279198A (en) Data table storage method, data table modification method, data table query method and data table statistical method
CN111209341B (en) Data storage method, device, equipment and medium of block chain
US8909897B2 (en) Method for generating a delta for compressed data
CN104991836A (en) Database recovery method and apparatus and database server
CN104503868A (en) Data synchronizing method, device and system
CN104503862B (en) The method and apparatus for obtaining the check value using channel bag
CN104036141B (en) Open computing language (OpenCL)-based red-black tree acceleration method
US9536016B2 (en) On-disk multimap
CN115549862B (en) MES system concurrency performance test data receiving method based on dynamic analysis
CN104991963B (en) Document handling method and device
CN110457064B (en) Method and device for generating network cutover script
CN110852118B (en) Distributed machine translation method and system

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
CP02 Change in the address of a patent holder

Address after: Room 702-2, No. 4811, Cao'an Highway, Jiading District, Shanghai

Patentee after: CHINA UNITECHS

Address before: 100872 5th floor, Renmin culture building, 59 Zhongguancun Street, Haidian District, Beijing

Patentee before: CHINA UNITECHS