WO2005013566A1 - データ検索方法及び装置 - Google Patents

データ検索方法及び装置 Download PDF

Info

Publication number
WO2005013566A1
WO2005013566A1 PCT/JP2003/009740 JP0309740W WO2005013566A1 WO 2005013566 A1 WO2005013566 A1 WO 2005013566A1 JP 0309740 W JP0309740 W JP 0309740W WO 2005013566 A1 WO2005013566 A1 WO 2005013566A1
Authority
WO
WIPO (PCT)
Prior art keywords
search
field
entry
data
priority
Prior art date
Application number
PCT/JP2003/009740
Other languages
English (en)
French (fr)
Inventor
Yuichi Uzawa
Yasuhiro Ooba
Original Assignee
Fujitsu Limited
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 Fujitsu Limited filed Critical Fujitsu Limited
Priority to JP2005507390A priority Critical patent/JPWO2005013566A1/ja
Priority to PCT/JP2003/009740 priority patent/WO2005013566A1/ja
Publication of WO2005013566A1 publication Critical patent/WO2005013566A1/ja
Priority to US11/266,551 priority patent/US20060064413A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • 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
    • G06F16/90344Query processing by using string matching techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/7453Address table lookup; Address filtering using hashing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • H04L45/74591Address table lookup; Address filtering using content-addressable memories [CAM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • 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/604Address structures or formats
    • 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

Definitions

  • the present invention relates to a data search method and apparatus, and more particularly to a data search method and apparatus for searching a database for data that matches a search key.
  • route selection processing ie, routing processing
  • routing processing ie, routing processing
  • a router 101 shown in FIG. 6 is a relay point of a network, and network lines 102 to 105 are connected to the router 101. Servers 130, 140, and 150 are connected to the ends of the network lines 103 to 105, respectively.
  • the header of the bucket 110 received by the router 101 via the network line 102 includes the destination IP address 111 and the source IP address 112 belonging to Layer 3, the destination port number 113 and the source Information on port number 114 is included.
  • the destination network to which the bucket 110 is to be transmitted can be identified.
  • the sender of the bucket 110 can be identified from the source IP address 112
  • the contents of the contract (eg, line capacity) regarding the use of the network concluded with the identified sender can be ascertained. You can do it.
  • the type of the application can be determined from the destination port number 113 and the source port number 114.
  • the router 101 performs a layer 3 or layer 4 routing process based on the information to output the bucket 110 to an appropriate network line 103, 104, 105.
  • the routing is performed according to the contract contents regarding the circuit capacity with the sender of the bucket 110. Processing can be performed.
  • load distribution can be performed by layer 3 routing processing. If the routing process is properly performed in the router 101, a flexible network can be constructed.
  • the above-described routing process is realized by a data search process of a destination by software and hardware.
  • content addressable / associative memory (CAM) devices have been mainly used as data retrieval devices for high-speed, large-capacity routing processing.
  • the CAM device is used not only for a router that performs routing processing at Layer 3 or Layer 4 as in the router 101 described above, but also for switching using a MAC address such as a Layer 2 switch (not shown). .
  • IP address search process As an example of a routing process using a CAM device, an IP address search process will be described below with reference to FIG.
  • FIG. 7 shows a configuration example of a part related to the routing process in the router 101 of FIG. 6, for example.
  • the CAM device 200 has a database 203 that stores a group of entries to be searched, and a network processor 210 is a processor specialized in network processing.
  • a context RAM (Context-RAM or Associated-RAM) 220 is a memory that stores processing contents and the like corresponding to each entry of the CAM device 200, and is generally configured by a memory device such as an SRAM or a DRAM. .
  • the CAM device 200, the network processor 210, and the context RAM 220 are mutually connected by an input interface 211 and output buses 201 and 221.
  • the network processor 210 extracts header information from the received bucket 110 and inputs the IP address or port number or the like to be searched as a search key 212 to the CAM device 200 via the input interface 211.
  • CA Debye The scan 200 internal database 203, and IP Ryo address information input in advance by the network administrator is accommodated as entry group, CAM device 200, compares the respective entry of search key 2 12 and Database 20 3 I do.
  • the comparison operation by the CAM device 200 is performed simultaneously for each bit of each entry.
  • the physical address of the “most” appropriate entry (address [2] in the example in the figure) is set as the hit address 202 and the output bus 201 is set.
  • the context RAM 220 outputs the processing contents to be dealt with and the data of the output port (distribution destination) to the network processor 210 via the output bus 221 corresponding to the address [2] obtained as the hit address 202 in FIG.
  • search result 222 The network processor 210 processes the packet 110 according to the search result 222 or performs a search again.
  • FIG. 8 shows a portion related to the IP end address search process in the CAM device 200 of FIG. 7 in more detail. Therefore, only the top four entries # 1 to # 4 are shown in the database 203 of FIG. 7 among the entries previously input by the network administrator for convenience of explanation. Matching lines 321 to 324 are provided for each of the entries # 1 to # 4, respectively, and are connected to the priority encoder 330, respectively. In each of the entries # 1 to # 4, an IP address and a subnet mask are stored as a pair in the database 203. In the figure, the upper row of each entry # 1 to # 4 shows " ⁇ ,” “2,” “A3,” and “$ 4" as the IP addresses, and the lower row shows the respective subnets. The mask is indicated by consecutive bits “1" and “0", where consecutive bits "1" indicate the prefix part and consecutive bits "0" indicate the mask part.
  • the length of the prefix portion (bit "1") of the subnet mask that is, the prefix length (prefix length) is arranged in ascending order.
  • [1] to [4] shown on the right side of each entry # 1 to # 4 indicate each physical address.
  • the IP address indicates that the lower bits on the right represent the end of the network, and the search results that match up to the more detailed lower bits, as well as the address on the map, are more relevant.
  • the search result of the IP address is the one with the longest prefix length, and such a search result is called Longest Prefix Match. This is why entries are housed side by side according to the prefix length.
  • the IP address “A-KEY” is input as the search key 212 from the network processor 210 or the like.
  • the CAM device 200 compares each bit for all entries simultaneously. However, comparison is not performed for bits whose subnet mask is "0" (don't care condition). If any of the compared bits is “mismatch”, a signal indicating a mismatch is output on the match lines 321 to 324, and the entry is identified as a mismatched entry. In the example shown in the figure, since the mismatch signals 331 and 333 are output to the match lines 321 and 323, respectively, the entries # 1 and # 3 are identified as the mismatch entries.
  • the priority encoder 330 When a plurality of hits are performed in this way, the priority encoder 330 outputs the longer prefix length, that is, the physical address [2] of the entry # 2, as the hit address 202.
  • the CAM device that performs the mask process using the mask bit is called a ternary CAM device because it handles ternary data.
  • a CAM device that only compares the data bits of the search key 212 with the data bits of entries # 1 to # 4 and does not perform mask processing is called a binary CAM device because it handles binary data. I have.
  • FIG. 9 shows a function of the ternary CAM cell 600 corresponding to one bit in the ternary CAM device and a truth table 610 of search results.
  • a ternary CAM cell 600 holds a data bit 601 and a mask bit 602, and further includes an input search key 607 and a data bit 601. And a mask processing unit 604 that performs a mask process on the comparison result output from the comparison processing unit 603 in accordance with the mask bit 602.
  • One entry in the database is made up of multiple ternary CAM cells 600 connected to a common match line.
  • the ternary CAM cell 600 compares the result of the comparison between the search key 607 and the data bit 601 by the comparison processing unit 603 with the result of the mask processing performed by the mask processing unit 604 to obtain the final search result.
  • 605 is output to the coincidence line 606. That is, the comparison processing unit 603 outputs “0” if the value of the search key 607 is different from the value of the data bit 601, and outputs “1” if they are equal.
  • the mask processing unit 604 outputs the value S of the mask bit 602.
  • the output of the comparison processing unit 603 is output as it is as the search result 605, and when the value of the mask bit 602 is "0", " ⁇ " is forcibly output as the search result 605 regardless of the output of the comparison processing unit 603.
  • Figure (2) shows such search results in the form of a truth table.
  • the logic may be inverted.
  • a flip-flop As the function of holding the data bit 601 and the mask bit 602, for example, a flip-flop, a capacitor, a high dielectric film or a magnetic film having hysteresis can be used.
  • each of the entries # 1 to # 4 is constituted by a ternary CAM cell 600 corresponding to the number of bits of the entry.
  • each of the coincidence lines 321 to 324 corresponds to the coincidence line 606.
  • entries # 1 to # ⁇ are shown to contain only an IP address.
  • entries # 1 to # 4 store data divided into a plurality of fields, for example, fields F1 to F5. .
  • the field F5 stores management information notified from the outside, such as a tag indicating whether the entry is valid or invalid, as other information.
  • the fields F1 and F2 are shown in two rows above and below each entry # 1. However, since the subnet mask is usually applied to the fields F1 and F2, the prefixes 431 and 432 and the mask Parts 441 and 442 are shown below. Fields F3 to F5 are shown in a single row because usually no subnet mask is applied.
  • FIG. 2B shows a global mask pattern 450 used when it is desired to specify only a specific field among the fields F1 to F5 in FIG. 1A as a search target.
  • the mask portions 451 and 453 are excluded from the search target, and only the field F2 indicating the destination IP address corresponding to the search target portion 452 is searched. Become.
  • Conventionally proposed CAM devices consist of an associative memory array composed of a plurality of fields, and specify the field to be searched, so that the specified field contains the data to be searched and the other fields contain the data to be searched.
  • There is one that performs a search by giving a mask signal for example, see Patent Document 1).
  • information on the prefix length is separately stored together with the route information expressed by the combination of the IP address and the prefix length (for example, refer to Patent Document 2), and the priority order of data selection can be arbitrarily set from outside. In some cases (for example, see Patent Document 3).
  • some devices have a memory width extension function that enables data search with low power consumption and has a higher degree of integration (for example, see Patent Document 4), and a variable-width CAM device for searching variable-width data. (For example, see Patent Document 5).
  • Patent Document 2 Japanese Patent Application Laid-Open No. 2000-3005539 (Summary, Figure 1)
  • a search using a CAM device can only be performed with a width of several tens of bits, for example, the ability to repeat a CAM search multiple times to perform processing such as contact identification. Supports multi-bit width searches exceeding several hundred bits.
  • the destination IP address 32 bits
  • the source IP address 32 bits
  • the number (16 bits) and the source port number (16 bits) can be searched as a single entry for a total of 96 bits or more at a time.
  • the final search result output by the priority encoder 330 when a plurality of entries hits is determined by the storage order of the entries.
  • the present invention relates to a data search method and apparatus for searching a database for data that matches a search key, and to obtain a search result based on a desired priority without being restricted by the storage order of entries.
  • a data search method includes, among entries stored in a database divided into a plurality of fields, all non-mask bits in all search target fields, A first step in which an entry having the same data bit as that of the corresponding search key is set as an intermediate search result, and obtaining the longest prefix length for each search target field from the previx length of each search target field in the intermediate search result A second step; and a third step in which, among the intermediate search results, an entry having the longest prefix length in a search target field having the highest priority is used as a search result.
  • FIG. 1 shows that, for each of the entries # 1 to # 5 stored in the database, for example, when a search key (not shown) that searches a plurality of fields F1 and F2 is input, the match Z mismatch
  • the state is schematically shown.
  • the numerical value indicated as, for example, "/ 24" is the prefix length (the prefix not subnet masked). (Length of the part).
  • the shaded portion adjacent to the white background indicates a mask portion (subnet-masked portion), which is rough.
  • the prefix length of field F1 of entry # 1 in the figure is 24 bits
  • the prefix length of field F2 is 22 bits
  • the prefix lengths of fields F1 of entries # 2 to # 5 are 24 bits, 20 bits, 17 bits, and 12 bits, respectively
  • the prefix lengths of field F2 are 17 bits, 17 bits, and 17 bits, respectively. 22 bits and 16 bits.
  • Entries # 1, # 2, and # 5 indicated by dotted lines are “mismatched” because at least one bit of the prefix part does not match the data bit of the corresponding search key. It has been determined that.
  • the search results are output with the storage order of the entries # 1 to # 5 as the priority order, so that among the entries # 3 and # 4 extracted as described above, The entry stored in the higher order will be output as a search result.
  • the prefix lengths of the search target fields F1 and F2 held in the prefix length register are calculated as follows. Find the longest prefix length in fields F1 and F2.
  • the longest prefix length in field F1 is 20 bits obtained in entry # 3
  • the longest prefix length in field F2 is 22 bits obtained in entry # 4.
  • the entry having the longest prefix length in the search target field having the highest priority is used as the final search result.
  • the search field with the highest priority is the field F2
  • the entry # 4 stored lower than the entry # 3 and # 4 extracted as described above may be used as the final search result. Will be possible.
  • the search target field having the highest priority may be the longest search target field among the longest prefix lengths obtained in the third step.
  • the search target field having the highest priority is the longest search target field among the longest prefix lengths obtained in the third step. It is.
  • the maximum prefix length of field F1 is 20 bits
  • the search field with the highest priority is field F2
  • entry # 4 having the longest prefix length (22 bits) in field F2 is the search result. Is output.
  • the priority may be set in each field before the search is started.
  • entry # 4 having the longest prefix length (22 bits) is output as a search result.
  • the priority in this case only needs to be changeable each time a search is performed.
  • the priority is not fixedly set but can be changed each time a search is performed, it is possible to more flexibly obtain a search result based on a desired priority.
  • a field in which a predetermined value is set as the above priority may be excluded from the search.
  • the above priority can be used not only for determining the final search result, but also for determining whether or not a field is to be searched.
  • Prefix length holding unit that holds the length, and in all search target fields, the entry in which all non-mask bits of the entry and the bit data of the corresponding search key match the intermediate search result
  • the longest prefix length for each search target field is obtained from the prefix length of each search target field of the intermediate search result held in the prefix length holding unit, and the search target having the highest priority among the intermediate search results
  • a calculation unit that uses the entry having the longest prefix length in the field as a search result.
  • the search target field having the highest priority may be the longest search target field among the longest prefix lengths obtained by the operation unit.
  • the priority may be set in each field before the start of the search. In this case, the priority may be changed whenever the search is performed.
  • FIG. 1 is a block diagram showing the principle of a data search method and device according to the present invention.
  • FIG. 2 is a block diagram showing an example of an entry state common to the embodiments (1) and (2) of the data search method and apparatus according to the present invention.
  • FIG. 3 is a block diagram showing an embodiment (1) of the data search method and apparatus according to the present invention.
  • FIG. 4 is a block diagram showing an embodiment (2) of the data search method and apparatus according to the present invention.
  • FIG. 5 is a block diagram showing a modification of the embodiment (2) of the data search method and apparatus according to the present invention.
  • FIG. 6 is a block diagram for explaining an outline of a general routing process.
  • FIG. 7 is a block diagram showing a configuration example of a portion related to the routing process in the router 101 in FIG.
  • FIG. 8 is a block diagram showing a detailed configuration of the CAM device 200 in FIG.
  • FIG. 9 is a diagram showing a configuration example of a ternary CAM cell used for a general CAM device and a truth table of search results.
  • FIG. 10 is a block diagram showing an example of an entry configuration inside a general CAM device and a global mask pattern.
  • FIG. 2 shows the state of the entries # 1 to # 5 common to the above-described embodiments (1) and (2).
  • a search key (not shown) for searching a plurality of fields F1 and F2 is input. This is a diagram schematically showing the state of Z match at the time of matching.
  • matching lines 711 to 715 are shown corresponding to entries # 1 to # 5, respectively, and for entries # 1, # 2, and # 5, matching lines 711, For 712 and 715, a mismatch signal is output with a downward arrow (for example, a mismatch signal 716 in entry # 5).
  • entries # 1, # 2, and # 5 that output a mismatch signal are "mismatches", but entries # 3 and # 4 that do not output a mismatch signal are "matches”. To obtain intermediate search results.
  • registers 801 and 802 for holding the prefix lengths of the fields F1 and F2 of the entries # 1 to # 5 are provided. That is, the register 801 holds the prefix lengths “24”, “24”, “20”, “17”, and “12” of the field F1 of the entries ttl to # 5, respectively. Similarly, the register 802 holds the prefix lengths “22”, “17”, “17”, “22”, and “16” of the field F2 of the entries # 1 to # 5, respectively. .
  • the value of the prefix length of each entry # 1 to # 5 for the registers 801 and 802 needs to be set before the search operation, but the network administrator inputs the prefix length when creating the entry. It is good.
  • the value set in the mask bit may be counted by the CAM device itself and automatically input to the registers 801 and 802.
  • entries # 3 and # 4 obtained as an intermediate search result refer to registers 801 and 802, respectively, as shown by dotted arrows 811-814, and for field F1, the prefix of entry # 3 Preset for length "20" and entry # 4 The prefix length "17” is obtained, and for field F2, the prefix length "17” of entry # 3 and the prefix length "22" of entry # 4 are obtained.
  • the maximum values 821 and 822 are obtained for each of the finale fields F1 and F2.
  • the maximum value 822 in field F2 is the prefix length "22" of entry # 4.
  • the maximum values 821 and 822 are compared with each other, and when the maximum value is obtained, since the maximum value is "22" of the maximum value 822, the field F2 is prioritized.
  • the entry # 4 with the longest prefix length in field F2 is the final search result.
  • the registers 901 and 902 shown in FIG. 4 correspond to the registers 801 and 802 shown in FIG. 3, and similarly to the embodiment (1), the fields F1 and F1 of the entries # 1 to # 5 are used. Holds the F2 prefix length.
  • the maximum values 921 and 922 in the registers 901 and 902 are also obtained in the same manner as the maximum values 821 and 822 in the registers 801 and 802 shown in FIG. FIG. 4 differs from FIG. 3 in that priority registers 931 and 932 are provided for fields F1 and F2, respectively. Note that the values set in the priority registers 931 and 932 can be changed each time a search is performed.
  • the priority comparison between the fields indicated by the dotted arrow 933 is performed based on the priority registers 931 and 932, and in the field F1 having a higher priority, the entry # 3 having the longest prefix length is finalized. Search results.
  • FIG. 5 shows a modification of the embodiment (2) in which the priority register is set to a global mask pattern. It shows the case of using it as an application. For example, assuming that n is 255, it is assumed that priority registers Rl to Rn are provided for the fields Fl to Fn.
  • the data search method and apparatus from among the entries divided into a plurality of fields in the database and stored, all the non-mask bits in all the search target fields,
  • the entry matching the bit data of the search key corresponding to the search result is set as the intermediate search result, and the longest prefix length for each search target field is obtained from the prefix length of each search target field of the intermediate search result.
  • the entry having the longest prefix length is configured as the search result, so that a more appropriate search result is obtained without being restricted by the storage order of the entries. It becomes possible.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

 データベースにおいて複数フィールドに分割して格納されたエントリの中から、全ての検索対象フィールドにおいて全ての非マスクビットと、これらに対応する検索キーのビットデータとが一致するエントリを中間検索結果とし、該中間検索結果の各検索対象フィールドのプリフィクス長の中から検索対象フィールド毎の最長プリフィクス長を求め、該中間検索結果の内、優先度が最も高い検索対象フィールドにおいて該最長プリフィクス長を有するエントリを検索結果とする。

Description

明 細 書 データ検索方法及び装置 技術分野
本発明はデータ検索方法及び装置に関し、 特にデータベースの中から検索キー に一致するデータを検索するデータ検索方法及び装置に関するものである。 背景技術
ネットワークの中継点となるルータ又はスィッチにおいては、 ネットワーク内 を流れるバケツト (例えば IPデータグラム) の宛先に応じた経路選択処理、 すな わちルーティング処理を行なう必要がある。
例えば、 図 6に示したルータ 101はネットワークの中継点となっており、 この ルータ 101にはネットワーク回線 102〜105が接続されている。 また、ネットヮー ク回線 103〜105の先にはサーバ 130、 140、及び 150がそれぞれ接続されている。 図示の如く、ルータ 101がネットワーク回線 102を介して受信するバケツト 110 のヘッダには、 レイヤー 3に属する宛先 IPァドレス 111及び送信元 IP了ドレス 112や、レイヤー 4に属する宛先ポート番号 113及び送信元ポート番号 114の各情 報が含まれている。
宛先 IPァドレス 111からはバケツト 110を送信すべき宛先のネットワークを識 別することが出来る。また、送信元 IPァドレス 112からはバケツト 110の送信者 を識別することが出来るため、 識別された送信者との間で締結されているネット ワークの利用に関する契約の内容 (回線容量等) を把握することも出来る。 さら に、 宛先ポート番号 113及び送信元ポート番号 114からはアプリケーションの種 類などを判別することが出来る。
従って、 ルータ 101はこれらの情報に基づき、 バケツト 110を適切なネットヮ ーク回線 103, 104, 105に出力するように、レイヤー 3又はレイヤー 4のルーティン グ処理を行なう。
例えば、 ネットワーク回線 103及び 104の回線容量 (帯域) について、 それぞ れの実線の太さで表される如く、 ネットワーク回線 103が大容量であり、 ネット ワーク回線 104が小容量であるような場合、 バケツト 110の送信者との回線容量 に関する契約内容に応じてルーティング処理を行うことが可能となる。
また、 アプリケーション毎にサーバ 130、 140、 及ぴ 150をそれぞれ対応させて おくことにより、 レイヤー 3のルーティング処理で負荷分散を行うこともできる。 ルータ 101においてルーティング処理を適切に行えば、 柔軟なネットワークが 構築可能となる。
一般に、 上記のルーティング処理はソフトウエア及びハードウヱァによる宛先 のデータ検索処理によって実現されている。 特に、 高速 ·大容量のルーティング 処理を行なうためのデータ検索装置としては、 従来より連想メモリ (Content Addressable/Associative Memory: CAM) デバイスが主として用いられている。 なお、 CAMデバイスは、 上記のルータ 101の様にレイヤー 3又はレイヤー 4での ルーティング処理を行うルータだけでなく、 レイヤー 2 スィッチ (図示せず) の 様に MACァドレスによるスィツチングにも用いられている。
CAMデバイスを用いたルーティング処理の一例として、 IPアドレスの検索処理 について図 7を参照して以下に説明する。
図 7は、 例えば図 6のルータ 101内において、 ルーティング処理に関連した部 分の構成例を示したものである。
CAMデバイス 200は、 検索対象のェントリ群を格納したデータベース 203を有 するものであり、 ネットワークプロセッサ 210は、 ネットワークの処理に特化し たプロセッサである。また、コンテキスト RAM (Context- RAM又は Associated- RAM) 220は、 CAMデバイス 200の各ェントリに対応した処理内容等を格納したメモリで あり、 通常 SRAM、 DRAMなどのメモリデバイスで構成されるものである。
CAMデバイス 200、ネットワークプロセッサ 210、及ぴコンテキスト RAM220は、 入力インタフェース 211、 出力バス 201及ぴ 221でそれぞれ相互に接続されてい る。
動作において、 ネットワークプロセッサ 210は受信したバケツト 110からへッ ダ情報を抽出して、検索したい IPァドレスまたはポート番号等を検索キー 212と して入カインタフェース 211を介して CAMデバイス 200に入力する。 CA デバイ ス 200内部のデータベース 203には、 予めネットワーク管理者によって入力され た IP了ドレス情報がェントリ群として収容されており、 CAMデバイス 200は、 検 索キー 212とデータベース 203の各ェントリとを比較する。
ここで、 CAMデバイス 200による比較動作は各ェントリの各ビットに対して同 時に行われる。 検索した結果、 適切なエントリが有った (ヒットした) 場合、 そ の中で "最も"適切なエントリの物理アドレス (同図の例ではアドレス [2] ) をヒ ットァドレス 202として出力バス 201を介してコンテキスト RAM220に与える。 コンテキスト RAM220は、例えば、 同図のヒットァドレス 202として得られたァ ドレス [2]に対応して、対処すべき処理内容や出力ポート(配布先)のデータを出力 バス 221を介してネットワークプロセッサ 210に検索結果 222として与える。 ネットワークプロセッサ 210は、 検索結果 222に応じてパケット 110を処理し たり、 再度検索を行なったりする。
上記の CAMデバイス 200内における従来の IPァドレス検索処理について、図 8 を参照してより詳細に説明する。
図 8は、図 7の CAMデバイス 200において IP了ドレス検索処理に関連した部分 をより詳細に示したものである。 従って、 図 7のデータベース 203に予めネット ワーク管理者によって入力されたエントリ群の内、 説明の便宜上、 上位 4つのェ ントリ #1〜#4のみが示されている。また、各ェントリ #1〜#4毎に一致線 321〜324 が設けられており、それぞれプライオリティ 'エンコーダ 330に接続されている。 各ェントリ #1〜#4は、 IPァドレスとサブネットマスクが一対となってデータべ ース 203に収容されたものである。同図の各ェントリ #1〜#4の上段にはそれぞれ、 IP ア ドレスとして "ΑΓ、 "Α2"、 "A3"、 及び "Α4" が示されており、 下段にはそ れぞれのサブネットマスクが連続したビット " 1" 及び "0" で示されている。 こ の場合、 連続したビット " 1" はプリフィクス部分を示しており、 連続したビット "0" はマスク部分を示している。
ェントリ #1〜#4は、 図示の如くサブネットマスクのプリフィタス部分 (ビット "1") の長さ、 すなわちプリフィクス長 (prefix length) が長い順に並べられて いる。 また、 各エントリ #1〜#4の右側に示された [1]〜[4]は、 それぞれの物理ァ ドレスを示している。 IPァドレスは右側の下位ビットほどネットワークの末端を現し、地図上の住所 と同様に、 より詳細な内容である下位ビッ トまで一致している検索結果ほど適切 であるということができる。 すなわち、 IPア ドレスの検索結果としては、 プリフ イクス長が最も長いァドレスが最も適切であり、 このような検索結果はロンゲス ト 'プリフィクス 'マッチ (Longest Prefix Match) と呼ばれるものである。 ェ ントリをプリフィクス長に従って並べて収容するのはこのためである。
運用中の CAMデバイス 200の動作においては、 ネッ トワークプロセッサ 210な どから検索キー 212として例えば IPァドレス "A-KEY"が入力される。 CAMデバイ ス 200は全エントリに対して同時に各ビットについて比較を行なう。 但し、 サブ ネッ トマスクが "0" のビッ トに関しては比較を行なわない (ドントケア条件)。 比較したビッ トが 1つでも 「不一致」 である場合、 一致線 321〜324に不一致を あらわす信号が出力されて、 不一致エントリとして識別される。 同図の例では、 不一致信号 331及び 333がそれぞれ一致線 321及び 323に出力されているため、 エントリ #1及び #3が不一致ェントリとして識別されている。
比較したビットが全て 「一致」 している場合は、 エントリ #2及び #4の様に一致 エントリとして識別される。
このように複数ヒッ トした場合は、従来よりプライオリティエンコーダ 330は、 プリフィクス長の長い方、 すなわちェントリ #2 の物理ァドレス [2]をヒットアド レス 202として出力する。
このように、 検索キー 212のデータビッ トと、 エントリ #1〜#4のデータビッ ト とを比較する場合、 マスクビットによるマスク処理を行う CAMデバイスは 3値の データを扱うことからターナリ CAMデバイスと呼ばれ、 一方、 検索キー 212のデ ータビットとェントリ #1〜#4のデータビッ トとの比較のみを行ない、マスク処理 を行なわない CAMデバイスは 2値のデータを扱うことからバイナリ CAMデバイス と呼ばれている。
図 9は、 ターナリ CAMデバイスにおける 1ビッ ト分に相当するターナリ CAMセ ル 600の機能及び検索結果の真理値表 610を示したものである。
同図 (1 ) において、 ターナリ CAMセル 600は、 データビット 601及びマスク ビット 602を保持しており、 さらに、入力された検索キー 607とデータビッ ト 601 とを比較する比較処理部 603と、 この比較処理部 603が出力する比較結果に対し マスクビット 602に応じてマスク処理を施すマスク処理部 604を有している。 データベースの 1つのェントリは共通の一致線 に接続された複数のターナ リ CAMセル 600によって構成されている。
動作において、ターナリ CAMセル 600は、比較処理部 603によって検索キー 607 とデータビット 601とが比較された結果に対して、 マスク処理部 604によってマ スク処理を施した結果を、 最終的な検索結果 605として一致線 606に出力する。 すなわち、 比較処理部 603は、 検索キー 607 とデータビット 601の値が異なれ ば "0"、 等しければ " 1" を出力し、 マスク処理部 604は、 マスクビット 602の値 力 S "1"のときは比較処理部 603の出力をそのまま検索結果 605として出力し、 マ スクビット 602の値が "0" のときは比較処理部 603の出力に関わらず "Γ を検 索結果 605として強制的に出力する。 同図 (2 ) は、 このような検索結果を真理 値表の形で示したものである。
なお、 ここで動作が相等しければ論理反転させても良い。
データビット 601及ぴマスクビット 602を保持する機能としては、 例えばフリ ップフ口ップ、 キャパシタ、 ヒステリシスを有する高誘電膜あるいは磁性膜を用 レヽられる。
上記の図 7及び図 8に示した CAMデバイス 200がターナリ CAMデバイスである 場合、 各エントリ #1〜#4は、 エントリのビット数に応じたターナリ CAMセル 600 によって構成されることになる。 この場合、各一致線 321〜324は一致線 606に対 応している。
上記の図 8においては、 特定の項目、 すなわち、 IPアドレスのみを検索する場 合を例にとって説明したため、 各ェントリ #1〜ίΗには IPァドレスのみが収容さ れているように示したが、 実際の CAMデバイス 200内のデータベース 203には、 図 1 0 ( 1 ) に示す如く、 エントリ #1〜#4には例えばフィールド F1〜F5のよう に複数フィールドに分割されたデータが格納されている。
すなわち、 エントリ #1〜#4のフィールド F1には、 それぞれ送信元 IPア ドレス として "SA1" 〜 "SA4" が格納されており、 同様に、 フィールド F2には宛先 IP アドレスとして "DA1 "〜 "DA4"が格納されている。 さらに、 フィールド F3には、 それぞれ送信元ポート番号として "SP1" 〜 "SP4" が格納されており、 フィール ド F4には宛先ポート番号として "DPI" 〜 "DP4" が格納されている。
また、 フィールド F5には、 その他の情報として、 例えば、 エントリの有効 無 効を示すタグのように、 外部から通知される管理用の情報が格納されている。 なお、 フィールド F1及び F2は各ェントリ #1〜 について上下 2段で示されて いるが、 これは、 フィールド F1及び F2には通常サブネットマスクが適用される ため、 それぞれのプリフィクス部分 431, 432及びマスク部分 441, 442を下段に示 したものである。 フィールド F3〜F5については、通常はサブネットマスクを適用 しないため 1段で示されている。
同図 (2 ) は、 同図 (1 ) のフィールド F1〜F5の内、 特定のフィールドのみを 検索対象に指定したい場合に用いられるグローバルマスクパターン 450を示した ものである。
このようなグローバルマスクパターン 450を用いれば、 同図の例では、 マスク 部分 451及ぴ 453が検索対象外となり、 検索対象部分 452に対応して、 宛先 IP ァドレスを示すフィールド F2のみが検索対象になる。
従来より提案されている CAMデバイスとしては、 連想メモリアレイを複数のフ ィールドから構成し、 検索対象となるフィールドを指示することにより、 指示さ れたフィールドには検索対象データを、 その他のフィールドにマスク信号を与え て検索を行なうものがある (例えば、 特許文献 1参照)。
また、 IPァドレスとプリフィクス長との組み合せにより表現された経路情報と ともに別途当該プリフィクス長の情報を格納したもの (例えば、特許文献 2参照) や、データ選択の優先順序を外部から任意に設定可能としたものもある(例えば、 特許文献 3参照)。
さらには、 低消費電力によるデータ検索を可能とし、 より集積度の高いメモリ 幅拡張機能を有するもの (例えば、 特許文献 4参照) や、 可変幅のデータを検索 するための可変幅の CAMデバイスもある (例えば、 特許文献 5参照)。
<特許文献 1〉
特開昭 5 8— 2 0 0 4 9 4号公報 (特許請求の範囲、 図 1)
<特許文献 2〉 特開 2 0 0 2— 3 0 5 5 3 9号公報 (要約、 図 1)
く特許文献 3〉
特開平 1 1一 1 0 2 5 8 9号公報 (要約、 図 1)
く特許文献 4 >
特開平 5— 1 8 9 9 7 8号公報 (要約、 図 1)
く特許文献 5 >
特開 2 0 0 1— 1 6 0 2 9 2号公報 (要約、 図 2A)
CAMデバイスを用いた検索を数十ビットの幅でしか行えない状況では、例えば、 フ口一識別などの処理を行なうために複数回 CAM検索を繰り返す必要があった力 近年では、 多くの CAMデバイスが数百ビッ トを超える多ビット幅検索に対応して おり、例えば、 IPv4によるフロ一識別を例にとると、宛先 IPアドレス(32ビッ ト)、 送信元 IPァドレス (32 ビット)、 宛先ポート番号(16 ビット)、 及び送信元ポート 番号(16 ビット)を 1つのェントリとして合計 96 ビッ ト以上を一度に検索するこ とが可能になっている。
しかしながら、 従来の技術においては、 上述の如く、 複数のエントリがヒット した場合にプライオリティエンコーダ 330が出力する最終検索結果は、 エントリ の格納順によつて決まってしまう。
別の最終検索結果を得るためには、ェントリの格納順を変更する必要があるが、 これには、 データベース 203の書き換えが必要になる。 このようなデータベース 203のメンテナンスを行なうためには、 ルータ 101 のル一ティング処理を停止す る必要があり、 ネットワークのダウン時間を増大させることになる。
従って、 ネッ トワークの常時運用を実現するためには、 エントリの格納順は容 易に変更することが出来ない。
一方、 近年における仮想閉域網 (Virtual Private Network: VPN) の利用の拡 大に伴い、 顧客毎の柔軟な対応がネットワークの運用において重要になって来て いる。 例えば、 ネットワークの障害時において、 特定の顧客の回線を優先させる 必要がある場合、 当初の格納順が低位のェントリを優先させることが望まれる。 また、 運用中のサーバ等の負荷が集中しないように、 適切な負荷分散を行なう 場合にも、 当初の格納順が低位のェントリを優先させることが望まれる。 従って、 本発明は、 データベースの中から検索キーに一致するデータを検索す るデータ検索方法及び装置に関し、 エントリの格納順に拘束されることなく、 所 望の優先度に基づく検索結果を得ることを目的とする。 発明の開示
上記の目的を達成するため、 本発明に係るデータ検索方法は、 データベースに おいて複数フィールドに分割して格納されたェントリの中から、 全ての検索対象 フィールドにおいて全ての非マスクビットと、 これらに対応する検索キーのデー タビットとが一致するェントリを中間検索結果とする第 1ステップと、 該中間検 索結果の各検索対象フィールドのプリブイクス長の中から該検索対象フィールド 毎の最長プリフィクス長を求める第 2ステップと、 該中間検索結果の内、 優先度 が最も高い検索対象フィ一ルドにおいて該最長プリフィクス長を有するェントリ を検索結果とする第 3ステップと、 を有することを特徴としている。
本発明の原理を図 1を用いて以下に説明する。 同図は、 データベースに格納さ れたェントリ #1〜#5の各々について、例えば複数のフィールド F1及ぴ F2を検索 対象とする検索キー (図示せず) が入力された際の一致 Z不一致の状態を模式的 に示したものである。
各ェントリ #1〜#5の点線又は実線で囲まれた各フィールド F1及ぴ F2内の白地 部分において、 例えば "/24" のように示された数値は、 プリフィクス長 (サブネ ットマスクされていないプリフィクス部分の長さ) を示すビット数である。 また 、 白地部分に隣接した網掛部分は、 マスク部分 (サブネッ トマスクされた部分) を示しナこものである。
すなわち、同図のェントリ #1のフィールド F1のプリフィクス長は 24ビットで あり、 フィールド F2のプリフィクス長は 22ビットであることを示している。 同 様に、 エントリ #2〜#5のフィールド F1のプリフィクス長はそれぞれ、 24ビット 、 20ビット、 17ビット、 12ビットであり、 フィールド F2のプリフイクス長はそ れぞれ、 17ビット、 17ビット、 22ビット、 16ビットである。
また、 点線で示したエントリ #1, #2,及び #5は、 プリフィクス部分の少なくとも 1ビットが対応する検索キーのデータビットに一致しないために、 「不一致」であ ると判定されている。
他方、 実線で示したエントリ 503及び 504は、 プリフィクス部分の全ビット ( 非マスクビット) が対応する検索キーのビットデータに 「一致」 しており、 中間 検索結果になっている。
ここで、 従来の連想メモリの検索方法では、 ェントリ #1〜#5の格納順を優先順 位として検索結果を出力するため、上記の如く抽出されたェントリ #3及ぴ #4の内 、 より上位に格納されたェントリ が検索結果として出力されることになる。 このような従来例とは異なり、 本発明においては、 上記の如く抽出されたェン トリ #3 及び #4 についてプリフィクス長レジスタに保持された各検索対象フィー ルド F1及ぴ F2のプリフィクス長から、 フィールド F1及ぴ F2における最長プリ フィクス長を求める。
すなわち、 同図において、 フィールド F1における最長プリフィクス長は、 ェン トリ #3で求めた 20ビットであり、 フィールド F2の最長プリフィクス長は、 ェン トリ #4で求めた 22 ビットである。 本発明ではさらに、 優先度が最も高い検索対 象フィールドにおいて最長プリフィクス長を有するェントリを最終検索結果とす る。
従って、優先度が最も高い検索対象フィールドがフィールド F2であれば、上記 の如く抽出されたェントリ #3及ぴ #4の内、 より下位に格納されたェントリ #4を 最終検索結果とすることが可能になる。
このように、優先度を適切に設定することにより、従来のようにェントリ #1〜# 5 の格納順に拘束されることなく、 所望の優先度に基づく検索結果が得られるよ うになる。
上記の優先度が最も高い検索対象フィールドは、 該第 3ステップにおいて求め られた該最長プリフィクス長同士の内、 最長の検索対象ブイールドであってもよ い。
すなわち、 上記の優先度の指標として最長プリフィクス長を用いれば、 該優先 度が最も高い検索対象フィールドは、 該第 3ステップにおいて求められた該最長 プリフィクス長同士の内、 最長になった検索対象フィールドである。
図 1の場合に、 フィールド F1の最長プリフィクス長である 20ビッ トよりも、 フィールド F2の最長プリフィクス長である 22ビットの方が長いため、 優先度が 最も高い検索対象フィールドはフィールド F2となり、 このフィールド F2におい て最長プリフィクス長(22ビット) を有するェントリ #4が検索結果として出力さ れる。
このように、 エントリの格納順に拘らず、 より適切な検索結果を得ることが可 能になる。
また、 検索開始前に各フィールドに該優先度を設定してもよい。
すなわち、 上記の優先度を検索開始前に各フィールドに設定する場合、 例えば 図 1におけるフィールド F2の優先度をフィールド F1よりも高く設定しておけば 、優先度が最も高い検索対象フィールドはフィールド F2となり、 このフィールド
F2において最長プリフィクス長 (22 ビッ ト) を有するエントリ #4が検索結果と して出力される。
このように、 エントリの格納順に拘らず、 検索開始前に各フィールドに設定し た優先度に基づいた検索結果を得ることが可能になる。
この場合の優先度は、 検索を行う度に変更可能であればよい。
すなわち、 上記の優先度を固定的に設定するのではなく、 検索を行う度に変更 できるようにすれば、 より柔軟に所望の優先度に基づいた検索結果を得ることが 可能になる。
また、 上記の優先度として所定の値が設定されたフィールドを検索対象外にし てもよレヽ。
すなわち、 フィールドを検索対象外とする所定の値を定めておくことにより、 該優先度として所定の値が設定されたフィールドを検索対象外にすることができ る。 これにより、 最終検索結果を判定するためだけでなく、 フィールドを検索対 象とするか否かの判断材料としても上記の優先度を流用することが出来る。
また、 上記の目的を達成するため、 本発明に係るデータ検索方法を実現する本 発明に係るデータ検索装置は、 エントリを複数フィールドに分割して格納したデ ータベースと、 各ェントリのフィーノレド毎のプリフィクス長を保持するプリフィ タス長保持部と、 全ての検索対象フィールドにおいてェントリの全ての非マスク ビットと対応する検索キーのビットデータとがー致するェントリを中間検索結果 とし、 該プリフィクス長保持部に保持された該中間検索結果の各検索対象フィー ルドのプリフィクス長から検索対象ブイールド毎の最長プリフィクス長を求め、 該中間検索結果の内、 優先度が最も高い検索対象フィールドにおいて該最長プリ フィクス長を有するェントリを検索結果とする演算部と、 を備えたことを特徴と している。
上記の優先度が最も高い検索対象フィールドは、 該演算部によって求められた 該最長プリフィクス長同士の内、 最長の検索対象フィールドであってもよい。 また、 検索開始前に各フィールドに該優先度を設定してもよく、 この場合の優 先度は、 検索を行う度に変更可能であればよい。
さらに、 上記の優先度として所定の値が設定されたフィールドを検索対象外に してもよい。 図面の簡単な説明
図 1は、 本発明に係るデータ検索方法及び装置の原理を示したプロック図であ る。
図 2は、 本発明に係るデータ検索方法及び装置の実施例(1)及び (2)に共通した エントリの状態例を示したプロック図である。
図 3は、本発明に係るデータ検索方法及び装置の実施例(1)を示したプロック図 である。
図 4は、本発明に係るデータ検索方法及び装置の実施例(2)を示したプロック図 である。
図 5は、本発明に係るデータ検索方法及び装置の実施例(2)の変形例を示したブ 口ック図である。
図 6は、 一般的なルーティング処理の概要を説明するためのプロック図である 。
図 7は、 図 6におけるルータ 101内のルーティング処理に関連した部分の構成 例を示したプロック図である。
図 8は、 図 7における CAMデパイス 200の詳細な構成を示したプロック図であ る。 図 9は、 一般的な CAMデバイスに用いられるターナリ CAMセルの構成例及び検 索結果の真理値表を示した図である。
図 1 0は、 一般的な CAMデバイス内部のエントリ構成例及ぴグローバルマスク パターンを示したブロック図である。
符号の説明
# 1〜 5 エントリ
Fl〜 'F5 フィールド
Rl〜 Rn, 931, 932, 優先度レジ
101 ルータ 102〜105 ネッ トワーク回線
110 パケッ ト 111 宛先 IPア ドレス
112 送信元 IPア ドレス 113 宛先ポート番号
114 达 ffe元ポート番号 130, 140, 150 サーバ
200 CAMデバイス 201, 221 出力バス
202 ヒッ トァ ドレス 203 データベース
210 ネッ トワークプロセッサ 211 入力インタフェース
212, 607 検索キー 220 コンテキス ト RAM
222, 605 検索結果 321〜324, 606, 711〜715 —致線
330 プライオリティエンコーダ 431, 432 プリフィタス部分
441, 442, 451 , 53 マスク部分 450 グ口ーノ ノレマスクノ ターン
452 検索対象部分 600 ターナリ CAMセル
601 データビッ ト 602 マスクビッ ト
603 比較処理部 604 マスク処理部
801, 802, 901, 902 レジスタ
図中、 同一符号は同一又は相当部分を示す。 発明を実施するための最良の形態
本発明の実施例として、 フィールド毎の最長プリフィクス長同士を比較する場 合の実施例(1)と、 予めフィールド毎の優先度を設定しておく場合の実施例(2)の 2種類について以下に説明する。 まず、上記の実施例(1)及び(2)に共通したェントリ #1〜#5の状態を図 2に示す 。 同図は、 図 1と同様に、 データベースに格納されたエントリ #1〜#5の各々につ いて、 例えば複数のフィールド F1及び F2を検索対象とする検索キー (図示せず ) が入力された際の一致 Z不一致の状態を模式的に示したものである。
図 2には、 図 1に加え、 一致線 711〜715がそれぞれエントリ #1〜#5に対応し て示されており、ェントリ #1、 #2、及び #5については、それぞれ一致線 711、 712、 及ぴ 715に対して、 下向きの矢印で不一致信号が出力されている (例えば、 ェン トリ #5における不一致信号 716)。
このように、 不一致信号が出力されたエントリ #1、 #2、 及び #5 は、 「不一致」 であるが、 不一致信号が出力されていないエントリ #3及び #4は 「一致」 であると して中間検索結果が得られる。
実施例(1)
図 2の状態において、 エントリ #1〜#5の格納順に拘らず、 検索対象フィールド 毎の最長プリフィクス長同士を比較することによって、 最終検索結果を得る方法 について図 3を用いて説明する。
同図に示す如く、ェントリ #1〜#5の各フィールド F1及ぴ F2のプリフィタス長 を保持するレジスタ 801及び 802を設けておく。 すなわち、 レジスタ 801には、 エント リ ttl〜#5 のフィールド F1 のプリ フィクス長である "24"、 "24"、 "20"、 " 17"、 及び " 12" がそれぞれ保持されている。 同様に、 レジスタ 802には、 ェン トリ #1〜#5 のフィールド F2 のプリフィクス長である "22"、 " 17"、 " 17"、 "22"、 及び "16" がそれぞれ保持されている。
なお、上記のレジスタ 801及び 802に対する各ェントリ #1〜#5のプリフィクス 長の値は検索運用時前に予め設定されておく必要があるが、 ネットワーク管理者 がェントリ作成時にプリフィクス長を入力しておけばよい。 或いは、 マスクビッ トに設定された値を CAMデバイス自身がカウントしてレジスタ 801及ぴ 802に自 動的に入力するようにしてもよレ、。
同図において、 中間検索結果として得られているェントリ #3及び #4について、 点線矢印 811〜814に示す如く、それぞれレジスタ 801及ぴ 802を参照し、 フィー ルド F1については、 エントリ #3のプリフィクス長 "20" 及びエントリ #4のプリ フィクス長 "17" が得られ、 フィールド F2については、 エントリ #3のプリフィ クス長 "17" 及ぴエントリ #4のプリフィクス長 "22" が得られる。
これらのプリフィタス長について、 点線矢印 815及ぴ 816に示す如く各フィー ノレド F1及び F2において最大値 821及ぴ 822を求めると、フィールド F1における 最大値 821は、 エント リ #3のプリフィクス長 " 20" であり、 フィールド F2にお ける最大値 822は、 エントリ #4のプリフィクス長 "22" である。
次に、 点線矢印 817に示す如く各最大値 821及び 822同士を比較し、 最大の値 を求めると、 最大値 822の "22" であることから、 フィールド F2を優先し、 CAM 検索結果としては、 フィールド F2のプリフィクス長が最長となるェントリ #4が 最終検索結果になる。
実施例(2)
図 2の状態において、 エントリ #1〜#5の格納順に拘らず、 予めフィールド毎の 優先度を設定しておくことによって、 最終検索結果を得る方法について図 4を用 いて説明する。
図 4に示したレジスタ 901及び 902は、 図 3に示したレジスタ 801及び 802に 相当するものであり、 実施例(1)の場合と同様に、 エントリ #1〜#5 の各フィール ド F1及び F2のプリフィクス長を保持している。
また、 レジスタ 901及ぴ 902における最大値 921及ぴ 922も、 図 3に示したレ ジスタ 801及ぴ 802における最大値 821及ぴ 822と同様にして求めたものである。 図 4は、 図 3と異なり、 フィールド F1及び F2に対し、 それぞれ優先度レジス タ 931及ぴ 932が設けられている。 なお、 優先度レジスタ 931及び 932に設定す る値は、 検索を行なう度に変更可能にしておく。
図示の例では、最高の優先度を示す "1"がフィールド F1の優先度レジスタ 931 に設定され、 フィールド F2の優先度レジスタ 932には "2" が設定された状態が 示されている。
この場合、 点線矢印 933に示すブイールド間の優先度の比較は、 優先度レジス タ 931及び 932に基づいて行なわれ、 より優先度が高いフィールド F1において、 プリフィクス長が最長となるェントリ #3が最終検索結果になる。
図 5は、実施例(2)の変形例として、優先度レジスタをグローバルマスクパター ンとして使用する場合を示したものである。 例えば、 nく 255として、 各フィール Fl〜Fnに対する優先度レジスタ Rl〜Rnが設けられているものとする。
この場合、 非選択を示す優先度である "255" が優先度レジスタ Rnに設定され たフィールド Fnを検索対象から外すことが可能になる。 なお、 フィールド数が n となっているため非選択を表す値は nより大きくとる必要がある。
以上説明したように、 本発明に係るデータ検索方法及び装置によれば、 データ ベースにおいて複数フィールドに分割して格納されたェントリの中から、 全ての 検索対象フィールドにおいて全ての非マスクビットと、 これらに対応する検索キ 一のビットデータとがー致するェントリを中間検索結果とし、 該中間検索結果の 各検索対象フィールドのプリフィクス長の中から検索対象フィールド毎の最長プ リフィクス長を求め、 該中間検索結果の內、 優先度が最も高い検索対象フィール ドにおいて該最長プリフィクス長を有するェントリを検索結果とするように構成 したので、 エントリの格納順に拘束されることなく、 より適切な検索結果を得る ことが可能になる。

Claims

請 求 の 範 囲
1 . データベースにおいて複数フ,ィールドに分割して格納されたェントリの中か ら、 全ての検索対象フィールドにおいて全ての非マスクビッ トと、 これらに対応 する検索キーのデータビットとが一致するェントリを中間検索結果とする第 1ス テツプと、
該中間検索結果の各検索対象フィールドのプリフィクス長の中から該検索対象 フィールド毎の最長プリフィクス長を求める第 2ステップと、
該中間検索結果の内、 優先度が最も高い検索対象フィールドにおいて該最長プ リフィクス長を有するェントリを検索結果とする第 3ステップと、
を有することを特徴とするデータ検索方法。
2 . 請求の範囲 1において、
該優先度が最も高い検索対象フィールドが、 該第 3ステップにおいて求められ た該最長プリフィクス長同士の内、 最長の検索対象フィールドであることを特徴 とするデータ検索方法。
3 . 請求の範囲 1において、
検索開始前に各フィールドに該優先度を設定することを特徴とするデータ検索 方法。
4 . 請求の範囲 3において、
該優先度は、 検索を行う度に変更可能であることを特徴とするデータ検索方法
5 . 請求の範囲 3において、
該優先度として所定の値が設定されたフィールドを検索対象外にすることを特 徴とするデータ検索方法。
6 . エントリを複数フィールドに分割して格納したデータベースと、
各エントリのフィールド毎のプリフィクス長を保持するプリフィクス長保持部 と、
全ての検索対象フィ一ルドにおいてェントリの全ての非マスクビッ トと対応す る検索キーのビットデータとがー致するェントリを中間検索結果とし、 該プリフ イクス長保持部に保持された該中間検索結果の各検索対象ブイールドのプリフィ クス長から検索対象フィールド毎の最長プリフィクス長を求め、 該中間検索結果 の内、 優先度が最も高い検索対象フィールドにおいて該最長プリフィクス長を有 するェントリを検索結果とする演算部と、
を備えたことを特徴とするデータ検索装置。
7 . 請求の範囲 6において、
該優先度が最も高い検索対象フィールドが、 該演算部によって求められた該最 長プリフィクス長同士の内、 最長の検索対象フィールドであることを特徴とする データ検索装置。
8 · 請求の範囲 6において、
検索開始前に各フィールドに該優先度を設定したことを特徴とするデータ検索 装置。
9 . 請求の範囲 8において、
該優先度は、 検索を行う度に変更可能であることを特徴とするデータ検索装置 。
1 0 . 請求の範囲 8において、
該優先度として所定の値が設定されたフィールドを検索対象外にすることを特 徵とするデータ検索装置。
PCT/JP2003/009740 2003-07-31 2003-07-31 データ検索方法及び装置 WO2005013566A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2005507390A JPWO2005013566A1 (ja) 2003-07-31 2003-07-31 データ検索方法及び装置
PCT/JP2003/009740 WO2005013566A1 (ja) 2003-07-31 2003-07-31 データ検索方法及び装置
US11/266,551 US20060064413A1 (en) 2003-07-31 2005-11-03 Data retrieval method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2003/009740 WO2005013566A1 (ja) 2003-07-31 2003-07-31 データ検索方法及び装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US11/266,551 Continuation US20060064413A1 (en) 2003-07-31 2005-11-03 Data retrieval method and device

Publications (1)

Publication Number Publication Date
WO2005013566A1 true WO2005013566A1 (ja) 2005-02-10

Family

ID=34113473

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2003/009740 WO2005013566A1 (ja) 2003-07-31 2003-07-31 データ検索方法及び装置

Country Status (3)

Country Link
US (1) US20060064413A1 (ja)
JP (1) JPWO2005013566A1 (ja)
WO (1) WO2005013566A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008236306A (ja) * 2007-03-20 2008-10-02 Fujitsu Ltd 中継装置、中継方法および中継プログラム

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB0524126D0 (en) * 2005-11-26 2006-01-04 Cogniscience Ltd Data transmission method
CN117033735B (zh) * 2023-10-08 2024-01-16 之江实验室 基因数据检索方法、装置、计算机设备以及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11261647A (ja) * 1998-03-12 1999-09-24 Nec Corp ルータ及び最長一致検索装置
JPH11284658A (ja) * 1998-03-30 1999-10-15 Kawasaki Steel Corp 最長一致検索装置
JP2000349811A (ja) * 1999-06-09 2000-12-15 Nec Corp 通信制御装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1505819A (zh) * 2001-04-25 2004-06-16 �ʺ�˿Ƽ����޹�˾ 相联存储器及其检索方法、网络设备及网络***
US7013367B2 (en) * 2002-07-18 2006-03-14 Intel Corporation Caching associative memory using non-overlapping data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11261647A (ja) * 1998-03-12 1999-09-24 Nec Corp ルータ及び最長一致検索装置
JPH11284658A (ja) * 1998-03-30 1999-10-15 Kawasaki Steel Corp 最長一致検索装置
JP2000349811A (ja) * 1999-06-09 2000-12-15 Nec Corp 通信制御装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008236306A (ja) * 2007-03-20 2008-10-02 Fujitsu Ltd 中継装置、中継方法および中継プログラム

Also Published As

Publication number Publication date
US20060064413A1 (en) 2006-03-23
JPWO2005013566A1 (ja) 2006-09-28

Similar Documents

Publication Publication Date Title
US7234019B1 (en) Method and apparatus for implementing a search engine using an SRAM
CA2434876C (en) Method and apparatus for ternary content addressable memory (tcam) table management
JP4614946B2 (ja) 限定サイズを有する限定数のサブデータベースに分割された転送データベースを効率的にサーチするシステムと方法
US6665297B1 (en) Network routing table
US6792423B1 (en) Hybrid longest prefix match and fixed match searches
US7219184B2 (en) Method and apparatus for longest prefix matching in processing a forwarding information database
US7555594B2 (en) Range representation in a content addressable memory (CAM) using an improved encoding scheme
JP4742167B2 (ja) Camのキーサイズを超えるテーブルインデックスを用いてテーブルルックアップ動作を実行する方法
US6546391B1 (en) High-speed lookup method and high-speed lookup apparatus
US7707217B2 (en) Trie search engines and ternary CAM used as pre-classifier
US6987683B2 (en) Magnitude comparator based content addressable memory for search and sorting
US7624226B1 (en) Network search engine (NSE) and method for performing interval location using prefix matching
US10623316B2 (en) Scaling of switching tables with high bandwidth
US6570866B1 (en) High-speed flexible longest match retrieval
CN105760411B (zh) 混合通配符匹配表
US9485179B2 (en) Apparatus and method for scalable and flexible table search in a network switch
US20040044868A1 (en) Method and apparatus for high-speed longest prefix match of keys in a memory
Yu et al. Forwarding engine for fast routing lookups and updates
CN112818185A (zh) 一种基于sram的最长前缀匹配硬件***查找的方法
US20080281789A1 (en) Method and apparatus for implementing a search engine using an SRAM
WO2005013566A1 (ja) データ検索方法及び装置
US7114026B1 (en) CAM device having multiple index generators
JP3609358B2 (ja) フロー識別検索装置および方法
JP3558151B2 (ja) データ検索回路
JP2013038536A (ja) 半導体装置

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): JP US

WWE Wipo information: entry into national phase

Ref document number: 2005507390

Country of ref document: JP

WWE Wipo information: entry into national phase

Ref document number: 11266551

Country of ref document: US

WWP Wipo information: published in national office

Ref document number: 11266551

Country of ref document: US