CN110505322B - IP address field searching method and device - Google Patents

IP address field searching method and device Download PDF

Info

Publication number
CN110505322B
CN110505322B CN201910800729.XA CN201910800729A CN110505322B CN 110505322 B CN110505322 B CN 110505322B CN 201910800729 A CN201910800729 A CN 201910800729A CN 110505322 B CN110505322 B CN 110505322B
Authority
CN
China
Prior art keywords
address
boundary
target
storage tree
subsets
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
CN201910800729.XA
Other languages
Chinese (zh)
Other versions
CN110505322A (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201910800729.XA priority Critical patent/CN110505322B/en
Publication of CN110505322A publication Critical patent/CN110505322A/en
Application granted granted Critical
Publication of CN110505322B publication Critical patent/CN110505322B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9027Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • 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/668Internet protocol [IP] address subnets

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a method and a device for searching an IP address field, wherein the method comprises the following steps: acquiring a boundary IP address storage tree and a target IP address; traversing a path formed from a root node to any leaf node in the boundary IP address storage tree; acquiring IP subsets stored on the path and integrating the IP subsets into a boundary IP address; determining an IP address section corresponding to the boundary IP address; judging whether the target IP address is in the IP address field interval or not; if yes, determining the IP address field as the IP address field needing to be searched.

Description

IP address field searching method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for searching an IP address segment.
Background
Compared with the development of the traditional PC and single chip microcomputer, the FPGA (field programmable gate array) chip is greatly different, usually mainly adopts parallel operation, has higher clock frequency and abundant hardware resources, and can quickly and effectively control complex combinational logic and sequential logic circuits.
Generally speaking, the functions that can be realized by the CPU are also realized by the FPGA. However, when facing extremely complex algorithms, it is difficult to implement the algorithms by using the FPGA, and the resource consumption is also large, so that what kind of algorithms are suitable for implementing the FPGA, and reducing the resource consumption becomes a key point of concern in the current FPGA development.
In the related art, when the IP address segment (i.e., the IP address range) is searched on the FPGA, the commonly used algorithms are sequential search, binary search, hash table search, and the like. The method comprises the steps of sequential searching and storage space saving, wherein one IP address segment is stored in one memory space, but the searching times are uncertain, and the searching performance is difficult to evaluate; compared with sequential searching, binary searching has greatly improved searching times, but the searching times are still difficult to accept when the IP address field is more; the hash table lookup can reduce the lookup times, but the IP address segment needs to be expanded to consume more address space, hash collision cannot be avoided, and the lookup times are uncertain. Therefore, a high-performance IP address field searching method suitable for being implemented inside an FPGA chip is urgently needed.
Disclosure of Invention
In view of the above, the present application provides a method and an apparatus for searching an IP address segment.
Specifically, the method is realized through the following technical scheme:
an IP address field searching method is applied to FPGA, and the method comprises the following steps:
acquiring a boundary IP address storage tree and a target IP address;
traversing a path formed from a root node to any leaf node in the boundary IP address storage tree;
acquiring IP subsets stored on the path and integrating the IP subsets into a boundary IP address;
determining an IP address section corresponding to the boundary IP address;
judging whether the target IP address is in the IP address segment interval or not;
if yes, determining the IP address field as the IP address field needing to be searched.
An IP address field searching device applied to FPGA, the device comprises:
the first acquisition module is used for acquiring a boundary IP address storage tree and a target IP address;
the traversal module is used for traversing a path from a root node to any leaf node in the boundary IP address storage tree;
a second obtaining module, configured to obtain the IP subsets stored on the path and integrate the IP subsets into a boundary IP address;
the first determining module is used for determining an IP address section corresponding to the boundary IP address;
the judging module is used for judging whether the target IP address is in the IP address field interval or not;
and the second determining module is used for determining that the IP address field is the IP address field needing to be searched if the IP address field is the IP address field needing to be searched.
According to the technical scheme provided by the embodiment of the application, the IP subsets stored on the path are obtained by traversing the path formed by the root node to any leaf node in the boundary IP address storage tree, the boundary IP address is integrated, whether the target IP address is in the IP address section interval corresponding to the boundary IP address is judged, and the IP address section to be searched is determined according to the judgment result, wherein the boundary IP address storage tree is used for splitting and storing the boundary IP address in the IP address section, the relation between the storage resources and the searching performance is well balanced, the IP address section to be searched is determined to be relatively simple and efficient, the consumed FPGA resources are limited, and the method is easy to realize on an FPGA.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required in the description of the embodiments will be briefly introduced below, and it is apparent that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart illustrating an implementation flow of a method for searching an IP address field according to an exemplary embodiment of the present application;
FIG. 2 is a diagram illustrating a right boundary IP address storage tree in accordance with an exemplary embodiment of the present application;
FIG. 3 is a diagram illustrating another right boundary IP address memory tree in accordance with an illustrative embodiment of the present application;
FIG. 4 is a diagram of a hardware configuration shown in an exemplary embodiment of the present application;
fig. 5 is a schematic structural diagram of an IP address segment lookup apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
As shown in fig. 1, an implementation flow diagram of a method for searching an IP address field provided in the embodiment of the present application is shown, where the method specifically includes the following steps:
s101, acquiring a boundary IP address storage tree and a target IP address;
in the embodiment of the present application, in order to save a storage space, a boundary IP address storage tree is generated, and a boundary IP address in an IP address segment is split and stored, which is specifically as follows:
acquiring a plurality of IP address sections;
when the policies such as speed limit, protection, etc. are configured in the network device, user grouping is usually performed according to the IP address, and then the policies such as speed limit, protection, etc. are configured for user groups, and each user group has an IP address segment corresponding to the user group, as shown in table 1 below:
user group IP address field
A 10.10.11.31——10.10.12.33
B 10.10.12.35——10.10.12.35
TABLE 1
In the embodiment of the present application, several IP address fields as shown in table 1 may be obtained: "10.10.11.31-10.10.12.33", "10.10.12.35-10.10.12.35".
Sequencing the plurality of IP address fields, wherein the sequencing rule can be from small to large or from large to small, and the sequencing rule is not limited in the embodiment of the application;
sequencing the obtained IP address fields, taking sequencing from small to large as an example, the sequencing result is as follows: "10.10.11.31-10.10.12.33", "10.10.12.35-10.10.12.35".
Separating a plurality of boundary IP addresses in the plurality of sequenced IP address segments, wherein the boundary IP addresses comprise a left boundary IP address or a right boundary IP address;
after the plurality of IP address segments are sorted, a plurality of boundary IP addresses in the plurality of IP address segments are separated, taking a right boundary as an example, a plurality of right boundary IP addresses in the plurality of IP address segments are separated, as shown in table 2 below:
IP address field Right border IP address
10.10.11.31——10.10.12.33 10.10.12.33
10.10.12.35——10.10.12.35 10.10.12.35
TABLE 2
As shown in Table 1 above, the right boundary IP address "10.10.12.33" in the split IP address segment "10.10.11.31-10.10.12.33" and the right boundary IP address "10.10.12.35" in the split IP address segment "10.10.12.35-10.10.12.35".
Aiming at any boundary IP address, converting the boundary IP address into a target boundary IP address according to a preset conversion rule;
taking the right border IP address as an example, the right border IP address is generally in a decimal expression form, and is converted into a hexadecimal expression form, as shown in table 3 below:
right border IP address Target boundary IP address
10.10.12.33 0x0a0a0c21
10.10.12.35 0x0a0a0c23
TABLE 3
As shown in table 3 above, the right border IP address "10.10.12.33" is converted into the target border IP address "0 x0a0a0c 21" and the right border IP address "10.10.12.35" is converted into the target right border IP address "0 x0a0a0c 23" according to the preset conversion rules.
Splitting the target boundary IP address according to a preset splitting rule to obtain a plurality of IP subsets;
generally, according to the internal cache characteristics of the FPGA, a splitting rule is configured, for example, five-level splitting is performed on a target right boundary IP address "0 x0a0a0c 21", a content corresponding to each level is called an IP subset, and the target right boundary IP address "0 x0a0a0c 21" includes 32 bits: 0-31, first stage [ 31: 16 ] for 16 bits, corresponding to "0 aOa" in the target boundary IP address "0 x0a0a0c 21", 4 bits in the second level [ 15:12 ], corresponding to "0" in the target boundary IP address "0 x0a0a0c 21", 4 bits in the third level [ 11:8 ], corresponding to "c" in the target boundary IP address "0 x0a0a0c 21", 4 bits in the fourth level [ 7:4 ], corresponding to "2" in the target boundary IP address "0 x0a 0c 21", 4 bits in the fifth level [ 3:0 ], corresponding to "1" in the target boundary IP address "0 x0a0a0c 21", so that it can be seen that the target right boundary IP address "0 x0a0a0c 21" is divided into five IP subsets: "0 aOa", "0", "c", "2", "1".
The repeated IP subsets are removed aiming at the IP subsets corresponding to the plurality of boundary IP addresses, and effective IP subsets are obtained;
for example, the target right border IP address "0 x0a0a0c 21" is split into five IP subsets: "0 aOa", "0", "c", "2", "1", split into five IP subsets for the target right border IP address 0x0a0a0c 23: "0 a0 a", "0", "c", "2", "3", eliminating duplicate IP subsets: "0 aOa", "0", "c", "2", resulting in a valid IP subset: "0 aOa", "0", "c", "2", "1", "3". Thus, it can be seen that for the target right boundary IP address "0 x0a0a0c 21" and the target right boundary IP address 0x0a0a0c23, the IP subset is shared: "0 aOa", "0", "c", "2".
And generating a boundary IP address storage tree by utilizing the effective IP subsets and the front-back connection relation of each IP subset in the boundary IP addresses. A right boundary IP address storage tree may thus be generated, or a left boundary IP address storage tree may be generated.
And generating a boundary IP address storage tree by using the obtained effective IP subsets and the front-back connection relation of each IP subset in the boundary IP addresses. For example, for the active IP subset: "0 aOa", "0", "c", "2", "1", "3", for the tandem relationship of five IP subsets "0 aOa", "0", "c", "2", "1" in the target right boundary IP address "0 x0a0a0c 21": the first level IP subset "0 aOa" points to the second level IP subset "0", the second level IP subset "0" points to the third level IP subset "c", the third level IP subset "c" points to the fourth level IP subset "2", the fourth level IP subset "2" points to the fifth level IP subset "1", for the tandem relationship of five IP subsets "0 aOa", "0", "c", "2", "3" in the target right boundary IP address "0 x0a0a0c 23": first level IP subset "0 aOa" points to second level IP subset "0", second level IP subset "0" points to third level IP subset "c", third level IP subset "c" points to fourth level IP subset "2", fourth level IP subset "2" points to fifth level IP subset "3", a right boundary IP address storage tree is generated, as shown in fig. 2.
Therefore, the IP address of the IP address segment boundary is arranged and stored, so that the storage space is compressed, and the searching times are reduced.
In the process of actually searching the IP address field, the generated boundary IP address storage tree may be obtained, for example, a right boundary IP address storage tree is obtained, and in addition, a target IP address is obtained, where the target IP address may be one or more.
S102, traversing a path from a root node to any leaf node in the boundary IP address storage tree;
for the above boundary IP address storage tree, a path formed from a root node to any leaf node is traversed, for example, for the right boundary IP address storage tree, a path formed from a root node to any leaf node is traversed: path 1 ("0 aOa", "0", "c", "2", "1"), path 2 ("0 aOa", "0", "c", "2", "3").
S103, acquiring IP subsets stored on the path and integrating the IP subsets into a boundary IP address;
for example, as shown in the right border IP address storage tree of fig. 2, the path from the root node to any leaf node: path 1, path 2, acquiring the IP subset stored on path 1: "0 aOa", "0", "c", "2", "1", integrated into the right border IP address "0 aOa0c 21", the IP subset stored on path 2 is obtained: "0 aOa", "0", "c", "2", "3", integrated into the right boundary IP address "0 aOa0c 23".
S104, determining an IP address section corresponding to the boundary IP address;
in the embodiment of the application, for the boundary storage tree, each node further stores an IP address segment identifier for indicating an IP address segment corresponding to an IP subset stored by the current node, and the IP address segment identifiers corresponding to the IP subsets stored on the same path are consistent, so that the IP address segment corresponding to the boundary IP address can be determined.
For example, as shown in fig. 3, each node stores an IP subset and an IP address segment identifier corresponding to the IP subset, acquires the IP subsets stored on a path, integrates the IP subsets into a boundary IP address, and may also determine the IP address segment identifier corresponding to the boundary IP address, thereby determining the IP address segment corresponding to the boundary IP address.
S105, judging whether the target IP address is in the IP address field interval;
for a target IP address, it needs to determine which IP address segment the target IP address belongs to, i.e. determine which IP address segment the target IP address is in.
Wherein, for the IP address field, the front-back position relation of the target IP address and the right boundary IP address thereof is preferentially judged; if the target IP address is in front of the right boundary IP address, continuously judging the front-back relationship of the target IP address and the left boundary IP address thereof, and if the target IP address is behind the right boundary IP address thereof, determining that the IP address segment is not the IP address segment to be searched; if the target IP address is behind the left boundary IP address, the IP address segment is determined to be the IP address segment needing to be searched.
In addition, the number of the IP address fields is usually multiple, whether the target IP address is in the multiple IP address field intervals can be judged in parallel, and the parallel processing characteristic of the FPGA chip can be better played.
And S106, if so, determining the IP address field as the IP address field needing to be searched.
For the above judgment result, if the target IP address is in the IP address field interval, it may be determined that the IP address field is the IP address field to be searched, and if the target IP address is not in the IP address field interval, it may be determined that the IP address field is not the IP address field to be searched.
For example, for multiple IP address segments: the IP address field 0, the IP address field 1, the IP address field 2, … …, and whether the target IP address is in the multiple IP address field intervals is judged in parallel, if the target IP address is in the IP address field 2 interval, the IP address field 2 can be determined as the IP address field to be searched.
Through the above description of the technical solution provided in the embodiment of the present application, a path formed from a root node to any leaf node in a boundary IP address storage tree is traversed, an IP subset stored on the path is obtained and integrated into a boundary IP address, whether a target IP address is in an IP address segment interval corresponding to the boundary IP address is judged, and an IP address segment to be searched is determined according to a judgment result, where the boundary IP address storage tree splits and stores the boundary IP address in the IP address segment, a relationship between storage resources and search performance is well balanced, and it is determined that the IP address segment to be searched is relatively simple and efficient, consumed FPGA resources are limited, and it is easy to implement on an FPGA.
Corresponding to the foregoing embodiments of the method for searching for an IP address segment, the present application also provides embodiments of an apparatus 500 for searching for an IP address segment.
The embodiment of the IP address field searching device can be applied to network equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the network device where the software implementation is located as a logical means. From a hardware aspect, as shown in fig. 4, a hardware structure diagram of a network device where the IP address segment lookup apparatus of the present application is located is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, the network device where the apparatus is located in the embodiment may also include other hardware according to the actual function of the network device, which is not described again.
Referring to fig. 5, a schematic structural diagram of an IP address segment lookup apparatus provided in an embodiment of the present application is shown, where the apparatus may include: a first obtaining module 510, a traversing module 520, a second obtaining module 530, a first determining module 540, a judging module 550, and a second determining module 560.
A first obtaining module 510, configured to obtain a boundary IP address storage tree and a target IP address;
a traversing module 520, configured to traverse a path from a root node to any leaf node in the boundary IP address storage tree;
a second obtaining module 530, configured to obtain the IP subsets stored on the path and integrate the IP subsets into a boundary IP address;
a first determining module 540, configured to determine an IP address segment corresponding to the boundary IP address;
a judging module 550, configured to judge whether the target IP address is in the IP address segment interval;
a second determining module 560, configured to determine, if yes, that the IP address segment is an IP address segment to be searched
In a specific implementation manner of the embodiment of the present application, the boundary IP address storage tree is a right boundary IP address storage tree, and the boundary IP address is a right boundary IP address, or the boundary IP address storage tree is a left boundary IP address storage tree, and the boundary IP address is a left boundary IP address.
In a specific implementation manner of the embodiment of the present application, the apparatus further includes: a storage tree generation module 570;
the storage tree generation module 570 includes:
an address segment obtaining sub-module 571, configured to obtain a plurality of IP address segments;
an address segment ordering submodule 572 configured to order the plurality of IP address segments;
the address separation submodule 573 is used for separating a plurality of boundary IP addresses in the sorted IP address sections, wherein the boundary IP addresses comprise left boundary IP addresses or right boundary IP addresses;
and the storage tree generation submodule 574 is configured to generate a boundary IP address storage tree for the plurality of boundary IP addresses.
In a specific implementation manner of the embodiment of the present application, the storage tree generation submodule 574 includes:
a conversion unit 574A, configured to convert, according to a preset conversion rule, any boundary IP address into a target boundary IP address;
a splitting unit 574B, configured to split the target boundary IP address according to a preset splitting rule, to obtain multiple IP subsets;
a generating unit 574C, configured to generate a boundary IP address storage tree by using the IP subsets and the tandem relationship of each IP subset in the boundary IP addresses.
In a specific implementation manner of the embodiment of the present application, the generating unit 574C is specifically configured to:
removing repeated IP subsets aiming at the IP subsets corresponding to the boundary IP addresses to obtain effective IP subsets;
and generating a boundary IP address storage tree by utilizing the effective IP subsets and the front-back connection relation of each IP subset in the boundary IP addresses.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (8)

1. An IP address field searching method is applied to FPGA and is characterized by comprising the following steps:
acquiring a boundary IP address storage tree and a target IP address;
traversing a path formed from a root node to any leaf node in the boundary IP address storage tree;
acquiring IP subsets stored on the path and integrating the IP subsets into a boundary IP address;
determining an IP address section corresponding to the boundary IP address;
judging whether the target IP address is in the IP address segment interval or not;
if yes, determining the IP address field as the IP address field needing to be searched;
the boundary IP address storage tree is a right boundary IP address storage tree, and the boundary IP address is a right boundary IP address, or the boundary IP address storage tree is a left boundary IP address storage tree, and the boundary IP address is a left boundary IP address;
the judging whether the target IP address is in the IP address segment interval specifically includes:
judging the front-back position relation between the target IP address and the right boundary IP address of the IP address section; if the target IP address is in front of the right boundary IP address of the IP address section, continuously judging the front-back relationship between the target IP address and the left boundary IP address of the IP address section;
if the target IP address is behind the left boundary IP address of the IP address field, the target IP address is in the IP address field interval.
2. The method of claim 1, wherein the boundary IP address storage tree is obtained by:
acquiring a plurality of IP address sections;
sorting the IP address fields;
separating a plurality of boundary IP addresses in the sorted IP address sections, wherein the boundary IP addresses comprise a left boundary IP address or a right boundary IP address;
and generating a boundary IP address storage tree aiming at the plurality of boundary IP addresses.
3. The method of claim 2, wherein generating a boundary IP address storage tree for the number of boundary IP addresses comprises:
aiming at any boundary IP address, converting the boundary IP address into a target boundary IP address according to a preset conversion rule;
splitting the target boundary IP address according to a preset splitting rule to obtain a plurality of IP subsets;
and generating a boundary IP address storage tree by using the IP subsets and the front-back connection relation of each IP subset in the boundary IP addresses.
4. The method of claim 3, wherein the generating a boundary IP address storage tree using the IP subsets and the tandem relationship of each IP subset of the boundary IP addresses comprises:
removing repeated IP subsets aiming at the IP subsets corresponding to the boundary IP addresses to obtain effective IP subsets;
and generating a boundary IP address storage tree by utilizing the effective IP subsets and the front-back connection relation of each IP subset in the boundary IP addresses.
5. An IP address field searching device applied to FPGA is characterized by comprising:
the first acquisition module is used for acquiring a boundary IP address storage tree and a target IP address;
the traversal module is used for traversing a path from a root node to any leaf node in the boundary IP address storage tree;
a second obtaining module, configured to obtain the IP subsets stored on the path and integrate the IP subsets into a boundary IP address;
the first determining module is used for determining an IP address section corresponding to the boundary IP address;
the judging module is used for judging whether the target IP address is in the IP address field interval or not;
judging whether the target IP address is in the IP address segment interval or not; if yes, the step of determining that the IP address segment is the IP address segment needing to be searched is specifically as follows:
judging the front-back position relation between the target IP address and the right boundary IP address of the IP address section; if the target IP address is in front of the right boundary IP address of the IP address section, continuously judging the front-back relationship between the target IP address and the left boundary IP address of the IP address section;
if the target IP address is behind the left boundary IP address of the IP address section, the target IP address is in the IP address section interval;
the second determining module is used for determining the IP address field as the IP address field needing to be searched if the IP address field is the IP address field needing to be searched;
the boundary IP address storage tree is a right boundary IP address storage tree, and the boundary IP address is a right boundary IP address, or the boundary IP address storage tree is a left boundary IP address storage tree, and the boundary IP address is a left boundary IP address.
6. The apparatus of claim 5, further comprising: a storage tree generation module;
the storage tree generation module comprises:
the address segment acquisition submodule is used for acquiring a plurality of IP address segments;
the address segment ordering submodule is used for ordering the IP address segments;
the address separation submodule is used for separating a plurality of boundary IP addresses in the sequenced IP address sections, wherein the boundary IP addresses comprise left boundary IP addresses or right boundary IP addresses;
and the storage tree generation submodule is used for generating a boundary IP address storage tree aiming at the plurality of boundary IP addresses.
7. The apparatus of claim 6, wherein the storage tree generation submodule comprises:
the conversion unit is used for converting any boundary IP address into a target boundary IP address according to a preset conversion rule;
the splitting unit is used for splitting the target boundary IP address according to a preset splitting rule to obtain a plurality of IP subsets;
and the generating unit is used for generating a boundary IP address storage tree by using the IP subsets and the front-back connection relation of each IP subset in the boundary IP addresses.
8. The apparatus according to claim 7, wherein the generating unit is specifically configured to:
removing repeated IP subsets aiming at the IP subsets corresponding to the boundary IP addresses to obtain effective IP subsets;
and generating a boundary IP address storage tree by utilizing the effective IP subsets and the front-back connection relation of each IP subset in the boundary IP addresses.
CN201910800729.XA 2019-08-28 2019-08-28 IP address field searching method and device Active CN110505322B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910800729.XA CN110505322B (en) 2019-08-28 2019-08-28 IP address field searching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910800729.XA CN110505322B (en) 2019-08-28 2019-08-28 IP address field searching method and device

Publications (2)

Publication Number Publication Date
CN110505322A CN110505322A (en) 2019-11-26
CN110505322B true CN110505322B (en) 2022-07-01

Family

ID=68590013

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910800729.XA Active CN110505322B (en) 2019-08-28 2019-08-28 IP address field searching method and device

Country Status (1)

Country Link
CN (1) CN110505322B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112019652B (en) * 2020-08-27 2023-01-24 北京亚鸿世纪科技发展有限公司 Method and device for judging IPV6 address field
CN113076389B (en) * 2021-03-16 2024-06-07 百度在线网络技术(北京)有限公司 Article region identification method and device, electronic equipment and readable storage medium
CN114448890B (en) * 2021-12-22 2023-10-10 天翼云科技有限公司 Addressing method, addressing device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739520A (en) * 2012-05-31 2012-10-17 华为技术有限公司 Checking method and checking device
CN105512229A (en) * 2015-11-30 2016-04-20 北京奇艺世纪科技有限公司 IP address regional information storage, query method and device
CN105978868A (en) * 2016-05-05 2016-09-28 杭州迪普科技有限公司 Method and apparatus for searching IP address authority
CN106657443A (en) * 2017-02-13 2017-05-10 杭州迪普科技股份有限公司 IP address duplication eliminating method and device
CN106777163A (en) * 2016-12-20 2017-05-31 携程旅游网络技术(上海)有限公司 IP address institute possession querying method and system based on RBTree
WO2017133344A1 (en) * 2016-02-02 2017-08-10 中国互联网络信息中心 Ip address table storage and query method applicable in dns querying
CN109951495A (en) * 2019-03-29 2019-06-28 新华三信息安全技术有限公司 Network segment lookup method and device
CN109951393A (en) * 2019-03-29 2019-06-28 新华三信息安全技术有限公司 Network segment lookup method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102739520A (en) * 2012-05-31 2012-10-17 华为技术有限公司 Checking method and checking device
CN105512229A (en) * 2015-11-30 2016-04-20 北京奇艺世纪科技有限公司 IP address regional information storage, query method and device
WO2017133344A1 (en) * 2016-02-02 2017-08-10 中国互联网络信息中心 Ip address table storage and query method applicable in dns querying
CN105978868A (en) * 2016-05-05 2016-09-28 杭州迪普科技有限公司 Method and apparatus for searching IP address authority
CN106777163A (en) * 2016-12-20 2017-05-31 携程旅游网络技术(上海)有限公司 IP address institute possession querying method and system based on RBTree
CN106657443A (en) * 2017-02-13 2017-05-10 杭州迪普科技股份有限公司 IP address duplication eliminating method and device
CN109951495A (en) * 2019-03-29 2019-06-28 新华三信息安全技术有限公司 Network segment lookup method and device
CN109951393A (en) * 2019-03-29 2019-06-28 新华三信息安全技术有限公司 Network segment lookup method and device

Also Published As

Publication number Publication date
CN110505322A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
CN110505322B (en) IP address field searching method and device
Lakshminarayanan et al. Algorithms for advanced packet classification with ternary CAMs
CN108875064B (en) OpenFlow multidimensional data matching search method based on FPGA
CN109639579B (en) Multicast message processing method and device, storage medium and processor
CN107368527B (en) Multi-attribute index method based on data stream
US20140019486A1 (en) Logic Content Processing for Hardware Acceleration of Multi-Pattern Search
US20050018683A1 (en) IP address storage technique for longest prefix match
US10496648B2 (en) Systems and methods for searching multiple related tables
Faezipour et al. Wire-speed TCAM-based architectures for multimatch packet classification
CN108304460B (en) Improved database positioning method and system
CN105515997A (en) BF_TCAM (Bloom Filter-Ternary Content Addressable Memory)-based high-efficiency range matching method for realizing zero range expansion
CN108052535B (en) Visual feature parallel rapid matching method and system based on multiprocessor platform
Cheng et al. Scalable multi-match packet classification using TCAM and SRAM
Song et al. Packet classification using coarse-grained tuple spaces
Khan et al. Set-based unified approach for attributed graph summarization
CN104253754A (en) ACL (access control list) fast matching method and equipment
CN112235197B (en) Parallel route searching method and system
Zhou et al. Large-scale packet classification on FPGA
US9703484B2 (en) Memory with compressed key
US10795580B2 (en) Content addressable memory system
US20160105363A1 (en) Memory system for multiple clients
CN103761298A (en) Distributed-architecture-based entity matching method
CN113382092B (en) Active address detection method and device based on graph community discovery
EP3793171B1 (en) Message processing method, apparatus, and system
Chang et al. Dynamic multiway segment tree for IP lookups and the fast pipelined search engine

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