MATCHING DEVICE, MATCHING METHOD, AND MATCHING PROGRAM
By generating and sorting IP address range records with a primary and secondary key system, the method addresses the complexity issues in matching large IP address lists, achieving efficient and fast detection of matches.
Patent Information
- Application Number
- JP2023514194
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-04-12
- Publication Date
- 2024-10-16
- Estimated Expiration
- 2041-04-12
AI Technical Summary
Existing IP address matching methods face high time and space complexity when dealing with large lists of access source IP addresses and IP address ranges, particularly when multiple ranges need to be matched, and existing high-speed methods do not account for this scenario effectively.
A method involving generating records for IP address ranges with start and end addresses, combining these with target addresses, and sorting them using a primary and secondary key system to efficiently determine matches, reducing complexity to O(M+N) time and O((M+N)log(M+N)) with algorithms like Timsort.
This approach significantly reduces the computational effort required for matching large lists of IP addresses, allowing for fast and efficient detection of matches even in large-scale scenarios, with a substantial reduction in comparison operations.
Smart Images

Figure 0007568071000001 
Figure 0007568071000002 
Figure 0007568071000003
Abstract
Description
[Technical field]
[0001] The present invention relates to an IP address matching device, a matching method, and a matching program. [Background technology]
[0002] In order to detect suspicious access to servers, etc., it is necessary to identify which of the accesses shown in the access log to the server are from proxy servers or malicious IP addresses, and if there is access from a proxy server, what type of proxy server it is from.
[0003] If the server receives a large number of accesses, it is necessary to match a list of individual IP addresses from which a large number of accesses originate with a list of large numbers of IP addresses (including IP address ranges), such as the IP addresses of proxy servers or a list of malicious IP addresses. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] N. Yazdani, et al., Fast and Scalable schemes for the IP address Lookup Problem, High Performance Switching and Routing, 2000. ATM 2000. [Non-Patent Document 2] Changhoon Yim, et al., Efficient Binary Search for IP Address Lookup, IEEE Communications Letters (Volume: 9, Issue: 7, July 2005) [Non-Patent Document 3] Ju Hyoung Mun, et al., New Approach for Efficient IPAddress Lookup Using a Bloom Filter in Trie Based Algorithms, IEEE Transactions on Computers ( Volume: 65, Issue: 5, May 1 2016) Summary of the Invention [Problem to be solved by the invention]
[0005] Here, if the number of IP addresses from which the accesses originate, or the number of IP address ranges in the proxy server's IP address list and the list of malicious IP addresses (list of IP addresses for reference) is enormous, the time required for matching will become enormous.
[0006] For example, if the number of IP addresses of access sources is M and the number of IP address ranges in the reference IP address list is N, the time complexity required for matching IP addresses is O(MN).
[0007] It is also possible to match the IP addresses obtained by expanding the range of IP addresses in the list of reference IP addresses with each of the access source IP addresses using hashing, etc. With this method, the time complexity required for matching is O(M), but depending on the size of the range of IP addresses indicated in the list of reference IP addresses, the memory usage (space complexity) may become enormous.
[0008] Although there are high-speed matching methods for IP address lookup (see Non-Patent Documents 1, 2, and 3), these methods do not take into consideration the case where the IP address of the access source matches multiple IP address ranges.
[0009] Therefore, an object of the present invention is to solve the above-mentioned problems and to reduce the amount of calculation required when matching a large number of IP address lists. [Means for solving the problem]
[0010] In order to solve the above-mentioned problems, the present invention is characterized by comprising: a generation unit that generates, for each IP address range in a list indicating a reference IP address range, a record indicating a start IP address and a record indicating an end IP address of the IP address range; a combination unit that combines the records indicating the start IP address and the end IP address of each of the reference IP address ranges with records indicating IP addresses to be matched; a sorting unit that sorts the combined record group using the IP address of the record as a primary key and information indicating whether the record is a record of the IP address to be matched, a record indicating the start IP address, or a record of the end IP address as a secondary key; a judgment unit that judges that the IP address to be matched matches the IP address range if, in the sorted record group, there is a record of the IP address to be matched between the record indicating the start IP address and the record indicating the end IP address of any of the IP address ranges; and a judgment result output unit that outputs the result of the judgment. Effect of the Invention
[0011] According to the present invention, it is possible to reduce the amount of calculation required when matching a large number of IP address lists. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a diagram for explaining an outline of the matching device. [Diagram 2] FIG. 2 is a diagram for explaining an outline of the operation of the matching device. [Diagram 3] FIG. 3 is a diagram for explaining an outline of the operation of the matching device. [Figure 4] FIG. 4 is a diagram illustrating an example of the configuration of a matching device. [Diagram 5]FIG. 5 is a flowchart illustrating an example of a processing procedure of the matching device. [Figure 6] FIG. 6 is a diagram showing an example of determination by the matching device. [Figure 7] FIG. 7 is a diagram showing an application example of IP address matching by the matching device. [Figure 8] FIG. 8 is a diagram illustrating an example of a computer that executes a matching program. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, a mode (embodiment) for carrying out the present invention will be described with reference to the drawings. The present invention is not limited to the embodiment described below.
[0014] In the following description, the matching device performs matching between a list of IP addresses to be matched and a list of reference IP addresses. The list of reference IP addresses is, for example, a list of IP addresses that may be malicious, such as a list of IP addresses of proxy servers or a list of malicious IP addresses.
[0015] In addition, the IP addresses in the list of IP addresses to be matched are each an individual IP address. In addition, the IP addresses in the list of reference IP addresses are each an individual IP address or an IP address range. Each list is assumed to be a large list, with a total size of 1M or more.
[0016] [overview] First, an overview of the matching device of the present embodiment will be described with reference to Fig. 1. The matching device matches a list of IP addresses to be matched (for example, IP addresses of access sources obtained from an access log) with a list of reference IP addresses.
[0017] For example, the matching device matches a list of IP addresses of access origins with a list of IP addresses for reference, thereby determining whether each access is via a proxy server. For example, if the IP address of the access origin corresponds to an IP address (IP address range) of a proxy server in the list of IP addresses for reference, the matching device determines that the access is via a proxy server. This allows the matching device to determine whether the access from the IP address of the access origin is likely to be malicious.
[0018] An overview of the operation of the matching device will be described with reference to Figures 2 and 3. First, the matching device assigns an index to each range of IP addresses in the list of reference IP addresses (Figure 2 (1) Assigning an index to the list of reference IP addresses).
[0019] Next, the matching device divides each IP address range in the list of reference IP addresses into a record of the starting IP address of the range and a record of the ending IP address of the range ((2) Divide a range in the list of reference IP addresses into a starting IP address and an ending IP address).
[0020] At this time, the matching device assigns information (e.g., BEGIN) to the record of the starting IP address indicating that it is a record of the starting IP address, and assigns information (e.g., END) to the record of the ending IP address indicating that it is a record of the ending IP address.
[0021] Next, the matching device combines the list obtained by the process in (2) with the list of IP addresses to be matched ((3) Combine with the list of IP addresses to be matched). At this time, the matching device adds information (e.g., TARGET) to the records of the IP addresses to be matched, indicating that they are records of IP addresses to be matched.
[0022] Move on to the description of FIG. 3. The matching device sorts each record in the list obtained by performing the process of (3) in FIG. 2 in ascending order according to the following rules ((4) sort in ascending order according to the following rules).
[0023] Primary key: IP address (sort with the IP address as an integer value) Secondary key: Sort in the order of BEGIN < TARGET < END
[0024] According to the above rules, each record is sorted as shown by reference numeral 301 in FIG. 3, for example.
[0025] Thereafter, for each record sorted in (4), the matching device determines, in order from the top, whether there is a record of the IP address to be matched between the record of the start IP address and the record of the end IP address having the same index ((5) process in order from the top).
[0026] For example, for the portion surrounded by the broken line in the list shown by reference numeral 302 in FIG. 3, the matching device determines that there is an IP address 1.1.1.2 to be matched between the start IP address (BEGIN) and the end IP address (END) of index 0 (1.1.1.1 - 1.1.1.10). Therefore, the matching device determines that the IP address 1.1.1.2 to be matched is included (matched) in the IP address range of index 0 (1.1.1.1 - 1.1.1.10) of the reference IP addresses.
[0027] By performing the matching of each list of IP addresses as described above, the matching device can reduce the computational complexity required for matching even if each list is large.
[0028] For example, if the number of IP addresses in the list of IP addresses to be matched is M and the number of IP address ranges in the list of reference IP addresses is N, the space complexity required for matching IP addresses in each list can be O(M+N). Also, for example, if the sorting algorithm used for matching is Timsort, the time complexity required for matching IP addresses in each list can be O((M+N)log(M+N)).
[0029] [Configuration example] Next, a configuration example of the matching device will be described with reference to Fig. 4. As shown in Fig. 4, the matching device 10 includes an input / output unit 11, a storage unit 12, and a control unit 13.
[0030] The input / output unit 11 is an interface that controls the input / output of various data. For example, the input / output unit 11 receives inputs of a list of IP addresses to be matched, a list of IP addresses for reference, etc. The IP addresses in each list may be IPv4 IP addresses or IPv6 IP addresses.
[0031] The storage unit 12 stores various data to be referred to when the control unit 13 executes various processes. For example, the storage unit 12 stores a list of IP addresses to be matched and a list of reference IP addresses input via the input / output unit 11. The storage unit 12 also temporarily stores data created by the control unit 13 in the process of performing matching.
[0032] The control unit 13 is responsible for controlling the entire matching device 10. The control unit 13 includes a generating unit 131, a combining unit 132, a sorting unit 133, a determining unit 134, and a determination result output unit 135, for example.
[0033] The generating unit 131 generates, for each range of IP addresses in the list of reference IP addresses, a record indicating the start IP address and the end IP address of the range of IP addresses.
[0034] For example, the generation unit 131 first assigns an index to each range of IP addresses in the list of reference IP addresses (see (1) in FIG. 2). Then, for each range of IP addresses, the generation unit 131 generates a record of the start IP address and a record of the end IP address of the range of IP addresses.
[0035] Then, the generation unit 131 assigns information indicating that the record is a record of the start IP address (e.g., BEGIN) to the record of the start IP address of the range of IP addresses. Also, the generation unit 131 assigns information indicating that the record is a record of the end IP address (e.g., END) to the record of the end IP address of the range of IP addresses (see (2) in FIG. 2).
[0036] The combining unit 132 combines the records generated by the generation unit 131 with the records of the IP addresses in the list of IP addresses to be matched. At this time, the combining unit 132 assigns information indicating that the record is a record of the IP address to be matched (e.g., TARGET) to the record of the IP address to be matched (see (3) in FIG. 2).
[0037] The sorting unit 133 sorts the group of records combined by the combining unit 132 with the IP address of each record as the primary key and information indicating whether each record is a record of the IP address to be matched, a record of the start IP address, or a record of the end IP address (e.g., TARGET, BEGIN, END) as the secondary key (see (4) in FIG. 3). For example, the sorting unit 133 sorts each record in ascending order of BEGIN<TARGET<END.
[0038] As a result, the sorting unit 133 can sort so that, for example, even when the IP address of a record with TARGET attached matches the IP address of a record with BEGIN or END attached, the record with TARGET attached is arranged between the record with BEGIN attached and the record with END attached.
[0039] The sorting algorithm used by the sorting unit 133 is, for example, Timsort.
[0040] If, in the records sorted by the sorting unit 133, there is a record of the IP address to be matched between the record of the starting IP address and the record of the ending IP address of any IP address range in the list of reference IP addresses (see (5) in Figure 3), the judgment unit 134 judges that the IP address to be matched falls within the IP address range.
[0041] In addition, if, in the records sorted by the sorting unit 133, there is no record of the IP address to be matched between the record indicating the start IP address and the record indicating the end IP address of any IP address range in the list of reference IP addresses, the judgment unit 134 judges that each IP address in the list of matching IP addresses does not fall into any IP address range in the list of reference IP addresses.
[0042] The determination result output unit 135 outputs the result of the determination made by the determination unit 134. For example, when the determination unit 134 determines that the IP address of the matching target falls within the range of IP addresses in the malicious IP list, the determination result output unit 135 outputs a determination result indicating that the access from the IP address of the matching target is likely to be malicious access.
[0043] Furthermore, the determination result output unit 135 may output attribute information of the IP address range to which the matching target IP address matches as the determination result. For example, when the determination unit 134 determines that the matching target IP address is included in the IP address range of the Web Proxy and the IP address range of the Residential Proxy, the determination result output unit 135 may output a determination result indicating that the matching target IP address is accessed from the Web Proxy and the Residential Proxy.
[0044] [Example of processing procedure] Next, an example of a processing procedure of the matching device 10 will be described with reference to Fig. 5. It is assumed that the matching device 10 has already acquired a list of reference IP addresses and a list of IP addresses to be matched.
[0045] First, the generating unit 131 of the matching device 10 assigns an index to the record of each IP address range in the list of reference IP addresses (S1). Next, the generating unit 131 divides the record of each IP address range in the list of reference IP addresses into a record of the start IP address and a record of the end IP address (S2). Then, the combining unit 132 combines the list of reference IP addresses divided in S2 with the records of the list of IP addresses to be matched (S3).
[0046] After S3, the sorting unit 133 sorts each record in the list combined in S3 in ascending order (S4). In this case, the primary key is the IP address, and the secondary key is information (e.g., TARGET, BEGIN, END) indicating whether each record is a record of the IP address to be matched, a record of the start IP address, or a record of the end IP address.
[0047] For example, for each record in the list combined in S3, the sorting unit 133 sorts the records such that the value obtained by converting the IP address, which is the primary key, into an integer value is in ascending order, and the secondary keys TARGET, BEGIN, and END are in ascending order with BEGIN < TARGET < END.
[0048] After S4, the determination unit 134 determines, in order from the top, whether there is an IP address to be matched between the record with the start IP address with the same index and the end IP address among the unprocessed records in the sorted records (S5).
[0049] Here, when the determination unit 134 determines that there is an IP address to be matched between the record with the start IP address with the same index and the end IP address (Yes in S5), it is determined that the IP address to be matched is included in (matches) the range of the IP address of that index (S6). Then, when the determination unit 134 determines that all the sorted records have been processed (Yes in S7), it proceeds to S8. On the other hand, when the determination unit 134 determines that there are unprocessed records (No in S7), it returns to S5.
[0050] In S7, when the determination unit 134 determines that all the sorted records have been processed (Yes in S7), the determination unit 134 outputs the determination result to the determination result output unit 135. Then, the determination result output unit 135 outputs the determination result by the determination unit 134 via the input / output unit 11 (S8). For example, the determination result output unit 135 outputs the attribute information (e.g., Web Proxy, Residential Proxy, etc.) of the IP address range to which the IP address to be matched corresponds (matches) and the IP address to be matched.
[0051] By the matching device 10 performing the above processing, even if the lists of IP addresses are each large-scale, the amount of calculation required for matching can be reduced. As a result, the matching device 10 can perform matching between large-scale lists of IP addresses at high speed and with high efficiency.
[0052] For example, when the matching device 10 matches a list of 1 million IP addresses with a list of 1 million reference IP addresses, the number of comparisons between IP addresses can be reduced to 1 / 10000 or less compared to matching the IP addresses in each list one by one. As a result, the time required for matching the lists of IP addresses can be significantly reduced.
[0053] The process of S5 in Fig. 5 may be performed, for example, as follows. For example, the determination unit 134 looks through the unprocessed records from top to bottom, and when it finds a record to which BEGIN has been added, it sets a flag for the index added to that record. Also, when the determination unit 134 finds a record to which TARGET has been added, it determines that the IP address of the record to which TARGET has been added is included in the range of IP addresses corresponding to the index for which the flag has been set. Also, when the determination unit 134 finds a record to which END has been added, it clears the flag for the index added to that record.
[0054] The determination unit 134 executes the above process from the top to the last record. Then, the determination unit 134 sets the IP address range corresponding to the index with the flag set as the IP address range that matches the matching target IP address. In this way, the determination unit 134 can detect all matching target IP addresses even if the matching target IP address is included in multiple IP address ranges.
[0055] For example, as shown in FIG. 6, even if the ranges of multiple IP addresses to which the matching target IP address falls are nested (see reference number 601) or partially overlap (see reference number 602), it is possible to detect them without omission.
[0056] For example, in the case of the example indicated by the reference numeral 601, the determining unit 134 can detect that the matching target IP address "1.1.1.2" is included in index 0 (1.1.1.1-1.1.1.10) and index 1 (1.1.1.1-1.1.1.5).
[0057] In the example indicated by the reference numeral 602, the determining unit 134 can detect that the matching target IP address "1.1.1.3" is included in index 0 (1.1.1.1-1.1.1.10) and index 2 (1.1.1.2-1.1.1.15).
[0058] [Example of application] An application example of matching of IP address lists by the matching device 10 will be described with reference to Fig. 7. For example, IP address matching by the matching device 10 may be applied to matching an IP (IP address) log of credit card payments at a shopping site with a pre-prepared Proxy List, as shown in Fig. 7 (1). Here, if an IP address written in the IP log falls within any of the IP address ranges in the pre-prepared Proxy List, the access corresponding to the IP log can be determined to be a suspicious access via a Proxy.
[0059] Furthermore, the matching of IP addresses by the matching device 10 may be applied to matching an access log to a server of a certain website with a prepared list of malicious IP addresses, as shown in (2) of Fig. 7. Here, if an IP address recorded in the access log falls within any of the IP address ranges in the prepared list of malicious IP addresses, it can be determined that the access corresponding to the IP log is an access from a hijacked terminal, etc.
[0060] [System configuration, etc.] In addition, each component of each unit shown in the figure is a functional concept, and does not necessarily have to be physically configured as shown in the figure. In other words, the specific form of distribution and integration of each device is not limited to that shown in the figure, and all or a part of it can be functionally or physically distributed and integrated in any unit according to various loads, usage conditions, etc. Furthermore, each processing function performed by each device can be realized in whole or in part by a CPU and a program executed by the CPU, or can be realized as hardware using wired logic.
[0061] Furthermore, among the processes described in the above embodiments, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically by a known method. In addition, the information including the processing procedures, control procedures, specific names, various data and parameters shown in the above documents and drawings can be changed arbitrarily unless otherwise specified.
[0062] [program] The above-mentioned matching device 10 can be implemented by installing a program as package software or online software on a desired computer. For example, the above-mentioned program can be executed by an information processing device, causing the information processing device to function as the matching device 10. The information processing device here includes desktop or notebook personal computers. In addition, the information processing device also includes mobile communication terminals such as smartphones, mobile phones, and PHS (Personal Handyphone System), and further terminals such as PDA (Personal Digital Assistant), etc.
[0063] The matching device 10 may also be implemented as a server device that provides services related to the above-mentioned processes to a client terminal device used by the user. In this case, the server device may be implemented as a Web server or as a cloud that provides services related to the above-mentioned processes by outsourcing.
[0064] 8 is a diagram showing an example of a computer that executes a matching program. The computer 1000 has, for example, a memory 1010 and a CPU 1020. The computer 1000 also has a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070. These components are connected by a bus 1080.
[0065] The memory 1010 includes a read only memory (ROM) 1011 and a random access memory (RAM) 1012. The ROM 1011 stores a boot program such as a basic input output system (BIOS). The hard disk drive interface 1030 is connected to a hard disk drive 1090. The disk drive interface 1040 is connected to a disk drive 1100. A removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 1100. The serial port interface 1050 is connected to a mouse 1110 and a keyboard 1120, for example. The video adapter 1060 is connected to a display 1130, for example.
[0066] The hard disk drive 1090 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. That is, a program that defines each process executed by the above-mentioned matching device 10 is implemented as a program module 1093 in which a computer-executable code is written. The program module 1093 is stored, for example, in the hard disk drive 1090. For example, a program module 1093 for executing a process similar to the functional configuration of the matching device 10 is stored in the hard disk drive 1090. The hard disk drive 1090 may be replaced by an SSD (Solid State Drive).
[0067] Data used in the processing of the above-described embodiment is stored as program data 1094 in, for example, the memory 1010 or the hard disk drive 1090. Then, the CPU 1020 reads out the program module 1093 or the program data 1094 stored in the memory 1010 or the hard disk drive 1090 into the RAM 1012 as necessary and executes them.
[0068] Note that the program module 1093 and the program data 1094 are not limited to being stored in the hard disk drive 1090, but may be stored in, for example, a removable storage medium and read by the CPU 1020 via the disk drive 1100 or the like. Alternatively, the program module 1093 and the program data 1094 may be stored in another computer connected via a network (such as a local area network (LAN) or wide area network (WAN)). The program module 1093 and the program data 1094 may then be read by the CPU 1020 from the other computer via the network interface 1070. [Explanation of symbols]
[0069] 10 Matching device 11 Input / output section 12 Storage section 13 Control section 131 Generation part 132 Joint 133 Sorting section 134 Judgment section 135 Judgment result output unit
Claims
1. a generating unit that generates, for each IP address range in a list indicating the reference IP address range, a record indicating a start IP address and a record indicating an end IP address of the IP address range; a combining unit that combines a record indicating a start IP address and a record indicating an end IP address of each of the reference IP address ranges with a record indicating an IP address to be matched; a sorting unit that sorts the combined record group using the IP address of the record as a primary key and information indicating whether the record is a record of the IP address to be matched, a record indicating the start IP address, or a record of the end IP address as a secondary key; a determination unit that, when a record of the IP address to be matched is between a record indicating a start IP address and a record indicating an end IP address of any of the IP address ranges in the sorted record group, determines that the IP address to be matched matches the IP address range; a judgment result output unit that outputs a result of the judgment; A matching device comprising:
2. The sorting unit includes: The combined records are sorted in ascending order using the IP address of each record as a primary key, and the secondary keys are sorted in the order of the record indicating the start IP address, the record indicating the IP address to be matched, and the record indicating the end IP address.
2. The matching device according to claim 1.
3. The determination unit, If it is determined that the IP address to be matched matches any of the IP address ranges, The determination result output unit A determination result is output indicating that the access from the matching IP address is likely to be malicious.
2. The matching device according to claim 1.
4. The determination unit, If it is determined that the IP address to be matched matches any of the IP address ranges, The determination result output unit Output attribute information for each of the IP address ranges that match the matching target IP address 2. The matching device according to claim 1.
5. A matching method performed by a matching device, comprising: generating, for each IP address range in the list of reference IP address ranges, a record indicating a start IP address and a record indicating an end IP address of the IP address range; combining a record indicating a start IP address and a record indicating an end IP address of each of the reference IP address ranges with a record indicating an IP address to be matched; sorting the combined records using the IP address of the record as a primary key and information indicating whether the record is a record of the IP address to be matched, a record indicating the start IP address, or a record of the end IP address as a secondary key; determining that the matching IP address matches the IP address range when the record of the matching IP address is between a record indicating a start IP address and a record indicating an end IP address in any of the IP address ranges in the sorted record group; outputting the result of the determination; A matching method comprising:
6. generating, for each IP address range in the list of reference IP address ranges, a record indicating a start IP address and a record indicating an end IP address of the IP address range; combining a record indicating a start IP address and a record indicating an end IP address of each of the reference IP address ranges with a record indicating an IP address to be matched; a sorting unit that sorts the combined record group using the IP address of the record as a primary key and information indicating whether the record is a record of the IP address to be matched, a record indicating the start IP address, or a record of the end IP address as a secondary key; determining that the matching IP address matches the IP address range when the record of the matching IP address is between a record indicating a start IP address and a record indicating an end IP address in any of the IP address ranges in the sorted record group; outputting the result of the determination; A matching program that causes a computer to execute the above steps.
Citation Information
Patent Citations
Data retrieving apparatus
JP2005117211A
Communication apparatus
JP2006054637A
Systems and methods for geoprocessing-based computing network security
US20180063082A1
System and method for determining a customer associated with a range of IP addresses by employing a configurable rule engine with IP address range matching
US6813645B1
