IP Range Matching Using Sorted Boundary Records
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing IP address matching methods are inefficient and require significant computational time and memory when dealing with large lists of IP addresses, especially when an IP address may match multiple IP address ranges, and existing high-speed methods do not account for this scenario.
Innovation Solution
A matching device that generates records for start and end IP addresses within ranges, combines these with target IP addresses, and sorts them using IP addresses as primary keys and additional information as secondary keys, allowing efficient determination of IP address range matches.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If brute-force matching between M IP addresses and N IP address ranges is performed, then matching accuracy is ensured, but the time complexity becomes O(MN) which is enormous for large lists
Solution Approach 1:
The patent segments each IP address range into two boundary records (start IP address and end IP address), transforming N ranges into 2N boundary records. This segmentation enables the use of sorting and binary search algorithms, reducing the time complexity from O(MN) to O(M log N + N log N), while preserving matching accuracy by maintaining precise range boundaries.
Solution Approach 2:
The patent transforms the one-dimensional range matching problem into a two-dimensional sorted record structure by adding a record type dimension (start/end/match) and sorting both by IP address and record type. This dimensional transformation enables efficient binary search and linear scanning, achieving fast matching without sacrificing accuracy.
2Productivity
If IP address ranges are expanded and hashed for matching, then time complexity is reduced to O(M), but memory usage becomes enormous depending on the size of IP address ranges
Solution Approach 1:
The patent extracts only the essential boundary information (start and end IP addresses) of each range, discarding the need to expand and store all individual IP addresses within ranges. This extraction reduces memory usage from potentially enormous (when expanding large ranges) to linear with respect to the number of ranges (2N boundary records), while maintaining matching capability.
Solution Approach 2:
The patent creates compact boundary record copies that represent entire IP address ranges without expanding them. Each range is represented by two boundary records instead of all individual IP addresses, dramatically reducing memory usage while preserving the ability to perform accurate range matching through sorted comparison.
3Speed
If existing high-speed IP address lookup methods are used, then matching speed is improved, but they do not consider cases where an IP address matches multiple IP address ranges
Solution Approach 1:
The patent performs preliminary sorting of all boundary records by IP address and record type before matching. This preliminary action creates a structured foundation that enables efficient detection of multiple matches during the linear scanning phase, as all relevant boundary records are already in the correct order for comparison.
Solution Approach 2:
The patent implements a feedback mechanism during the linear scanning process where the algorithm continuously checks whether the current match record lies between the current start and end records. This feedback loop ensures that all overlapping ranges are detected and recorded, enabling the system to handle cases where an IP address matches multiple ranges while maintaining high speed.
Data Source
AI summary
A matching device includes processing circuitry configured to generate, for each IP address range in a list indicating reference IP address ranges, a record indicating a start IP address and a record indicating an end IP address in the IP address range, combine the record indicating a start IP address and the record indicating an end IP address of each of the reference IP address ranges and a record indicating an IP address to be matched, sort a combined record group using an 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, and determine that the IP address to be matched matches an IP address range.


