Search Circuit

By performing binary search operations in small-capacity memory, the problems of high memory cost and high power consumption caused by the increase of IP addresses in the IP network are solved, the IPv6 address search performance is improved, and efficient LPM search is achieved.

CN112055095BActive Publication Date: 2025-01-17RENESAS ELECTRONICS CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010470782.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-06-07
Filing Date
2020-05-28
Publication Date
2025-01-17
Estimated Expiration
2040-05-28

AI Technical Summary

Technical Problem

In IP networks, with the increase of IP addresses, traditional CAM storage and search methods are costly and consume high power, and the search performance of IPv6 addresses is deteriorated. The existing binary search algorithm requires smaller capacity memory to improve performance, but it is difficult to accomplish.

Method used

Design a search circuit, use small capacity memory to perform binary search operations, read entry data from the search table through the search processing unit, specify the search target range based on the search data and prefix length data, and determine whether the search keyword is within the range. And output search result data.

Benefits of technology

It realizes efficient execution of LPM search in small-capacity memory, reduces the number of memory accesses and the time to construct search tables, improves search performance, and reduces memory capacity and power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112055095B_ABST
    Figure CN112055095B_ABST
Patent Text Reader

Abstract

An embodiment of the present disclosure relates to a search circuit, which includes: a search table including a plurality of entry data, a search processing unit that receives a search keyword and performs a binary search operation on the search table. Each of the plurality of entry data includes search data, prefix length data, and search result data. The search processing unit reads one of the plurality of entry data from the search table according to the binary search operation, specifies a search target range based on the search data and prefix length data in the read entry data, determines whether the search keyword is included in the search target range, and outputs the search result data of the read entry data based on the determination result.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] The entire contents of the disclosure of Japanese Patent Application No. 2019-107258 filed on June 7, 2019 (including specification, drawings and abstract) are incorporated herein by reference in their entirety. Background Art

[0003] The present disclosure relates to a search circuit for searching a search table in which a plurality of entry data are stored for matching between input search keywords.

[0004] In an IP network, a network device such as a router generates a database called a Forwarding Information Base (FIB) that stores a destination port of packet data corresponding to a destination IP address in order to determine the destination of a received packet.

[0005] Upon receiving a packet, the router searches the FIB by using the destination IP address added to the header information of the packet data as a search key, and determines a transmission destination of the packet based on the search result.

[0006] Each IP address stored in the FIB defines a search validity bit length called the prefix length.

[0007] In the search of the FIB, an entry having the largest effective bit length and matching the destination IP address as the search key is output as a search result from the table entries.

[0008] Such a search process is called a Longest-Prefix-Match (LPM) search. When performing an LPM search, a CAM (Content Reference Memory: Content Addressable Memory) is used.

[0009] When CAM is used, high search performance can be achieved, but it is expensive and consumes a lot of power compared to general-purpose memories such as DRAM and SRAM.

[0010] In recent years, with the expansion of IP networks, the number of IP addresses has continued to increase, and the corresponding FIB capacity has also continued to increase proportionally. Therefore, it has become difficult to store and search large-capacity FIB databases in CAMs that are expensive and consume a lot of power.

[0011] The disclosed techniques are listed below.

[0012] [Non-patent document 1]

[0013] "IP Lookups using Multiway and Multicolumn Search" by Butler Lampson, V Srinivasan, and George Varghese, IEEE 1998 Summary of the invention

[0014] On the other hand, a method of performing LPM search using relatively inexpensive and low-power DRAM or SRAM has been proposed by using a search method based on various search algorithms such as a Tree-Bit-Map algorithm (Non-Patent Document 1).

[0015] In recent years, due to the exhaustion of IPv4 addresses, a transition to IPv6 addresses with longer bit lengths has begun. However, in the method using a tree bitmap search algorithm characterized in that search performance deteriorates in proportion to search key length, the following problem has arisen: in IPv6 where the search key length changes from 32 bits of IPv4 to 128 bits, performance deteriorates.

[0016] In addition, a method of using a binary search algorithm other than the tree bitmap algorithm as a search algorithm for LPM search has been proposed (Non-Patent Literature 1).

[0017] In a binary search algorithm, the search performance depends on the capacity of the search database rather than the length of the search key.

[0018] On the other hand, although the same performance as that of an IPv4 address search can be achieved even when searching for an IPv6 address, the search performance is proportional to the capacity. If the LPM search can be implemented using a memory of a smaller capacity, the search performance can be improved.

[0019] The present disclosure has been made to solve the above-mentioned problems, and provides a search circuit capable of performing a search process using a small-capacity memory.

[0020] Other objects and novel features will become apparent from the description of this specification and the accompanying drawings.

[0021] According to one embodiment, a search circuit includes: a search table having a plurality of entry data, each of the plurality of entry data including search data, prefix length data, and search result data; and a search processing unit configured to receive a search keyword and perform a binary search operation on the search table. The search processing unit reads one of the plurality of entry data from the search table according to the binary search operation, specifies a search target range based on the search data and prefix length data included in the read entry data, determines whether the search keyword is included in the search target range, and outputs the search result data of the read entry data based on the determination result.

[0022] According to one embodiment, the disclosed search circuit is capable of performing a search process in a small-capacity memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 is a diagram for explaining the configuration of a communication device 1 according to the first embodiment;

[0024] Figure 2 is a diagram showing a search table provided as a comparative example;

[0025] Figure 3A and 3B is a diagram showing a search process of a search table as a comparative example;

[0026] Figure 4 is a functional block diagram of a search circuit 10 according to the first embodiment;

[0027] Figure 5A and 5B is a diagram showing generation of a search table according to the first embodiment;

[0028] Figures 6A to 6C is a diagram for explaining a search process of a search table according to the first embodiment;

[0029] Figure 7 is a diagram showing generation of a search table according to the second embodiment;

[0030] Figures 8A to 8C is a diagram for explaining a method for implementing a search table according to a second embodiment;

[0031] Fig. 9 is a flowchart for explaining the sequence of a search process according to the second embodiment;

[0032] Fig.10 is a diagram showing generation of another search table according to the first embodiment;

[0033] Fig.11 is a diagram showing generation of a search table according to the third embodiment; and

[0034] Fig.12 2 is a diagram for explaining a search process of a search table according to the third embodiment. DETAILED DESCRIPTION

[0035] The embodiments will be described in detail. In the drawings, the same or corresponding components are denoted by the same reference numerals, and description thereof will not be repeated.

[0036] First embodiment

[0037] <Overall Configuration of Communication Equipment>

[0038] Figure 1 is a diagram showing the configuration of a communication device 1 according to the first embodiment.

[0039] like Figure 1 As shown, the communication device 1 is a communication device such as a switch or a router. The communication device 1 is connected to the Internet. The communication device 1 performs packet data transmission processing.

[0040] The communication device 1 includes a plurality of ports (port 0 to port 3 ), a switch 2 , and a search circuit 10 .

[0041] The switch 2 switches the connection destination of the port. In the present embodiment, the communication device 1 receives packet data and performs a transfer process of transferring the received packet data to a port specified by the search process of the search circuit 10 .

[0042] Here, the search circuit 10 includes a search table 30, and performs a search operation by a search method using an LPM (Longest Prefix Match) search.

[0043] The search table 30 stores a plurality of entry data. As shown in the figure, the destination IP address "32.48.09.00 / 24" is stored in association with the destination port (port 0). The destination IP address "32.48.10.00 / 23" is stored in association with the destination port (port 1). The destination IP address "32.48.08.00 / 21" is stored in association with the destination port (port 2). The destination IP address "32.48.00.00 / 16" is stored in association with the destination port (port 3).

[0044] Here, a case where a search IP address "32.48.09.03" is received as a search keyword is shown.

[0045] The received search keyword is matched with four entry data stored in the search table 30 .

[0046] The search circuit 10 outputs, as the search result, the entry data having the longest effective bit length among the entry data matching the search IP address serving as the search key.

[0047] In the present embodiment, the destination IP address "32.48.09.00 / 24" having a prefix length of 24 bits and having the longest effective bit length among the entry data matching the search IP address is output as the search result.

[0048] Therefore, the packet data is transferred to the port (port 0) which is the corresponding transfer destination, and the packet data is sent to the destination.

[0049] <Binary Search Algorithm According to Comparative Example>

[0050] As a comparative example, a case where an LPM search is performed by a conventional binary search algorithm will be described.

[0051] The above-mentioned comparative example is a method shown in Non-Patent Document 1. Figure 2 is a diagram showing a search table provided as a comparative example.

[0052] refer to Figure 2 , the search table 200 stores a plurality of item data. As an example, a case where four item data are stored is shown.

[0053] The entry data includes: search target data, whose data length is 4 bits; and search result data, which is to be output as a search result when the search data matches the search keyword.

[0054] If the search table 200 is a FIB, the search target data corresponds to the destination IP address, and the search result corresponds to the transmission destination port.

[0055] The entry data of the search table 200 includes the bits to be masked. The entry data is matched with a plurality of search keys corresponding to the masked bits.

[0056] For example, each entry data stored in the search table 200 has a search target range in which the lower limit value and upper limit value described below are respectively set as boundary values.

[0057] Table 1

[0058] Entry data Lower limit Upper limit Search target range 001* 0010(L0) 0011(H0) 0010-0011 010* 0100(L1) 0101(H1) 0100-0101 101* 1010(L2) 1011(H2) 1010-1011 0*** 0000(L3) 0111(H3) 0000-0111

[0059] In the comparative example, the LPM search is performed by a binary search. Figure 2 A search table 201 for performing an LPM search according to the binary search disclosed in Non-Patent Literature 1 is shown.

[0060] The lower limit value and the upper limit value of the entry data in the search table 200 are included as binary search (Binary-Search) data, and the search table 201 is generated by sorting the entry data in ascending order.

[0061] Therefore, the search table 201 stores eight entry data, which is twice that of the search table 200 .

[0062] The search table 201 stores data corresponding to the search keyword as search results in two cases.

[0063] When the search keyword matches the stored search data (keyword=data), the search result includes the search result data; when the search keyword is greater than the stored search data (keyword>data), the search result data includes the search result data.

[0064] Figure 3A and 3B 2 is a diagram showing a search process for the search table 201 as a comparative example.

[0065] exist Figure 3A , the search table 201 is shown, and search processing for the search keywords "0010" and "0110" is performed.

[0066] The case of search key "0010" will be described. When a binary search operation is performed using search key "0010" in search table 201, since the search key matches search data at table address "1" (key=data), search result data "P0" is output.

[0067] exist Figure 3B , the search process is shown, and "high or low" is a determination result indicating whether the search keyword (keyword) is low or high relative to the search data (data).

[0068] The binary search operation starts from the middle table address "4" of the search table 201. When it is determined that the search key is lower than the search data (low), the search is performed as follows: Figure 3B The lower addresses are read in the order shown, and when the search key is determined to be larger (higher), the higher addresses are read out.

[0069] The same search is performed for the case of the search key "0110". However, when the search table 201 is binary searched using the search key "0110", there is no search data for a table entry that matches the search key "0110".

[0070] In this case, the search result is the middle value between the table addresses "4" and "5". That is, the middle value (0110) between the upper limit value of the entry data "010*" (Entry1) and the upper limit value of the entry data "0***" (Entry3) is indicated. During the search, the search keyword is greater than the search data of the table address "4" which is the upper limit of the entry data (Entry1) (keyword (0110)>data (0101)). In addition, the search keyword is less than the search data of the table address "5" which is the upper limit of the entry data (Entry3) (keyword (0110)<data (0111)). Therefore, the search result is the middle value of the search data of the table addresses "4" and "5".

[0071] In this comparative example, when the search result of the binary search operation becomes the middle value of each search data, the search result data 201-2 is provided in the search table 201. For example, the search data of the table address "4" is Figure 2 The upper limit value (H1) of Entry 1 of the search table 200 shown in the figure is included in the search target range (L3 to H3) of Entry 3 of the search table 200. Therefore, when the search keyword is greater than the upper limit value of Entry 1 (search data (H1) of table address "4") and is within the range where the maximum value reaches the upper limit value of Entry 3 (search data (H3) of table address "5"), the search keyword hits Entry 3. Therefore, when the search keyword is greater than the search data of table address "4", the search table 201 has search result data 201-2, and "P3" which is the search result data of Entry 3 is stored as the search result.

[0072] As described above, the search result in the binary search of the search keyword "0110" is between table addresses "4" and "5". Therefore, "P3" stored in the search result data (201-2) of table address "4" in the case of keyword>data is output as a determination result corresponding to the search target range including table address "4" and table address "5" adjacent to table address "4".

[0073] If the search keyword does not match the search data stored in the search table 201 in a conventional binary search, the search keyword does not match the search data (referred to as a "miss").

[0074] The capacity of the search table according to the method of this comparative example will be described. The search table 201 for performing the binary search operation used in the search stores two search data, ie, a lower limit value and an upper limit value of each entry data of the original search table 200 .

[0075] Therefore, when the search table 201 is generated from the search table 200 of N entry data, 2N table addresses are required in the worst case.

[0076] Therefore, in the method according to the comparative example, in order to perform an LPM search on a search table of N entry data, a memory having a 2N memory space needs to be prepared.

[0077] In addition, two data are stored as data to be output as search results in each memory address of the search table 201. One data is the search result data when the search keyword matches the search data (keyword=data), and the other data is the search result data when the search keyword is greater than the search data (keyword>data).

[0078] For example, when the search table 200 has 1M entry data, when the entry address is output as search result data in the same manner as the CAM, the search result data requires 20 bits. Therefore, when the above method is adopted, 40 bits are required as search result data.

[0079] For example, when the search table 200 is a search table based on an IPv4 address and has 1M entry data, and when the search table 201 is generated from the search table 200, the following memory capacity is required.

[0080] Table 2

[0081] address Search Data Search result data Memory capacity Search table 200 1M 38 digits (*1) 20 digits × 1 760Mbit Search Table 201 2M 32-bit 20 digits × 2 2560Mbit

[0082] As shown in Table 2, the search table 201 for LPM search requires twice the memory capacity of the original search table 200.

[0083] In addition, the memory address space is also increased from N to 2N. Therefore, since the memory address space is doubled, the number of memory accesses when performing a binary search operation increases compared to the number of entries N of the original search table 200. As a result, there is a problem that the speed cannot be improved.

[0084] In addition, when updating the search table, the entry data must be sorted in value order. For example, for a search table with N data, when adding new entry data to the smallest position of the table, all existing entry data must be moved because the new entry data needs to be inserted into the smallest address position.

[0085] In the case of constructing the search table 201, the number of times data is moved in the worst case depends on the number of entries. Therefore, when the memory address space increases from N to 2N, the time for constructing the search table also increases.

[0086] Therefore, it is desirable to reduce the number of entry data in the search table. Figure 4is a functional diagram of the search circuit 10 according to the first embodiment.

[0087] refer to Figure 4 , the search circuit 10 includes a processing unit 20 and a search table 30. In the present embodiment, each functional block is implemented by executing a program stored in a memory accessible to the CPU according to the processing unit 20.

[0088] The processing unit 20 performs various processes on the search table 30 , and includes a search processing unit 22 , a result storage unit 24 , and a table generation unit 26 .

[0089] The search processing unit 22 performs a binary search operation on the search table 30. The search processing unit 22 stores the result of the binary search operation in the result storage unit 24.

[0090] The table generating unit 26 generates entry data of a search table 30 used in a binary search operation of the search processing unit 22 from the original search table. The original search table may be set by a user, or may be generated by a search execution system based on a program.

[0091] The table generating unit 26 includes a data acquiring unit 260 , a search data setting unit 262 , an entry data setting unit 264 , and an entry data adding unit 266 .

[0092] The data acquisition unit 260 acquires the entry candidate data included in the original search table. The search data setting unit 262 sets one data within the search target range indicated by the entry candidate data acquired by the data acquisition unit 260 as search data.

[0093] The entry data setting unit 264 associates the search data with the prefix length data, and sets the search data as entry data of the search table 30 .

[0094] The entry data adding unit 266 determines whether another search data of another search target data is included in the search target range indicated by the search target data, and sets additional entry data when the another search data is included.

[0095] <Search table generation>

[0096] Each entry data stored in the search table according to the first embodiment includes search data, prefix length data, and search result data.

[0097] Based on the search data and prefix length data included in each entry data of the search table, a search data group (search target range) as a target of each entry data is calculated. That is, the upper limit value and the lower limit value of the search data in the search data group are calculated. For example, when the search data is "0100" and the prefix length is "3", it can be understood that the original search data is "010*". Therefore, it can be seen that the search target range of the search data has an upper limit value "0101" and a lower limit value "0100".

[0098] In this embodiment, for example, a case where the lower limit value of the search data group is set to the search data stored in the entry data will be described. The value is not limited to the lower limit value, and can be set to any value between the upper limit value and the lower limit value of the search data group.

[0099] The table generating unit 26 generates a search table 30 from an original search table composed of entry candidate data.

[0100] Figure 5A is a diagram showing generation of a search table according to the first embodiment. Figure 5A An original search table 400 is shown.

[0101] The original search table 400 stores a plurality of entry candidate data Entry0 to 3 to be searched for entry addresses 0 to 3, respectively. In the present embodiment, four entry candidate data are stored in the original search table 400 .

[0102] The entry candidate data includes: search target data including bits to be masked; and search result data to be output as a search result when the search target data matches a search keyword.

[0103] exist Figure 5A In the center of FIG. 4 , the search target range of the original search table 400 according to the first embodiment is shown.

[0104] The search target range for each entry candidate data is Figure 5A Specifically, the following search target ranges are shown: the search target range of the search target data "001*" of the entry candidate data Entry0, the search target range of the search target data "010*" of the entry candidate data Entry1, the search target range of the search target data "111*" of the entry candidate data Entry2, and the search target range of the search target data "10**" of the entry candidate data Entry3.

[0105] In this case, the search target ranges of the entry candidate data do not overlap. That is, the search target range of each entry candidate data is not divided by the search target range of another entry candidate data.

[0106] Figure 5A 0046 . A diagram illustrating a search table 401 according to the first embodiment is shown in . The search data setting unit 262 sets the lower limit value of the search target range indicated by the search target data of each entry candidate data of the original search table 400 as the search data of the search table 401. Then, the entry data setting unit 264 sets entry data that associates the search data with the prefix length data and the search result data.

[0107] The entry data setting unit 264 stores the entry data set by the search data setting unit 262 in the search table 401 .

[0108] The entry data setting unit 264 sorts the stored entry data, and stores the entry data including the search data having a small value at a position where the table address is small.

[0109] For example, search data “0010”, prefix length data “3”, and search result data “P0” corresponding to entry candidate data Entry0 are stored in table address “0”.

[0110] For example, search data "0100", prefix length data "3", and search result data "P1" corresponding to entry candidate data Entry1 are stored in the table address "1".

[0111] For example, search data "1000", prefix length data "2", and search result data "P3" corresponding to entry candidate data Entry3 are stored in the table address "2".

[0112] For example, search data "1110", prefix length data "3", and search result data "P2" corresponding to entry candidate data Entry2 are stored in the table address "3".

[0113] In the present embodiment, since the search target range of each entry candidate data is not divided by the search target ranges of other entry candidate data, new entry data is not added.

[0114] Next, a case where a search target range of entry candidate data is divided by search target ranges of other entry candidate data will be described.

[0115] Figure 5B An original search table 402 is shown. The original search table 402 stores a plurality of entry candidate data Entry0 to 3 to be searched for entry addresses 0 to 3, respectively. In the present embodiment, four entry candidate data are stored in the original search table 402.

[0116] The entry candidate data includes: search target data including bits to be masked; and search result data to be output as a search result when the search target data matches a search keyword.

[0117] Figure 5B Also shown is the search target range of the original search table 402 according to the first embodiment.

[0118] The search target range for each entry candidate data is Figure 5B Specifically, the following search target ranges are shown: the search target range of the search target data "001*" of the entry candidate data Entry0, the search target range of the search target data "010*" of the entry candidate data Entry1, the search target range of the search target data "101*" of the entry candidate data Entry2, and the search target range of the search target data "0***" of the entry candidate data Entry3.

[0119] In this case, a situation is shown where the search target range of the search target data “0***” of the entry candidate data Entry3 overlaps with the search target range of the search target data “001*” of the entry candidate data Entry0 and the search target range of the search target data “010*” of the entry candidate data Entry1.

[0120] That is, the search target range of the search target data “0***” of the entry candidate data Entry3 is divided by the search target data “001*” of the entry candidate data Entry0 and the search target data “010*” of the entry candidate data Entry1.

[0121] In the first embodiment, since the search target range of the entry candidate data Entry3 is divided as described above, a new entry candidate data Entry3-1 is added, which includes search target data different from the entry candidate data Entry3-0, and the Entry3 lower limit of the entry candidate data Entry3-0 is set to the search data "0000".

[0122] The entry data adding setting unit 266 adds new entry candidate data. The entry data adding unit 266 adds entry data Entry3-1 whose search target range excludes the search target range of the search data "001*" of the entry candidate data Entry0 and the search target range of the search data "010*" of the entry candidate data Entry1 from the search target range of the search data "0***" of the entry candidate data Entry3.

[0123] At this point, the entry data adding unit 266 sets the data “0110” indicating the boundary between the search target range of the entry candidate data Entry1 and the search target range of the entry candidate data Entry3 as the search data.

[0124] Then, the entry data adding unit 266 sets new entry data associating the search data with the prefix length data and the search result data.

[0125] The entry data adding unit 266 sets new entry data in which the search data “0110” is associated with the prefix length data “1” and the search result “P3”.

[0126] exist Figure 5B , a diagram for explaining the search table 403 according to the first embodiment is shown. The search data setting unit 262 sets the lower limit value of the search target range of the search target data of each entry candidate data of the original search table 402 as the search data of the search table 403. Then, the entry data setting unit 264 sets the entry data associating the search data with the prefix length data and the search result data.

[0127] The entry data setting unit 264 stores the set entry data in the search table 403. The entry data adding unit 266 stores the new entry data in the search table 403.

[0128] The entry data setting unit 264 sorts the entry data to be stored, and stores the entry data including the search data having a small value at a position where the table address is small.

[0129] like Figure 5B As shown, the entry data that has been sorted after the entry data is added is stored in the search table 403 according to the first embodiment.

[0130] For example, search data "0000", prefix length data "1", and search result data "P3" corresponding to entry candidate data Entry3-0 are stored in table address "0".

[0131] For example, search data “0010”, prefix length data “3”, and search result data “P0” corresponding to entry candidate data Entry0 are stored in the table address “1”.

[0132] For example, search data "0100", prefix length data "3", and search result data "P1" corresponding to entry candidate data Entry1 are stored in the table address "2".

[0133] For example, search data "0110", prefix length data "1", and search result data "P3" corresponding to entry candidate data Entry3-1 are stored in the table address "3".

[0134] For example, search data "1010", prefix length data "3", and search result data "P2" corresponding to entry candidate data Entry2 are stored in the table address "4".

[0135] The search processing unit 22 may perform a binary search operation using the search table.

[0136] <Binary Search Algorithm According to One Embodiment>

[0137] Figures 6A to 6C 4 is a diagram showing a search process for the search table 403 according to the first embodiment.

[0138] The search processing unit 22 accesses the search table 403 and performs a search operation. The search processing unit 22 stores information of the search process in the result storage unit 24.

[0139] Fig. 6A There is shown a search table 403. Here, the search processing unit 22 performs a search operation on the search key "0010" and the search key "0110".

[0140] Figure 6B Information on the search process for the search keyword "0010" stored in the result storage unit 24 is shown.

[0141] The search processing unit 22 starts the search operation from the middle table address “2” of the search table 403 .

[0142] The search processing unit 22 calculates the upper limit value of the search target range of the entry data based on the search data and the prefix length data of the entry data read from the intermediate table address "2" of the search table 403. As an example, the upper limit value "0101" is calculated. Since the search data is the lower limit value of the search target range, it can be seen that the search target range is "0100" to "0101".

[0143] The search processing unit 22 performs a matching determination process as to whether the search keyword is included based on the specified search target range.

[0144] In this embodiment, the search processing unit 22 determines that the search keyword "0010" is not within the search target range of the entry data. That is, the search result "misses".

[0145] In addition, the search processing unit 22 performs a comparison process between the search data "0100" and the search key "0010." The next search address is determined based on the comparison result.

[0146] When it is determined through the comparison process that the search key is smaller than the (lower) search data, the search processing unit 22 reads the entry data corresponding to the lower address as the next search target.

[0147] When the search key is larger than (higher) search data, the search processing unit 22 reads entry data corresponding to the upper address as the next search target.

[0148] In this case, the search key "0010" is lower than the search data "0100." Therefore, data of the table address "0" which is a lower address is read out because it is determined to be smaller (lower) by comparison.

[0149] like Figure 6B As shown, in the result storage unit 24, in the case where the table address "2" is used as the search address as the first memory access, the search result is stored. A case where the upper limit value "0101" is calculated for the search data "0100" is shown. In addition, the low value is stored as the comparison result of the comparison process. In addition, miss (Miss) is stored as the matching determination process.

[0150] Next, the search processing unit 22 reads the lower table address "0" of the search table 403, and performs a search operation using the search key "0010".

[0151] The search processing unit 22 calculates the upper limit value of the search target range of the entry data based on the search data and the prefix length data of the read entry data in the same manner as described above. That is, the upper limit value "0111" of the search target range of the entry data of the table address "0" is calculated. Therefore, it can be understood that the search target range of the entry data is "0000" to "0111".

[0152] The search processing unit 22 performs a matching determination process as to whether the search keyword is included based on the specified search target range.

[0153] In this embodiment, the search processing unit 22 determines that the search keyword "0010" is included in the search target range of the entry data. That is, the search result is a match (Hit).

[0154] In addition, the search processing unit 22 performs a comparison process of the search data "0000" and the search key "0010." The next search address is determined based on the comparison result.

[0155] In this case, the search key "0010" is larger than the search data "0000." Therefore, since it is determined through the comparison process that the search key is larger (higher), the upper address "1" is read out.

[0156] like Figure 6B As shown, in the result storage unit 24, the search result is stored in the case where the table address "0" is read as the search address to be accessed as the second memory. A case where the upper limit value "0111" is calculated for the search data "0000" is shown. Therefore, the match determination process is a match (Hit). Here, since the match determination is a hit, the temporary search result stored in the result storage unit 24 is updated from miss to P3. In addition, since the result of the comparison process is large (high), the next search target is a high-order table address.

[0157] Next, the search processing unit 22 reads the upper table address "1" of the search table 403, and performs a search operation using the search key "0010".

[0158] The search processing unit 22 calculates the upper limit value of the search target range of the read entry data based on the search data and prefix length data of the read entry data in the same manner as described above. Based on the read search data and prefix length data, the upper limit value of the search target range of the entry data of the table address "1" is "0011".

[0159] The search processing unit 22 performs a matching determination process as to whether the search keyword is included based on the specified search target range.

[0160] In this embodiment, the search processing unit 22 determines that the search keyword "0010" is included in the search target range of the entry data. That is, the search result is a match (hit).

[0161] In this case, since the table address "1" is the final address, the comparison process for determining the search address is not performed.

[0162] like Figure 6B As shown, in the result storage unit 24, in the case where the table address "1" is read as the search address for the third memory access, the search result is stored. The case where the upper limit value "0011" is calculated for the search data "0010" is shown. In addition, the match is stored as the result of the match determination process. The search result data "P0" is stored as a temporary search result.

[0163] Here, the prefix length data of the entry data of the table address "1" is "3". On the other hand, the prefix length data of the entry data of the table address "0" stored in the result storage unit 24 is "1". Therefore, since the prefix length of the entry data of the table address "1" is large (the effective bit length is long), the search processing unit 22 updates the search result data of the result storage unit 24 to the search result data "P0" of the entry data of the table address "1". On the other hand, when the prefix length is small, the temporary search result stored in the result storage unit 24 is not updated, and the temporary search result is maintained.

[0164] When the match determination result is a hit, when the prefix length is greater than the prefix length of the temporary search result at the previous time, the search processing unit 22 continues to update the temporary search result to the temporary search result at the previous time stored in the result storage unit 24, so that the search result with the largest prefix length is maintained in the result storage unit 24. The search processing unit 22 outputs the final search result data based on the determination result stored in the result storage unit 24 at the end of the binary search of the final address.

[0165] Next, the search processing unit 22 will describe the search processing for the search keyword "0110". Figure 6C Information on the search process for the search keyword "0110" stored in the result storage unit 24 is shown.

[0166] As described above, the search processing unit 22 starts the search processing from the middle table address “2” of the search table 403 .

[0167] Figure 6C The result storage unit 24 shows a case where the table address "2" is read as the search address for the first memory access. The case where the upper limit value "0101" is calculated for the search data "0100" is shown. In addition, the large value (High) is stored as the comparison result of the comparison processing. In addition, a miss (Miss) is stored as the result of the matching determination process. When it is determined through the comparison processing that the search keyword is greater than the search data (High), the search processing unit 22 reads the entry data corresponding to the high-order address in the subsequent binary search. In this case, the table address "4" as the high-order address is read out.

[0168] like Figure 6CAs shown, in the result storage unit 24, a case is shown in which the table address "4" is read as the search address for access as the second memory. A case is shown in which the upper limit value "1011" is calculated for the search data "1010". Therefore, along with the matching determination process, a miss (miss) occurs. In addition, through the comparison processing, the comparison result is low. When the search keyword is lower (low) than the search data, the search processing unit 22 reads the entry data corresponding to the low address according to the binary search operation. In this case, the table address "3" as the low address is read out.

[0169] like Figure 6C As shown, in the result storage unit 24, a case where the table address "3" is read as the search address for the third memory access is shown. A case where the upper limit value "0111" is calculated for the search data "0110" is shown. Therefore, the result of the match determination process is a match (hit). Therefore, the temporary search result is updated, and the search result data "P3" is stored.

[0170] The search processing unit 22 outputs final search result data based on the search results stored in the result storage unit 24 .

[0171] The result storage unit 24 stores the search result data “P3” corresponding to the entry data of the table address “3” indicating “hit” in the third memory access. The search result data “P3” is output from the search processing unit 22 .

[0172] According to this first embodiment, the method allows performing an LPM search on a search table using a binary search operation.

[0173] According to the first embodiment, only the lower limit value of the search target range is stored in the search table. Therefore, since the capacity of the search table according to the first embodiment does not become twice the number of entries of the original search table as in the comparison method, the table capacity can be reduced. In other words, a search operation can be performed with a small-capacity memory. In addition, unlike the comparison method, it is not necessary to keep two data as search result data, and since only one search result data is kept, the table capacity can also be reduced in this regard.

[0174] Furthermore, by reducing the table capacity, the number of memory accesses can be reduced and the search process can be accelerated.

[0175] Furthermore, by reducing the number of entry data in the search table, the duration required to construct the table can be shortened.

[0176] Second embodiment

[0177] In the generation of the search table according to the first embodiment, it has been described that Figure 5BA method of adding entry data when the search target range of entry candidate data is divided by the search target ranges of other entry candidate data. Therefore, the number of entry data increases compared to a case where the search target range of each entry candidate data is not divided by the search target ranges of other entry candidate data.

[0178] In the second embodiment, a method of suppressing an increase in the number of entries will be described.

[0179] In the first embodiment described above, Figure 5B , the search target range of the search target data “0***” of the entry candidate data Entry3 overlaps with the search target range of the search target data “001*” of the entry candidate data Entry0 and the search target range of the search target data “010*” of the entry candidate data Entry1.

[0180] That is, the search target range of the search target data “0***” of the entry candidate data Entry3 is divided by the search target data “001*” of the entry candidate data Entry0 and the search target data “010*” of the entry candidate data Entry1.

[0181] In the first embodiment, new entry candidate data Entry3 - 1 including search data different from the search data “0000” of the entry candidate data Entry3 - 0 is added.

[0182] On the other hand, if the search target data "0***" of entry candidate data Entry3 is separated from the search target data "001*" of entry candidate data Entry0 (which overlaps with the search target range) and the search target data "010*" of entry candidate data Entry1, the search target range of entry candidate data Entry3 is not divided.

[0183] Figure 7 2 is a diagram showing generation of a search table according to the second embodiment. The search table in the second embodiment is generated by the table generation unit 26 in the same manner as in the first embodiment.

[0184] Figure 7 The original search table 402 is shown in FIG. Figure 7 Search tables 600 and 601 are shown in FIG.

[0185] In the second embodiment, since the configuration of the search circuit is the same as that shown in the first embodiment, a detailed description of the search circuit is omitted.

[0186] The table generating unit 26 generates a plurality of search tables from the entry candidate data in the same manner as the first embodiment.

[0187] Similar to the first embodiment, the search data setting unit 262 sets the lower limit value of the search target data including the masked bits as the search data based on the entry candidate data.

[0188] The entry data setting unit 264 sets entry data in which the search data, the prefix length data, and the search result data are associated with each other.

[0189] The entry data setting unit 264 stores the set entry data in the search table.

[0190] When the set entry data is stored in the search table, the entry data setting unit 264 determines whether the search target range is divided by other entry data. When it is determined that the search target range is divided, the entry data setting unit 264 stores the entry data in another search table.

[0191] In this embodiment, search data “0010”, prefix length data “3”, and search result data “P0” corresponding to entry candidate data Entry0 are stored in the table address “0” of the search table 600 .

[0192] Furthermore, search data “0100”, prefix length data “3”, and search result data “ P1 ” corresponding to the entry candidate data Entry1 are stored in the table address “ 1 ” of the search table 600 .

[0193] Furthermore, search data “1010”, prefix length data “3”, and search result data “P2” corresponding to the entry candidate data Entry2 are stored in the table address “2” of the search table 600 .

[0194] On the other hand, the search data of the entry candidate data Entry3 is stored in the search table 601, which is different from the search table 600 and stores the search data of the entry candidate data Entry0 and Entry1 whose search target ranges overlap with the search target range of the entry candidate data Entry3. That is, the search data “0000”, the prefix length data “1”, and the search result data “P3” corresponding to the entry candidate data Entry3 are stored in the table address “0” of the search table 601.

[0195] Through this process, in each of the search tables 600 and 601 , the search target range of data is not divided by other entry data.

[0196] This makes it possible to suppress an increase in the number of entry data. Figures 8A to 8C is a diagram for explaining the implementation of a search table according to the second embodiment.

[0197] Fig. 8AA search circuit 11 according to the second embodiment is shown. The search circuit 11 includes a CPU 40 and a memory 50.

[0198] The CPU 40 executes the devices of the processing unit 20 by cooperating with the memory 50. The memory 50 includes search tables 600 and 601.

[0199] The processing unit 20 accesses the search tables 600 and 601 stored in the memory 50 to perform a binary search operation on the search tables.

[0200] Figure 8B The search circuit 12 according to the second embodiment is shown. The search circuit 12 includes a CPU 40 and memories 51 and 52. The memory 51 stores a search table 600. The memory 52 stores a search table 601.

[0201] The processing unit 20 accesses the search tables 600 and 601 stored in the memories 51 and 52, respectively, so that a binary search operation can be performed on the search tables. In the search circuit 11, since the search tables 600 and 601 are stored in the memory 50, it is impossible to perform a binary search operation in the search tables 600 and 601 at the same time. However, the search tables 600 and 601 are stored in separate memories in the search circuit 12, and a binary search operation can be performed in parallel in the search tables 600 and 601. Therefore, compared with the search circuit 11, the search performance is improved.

[0202] Figure 8C The search circuit 13 according to the second embodiment is shown. The search circuit 13 includes a CPU 40A and a memory 53.

[0203] The memory 53 includes a search table 600. The CPU 40A has a built-in cache memory, and the search table 601 is stored in the cache memory.

[0204] The processing unit 20 accesses the search table 600 stored in the memory 53 to perform a binary search operation on the search table 600. The processing unit 20 may perform a binary search operation on the search table 601 by accessing the search table 601 stored in the cache memory.

[0205] Since search tables 600 and 601 can operate in parallel in the same manner as search circuit 12, the search operation can be accelerated. In addition, since it can be expected that search table 601 can be implemented with a smaller capacity than search table 600, the memory 52 required by search circuit 13 can be reduced by incorporating it into a cache memory.

[0206] Fig. 9 Detailed description of the process flow of the search process according to the second embodiment. Fig. 9In step S2 , the processing unit 20 performs a binary search operation on the search table 600 .

[0207] In step S2, in the search process for search table 600, when the result of the match determination process is a match (hit) (hit in step S2), processing unit 20 ends the search (step S8). Then, processing unit 20 outputs search result data corresponding to the entry data that has been matched in search table 600.

[0208] On the other hand, in step S2, in the search process for the search table 600, when the result of the matching determination process is a miss (miss) (miss in step S2), the processing unit 20 performs a binary search operation on the search table 601 (step S4).

[0209] In step S4, in the search process for search table 601, if the result of the match determination process indicates a match (hit) ("hit" in step S4), processing unit 20 ends the search (step S10). Then, processing unit 20 outputs search result data corresponding to the entry data that has been matched in search table 601.

[0210] On the other hand, in step S4, in the search process for the search table 601, if the result of the matching determination process is miss (miss) (miss in step S4), the processing unit 20 ends the search. The processor 20 outputs miss (miss) as the search result (S6).

[0211] Then, the process ends (END). In the method according to the second embodiment, the search table having larger prefix length data of the entry data is searched preferentially over the search table having smaller prefix length data of the entry data.

[0212] Through this processing, it is possible to suppress an overall increase in the search processing time due to dividing the search table.

[0213] Third embodiment

[0214] In the above-described second embodiment, the method of reducing the table capacity by suppressing the addition of entry data has been described.

[0215] In the third embodiment, a method of reducing the table capacity more than the second embodiment will be described.

[0216] Specifically, by optimizing the set value of the search data, the increase of the entry data is avoided.

[0217] Fig.10 : is a diagram showing generation of another search table according to the first embodiment. The search table in the third embodiment is generated by the table generation unit 26 in the same manner as in the first embodiment.

[0218] Fig.10 The original search table 404 shown stores a plurality of entry candidates Entry0 to 4 to be searched at entry addresses 0 to 4, respectively. In this embodiment, five entry candidate data are stored in the original search table 404.

[0219] The entry candidate data includes: search target data including bits to be masked; and search result data to be output as a search result when the search target data matches a search keyword.

[0220] Here, as described above, the search target range of the search target data “****” of the entry candidate data Entry4 overlaps with the search target range of the search target data “000*” of the entry candidate data Entry0, the search target range of the search target data “010*” of the entry candidate data Entry1, the search target range of the search target data “100*” of the entry candidate data Entry2, and the search target range of the search target data “110*” of the entry candidate data Entry3.

[0221] That is, the search target area of ​​the search target data "****" of entry candidate data Entry4 is divided by the search target data "000*" of entry candidate data Entry0, the search target data "010*" of entry candidate data Entry1, the search target data "100*" of entry candidate data Entry2, and the search target data "110*" of entry candidate data Entry3.

[0222] As a result, it is necessary to add a plurality of new entry candidate data Entry4 - 1 to Entry4 - 3 including search data different from the search data “0010” of the entry candidate data Entry4 - 0 .

[0223] exist Fig.10 , a diagram illustrating a search table 406 is shown to which new entry data is added.

[0224] For example, search data “0000”, prefix length data “3”, and search result data “P0” corresponding to entry candidate data Entry0 are stored in the table address “000”.

[0225] For example, search data "0010", prefix length data "0", and search result data "P4" corresponding to entry candidate data Entry4-0 are stored in the table address "001".

[0226] For example, search data “0100”, prefix length data “3”, and search result data “P1” corresponding to entry candidate data Entry1 are stored in the table address “010”.

[0227] For example, search data "0110", prefix length data "0", and search result data "P4" corresponding to entry candidate data Entry4-1 are stored in the table address "011".

[0228] For example, search data "1000", prefix length data "3", and search result data "P2" corresponding to entry candidate data Entry2 are stored in the table address "100".

[0229] For example, search data "1010", prefix length data "0", and search result data "P4" corresponding to entry candidate data Entry4-2 are stored in the table address "101".

[0230] For example, search data "1100", prefix length data "3", and search result data "P3" corresponding to entry candidate data Entry3 are stored in the table address "110".

[0231] For example, search data "1110", prefix length data "0", and search result data "P4" corresponding to entry candidate data Entry4-3 are stored in the table address "111".

[0232] Therefore, in the method according to the first embodiment, the number of entry data increases by three. This occurs because the entry candidate data Entry4 is divided by the other entry candidate data Entry1 to 3.

[0233] On the other hand, if the search process can be performed on the search data of the entry candidate data Entry4 in priority to other search data, the search result data can be acquired by the search process, and therefore, there is no need to add the entry data.

[0234] In this regard, although the search data described in the above-mentioned first embodiment is set to the lower limit value of the search target range, the search data may be set to any value. The search data may be set to any value within the search target range.

[0235] Therefore, the search data of the entry candidate data Entry4 is adjusted so that the search process is performed with priority over the other search data.

[0236] As shown in the following table, search data corresponding to entry candidate data included in the entry candidate data Entry4 and having prefix length data greater than the prefix length data of the entry candidate data Entry4 is stored.

[0237] Table 3

[0238] Table address [2:0] Search Data Prefix length entry 000(minimum) 0000 3 Entry0 001 0100 3 Entry1 010 1000 3 Entry2 011(Max) 1100 3 Entry3 100 101 110 111

[0239] As shown in the above table, the search data of the entry candidate data Entry0 to 3 included in the search data of the entry candidate data Entry4 are sorted.

[0240] The search data "0000" of the entry candidate data Entry0 is stored in correspondence with the table address "000 (Min)". In addition, the search data "1100" of the entry candidate data Entry3 is stored in correspondence with the table address "011 (Max)".

[0241] Therefore, as Entry4 increases, the range of the insertion position of the search data of the entry candidate data Entry4 is the range of (Max)+1, and the entry candidate data Entry4 is inserted somewhere from "000(Min)" to "100(Max+1)".

[0242] Here, when the search data is sorted, in order to arrange the search data of the entry candidate data Entry4 at the position where the binary search operation is first performed in the table addresses "000" to "100", the search data of the entry candidate data Entry4 is inserted into an address in which the most significant bit of the address that varies within the desirable table address range is set to 1.

[0243] In this embodiment, the most significant bit that is changed in table address [2:0] is address [2].

[0244] Therefore, the table address "100" is the position where the search data of the entry candidate data Entry4 is inserted.

[0245] Then, in order to insert the search data into the insertion position, "1110" is set as one of the search data within the search target range of the entry candidate data Entry4.

[0246] Fig.11 is a diagram showing the generation of a search table according to the third embodiment. Fig.11 , the original search table 404 is shown.

[0247] The original search table 404 stores a plurality of entry candidate data Entry0 to 4, respectively, as candidates for generating entry data according to entry addresses 0 to 4. In the present embodiment, five entry candidate data are stored in the original search table 404.

[0248] The entry candidate data includes: search target data including bits to be masked; and search result data to be output as a search result when the search target data matches a search keyword.

[0249] Here, as described above, the search target range of the search target data “****” of the entry candidate data Entry4 overlaps with the search target range of the search target data “000*” of the entry candidate data Entry0, the search target range of the search target data “010*” of the entry candidate data Entry1, the search target range of the search target data “100*” of the entry candidate data Entry2, and the search target range of the search target data “110*” of the entry candidate data Entry3.

[0250] That is, the search target area of ​​the search target data "****" of the entry candidate data Entry4 is divided by the search target data "000*" of the entry candidate data Entry0, the search target data "010*" of the entry candidate data Entry1, the search target data "100*" of the entry candidate data Entry2, and the search target data "110*" of the entry candidate data Entry3.

[0251] In addition, Fig.11 , a diagram illustrating a search table 408 according to the third embodiment is shown. Specifically, for entry candidate data included in entry candidate data Entry4 and having prefix length data greater than the prefix length data of entry candidate data Entry4, the lower limit value of the search target data of the entry candidate data is set as the search data.

[0252] For example, search data “0000”, prefix length data “3”, and search result data “P0” corresponding to entry candidate data Entry0 are stored in the table address “000”.

[0253] For example, search data “0100”, prefix length data “3”, and search result data “P1” corresponding to entry candidate data Entry1 are stored in the table address “001”.

[0254] For example, search data "1000", prefix length data "3", and search result data "P2" corresponding to entry candidate data Entry2 are stored in the table address "010".

[0255] For example, search data "1100", prefix length data "3", and search result data "P3" corresponding to entry candidate data Entry3 are stored in the table address "011".

[0256] Next, for the entry candidate data having the smaller prefix length data, one of the search data indicated by the search target data of the entry candidate data Entry4 is set as the search data.

[0257] In the present embodiment, as described above, the search data is set to "1110" so that the table address "100" is the position where the search data of the entry candidate data Entry4 is inserted.

[0258] For example, search data "1110", prefix length data "0", and search result data "P4" corresponding to entry candidate data Entry4 are stored in the table address "100".

[0259] The search processing unit 22 may perform a binary search operation using the search table. Fig.12 4 is a diagram for explaining a search process for the search table 408 according to the third embodiment.

[0260] The search processing unit 22 accesses the search table 408 and performs a search process. The search processing unit 22 stores information of the search process in the result storage unit 24.

[0261] exist Fig.12 , there is shown a search table 408. Here, the search processing unit 22 performs a search process on the search keyword "0111".

[0262] Fig.12 The right side of shows information of the search process for the search keyword “0111” stored in the result storage unit 24.

[0263] The search processing unit 22 starts the binary search operation from the intermediate table address “4” (“100”) of the search table 408 .

[0264] The result storage unit 24 shows a case where the table address "4" is read as the search address for the first memory access. The upper limit value "1111" of the search data "1110" is calculated. As a result, a case where the matching determination result of the search keyword is "hit" is shown. Therefore, the search result data "P4" is stored as a temporary search result. In addition, as a comparison process, a low value is stored as a comparison result. When the search keyword is less than the search data (low), the search processing unit 22 reads the entry data corresponding to the low address in the next binary search. In this case, the low address "2" is read out.

[0265] Next, as a second memory access, the search processing unit 22 reads the lower table address "2 (010)" of the search table 408, and performs a binary search using the search key "0111".

[0266] The search processing unit 22 calculates the upper limit value of the search target range based on the search data and the prefix length data of the read entry data in the same manner as described above.

[0267] The search processing unit 22 performs a matching determination process as to whether the search keyword is included based on the determined search target range.

[0268] In this embodiment, the search processing unit 22 determines that the search keyword "0111" is not within the search target range of the entry data. That is, the search result is a miss, so the search result data is not updated.

[0269] In addition, the search processing unit 22 performs a comparison process of the search data ("1000") and the search key "0111". The next search address is determined based on the comparison result.

[0270] In this entry data, search key (key=0111)<search data ("1000") Therefore, since the lower address "1" is determined to be smaller (lower) by the comparison process, the lower address "1" is read out.

[0271] Fig.12 The result storage unit 24 shows a case where the table address "1" is read as the search address for access as the third memory. The case where the upper limit value "0101" is calculated for the search data "0100" is shown. In addition, a large value (high) is stored as a comparison result as a comparison process. In addition, a miss (miss) occurs along with the match determination process. Therefore, the search result data is not updated.

[0272] The search processing unit 22 outputs final search result data based on the determination result stored in the result storage unit 24 .

[0273] The search processing unit 22 outputs the stored search result data "P4." According to the third embodiment, this process enables a binary search operation to be performed on the search table.

[0274] In the third embodiment, it is possible to prevent the entry data from increasing by optimizing the setting value of the search data.

[0275] Therefore, the table capacity can be further reduced compared to the first embodiment. In the above description, the case where a 3-bit address range is set as the table address of the search table has been described, but the present invention is also applicable to the case where a 4-bit address range is set.

[0276] Table 4

[0277]

[0278] As shown in the above table, when a 4-bit address range is set, the insertion position of the entry data can be set according to the most significant bit of the address to be changed.

[0279] By setting the search data at this position, the search process can be performed on the entry data including the search data with a smaller prefix length data in priority to the entry data including the search data with a larger prefix length data.

[0280] In the above-described embodiment, a configuration has been described in which each functional block is realized by executing a program stored in a memory in the CPU according to the processing unit 20, but the present invention is not particularly limited thereto, and each functional block may also be realized by providing a dedicated circuit.

[0281] Although the present disclosure has been specifically described based on the above-mentioned embodiments, the present disclosure is not limited to these embodiments, and it goes without saying that various modifications can be made without departing from the gist thereof.

Claims

1. A search circuit, comprising: A search table having a plurality of entry data, each of the plurality of entry data comprising search data, prefix length data and search result data; as well as A search processing unit is configured to receive a search keyword and perform a binary search operation on the search table, wherein the search processing unit reads one of the plurality of entry data from the search table according to the binary search operation, specifies a search target range based on the search data and the prefix length data included in the read entry data, determines whether the search keyword is included in the search target range, and outputs the search result data of the read entry data based on a determination result; wherein the plurality of entry data comprises first entry data and second entry data, wherein when the search processing unit determines that the search keyword is included in the first search target range, but the search keyword does not match the first search data, the search processing unit reads the second entry data from the search table according to the binary search operation, and determines whether the search keyword is included in the second search target range, the first search target range is specified by the first search data and the first prefix length data included in the first entry data, and the second search target range is specified by the second search data and the second prefix length data included in the second entry data, and When it is determined that the search keyword is included in the second search target range, the search processing unit outputs one of the first search result data in the first entry data and the second search result data in the second entry data based on the comparison result of the first prefix length data and the second prefix length data.

2. The search circuit according to claim 1, The search data is the lower limit value of the search target range.

3. The search circuit according to claim 1, further comprising: A result storage unit is configured to store the determination result of the search processing unit.

4. The search circuit according to claim 1, wherein the search table is one of a plurality of search tables, The search processing unit performs the binary search operation on the multiple search tables respectively.

5. The search circuit according to claim 4, The search processing unit performs the binary search operation on the multiple search tables sequentially or in parallel.

6. The search circuit according to claim 1, further comprising: The table generating unit is configured to generate the plurality of entry data to store the search table.

7. The search circuit according to claim 6, wherein the table generation unit comprises: a data acquisition unit configured to acquire a plurality of entry candidate data, each of the plurality of entry candidate data comprising the search result data and the search target data having a masked bit, a search data setting unit configured to set one of the data included in the search target range indicated by the search target data acquired by the data acquisition unit as the search data for each entry candidate data, An entry data setting unit is configured to set the search data, the prefix length data based on the entry candidate data, and the search result data as the entry data of the search table.

8. The search circuit according to claim 7, wherein the search data setting unit sets a lower limit value within the search target range indicated by the search target data as the search data.

9. The search circuit according to claim 7, wherein the plurality of entry candidate data include first entry candidate data and second entry candidate data, and The table generating unit further comprises: An entry data adding unit is configured to set additional entry data associated with the first entry candidate data when a first search target range indicated by the first search target data in the first entry candidate data includes a second search target range indicated by the second search target data in the second entry candidate data.

10. The search circuit according to claim 9, The additional entry data includes additional search data, first prefix length data based on the first entry candidate data, and first search result data based on the first entry candidate data, and the additional search data is a boundary value between the first search target data and the second search target range.

11. The search circuit according to claim 7, wherein the search table is one of a plurality of search tables, wherein when the search target range indicated by the search target data includes another search target range indicated by another entry candidate data, the entry data setting unit sets the search data, the prefix length data and the search result data as the entry data of another search table.

12. The search circuit according to claim 7, wherein the plurality of entry candidate data include first entry candidate data and second entry candidate data, the first entry candidate data include first search result data and first search target data, the second entry candidate data include second search result data and second search target data, wherein the first prefix length data based on the first search target data is smaller than the second prefix length data based on the second search target data, When a first search target range indicated by the first search target data includes a second search target range indicated by the second search target data, the search data setting unit sets the first search data based on the first search target data, so that the search processing unit reads the first search data earlier than the second search data based on the second search target data according to the binary search operation.

13. The search circuit according to claim 12, The search data setting unit sets a first address of the first search data to be stored in the search table based on an address range to be stored in the search table for search data having a prefix length data greater than the first prefix length data.

Citation Information

Patent Citations

  • PTP tablet taking-out detector

    JP2019107258A

  • Communication control apparatus and method for searching an internet protocol address

    US20040215609A1