JP2024022699A - Information processing device, information processing method and computer program - Google Patents

Information processing device, information processing method and computer program Download PDF

Info

Publication number
JP2024022699A
JP2024022699A JP2020186097A JP2020186097A JP2024022699A JP 2024022699 A JP2024022699 A JP 2024022699A JP 2020186097 A JP2020186097 A JP 2020186097A JP 2020186097 A JP2020186097 A JP 2020186097A JP 2024022699 A JP2024022699 A JP 2024022699A
Authority
JP
Japan
Prior art keywords
node
bit
search
transition
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2020186097A
Other languages
Japanese (ja)
Inventor
大史 浅井
Hiroshi Asai
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Preferred Networks Inc
Original Assignee
Preferred Networks Inc
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 Preferred Networks Inc filed Critical Preferred Networks Inc
Priority to JP2020186097A priority Critical patent/JP2024022699A/en
Priority to PCT/JP2021/040841 priority patent/WO2022097725A1/en
Publication of JP2024022699A publication Critical patent/JP2024022699A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/22Arrangements for preventing the taking of data from a data transmission channel without authorisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To enable search processing to be performed at a high speed.
SOLUTION: An information processing device according to an embodiment of the present invention comprises a search processing unit for performing, on a data structure having a plurality of nodes that include reference information, in which a k-number (k is an integer of 1 or more) of bits to be referred to in a search key are designated, and include one or more transition conditions which define a node of a transition destination in accordance with a value of bits designated by the reference information, search for a node that matches the search key. The one or more transition conditions in one or more of the nodes allow one or more specific bits in the bits designated by the reference information to represent a first value or a second value. The search processing unit specifies, from among the one or more transition conditions, a transition condition that is satisfied by bits designated by the reference information, and performs search for a node that matches the search key by transitioning to a node defined by the specified transition condition.
SELECTED DRAWING: Figure 1
COPYRIGHT: (C)2024,JPO&INPIT

Description

本開示は、情報処理装置、情報処理方法及びコンピュータプログラムに関する。 The present disclosure relates to an information processing device, an information processing method, and a computer program.

インターネットが必要不可欠なインフラになってきたことにより、ネットワークセキュリティが重要になってきている。ファイヤウォールのようなネットワーク装置が、認証されていないネットワークアクセスから情報を保護するために用いられている。 Network security has become important as the Internet has become an essential infrastructure. Network devices such as firewalls are used to protect information from unauthorized network access.

ファイヤウォール機能としてネットワーク装置にネットワークアクセス制御リスト(ACL:Access Control List)を設け、ACLに基づき、パケットのフィルタリングを行うことが一般的に行われている。ACLは、複数のレイヤの通信プロトコルのヘッダ情報を用いてパケットをフィルタリングするルールを複数集めたルールの集合である。ACLの各ルールはコンピュータ上ではビット列によって表され、ビット列は“0”、“1”以外にワイルドカード“*”を許容する。受信したパケットのヘッダ情報が各ルールにマッチングするか否かは3値マッチング問題(ternary matching problem)として一般化されることができる。 It is common practice to provide a network access control list (ACL) in a network device as a firewall function and filter packets based on the ACL. ACL is a set of rules for filtering packets using header information of communication protocols of multiple layers. Each rule of the ACL is represented by a bit string on a computer, and the bit string allows a wild card "*" in addition to "0" and "1". Whether the header information of the received packet matches each rule can be generalized as a ternary matching problem.

既存のアルゴリズムは、ACLのルールをワイルドカードの前後で分割し、分割された複数の部分を用いて決定木を生成する。決定木を用いて、ヘッダ情報が各ルールにマッチングするか否か(ルールを満たすか否か)を判定する。しかしながら、このアルゴリズムは、市販のCPUでは高い性能を得ることができず、決定木の生成にも時間が要する問題があった。3値のマッチングを行う専用のデバイスとしてTCAM(Ternary Content Addressable Memory)が知られているが、消費電力、コスト、及び拡張性等に問題がある。市販のCPUで高い性能を得ることが可能なアルゴリズムの開発が要求されている。 Existing algorithms divide an ACL rule before and after a wild card, and generate a decision tree using the divided parts. A decision tree is used to determine whether the header information matches each rule (whether or not the rule is satisfied). However, this algorithm has the problem that high performance cannot be obtained using commercially available CPUs, and it takes time to generate a decision tree. TCAM (Ternary Content Addressable Memory) is known as a dedicated device for performing ternary matching, but it has problems in power consumption, cost, expandability, etc. There is a need to develop algorithms that can achieve high performance with commercially available CPUs.

特開2016-170818号公報Japanese Patent Application Publication No. 2016-170818

本開示は、検索処理を高速に行うことが可能な情報処理装置、情報処理方法及びコンピュータプログラムを提供する。 The present disclosure provides an information processing device, an information processing method, and a computer program that can perform search processing at high speed.

本実施形態に係る情報処理装置は、検索キーにおいて参照するk(kは1以上の整数)個のビットを指定した参照情報と、前記参照情報により指定されるビットの値に応じて遷移先のノードを定めた少なくとも1つの遷移条件と、を含む複数のノードを有するデータ構造に対して、前記検索キーに合致するノードの検索を行う検索処理部を備える。少なくとも1つのノードにおける前記遷移条件の少なくとも1つは、前記参照情報により指定されるビットの少なくとも1つの特定のビットが第1値及び第2値のいずれであることを許容する。前記検索処理部は、前記少なくとも1つの遷移条件のうち前記参照情報により指定されるビットが満たしている遷移条件を特定し、特定した前記遷移条件が定めるノードに遷移することにより、前記検索キーに合致するノードの検索を行う。 The information processing device according to the present embodiment includes reference information that specifies k bits (k is an integer of 1 or more) to be referenced in a search key, and a transition destination based on the value of the bit specified by the reference information. The method includes a search processing unit that searches for a node matching the search key in a data structure having a plurality of nodes including at least one transition condition defining a node. At least one of the transition conditions in at least one node allows at least one particular bit of the bits specified by the reference information to be either a first value or a second value. The search processing unit specifies a transition condition that is satisfied by the bit specified by the reference information among the at least one transition condition, and transitions to a node specified by the specified transition condition, thereby determining the search key. Search for matching nodes.

本実施形態に係る情報処理装置である通信装置の一例のブロック図。FIG. 1 is a block diagram of an example of a communication device that is an information processing device according to the present embodiment. 3値マッチングテーブルの一例を示す図。The figure which shows an example of a ternary matching table. ACLの一例を示す図。The figure which shows an example of ACL. 比較例として、基数木の一例を示す図。The figure which shows an example of a radix tree as a comparative example. 比較例として、パトリシアトライの一例を示す図。The figure which shows an example of Patricia try as a comparative example. 本実施形態に係るパームトライの一例を示す図。FIG. 3 is a diagram showing an example of a palm try according to the present embodiment. パームトライにおけるノードの構造の一例を示す図。The figure which shows an example of the structure of the node in a palm trie. パームトライの探索動作の一例を示すフローチャート。The flowchart which shows an example of the search operation of a palm try. kビット幅のパームトライの一部を模式的に示す図。FIG. 3 is a diagram schematically showing a part of a k-bit wide palm trie. 比較例として、3分木の例を示す図。The figure which shows the example of a ternary tree as a comparative example. 図10の3分木に図9のパームトライを重ねた図。A diagram in which the palm tries of FIG. 9 are superimposed on the tertiary tree of FIG. 10. パームトライにおいて子ノードへのポインタを取得するデータ構造の例を示す図。The figure which shows the example of the data structure which acquires the pointer to a child node in a palm try. チャンクと、チャンクのプレフィクスと、パラメータh、gとの関係を示した表を示す図。The figure which shows the table which showed the relationship between a chunk, the prefix of a chunk, and parameters h and g. 3ビット幅のパームトライにおけるノードの構造の一例を示す図。The figure which shows an example of the structure of the node in a palm trie of 3 bit width. 第2実施形態に係るパームトライの探索動作の一例を示すフローチャート。7 is a flowchart illustrating an example of a palm try search operation according to the second embodiment. 第2実施形態に係るパームトライの具体例を示す図。The figure which shows the specific example of the palm try based on 2nd Embodiment. 図16のパームトライにおける部分木T1の例を示す図。17 is a diagram showing an example of a subtree T1 in the palm try of FIG. 16. FIG. 図16のパームトライにおける部分木T2の例を示す図。17 is a diagram showing an example of a subtree T2 in the palm try of FIG. 16. FIG. 図16のパームトライにおける部分木T3の例を示す図。17 is a diagram showing an example of a subtree T3 in the palm try of FIG. 16. FIG. 図16のパームトライにおける部分木T4と、部分木T4につながる部分木T5の例を示す図。17 is a diagram showing an example of a subtree T4 in the palm try of FIG. 16 and a subtree T5 connected to the subtree T4. FIG. 図16のパームトライにおける部分木T6の例を示す図。17 is a diagram showing an example of a subtree T6 in the palm try of FIG. 16. FIG. 図16のパームトライにおける部分木T7の例を示す図。17 is a diagram showing an example of a subtree T7 in the palm try of FIG. 16. FIG. 図16のパームトライにおける部分木T8の例を示す図。FIG. 17 is a diagram showing an example of a subtree T8 in the palm try of FIG. 16; ヌルノードを示すポインタを斜線で示した図。A diagram showing a pointer indicating a null node with diagonal lines. 図24のノード構造を圧縮した、変形例1に係るノード構造を示す図。25 is a diagram showing a node structure according to modification example 1, which is a compressed version of the node structure in FIG. 24. FIG. 変形例2に係るノードの構造の例を示す図。7 is a diagram illustrating an example of a node structure according to modification example 2. FIG. 情報処理装置のハードウェア構成の一例を示すブロック図。FIG. 1 is a block diagram showing an example of a hardware configuration of an information processing device.

以下、図面を参照して、本開示の実施形態について説明する。図面は、本開示の実施形態を一例として模式的に示すものであり、本開示の実施形態は、図面に開示された形態に限定されるものではない。複数の図において同一の要素には同一の符号を付し、説明済みの要素の説明は適宜省略する。 Embodiments of the present disclosure will be described below with reference to the drawings. The drawings schematically illustrate embodiments of the present disclosure as an example, and the embodiments of the present disclosure are not limited to the forms disclosed in the drawings. In the plurality of figures, the same elements are given the same reference numerals, and explanations of already explained elements are omitted as appropriate.

(第1実施形態)
本実施形態では、ファイヤウォールやルータ等の通信装置において、受信したパケットのヘッダ情報から検索キーを生成し、生成した検索キーを用いてネットワークアクセス制御リスト(ACL:Access Control List)から、マッチするルールを検索する。ACLは、複数のレイヤの通信プロトコルのヘッダ情報を用いてパケットを処理(フィルタリング等)するルールを複数集めたルールの集合である。検索キーとは検索のキーとなるデータである。ACLの各ルールは、検索の対象となるデータであるキーデータ(検索対象データ)と、パケットに対して行う処理(アクション)を表したバリュー等を含む。通信装置では、検索キーを満たすキーデータを有するルールを探索する。通信装置は、検索されたルールに示されるバリューが示す処理を実行する。本実施形態は、検索キーにマッチするルールを効率的又は高速に検索する技術に関連する。但し、本実施形態の適用対象はルールの検索に限定されず、情報の検索一般に可能である。例えば、住所録から検索キーにマッチする住所を含むレコードを検索することも可能である。
(First embodiment)
In this embodiment, a search key is generated from the header information of a received packet in a communication device such as a firewall or router, and a match is made from a network access control list (ACL) using the generated search key. Search for rules. ACL is a set of rules for processing packets (filtering, etc.) using header information of communication protocols of multiple layers. A search key is data that is a key for a search. Each rule of the ACL includes key data (search target data), which is data to be searched, and a value representing a process (action) to be performed on a packet. The communication device searches for a rule having key data that satisfies the search key. The communication device executes the process indicated by the value indicated in the searched rule. The present embodiment relates to a technique for efficiently or quickly searching for rules that match a search key. However, the application of this embodiment is not limited to rule searches, but can be applied to information searches in general. For example, it is also possible to search an address book for records that include an address that matches a search key.

図1は、本実施形態に係る情報処理装置である通信装置の一例のブロック図である。図1の通信装置1は、無線又は有線のネットワークを介して受信したパケットの中継を行うファイヤウォールやルータ等のネットワーク装置である。図1の通信装置1は、受信部11、パケット処理部12、記憶部13、検索キー生成部14、検索処理部15及び送信部16を備えている。 FIG. 1 is a block diagram of an example of a communication device that is an information processing device according to this embodiment. The communication device 1 in FIG. 1 is a network device such as a firewall or router that relays packets received via a wireless or wired network. The communication device 1 in FIG. 1 includes a receiving section 11, a packet processing section 12, a storage section 13, a search key generation section 14, a search processing section 15, and a transmission section 16.

受信部11は、無線又は有線のネットワークを介してパケットを受信する。パケットは情報の伝送単位の一例を示すものであり、フレーム、セグメント又はデータグラムなどに読み替えることも可能である。 The receiving unit 11 receives packets via a wireless or wired network. A packet is an example of a unit of information transmission, and can also be read as a frame, segment, datagram, or the like.

パケット処理部12は、受信したパケットに対して行う処理を決定し、決定した処理をパケットに対して行う。例えばパケットを中継すべきか(通過させるべきか)、遮断すべきかを判断する。但し、パケットに行う処理の例は中継の許可、又は遮断に限定されず、例えば、パケットの転送先の決定、 別のプロトコルでカプセル化をして転送すること、ルールに一致したパケットの統計情報(パケット数やバイト数など)の取得、転送時のパケットスケジューリングの優先度の決定、転送時のパケットのキューの決定がある。その他、パケットを一定期間保存すること、パケットに含まれるデータからファイルを生成し、ファイルが安全か否かを検証することなど、様々可能である。パケット処理部12は、パケットに対して行う処理の種類に応じて複数のエンジンを備えていてもよい。パケット処理部12は、パケットの処理を決定するために、検索キー生成部14及び検索処理部15を用いる。 The packet processing unit 12 determines the processing to be performed on the received packet, and performs the determined processing on the packet. For example, it determines whether a packet should be relayed (passed) or blocked. However, examples of processing performed on packets are not limited to allowing or blocking relaying; for example, determining the forwarding destination of the packet, encapsulating it in another protocol and forwarding it, and statistical information on packets that match the rules. (number of packets, number of bytes, etc.), determining the priority of packet scheduling during transfer, and determining the queue of packets during transfer. Other possibilities include storing packets for a certain period of time, generating files from data contained in packets, and verifying whether the files are safe. The packet processing unit 12 may include a plurality of engines depending on the type of processing to be performed on the packet. The packet processing unit 12 uses the search key generation unit 14 and the search processing unit 15 to determine processing of the packet.

検索キー生成部14は、受信されたパケットのヘッダの情報から検索キーを生成する。検索処理部15は、検索キーに基づきACLからマッチするルールを検索し、検索されたルールに示されるアクション(処理)を示す情報をパケット処理部12に提供する。 The search key generation unit 14 generates a search key from information in the header of the received packet. The search processing unit 15 searches the ACL for a matching rule based on the search key, and provides the packet processing unit 12 with information indicating the action (processing) indicated by the searched rule.

パケット処理部12は検索処理部15から提供された情報に基づきパケットを処理する。例えば、当該情報が中継を許可するものである場合は、パケットの転送先を決定し、決定した転送先に送信するパケットを生成して、送信部16に提供する。当該情報がパケットの中継を認めない(遮断)するものである場合は、パケットを廃棄する。パケットの送信元にパケットの中継を認めないことを示す応答パケットを生成し、応答パケットを送信部16に提供してもよい。 The packet processing unit 12 processes the packet based on the information provided from the search processing unit 15. For example, if the information permits relaying, the transfer destination of the packet is determined, a packet to be transmitted to the determined transfer destination is generated, and the packet is provided to the transmitter 16. If the information disallows (blocks) relaying of the packet, the packet is discarded. A response packet indicating that the packet transmission source is not permitted to relay the packet may be generated and the response packet may be provided to the transmitter 16.

送信部16はパケット処理部12から提供されたパケットを、無線又は有線のネットワークに送信する。受信部11及び送信部16は1つ以上のインタフェース(ポート)を備えていてもよい。受信部11及び送信部16でインタフェースが共通でもよいし、別々のインタフェースでもよい。ACLのルールマッチング及びマッチするルールに応じたパケット処理は、インタフェースごとに別々のACLを用いて行ってもよいし、複数又は全てのインタフェースで共通のACLを用いて行ってもよい。またACLのルールマッチングは、受信インタフェースで受信されたパケットに対してルーティング処理を行う前に行ってもよいし、ルーティング処理で送信インタフェースが決定された後に、行ってもよいし、これらの両方で行ってもよい。ルーティング処理前に行う場合、受信インタフェースで受信したパケットに対してACLのルールマッチングを行い、パケットに対する処理を決定する。通過許可であればパケットをパケット処理部12のルーティングエンジンに提供し、それ以外の場合はマッチするルールに応じた処理エンジンに渡す。ルーティング処理により送信インタフェースが決定された後に、ACLのルールマッチングを行う場合は、例えば送信インタフェースに関連するACLのルールマッチングを、送信するパケットに行い、通過許可であれば送信インタフェースにパケットを渡し、それ以外の場合は、マッチするルールに応じた処理エンジンに渡す。 The transmitter 16 transmits the packet provided from the packet processor 12 to a wireless or wired network. The receiving section 11 and the transmitting section 16 may include one or more interfaces (ports). The receiving section 11 and the transmitting section 16 may have a common interface, or may have separate interfaces. ACL rule matching and packet processing according to matching rules may be performed using separate ACLs for each interface, or may be performed using a common ACL for multiple or all interfaces. In addition, ACL rule matching may be performed before routing processing is performed on packets received on the receiving interface, after the sending interface is determined in the routing processing, or in both cases. You may go. If performed before routing processing, ACL rule matching is performed on the packet received at the receiving interface, and processing for the packet is determined. If the packet is permitted to pass, the packet is provided to the routing engine of the packet processing unit 12; otherwise, it is passed to the processing engine according to the matching rule. When performing ACL rule matching after the sending interface is determined by routing processing, for example, ACL rule matching related to the sending interface is performed on the packet to be sent, and if passage is allowed, the packet is passed to the sending interface, Otherwise, it is passed to the processing engine according to the matching rule.

通信装置1が無線通信を行う場合は、送信部16及び受信部11にアンテナが設けられてもよい。送信部16及び受信部11は物理的に同一のインタフェースでも別々のインタフェースでもよい。 When the communication device 1 performs wireless communication, the transmitter 16 and the receiver 11 may be provided with an antenna. The transmitter 16 and the receiver 11 may be physically the same interface or may be separate interfaces.

記憶部13には、ACL、ACLの効率的に検索するためのデータ構造とである検索木(後述のパームトライ)、パケットの転送先を決定するルーティングテーブルなどが格納されている。通信装置1の受信部11、送信部16、パケット処理部12、検索キー生成部14、検索処理部15の動作の一部又は全部は、一例としてコンピュータプログラムをCPU等のプロセッサに実行させることにより実現される。この場合、コンピュータプログラムも記憶部13に格納されていてよい。記憶部13はメモリ、ハードディスク、光記憶装置など、任意の記録媒体である。 The storage unit 13 stores ACLs, a data structure for efficiently searching ACLs, a search tree (palm try described below), a routing table for determining a packet transfer destination, and the like. Part or all of the operations of the receiving unit 11, transmitting unit 16, packet processing unit 12, search key generation unit 14, and search processing unit 15 of the communication device 1 can be performed by, for example, causing a processor such as a CPU to execute a computer program. Realized. In this case, the computer program may also be stored in the storage unit 13. The storage unit 13 is any recording medium such as a memory, a hard disk, or an optical storage device.

上述のように本実施形態は、ACLにおいて検索キーにマッチするルールを効率的又は高速に検索する技術に関連する。ACLの各ルールはコンピュータ上ではビット列によって表され、ビット列は“0”、“1”以外にワイルドカード“*”を許容する。“*”は“0”でも“1”でもよいことを意味する。“*”に対応するビットを、ドントケアビットと呼ぶ。“*”を考慮する場合、受信したパケットのヘッダ情報が各ルールにマッチングするか否かは3値マッチング問題(ternary matching problem)として一般化されることができる。そこで、以下では、まず3値マッチング問題と、3値マッチング問題の適用対象であるACLの概要について説明する。 As described above, this embodiment relates to a technique for efficiently or quickly searching for a rule that matches a search key in an ACL. Each rule of the ACL is represented by a bit string on a computer, and the bit string allows a wild card "*" in addition to "0" and "1". “*” means that it may be “0” or “1”. The bit corresponding to "*" is called a don't care bit. When considering "*", whether or not the header information of the received packet matches each rule can be generalized as a ternary matching problem. Therefore, below, first, an overview of the ternary matching problem and ACL to which the ternary matching problem is applied will be explained.

3値マッチング問題は、各々優先度を有する複数のエントリを格納したテーブル(3値マッチングテーブル)において、検索キーにマッチする、最も優先度の高いエントリを検索することである。 The ternary matching problem is to search for an entry with the highest priority that matches a search key in a table (ternary matching table) storing a plurality of entries each having a priority.

図2は、3値マッチングテーブルの一例を示す。3値マッチングテーブルの各エントリは、エントリIDと、キーデータと、アクションを示すバリューと、優先度とを含む。 FIG. 2 shows an example of a ternary matching table. Each entry in the ternary matching table includes an entry ID, key data, a value indicating an action, and a priority.

エントリIDは、各エントリを識別するIDである。図の例では、1~9の9個のエントリが示されるが、エントリ数は0以上であれば、任意の個数でよい。 The entry ID is an ID that identifies each entry. In the illustrated example, nine entries numbered 1 to 9 are shown, but the number of entries may be any number as long as it is 0 or more.

各エントリの優先度としてP1~P9が示される。優先度はPX(Xは整数)によって表される。Xの値が大きいほど、優先度が高い。図2の例では、優先度P9が最も高い優先度であり、優先度P1が最も低い優先度である。 P1 to P9 are shown as the priority of each entry. The priority is represented by PX (X is an integer). The larger the value of X, the higher the priority. In the example of FIG. 2, priority P9 is the highest priority, and priority P1 is the lowest priority.

キーデータはビット列によって表される。ビット列は、3種類のビット値、“0”、“1”、“*”を含む。“*”はドントケアビット値であり、“0”でも“1”でもよい。例えば、キーデータ011*1000は、検索キー01101000と01111000のいずれにもマッチする。キーデータのビット長は8であるが、8より短くても、8より長くてもよい。“0”は一例として第1値及び第2値のいずれか一方に対応し、“1”はいずれか他方に対応する。 Key data is represented by a bit string. The bit string includes three types of bit values: "0", "1", and "*". “*” is a don't care bit value, and may be “0” or “1”. For example, key data 011*1000 matches both search keys 01101000 and 01111000. The key data has a bit length of 8, but may be shorter or longer than 8. For example, "0" corresponds to either the first value or the second value, and "1" corresponds to the other.

検索キーは“0”又は“1”を含む2値のビット列であり、ドントケアビット値である“*”を含まない。検索キーは、図2の複数のエントリにマッチしてもよく、この場合、最も優先度の高いエントリを検索結果として取得する。 The search key is a binary bit string containing "0" or "1" and does not contain "*" which is a don't care bit value. The search key may match multiple entries in FIG. 2, and in this case, the entry with the highest priority is obtained as the search result.

バリューは、当該バリューを含むエントリが検索結果として返された場合に行う処理(アクション)を識別する値である。例えば“A9”はパケットを通過させない(パケットを遮断する)、“A1”はパケットを中継する(パケットを通過させる)などである。バリューはA1~A9の9種類の値が示されるが、バリューの値は2種類以上であればよい。 The value is a value that identifies a process (action) to be performed when an entry including the value is returned as a search result. For example, "A9" does not allow packets to pass (blocks packets), "A1" relays packets (passes packets), and so on. Nine types of values, A1 to A9, are shown, but it is sufficient if there are two or more types of values.

以下、図2のテーブルを用いた検索の具体例を示す。検索キーが01110101である場合、キーデータが0*1101**と01110***の2つのエントリにマッチする。これら2つのエントリの優先度を比較し、最も大きい優先度のエントリを選択する。0*1101**のエントリの優先度はP7であり、01110***のエントリの優先度はP2である。よって、この場合、優先度の高い0*1101**のエントリを検索結果として取得する。このエントリに含まれるバリューの値A7に応じたアクションが実行される。 A specific example of a search using the table of FIG. 2 will be shown below. When the search key is 01110101, the key data matches two entries: 0*1101** and 01110***. The priorities of these two entries are compared and the entry with the highest priority is selected. The priority of the entry 0*1101** is P7, and the priority of the entry 01110*** is P2. Therefore, in this case, the entry 0*1101**, which has a high priority, is obtained as the search result. An action according to the value A7 included in this entry is executed.

3値マッチングをACLに適用する場合、各エントリがACLの各ルール(エントリ)に対応する。ACLの各エントリは、一例として通信プロトコルのレイヤ2~4のヘッダ情報によって定められる。ヘッダ情報の例として、宛先MACアドレス、送信元MACアドレス、イーサタイプ(EtherType)、IEEE802.1Q(VLAN:Virtual Local Area Network)タグ情報、送信元IPアドレス、宛先IPアドレス、プロトコル番号、送信元TCP/UDPポート番号、宛先TCP/UDPポート番号、TCPフラグ(TCP flags)などがある。これら複数の項目から選択した1つ以上の項目の値が、3値ビット列、すなわち0と1と*とのビット列によって、エントリのキーデータとして表現される。なお、IPアドレスは、通常、プレフィクス表記によってサブネットとして特定される。192.0.2.0/24であれば、192.0.2.0を表す32ビットのうちの先頭の24ビットを表す。TCPフラグは、0と1と*との3値のビット列によって表される。 When applying ternary matching to ACL, each entry corresponds to each rule (entry) of ACL. Each entry of the ACL is defined, for example, by header information of layers 2 to 4 of the communication protocol. Examples of header information include destination MAC address, source MAC address, EtherType, IEEE802.1Q (VLAN: Virtual Local Area Network) tag information, source IP address, destination IP address, protocol number, source TCP /UDP port number, destination TCP/UDP port number, TCP flags, etc. The value of one or more items selected from these plurality of items is expressed as key data of an entry by a ternary bit string, that is, a bit string of 0, 1, and *. Note that an IP address is usually specified as a subnet by a prefix notation. 192.0.2.0/24 represents the first 24 bits of the 32 bits representing 192.0.2.0. The TCP flag is represented by a ternary bit string of 0, 1, and *.

図3は、ACLの一例を示す。5個のエントリ(ルール)が示される。各エントリのエントリIDの表記は省略している。各エントリは優先度によって並べられており、一番上のエントリの優先度が最も高く、下に行くに従って小さくなる。パケットの通過(permit)/遮断(deny)の2つがバリューとして含まれる。バリューの右側にキーデータが示されている。図2の例では、簡単のため、レイヤ2のルールは省略し、レイヤ3と4のルールのみを示している。各エントリは、複数の項目を含んでいる。複数の項目は、アクション、プロトコル名(IPもしくはIPより上位の任意のプロトコル)、送信元IPアドレスのプレフィクス、送信元ポート番号(オプション)、レイヤ4に対して範囲を表す用語(例えば等しいを意味する“eq”)に続く送信元ポート番号範囲(オプション)、宛先IPアドレスのプレフィクス、範囲を表す用語に続く宛先ポート番号範囲(オプション)、TCPフラグが示す状態の用語、のうちの2つ以上を含んでいる。より詳細には、以下の通りである。 FIG. 3 shows an example of an ACL. Five entries (rules) are shown. The entry ID of each entry is omitted. Each entry is ordered by priority, with the top entry having the highest priority and decreasing as you go down. Two values are included: packet passage (permit)/blocking (deny). Key data is shown to the right of the value. In the example of FIG. 2, for simplicity, the rules for layer 2 are omitted, and only the rules for layers 3 and 4 are shown. Each entry contains multiple items. The multiple items can include an action, a protocol name (IP or any protocol above IP), a prefix for the source IP address, a source port number (optional), and a range term for Layer 4 (e.g., equal to two of the following: a source port number range (optional) followed by "eq", a destination IP address prefix, a destination port number range (optional) followed by a term representing the range, and a term for the state indicated by the TCP flag. Contains one or more. More details are as follows.

一番上のエントリは、プロトコル名がIPであり、送信元が192.0.2.0/24の内部ネットワークであり、宛先が0.0.0.0/0のネットワークである場合、全てのパケットの通過を許可する(permit)。0.0.0.0/0は、0.0.0.0の32ビットはすべてワイルドカード“*”であること(宛先IPアドレスは何でもよいこと)を意味する。 The top entry is all if the protocol name is IP, the source is the internal network at 192.0.2.0/24, and the destination is the network at 0.0.0.0/0. The packets are permitted to pass through. 0.0.0.0/0 means that all 32 bits of 0.0.0.0 are wild cards "*" (the destination IP address can be any).

上から2番上のエントリは、プロトコル名がICMPであり、送信元が0.0.0.0/0のネットワークであり、宛先が192.0.2.0/24の内部ネットワークである場合、全てのパケットの通過を許可する(permit)。0.0.0.0/0は、0.0.0.0の32ビットはすべてワイルドカード“*”であること(送信元IPアドレスは何でもよいこと)を意味する。 In the second entry from the top, the protocol name is ICMP, the source is the 0.0.0.0/0 network, and the destination is the internal network 192.0.2.0/24. , permit all packets to pass. 0.0.0.0/0 means that all 32 bits of 0.0.0.0 are wild cards "*" (the source IP address can be any).

上から3番目のエントリは、プロトコル名がUDPであり、ポート番号が53であるDNS応答のパケットの場合、送信元のIPアドレスに拘わらず、192.0.2.0/24の内部ネットワーク宛のパケットの通過を許可する。送信元のIPアドレスが0.0.0.0/0であることは、送信元のIPアドレスが何でも良いことを意味する。 The third entry from the top indicates that if the protocol name is UDP and the DNS response packet is port number 53, it will be addressed to the internal network 192.0.2.0/24 regardless of the source IP address. packets are allowed to pass. The fact that the source IP address is 0.0.0.0/0 means that any source IP address is acceptable.

上から4番目のエントリは、プロトコル名がTCPであり、TCPフラグが“established”を示していれば、送信元のIPアドレスに拘わらず、192.0.2.0/24の内部ネットワーク宛のパケットの通過を許可する。TCPフラグが“established”を示すことは、ACKフラグ又はRSTフラグが1になっていることを意味する。当該4番目のエントリは2つの3値マッチングエントリに変換可能であり、一方が****1****(ACK)を含み、他方が*****1***(RST)を含む。図2の例では示していないが、エントリに複数のポート番号を含む範囲が示されている場合もあり得る。この場合、当該エントリを、同様にして、複数のエントリに変換可能である。 The fourth entry from the top indicates that if the protocol name is TCP and the TCP flag indicates "established", the message is sent to the internal network 192.0.2.0/24, regardless of the source IP address. Allow packets to pass. The TCP flag indicating "established" means that the ACK flag or RST flag is set to 1. That fourth entry can be converted into two ternary matching entries, one containing ***1**** (ACK) and the other containing ***1**** (RST). include. Although not shown in the example of FIG. 2, an entry may indicate a range including multiple port numbers. In this case, the entry can be converted into multiple entries in the same way.

一番下のエントリは、プロトコル名がIPであり、192.0.2.0/24の内部ネットワーク宛のパケットであれば、送信元のIPアドレスに拘わらず、パケットの通過を拒否(deny)する。 The bottom entry indicates that the protocol name is IP, and if the packet is destined for the internal network 192.0.2.0/24, the packet will be denied passage regardless of the source IP address. do.

検索キーがACLの各エントリに一致するかどうかは、単純な方法としてACLの最上位のエントリから検索することが考えられる。この場合、nのオーダーの計算量が発生する。したがって、ACLサイズが大きい場合、この方法は効率的でない。 A simple way to determine whether a search key matches each entry in the ACL is to search from the topmost entry in the ACL. In this case, a computation amount on the order of n occurs. Therefore, this method is not efficient when the ACL size is large.

検索キーに対応するエントリを検索する他の方法として、検索木が知られている。検索木の基本的なデータ構造として、ラディックス木(基数木)、パトリシアトライが知られている。これらの検索木は一般にトライ(trie)と呼ばれている。トライにおいて、あるノードの下位ノードは、当該あるノードと共通のプレフィクスを有する。それ故、トライは、プレフィクス木とも呼ばれる。 A search tree is known as another method of searching for an entry corresponding to a search key. Radix trees and Patricia tries are known as basic data structures of search trees. These search trees are generally called tries. In a trie, the subordinate nodes of a node have a common prefix with that node. Therefore, a trie is also called a prefix tree.

本実施形態では、後述するパームトライ(Palmtrie)と名付けた検索木を導入する。パームトライの理解を容易にするため、基数木とパトリシアトライについて説明する。 In this embodiment, a search tree named Palmtrie, which will be described later, is introduced. To make it easier to understand palm tries, we will explain radix trees and patrician tries.

図4は、基数木の一例を示す。キーデータとして100,001,010が3つのノードに含まれている。基数木は2値木である。基数木の各枝(ブランチ)は親ノードのプレフィクスに1ビットを追加する。ノードの左側の枝には0、右側の枝には1が割り当てられている。深さdのノードのプレフィクスは、先頭(上位ビット側)からd番目のビットの値である。本実施形態では根ノード(ルートノード)の深さを0とする。 FIG. 4 shows an example of a radix tree. Three nodes contain 100,001,010 as key data. A radix tree is a binary tree. Each branch of the radix tree adds one bit to the prefix of its parent node. The left branch of the node is assigned 0, and the right branch is assigned 1. The prefix of a node with depth d is the value of the dth bit from the beginning (upper bit side). In this embodiment, the depth of the root node is set to 0.

基数木の探索は、各ノードで、検索キーの最上位ビットからd番目のビット値を調べることによって検索木を辿ることによって行われる。丸のノードに含まれている値は、ノードのID(エントリID)を表す。エントリが対応づいていないノードには番号(ノードID)が示されていない。エントリ2のキーデータ001はID=2のノードに対応し、エントリ3のキーデータ010はID=3のノードに対応し、エントリ1のキーデータ100はID=1のノードに対応する。葉ノード(リーフノード)である四角のノードは、ヌルノード(空ノード)を表す。ヌルノードは処理の便宜のために設けられたノードである。例えば検索キーが4ビット以上の場合、ヌルノードに分類される。ヌルノードを設けない構成も可能である。 Searching the radix tree is performed by traversing the search tree by examining, at each node, the dth bit value from the most significant bit of the search key. The value included in the circled node represents the node ID (entry ID). No number (node ID) is shown for a node with which no entry is associated. Key data 001 of entry 2 corresponds to the node with ID=2, key data 010 of entry 3 corresponds to the node with ID=3, and key data 100 of entry 1 corresponds to the node with ID=1. A square node that is a leaf node represents a null node (empty node). A null node is a node provided for processing convenience. For example, if the search key is 4 bits or more, it is classified as a null node. A configuration without providing a null node is also possible.

図5は、パトリシアトライの一例を示す。図4の基数木の例と同様に、キーデータとして100,001,010が3つのノードに含まれている。パトリシアトライは基数木を圧縮した木であり、キーデータ数(エントリ数)と、ノード(葉ノードを除く)の個数とが一致する。非葉ノード(根ノードと中間ノード)には、バリュー(アクション)と、2つの下位ノードへのポインタとが入っている。葉ノードにバリューは入っていないが、一部の葉ノードにはポインタが入っている(破線の矢印を参照)。ポインタが入っていない葉ノードはヌルノードに相当する。丸のノードに含まれている値は、ノードのID(エントリID)を表す。 FIG. 5 shows an example of a Patricia try. Similar to the example of the radix tree in FIG. 4, 100,001,010 is included as key data in three nodes. A Patricia trie is a tree obtained by compressing a radix tree, and the number of key data (number of entries) matches the number of nodes (excluding leaf nodes). The non-leaf nodes (root node and intermediate nodes) contain a value (action) and a pointer to two lower nodes. Leaf nodes do not contain values, but some leaf nodes contain pointers (see the dashed arrows). A leaf node that does not contain a pointer corresponds to a null node. The value included in the circled node represents the node ID (entry ID).

パトリシアトライでは、キーデータを含むノードにビットインデクス(図の“Bit”)が設けられている。ビットインデクスは、検索キーからビットを抽出して、分岐方向(左又は右)を決定するために用いられる参照情報である。ノードのキーデータにおいて最上位ビットからビットインデクスが示すビットまでのビット列は、該当するノードのプレフィクスを表す。キーデータのビット長をL、ノードのビットインデクスをbとすると、最上位ビットから(L-b)ビットは、当該ノードのプレフィクスである。例えばノードID=3のプレフィクスは01である。 In Patricia Try, a bit index ("Bit" in the figure) is provided for a node containing key data. The bit index is reference information used to extract bits from the search key and determine the branch direction (left or right). The bit string from the most significant bit to the bit indicated by the bit index in the key data of a node represents the prefix of the corresponding node. When the bit length of the key data is L and the bit index of the node is b, the (L−b) bits from the most significant bit are the prefix of the node. For example, the prefix for node ID=3 is 01.

パトリシアトライの探索は再帰的に定義される。ノードのビットインデクスに対応する、検索キーにおけるビットを調べ、0の場合は左の枝、1の場合は右側の枝に分岐することによって探索を行う。分岐により進んだノードのビットインデクスが、分岐前のノードのビットインデクス(現在のビットインデクス)以上であれば、探索を終了する。このときのノード(分岐により進んだノード)のキーデータと、検索キーとを比較し、両者が一致する(マッチする)場合は、当該ノードの情報(例えばキーデータとバリュー)を取得する。なお、キーデータと検索キーとの比較を省略してもよい。 The search for Patricia tries is defined recursively. The search is performed by checking the bit in the search key that corresponds to the bit index of the node, and branching to the left branch if it is 0 and to the right branch if it is 1. If the bit index of the node advanced by branching is greater than or equal to the bit index (current bit index) of the node before branching, the search ends. The key data of the current node (the node advanced by branching) and the search key are compared, and if they match, information (for example, key data and value) of the node is acquired. Note that the comparison between the key data and the search key may be omitted.

例えば検索キーが001であるとする。根ノードのビットインデクスは2である。末尾ビットの位置を0番目とすると、ビットインデクス2の位置のビットは先頭の0である。このため根ノードから左側の枝に分岐する。分岐後のノードにおけるビットインデクスは1であり、ビットインデクス1の位置のビットは0である。よって、左側の枝に分岐し、根ノードに戻る。根ノードのビットインデクス2は、1つ前のノードのビットインデクス1よりも大きい。よって探索を終了し、根ノードの情報を取得する。ノードの情報は、例えばキーデータ(この例では001)、バリュー(この例では2)を含む。 For example, assume that the search key is 001. The bit index of the root node is 2. If the position of the last bit is 0, then the bit at bit index 2 is the leading 0. Therefore, it branches to the left branch from the root node. The bit index at the node after the branch is 1, and the bit at bit index 1 is 0. Therefore, it branches to the left branch and returns to the root node. Bit index 2 of the root node is greater than bit index 1 of the previous node. Therefore, the search is ended and information on the root node is obtained. The node information includes, for example, key data (001 in this example) and value (2 in this example).

同様に、検索キーが010であるとする。根ノードのビットインデクスは2である。ビットインデクス2の位置のビットは先頭の0である。このため根ノードから左側の枝に分岐する。分岐後のノードにおけるビットインデクスは1であり、ビットインデクス1の位置のビットは1である。よって、右側の枝に分岐し、同じノードに戻る。当該ノードのビットインデクス1は、1つ前のノード(自ノード)のビットインデクス1と同じである。よって探索を終了し、当該ノードの情報を取得する。ノードの情報は、例えば、キーデータ(この例では010)、バリュー(この例では3)を含む。 Similarly, assume that the search key is 010. The bit index of the root node is 2. The bit at bit index 2 is the leading 0. Therefore, it branches to the left branch from the root node. The bit index at the node after the branch is 1, and the bit at bit index 1 is 1. Therefore, it branches to the right branch and returns to the same node. The bit index 1 of this node is the same as the bit index 1 of the previous node (self node). Therefore, the search is ended and information about the node is acquired. The node information includes, for example, key data (010 in this example) and value (3 in this example).

同様に、検索キーが100であるとする。根ノードのビットインデクスは2である。ビットインデクス0の位置のビットは末尾の0である。このため根ノードから右側の枝に分岐する。分岐後のノードにおけるビットインデクスは0であり、ビットインデクス0の位置のビットは0である。よって、左側の枝に分岐し、同じノードに戻る。当該ノードのビットインデクス0は、1つ前のノード(自ノード)のビットインデクス0と同じである。よって探索を終了し、当該ノードの情報を取得する。ノードの情報は、例えばキーデータ(この例では100)、バリュー(この例では1)を含む。 Similarly, assume that the search key is 100. The bit index of the root node is 2. The bit at bit index 0 is the last 0. Therefore, it branches to the right branch from the root node. The bit index at the node after the branch is 0, and the bit at bit index 0 is 0. Therefore, it branches to the left branch and returns to the same node. The bit index 0 of this node is the same as the bit index 0 of the previous node (self node). Therefore, the search is ended and information about the node is acquired. The node information includes, for example, key data (100 in this example) and value (1 in this example).

パトリシアトライに新たなエントリ(新たなキーデータを含む)に応じた新規のノードを追加する場合、パトリシアトライを探索して、新たなキーデータを含むノードを追加する位置を見つければよい。探索により、ノードのプレフィクスがキーデータに合致するかを判断し、一致しない場合は、当該ノードを新たなノードによって置換する。元のノードは、新たなノードの子ノードとする。新たなノードのビットインデクスは、元のノードのキーデータと新たなノードのキーデータとの間で最上位の最も異なるビットとする。もし新たなノードからヌルノードへ進む場合は、ヌルノードにおいて新たなノードへのポインタを設け(あるいは新たなノードにおいてヌルノードへのポインタを新たなノードへのポインタに置換し)、新たなノードのビットインデクスを0にする。エントリに削除に伴うノードの削除は逆の手順で行えばよい。 When adding a new node to a Patricia trie in accordance with a new entry (including new key data), the Patricia trie may be searched to find a position to add a node containing new key data. Through the search, it is determined whether the prefix of the node matches the key data, and if they do not match, the node is replaced with a new node. The original node is made a child node of the new node. The bit index of the new node is the most significant bit that differs between the key data of the original node and the key data of the new node. If you want to proceed from a new node to a null node, set a pointer to the new node in the null node (or replace the pointer to the null node with a pointer to the new node in the new node), and set the bit index of the new node. Set to 0. Deletion of a node accompanying deletion of an entry may be performed by performing the reverse procedure.

本実施形態では、パトリシアトライをベースとした新たなトライであるパームトライを導入する。パームトライは、ノードが3つ以上の分岐を有することが可能である。各枝には3値(0、1、*)の1ビット、又は3値を含む複数のビットを割り当てることができる。よって、パトリシアトライは、1及び0のいずれでもよいワイルドカード“*”を示すビットを含むキーデータを格納することができる。ワイルドカード“*”を示すビットをドントケアビット、また、ドントケアビットの値をドントケアビット値と呼ぶ。 In this embodiment, a new try based on Patricia try, Palm Try, is introduced. A palm trie allows a node to have more than two branches. Each branch can be assigned one bit of ternary values (0, 1, *) or multiple bits containing ternary values. Therefore, Patricia Try can store key data including a bit indicating a wild card "*" which may be either 1 or 0. The bit indicating the wild card "*" is called a don't care bit, and the value of the don't care bit is called a don't care bit value.

図6は、本実施形態に係るパームトライの一例を示す。図6のパームトライは、図2のテーブルに示した9個のエントリに基づき生成され、9個のエントリをそれぞれノード(非葉ノード)に格納している。パームトライは複数のノードを含むデータ構造である。パームトライについて、パトリシアトライと同じ説明は適宜省略する。パームトライはACLのエントリを効率的又は高速に検索するためのデータ構造として記憶部13に格納されている。 FIG. 6 shows an example of a palm try according to this embodiment. The palm try in FIG. 6 is generated based on the nine entries shown in the table in FIG. 2, and each of the nine entries is stored in a node (non-leaf node). A palm trie is a data structure containing multiple nodes. Regarding Palm Try, the same explanation as Patricia Try will be omitted as appropriate. The palm try is stored in the storage unit 13 as a data structure for efficiently or quickly searching for ACL entries.

パームトライのノードは、3つの枝を有する。左側の子ノードへの枝は0、中央の子ノードへの枝は*、右側の子ノードへの枝は1が割り当てられている。ドントケアビット値が割り当てられた枝をドントケア枝(don’t care branch)と、ドントケア枝への分岐はドントケア分岐と呼ぶ。0又は1が割り当てられた枝を完全一致枝(exact matching branch)と、完全一致枝への分岐を完全一致分岐と呼ぶ。矩形のノードは葉ノードであり、丸のノードは、根ノード又は中間ノードである。葉ノードのうち矢印付きの破線が出ている葉ノードは、当該葉ノードに遷移した際に、矢印が示すノードに遷移することを意味している。矢印付きの破線が出ていない葉ノードはヌルノードである。なお、葉ノードにはどのエントリも対応づけられていない。 A palm trie node has three branches. The branch to the left child node is assigned 0, the branch to the center child node is assigned *, and the branch to the right child node is assigned 1. A branch to which a don't care bit value is assigned is called a don't care branch, and a branch to a don't care branch is called a don't care branch. A branch to which 0 or 1 is assigned is called an exact matching branch, and a branch to the exact matching branch is called an exact matching branch. Rectangular nodes are leaf nodes, and round nodes are root nodes or intermediate nodes. Among the leaf nodes, a leaf node with a broken line with an arrow indicates that when transitioning to that leaf node, transition is made to the node indicated by the arrow. A leaf node without a dashed line with an arrow is a null node. Note that no entries are associated with leaf nodes.

図7は、パームトライにおけるノードの構造の一例を示す図である。図の例は図2のテーブルのエントリ7に対応するノードの構造例を示している。 FIG. 7 is a diagram illustrating an example of the structure of nodes in a palm try. The illustrated example shows an example of the structure of a node corresponding to entry 7 of the table in FIG.

パームトライのノードは、3つの枝へ分岐するための3つの子ノードへのポインタを有する。3つのポインタは、左側の枝(左側の子ノード)へのポインタ、右側の枝(右側の子ノード)へのポインタ、中央の枝(中央の子ノード)へのポインタを含む。左側の枝及び右側の枝へのポインタは完全一致用のポインタに対応し、中央の枝へのポインタはドントケア枝用のポインタに対応する。ポインタは図ではPtr1,Ptr2,Ptr3と模式的に示されている。ポインタは、参照すべきノードのメモリ上のアドレスである。なお図6において矢印付きの破線が出ている葉ノードは、矢印が示すノードのみへのポイントを保持している。当該葉ノードは、ポインタ以外の項目は保持していなくてよい。 A palm trie node has pointers to three child nodes for branching into three branches. The three pointers include a pointer to the left branch (left child node), a pointer to the right branch (right child node), and a pointer to the center branch (center child node). The pointers to the left branch and the right branch correspond to pointers for exact matches, and the pointers to the center branch correspond to pointers for don't care branches. The pointers are schematically shown as Ptr1, Ptr2, and Ptr3 in the figure. A pointer is an address in memory of a node to be referenced. In FIG. 6, leaf nodes with dashed lines with arrows hold points only to the nodes indicated by the arrows. The leaf node does not need to hold any items other than pointers.

各ポインタの下側には各ポインタに対応する遷移条件“0”、“1”、“*”が、少なくとも1つの遷移条件として示されている。遷移条件“0”はビットインデクスが示すビットが0の場合に、満たされ、遷移条件“0”に対応するポインタ(図の例ではPtr1)が示すノードに遷移する(進む)。遷移条件“1”はビットインデクスが示すビットが1の場合に満たされ、遷移条件“1”に対応するポインタ(図の例ではPtr2)が示すノードに遷移する(進む)。遷移条件“*”はビットインデクスが示すビットが0の場合に満たされ、遷移条件“*”に対応するポインタ(図の例ではPtr3)が示すノードに遷移する(進む)。遷移条件“*”はビットインデクスが指定する1ビットが第1値及び第2値のいずれであることも許容する条件である。遷移条件“0”、“1”、は第1遷移条件に対応し、遷移条件“*”は第2遷移条件に対応する。 Below each pointer, transition conditions "0", "1", and "*" corresponding to each pointer are shown as at least one transition condition. The transition condition "0" is satisfied when the bit indicated by the bit index is 0, and the process transitions (goes forward) to the node indicated by the pointer (Ptr1 in the illustrated example) corresponding to the transition condition "0". The transition condition "1" is satisfied when the bit indicated by the bit index is 1, and the pointer (Ptr2 in the illustrated example) corresponding to the transition condition "1" transitions (goes forward) to the node indicated. The transition condition "*" is satisfied when the bit indicated by the bit index is 0, and the process transitions (goes forward) to the node indicated by the pointer (Ptr3 in the illustrated example) corresponding to the transition condition "*". The transition condition "*" is a condition that allows one bit specified by the bit index to be either the first value or the second value. Transition conditions "0" and "1" correspond to the first transition condition, and transition condition "*" corresponds to the second transition condition.

またパームトライのノードは、パトリシアトライと同様、“Bit”によって示されるビットインデクスを含む。ビットインデクスは検索キーにおいて参照すべきビットを指定する。例えばBit=7は、最下位ビットを0番目として最下位ビットから数えて7番目のビットを指す。検索キーのビット長が8ビットの場合、Bit=7は、最上位ビットを示す。ビットインデクスは、検索キーにおいて参照するk(本実施形態ではk=1)個のビットを指定した参照情報の一例である。本実施形態ではk=1である。 Similarly to the Patricia trie, the palm trie node includes a bit index indicated by "Bit". The bit index specifies the bit to be referenced in the search key. For example, Bit=7 indicates the 7th bit counting from the least significant bit, with the least significant bit being the 0th bit. When the bit length of the search key is 8 bits, Bit=7 indicates the most significant bit. The bit index is an example of reference information that specifies k (k=1 in this embodiment) bits to be referenced in the search key. In this embodiment, k=1.

またパームトライのノードは、キーデータ、バリュー(アクション)、及び優先度を含む。図6のパームトライにおける丸のノード内の数値は、エントリID(ノードID)を表す。なお、エントリIDがノードに含まれていてもよい。キーデータは、2値のビット列(図におけるキーデータ(2値))と、マスク用のビット列(図におけるキーデータ(3値マスク))との組によって表現される。2値のビット列は、エントリのキーデータにおいて*を0に置換したビット列が格納される。マスク用のビット列には、エントリのキーデータにおける*を1にし、*以外のビットをすべて0にしたビット列が格納されている。2値のビット列のうち、マスク用のビット列で1に対応するビットが*であるとして内部的に解釈される。図の例ではマスク用のビット列は*の位置を1で表したが、*以外の位置を1で表し、*の位置を0で表してもよい。この場合、マスク用のビット列は11111100となる。 The palm try node also includes key data, value (action), and priority. The numerical value inside the circle node in the palm try in FIG. 6 represents the entry ID (node ID). Note that the entry ID may be included in the node. The key data is expressed by a set of a binary bit string (key data (binary) in the figure) and a mask bit string (key data (ternary mask) in the figure). As the binary bit string, a bit string obtained by replacing * with 0 in the key data of the entry is stored. The mask bit string stores a bit string in which * in the key data of the entry is set to 1 and all bits other than * are set to 0. Of the binary bit string, the bit corresponding to 1 in the mask bit string is internally interpreted as *. In the illustrated example, in the mask bit string, the * position is represented by 1, but the positions other than * may be represented by 1, and the * position may be represented by 0. In this case, the bit string for masking is 11111100.

パームトライへのノードの追加及び削除のアルゴリズムは基本的にパトリシアトライと同様である。ノードの追加及び削除において、ドントケアビットは0と1のいずれにも合致しない3値として扱えばよい。 The algorithm for adding and deleting nodes to the palm try is basically the same as the Patricia try. When adding and deleting nodes, don't care bits may be treated as ternary values that do not match either 0 or 1.

本実施形態ではパームトライを検索対象のデータ構造とする。検索キー生成部14がパケットのヘッダ情報に基づき検索キーを生成する。検索キーの生成は、パケットのヘッダ情報に基づき、ACLのエントリのキーデータと同じフォーマットで生成すればよい。パケット処理部12は、検索キーを指定した検索指示を検索処理部15に提供する。検索処理部15が検索指示に従ってパームトライの探索を開始し、検索キーに合致するノードを検索する。検索処理部15は、対象となるノードにおける複数の遷移条件のうち検索キーにおいてビットインデクスが指定するビットが満たしている遷移条件を特定する。特定した遷移条件が定めるノードに遷移する。この動作を根ノードから開始し、ノードの遷移に応じて順次行うことにより、検索キーに合致するノードの検索を行う。ビットインデクスが指定するビットが満たしている遷移条件が複数特定された場合、複数の特定した遷移条件ごとに、特定した遷移条件が定めるノードに遷移する。例えば遷移条件“0”、“1”のうちの1つと、遷移条件“*”との2つの遷移条件が特定される。検索処理部15は、遷移先のノードのビットインデクスが、当該ノードへ遷移する前のノードのビットインデクスと同じビット又は当該ビットより上位のビットを指定している場合、遷移先のノードの情報を検索結果の候補(探索結果)として取得する。この際、検索キーが当該遷移先のノードが保持するキーデータと一致する場合に、当該遷移先のノードの情報を検索結果の候補として取得してもよい。 In this embodiment, a palm try is used as the data structure to be searched. A search key generation unit 14 generates a search key based on the header information of the packet. The search key may be generated based on packet header information in the same format as the key data of the ACL entry. The packet processing unit 12 provides the search processing unit 15 with a search instruction specifying a search key. The search processing unit 15 starts searching for palm tries in accordance with the search instruction, and searches for nodes that match the search key. The search processing unit 15 identifies the transition condition that is satisfied by the bit specified by the bit index in the search key, among the plurality of transition conditions in the target node. Transition to the node specified by the specified transition condition. By starting this operation from the root node and performing it sequentially according to node transitions, a search for a node that matches the search key is performed. If a plurality of transition conditions that are satisfied by the bit specified by the bit index are specified, a transition is made to a node defined by the specified transition condition for each of the plurality of specified transition conditions. For example, two transition conditions are specified: one of transition conditions "0" and "1" and transition condition "*". If the bit index of the transition destination node specifies the same bit as the bit index of the node before transitioning to the node or a bit higher than the bit, the search processing unit 15 searches the information of the transition destination node. Obtained as a search result candidate (search result). At this time, if the search key matches key data held by the transition destination node, information on the transition destination node may be acquired as a search result candidate.

以下、図8を用いて、パームトライの探索アルゴリズムについて詳細に説明する。パームトライの探索は、0及び1のいずれにも合致するドントケアビットがあるため、パトリシアトライの探索とは異なる。 The palm try search algorithm will be described in detail below with reference to FIG. The palm try search differs from the patricia try search because there are don't care bits that match both 0 and 1.

図8は、パームトライの探索動作の一例を示すフローチャートである。まず対象となるノードで、ビットインデクスが示すビットを検索キーにおいて特定する(S1)。本フローの開始時は、対象となるノードは根ノートである。根ノードにおけるビットインデクスが示すビットを、検索キーにおいて特定する。 FIG. 8 is a flowchart illustrating an example of a palm try search operation. First, in the target node, the bit indicated by the bit index is specified using the search key (S1). At the start of this flow, the target node is the root note. The bit indicated by the bit index in the root node is specified in the search key.

特定したビットが0及び1のいずれであるかに拘わらず、特定したビットはドントケアビットに合致するため、ドントケアビット値“*”が対応づいた枝(ドントケア枝)を経由して、子ノードに進む(ステップS2A)。すなわち、ドントケアビット値に対応するポイントが指すノードに進む。本例では中央の子ノードに進む。ステップS2Aの動作はドントケア分岐に相当する。ドントケア分岐はパトリシアトライには無い動作である。 Regardless of whether the specified bit is 0 or 1, the specified bit matches the don't care bit, so it is sent to the child node via the branch with the don't care bit value "*" (don't care branch). Proceed (step S2A). That is, proceed to the node pointed to by the point corresponding to the don't care bit value. In this example, proceed to the central child node. The operation in step S2A corresponds to a don't care branch. Don't care branching is an action that Patricia Try does not have.

さらに、上述の対象となるノードにおいて、ビットインデクスが示すビットが0及び1のいずれであるかを検索キーにおいて判定し、いずれに合致するかに応じて左側又は右側への子ノードへ進む(S2B)。すなわちビットインデクスが示すビットが0であれば、0に対応するポインタが指すノードに進む。すなわち左側の子ノードに進む。ビットインデクスが示すビットが検索キーにおいて1であれば、1に対応するポインタが指すノードに進む。すなわち右側の子ノードに進む。ステップS2Bの動作は完全一致分岐に相当する。 Furthermore, in the above-mentioned target node, use the search key to determine whether the bit indicated by the bit index is 0 or 1, and proceed to the child node to the left or right depending on which bit it matches (S2B ). That is, if the bit indicated by the bit index is 0, the process proceeds to the node pointed to by the pointer corresponding to 0. That is, proceed to the child node on the left. If the bit indicated by the bit index is 1 in the search key, the process proceeds to the node pointed to by the pointer corresponding to 1. In other words, proceed to the child node on the right. The operation in step S2B corresponds to a perfect match branch.

このようにステップ2Aでは中央の子ノードに進み、ステップS2Bでは左側又は右側の子ノードに進む。すなわち1つのノードから複数の方向に分岐する。これにより複数の探索が並行して行われる。 Thus, in step 2A, the process proceeds to the center child node, and in step S2B, the process proceeds to the left or right child node. That is, it branches in multiple directions from one node. This allows multiple searches to be performed in parallel.

ステップS2A、S2Bで進んだ先のノード(分岐後のノード)でそれぞれ、当該ノードがヌルノードであるかを判定する(S3A、S3B)。ヌルノードは、次に進むノードへのポインタを含まないノードである。ヌルノードはキーデータ、バリュー及び優先度も含まない。ヌルノードである場合は、探索を終了する(S6A、S6B)。すなわち、探索結果としてヌルを返す。 At each node to which the process advances in steps S2A and S2B (node after branching), it is determined whether the node is a null node (S3A, S3B). A null node is a node that does not contain a pointer to the next node to proceed to. Null nodes also do not contain key data, values, and priorities. If it is a null node, the search ends (S6A, S6B). In other words, null is returned as the search result.

一方、進んだ先のノード(分岐後のノード)がヌルノードでない場合は、進んだ先のノード(分岐のノード)のビットインデクスが、進む前のノード(分岐前のノード)のビットインデクス以上か否かを判断する(S4A、S4B)。すなわち進んだ先のノードのビットインデクスが、進む前のノードのビットインデクス以上であるとのビットインデクス条件が満たされるか否かを判断する。但し、進んだ先のノードが、ヌルノードではない葉ノードの場合(図6の例では矢印付きの破線が出ている矩形のノードの場合)、葉ノードのポインタが指すノードにさらに進む。そして、進んだ先のノードのビットインデクスが、上記の進む前のノード(分岐前のノード)のインデクス以上か否かを判断する。 On the other hand, if the destination node (node after branching) is not a null node, check whether the bit index of the destination node (branch node) is greater than or equal to the bit index of the node before proceeding (pre-branch node). (S4A, S4B). That is, it is determined whether the bit index condition that the bit index of the next node is greater than or equal to the bit index of the previous node is satisfied. However, if the destination node is a leaf node that is not a null node (in the example of FIG. 6, it is a rectangular node with a broken line with an arrow), the process continues to the node pointed to by the leaf node pointer. Then, it is determined whether the bit index of the next node is greater than or equal to the index of the previous node (pre-branch node).

進んだ先のノード(分岐後のノード)のビットインデクスが、進む前のノード(分岐前のノード)のビットインデクスより小さい場合(NO)、分岐後のノードを対象となるノードとして、ステップS1に戻る。すなわち、再帰的に上述のステップS1、S2A~S4A、S2B~S4B)を繰り返す。 If the bit index of the destination node (node after branching) is smaller than the bit index of the node before proceeding (node before branching) (NO), the process proceeds to step S1 with the node after branching as the target node. return. That is, steps S1, S2A to S4A, S2B to S4B) described above are repeated recursively.

ビット分岐後のノードのビットインデクスが分岐前のインデクス以上である場合は(YES)、分岐後のノードの情報を検索結果の候補として取得し(S5A、S5B)、本探索を終了する。ノードの情報は、例えばキーデータとバリューと優先度等を含む。 If the bit index of the node after bit branching is greater than or equal to the index before branching (YES), information on the node after branching is acquired as a search result candidate (S5A, S5B), and the main search ends. The node information includes, for example, key data, value, priority, and the like.

全ての探索が終了したかを判断し(S7)、まだ終了していない探索が存在する場合(NO)、待機する。全ての探索が終了した場合(S7のYES)、取得された検索結果の候補のうち最も優先度の高い候補を検索結果とする(S8)。すなわち、探索により複数の検索結果の候補が得られた場合、これら複数の候補が示す優先度を比較し、優先度が最も高い候補を検索結果として選択する。検索結果を含むノードが、検索キーに合致するノードとなる。検索結果の候補が1つの場合は、当該候補を検索結果として取得する。検索結果は、少なくともノードのバリューを含み、その他、キーデータ又は優先度の少なくとも一方を含んでもよい。 It is determined whether all searches have been completed (S7), and if there are searches that have not yet been completed (NO), the process waits. When all searches are completed (YES in S7), the candidate with the highest priority among the acquired search result candidates is set as the search result (S8). That is, when a plurality of search result candidates are obtained through the search, the priorities of the plurality of candidates are compared, and the candidate with the highest priority is selected as the search result. The node containing the search result is the node that matches the search key. If there is one search result candidate, that candidate is acquired as the search result. The search result includes at least the value of the node, and may also include at least one of key data and priority.

以下、図6のパームトライに基づき、01110101の検索キーに対する検索を行う動作の具体例を、上述の図8のフローチャートを参照しつつ、説明する。以下、ノードXと記載した場合エントリID(ノードID)=Xのノードを意味する。例えばノード2は、エントリID=2を有する根ノードである。 Hereinafter, a specific example of the operation of searching for the search key 01110101 based on the palm try in FIG. 6 will be described with reference to the flowchart in FIG. 8 described above. Hereinafter, when a node is written as "node X", it means a node with entry ID (node ID)=X. For example, node 2 is the root node with entry ID=2.

まず根ノードであるノード2において、ビットインデクスは7である(S1)。ドントケア枝へ進み(S2A)、進んだ先のノードはヌルノードであるため、本探索を終了する(S3A、S6A)。 First, in node 2, which is the root node, the bit index is 7 (S1). The process advances to the don't care branch (S2A), and since the destination node is a null node, the main search ends (S3A, S6A).

一方、検索キー(01110101)においてビットインデクス7が示すビットは0(最上位ビットの値)であるため、ノード2から左側のノード3に進む(S2B)。ノード3はヌルノードではなく(S3BのNO)、ノード3のビットインデクス(=6)は、ノード2のビットインデクス(=7)より小さいため(S4BのNO)、ノード3を対象となるノードとする(S1)。 On the other hand, since the bit indicated by bit index 7 in the search key (01110101) is 0 (value of the most significant bit), the process proceeds from node 2 to node 3 on the left (S2B). Since node 3 is not a null node (NO in S3B) and the bit index (=6) of node 3 is smaller than the bit index (=7) of node 2 (NO in S4B), node 3 is set as the target node. (S1).

ノード3からドントケア枝を経由してノード5に進む(S2A)。ノード5はヌルノードではなく(S3AのNO)、ノード5のビットインデクス(=0)は、ノード3のビットインデクス(=6)より小さいため(S4AのNO)、ノード5を対象となるノードとする(S1)。 The process proceeds from node 3 to node 5 via the don't care branch (S2A). Since node 5 is not a null node (NO in S3A) and the bit index (=0) of node 5 is smaller than the bit index (=6) of node 3 (NO in S4A), node 5 is set as the target node. (S1).

ノード5からドントケア枝を経由して子ノードに進み(S2A)、子ノードはヌルノードではなく(S3AのNO)、ポインタを有する葉ノードであるため、ポイントが指すノード(すなわちノード5自身)へ進む。進んだ先のノード5のビットインデクスは、進む前のノード(ノード5自身)のビットインデクスと同じであるため(S4AのYES)、ノード5の情報を検索結果の候補として取得し(S5A)、本探索を終了する(S6A)。まだ他の探索が終了していないため待機する(S7のNO)。 Proceed from node 5 to the child node via the don't care branch (S2A), and since the child node is not a null node (NO in S3A) but a leaf node with a pointer, proceed to the node pointed to by the point (i.e. node 5 itself) . Since the bit index of the node 5 to which the process has proceeded is the same as the bit index of the previous node (node 5 itself) (YES in S4A), information on node 5 is obtained as a candidate for the search result (S5A), The main search ends (S6A). Since other searches have not yet been completed, the process waits (NO in S7).

上述のノード5においてビットインデクスは0であり、検索キー(01110101)においてビットインデクス0が示すビットの値(最下位ビットの値)は1であるため、右側の子ノードに進む(S2B)。子ノードはヌルノードであるため(S3BのYES)、本探索を終了する(S6B)。まだ他の探索が終了していないため待機する(S7のNO)。 In the above-described node 5, the bit index is 0, and in the search key (01110101), the value of the bit indicated by the bit index 0 (value of the least significant bit) is 1, so the process proceeds to the child node on the right side (S2B). Since the child node is a null node (YES in S3B), the main search ends (S6B). Since other searches have not yet been completed, the process waits (NO in S7).

上述のノード3において、ビットインデクスは6であり、検索キー(01110101)においてビットインデクス6が示すビットの値は1であるため、右側のノード7に進む(S2B)。ノード7はヌルノードではなく(S3BのNO)、ノード7のビットインデクス(=5)は、ノード3のビットインデクス(=6)より小さいため(S4BのNO)、ノード7を対象となるノードとする(S1)。 In the above-described node 3, the bit index is 6, and the value of the bit indicated by bit index 6 in the search key (01110101) is 1, so the process proceeds to node 7 on the right side (S2B). Node 7 is not a null node (NO in S3B), and the bit index (=5) of node 7 is smaller than the bit index (=6) of node 3 (NO in S4B), so node 7 is set as the target node. (S1).

ノード7からドントケア枝を経由して子ノードに進み(S2A)、子ノードはヌルノードであるため(S3AのYES)、本探索を終了する(S6A)。まだ他の探索が終了していないため待機する(S7のNO)。 The process proceeds from node 7 to the child node via the don't care branch (S2A), and since the child node is a null node (YES in S3A), the main search ends (S6A). Since other searches have not yet been completed, the process waits (NO in S7).

上述のノード7において、ビットインデクスは5であり、検索キー(01110101)においてビットインデクス5が示すビットの値は1であるため、右側のノード8に進む(S2B)。ノード8はヌルノードではなく(S3BのNO)、ノード8のビットインデクス(=4)は、ノード7のビットインデクス(=5)より小さいため(S4BのNO)、ノード8を対象となるノードとする(S1)。 In the above-described node 7, the bit index is 5, and the value of the bit indicated by bit index 5 in the search key (01110101) is 1, so the process proceeds to node 8 on the right side (S2B). Since node 8 is not a null node (NO in S3B) and the bit index (=4) of node 8 is smaller than the bit index (=5) of node 7 (NO in S4B), node 8 is set as the target node. (S1).

ノード8からドントケア枝を経由してノード1に進む(S2A)。ノード1はヌルノードではなく(S3AのNO)、ノード1のビットインデクス(=0)は、ノード8のビットインデクス(=4)より小さいため(S4AのNO)、ノード1を対象となるノードとする(S1)。 The process proceeds from node 8 to node 1 via the don't care branch (S2A). Since node 1 is not a null node (NO in S3A) and the bit index (=0) of node 1 is smaller than the bit index (=4) of node 8 (NO in S4A), node 1 is set as the target node. (S1).

ノード1からドントケア枝を経由して子ノードに進み(S2A)、子ノードはヌルノードであるため(S3AのYES)、本探索を終了する(S6A)。まだ他の探索が終了していないため待機する(S7のNO)。 Proceeding from node 1 to the child node via the don't care branch (S2A), and since the child node is a null node (YES in S3A), the main search ends (S6A). Since other searches have not yet been completed, the process waits (NO in S7).

ノード1において、ビットインデクスは0であり、検索キー(01110101)においてビットインデクス0が示すビットの値(最下位ビットの値)は1であるため、右側の子ノードに進む(S2B)。子ノードはヌルノードであるため(S3BのYES)、本探索を終了する(S6B)。まだ他の探索が終了していないため待機する(S7のNO)。 In node 1, the bit index is 0, and the value of the bit indicated by bit index 0 in the search key (01110101) (value of the least significant bit) is 1, so the process proceeds to the right child node (S2B). Since the child node is a null node (YES in S3B), the main search ends (S6B). Since other searches have not yet been completed, the process waits (NO in S7).

上述のノード8において、ビットインデクスは4であり、検索キー(01110101)においてビットインデクス4が示すビットの値は1であるため、右側のノードに進む(S2B)。進んだノードはポインタを有する葉ノードであるため、ポインタが指すノード(すなわち自ノード8)へ戻る。戻った先のノード8のビットインデクス(=4)は、戻る前のノード8のビットインデクス(=4)と同じである。よって、ノード8の情報を検索結果の候補として取得し(S5A)、本探索を終了する(S6A)。 In the above-mentioned node 8, the bit index is 4, and the value of the bit indicated by bit index 4 in the search key (01110101) is 1, so the process proceeds to the right node (S2B). Since the advanced node is a leaf node that has a pointer, the process returns to the node pointed to by the pointer (that is, the own node 8). The bit index (=4) of the node 8 to which the node 8 returned is the same as the bit index (=4) of the node 8 before the return. Therefore, information on node 8 is acquired as a search result candidate (S5A), and the main search is ended (S6A).

全て探索が終了したため(S7のYES)、探索された全ての検索結果の候補の優先度を比較し、最も優先度の高い候補を検索結果とする(S8)。本例ではノード5の情報と、ノード8の情報とが検索結果の候補として取得された。ノード5の優先度は図2のテーブルから優先度P7である。一方、ノード8の優先度は優先度P2である。よって、ノード5の優先度の方がノード8の優先度より高いため、ノード5の情報を検索結果として取得する。すなわちノード5が、検索キーに合致するノードであり、ノード5の情報が取得される。ノード5のエントリのバリューはA5であり、バリューA5の情報がパケット処理部12に渡される。パケット処理部12は、バリューA5が示す処理(アクション)をパケットに対して実行する。 Since all searches have been completed (YES in S7), the priorities of all search result candidates are compared and the candidate with the highest priority is set as the search result (S8). In this example, information on node 5 and information on node 8 are acquired as search result candidates. The priority of node 5 is priority P7 from the table of FIG. On the other hand, the priority of node 8 is priority P2. Therefore, since the priority of node 5 is higher than the priority of node 8, information on node 5 is obtained as a search result. That is, node 5 is a node that matches the search key, and information about node 5 is acquired. The value of the entry of the node 5 is A5, and the information of the value A5 is passed to the packet processing unit 12. The packet processing unit 12 executes the process (action) indicated by the value A5 on the packet.

以上、本実施形態によればパームトライを検索対象のデータ構造として生成し、パームトライを検索することにより、ドントケアビットを含むキーデータの検索を少ない計算量で高速に行うことができる。図2又は図3に示したようなリストを1つ1つ順番に検索する場合に比べて、計算量を大幅に削減することができる。例えばリスト検索ではnのオーダーの計算量であるのに対して、パームトライを用いた検索では

Figure 2024022699000002
のオーダーの計算量で済む。またパームトライでは新たなエントリが追加又は既存のエントリが削除される場合にもノードの追加及び削除をパトリシアトライと同様の手法で容易に行うことができ、拡張性にも優れている。 As described above, according to the present embodiment, by generating a palm try as a data structure to be searched and searching the palm try, key data including don't care bits can be searched at high speed with a small amount of calculation. The amount of calculation can be significantly reduced compared to searching the list one by one as shown in FIG. 2 or 3. For example, while a list search requires calculations on the order of n, a search using a palm try requires
Figure 2024022699000002
The calculation amount is on the order of . In addition, in PalmTrie, even when a new entry is added or an existing entry is deleted, nodes can be easily added and deleted using the same method as in PatriciaTrie, and it is also excellent in expandability.

(第2実施形態)
第1実施形態では、検索キーに対して1ビット単位で3値の判定(0,1,*)を行うことにより探索を行った。すなわちビットインデクス(参照情報)によって特定するkビットのkが1であった。第2実施形態では、k以上のビット幅(マルチビットストライド:multibit stride)の単位で探索を行うパームトライ(拡張パームトライ)を提供する。すなわちビットインデクスによって特定するkビットのkが2以上であるパームトライを提供する。k以上のビット幅のビットの群をチャンクと呼ぶ。検索キーにおいて指定するチャンクをキーチャンクと呼ぶ。拡張パームトライを用いることで、木(パームトライ)の深さを浅くし、探索のステップ数を低減できるため、検索速度を一層向上させることができる。
(Second embodiment)
In the first embodiment, the search is performed by performing ternary determination (0, 1, *) on the search key in units of 1 bit. That is, k of k bits specified by the bit index (reference information) was 1. The second embodiment provides a palm try (extended palm try) that performs a search in units of k or more bit widths (multibit stride). That is, a palm try in which k of k bits specified by the bit index is 2 or more is provided. A group of bits with a bit width of k or more is called a chunk. The chunk specified in the search key is called a key chunk. By using the extended palm try, the depth of the tree (palm try) can be made shallow and the number of search steps can be reduced, so the search speed can be further improved.

マルチビット幅に対応したパームトライを生成する簡単な方法は、3通りに分岐するように3値木を拡張することである。例えばk=3であれば、1つのビットが0,1,*の3通りあるため、1つのノードから27通りに分岐する木を生成する。例えば、000、001、・・・、111、00*、***・・・の27通りに分岐する木を生成する。しかしながら、この方法では多くの子ノードが発生する問題がある。 A simple way to generate palm tries that support multi-bit widths is to extend the ternary tree to have 3 k branches. For example, if k=3, there are three ways for one bit: 0, 1, and *, so a tree is generated that branches in 27 ways from one node. For example, a tree is generated that branches in 27 ways: 000, 001, . . . , 111, 00*, ***, . However, this method has the problem of generating many child nodes.

例えば、27個の子ノードのうち、8個のノードは完全一致用のノードである。すなわち8個のノードは、対象となる3ビットのすべてにおいて、2値(0又は1)を有する。つまり、8個のノードは、ドントケアビット値*を含まない3ビットの値の枝(完全一致枝)につながるノードである。よって、検索キーにおける対象となる3ビットのビット群(3ビット幅のキーチャンク)に対して、8個のノードのうちの1つのノードのみが選択される。一方、27個の子ノードのうちの残りの19個のノードは、対象の3ビットにおいて1つ以上のドントケアビットの枝につながるノードである。したがって、単純には、検索キーにおいて対象となる3ビット幅のキーチャンクに対して、19個のドントケア枝(3ビットのうちの1つ以上がドントケアビット*である枝)に対する探索が必要である。19個のうちの11個は、キーチャンクにおける1及び0のビットのマッチングを行うことによって探索を排除することは可能であるが、残りの7個のノードについては、下位の探索が必要となる。 For example, of the 27 child nodes, 8 nodes are exact match nodes. That is, the eight nodes have binary values (0 or 1) in all three target bits. In other words, the eight nodes are nodes connected to a 3-bit value branch (complete match branch) that does not include the don't care bit value *. Therefore, only one node out of eight nodes is selected for the target 3-bit bit group (3-bit wide key chunk) in the search key. On the other hand, the remaining 19 nodes among the 27 child nodes are nodes that connect to one or more don't care bit branches in the target three bits. Therefore, simply, it is necessary to search for 19 don't care edges (branches where one or more of the 3 bits is a don't care bit*) for a target 3-bit wide key chunk in the search key. . For 11 of the 19 nodes, it is possible to eliminate the search by matching 1 and 0 bits in the key chunk, but for the remaining 7 nodes, lower search is required. .

本実施形態ではキーチャンクに含まれるビット(k=3の場合、3つのビット)のうち最上位のドントケアビットに着目することで、子ノードの数を低減したパームトライ(拡張パームトライ)を提供し、ドントケア岐に対する探索を簡単に行う手法を提供する。 This embodiment provides a palm try (extended palm try) with a reduced number of child nodes by focusing on the most significant don't care bit among the bits included in the key chunk (three bits if k=3). We provide a method to easily search for don't care branches.

具体的には、キーチャンクにおける最下位ビット以外のビットで1個以上のドントケアビットを含む複数のドントケア枝を1つのドントケア枝に組み合わせる。組み合わされた1つのドントケア枝は、最下位ビットに1つのみのドントケアビットをもつことを許容する。組み合わされたドントケア枝は部分木につながる。組み合わされたドントケア枝のビット幅サイズ(ストライドサイズ)は、1以上k以下である。どのドントケア枝を組み合わせるかはパームトライの生成の元となるエントリ群に依存してもよい。 Specifically, a plurality of don't care branches including one or more don't care bits other than the least significant bit in the key chunk are combined into one don't care branch. One combined don't care branch allows having only one don't care bit in the least significant bit. Combined don't care branches lead to subtrees. The bit width size (stride size) of the combined don't care branches is 1 or more and k or less. Which don't care branches are combined may depend on the entry group from which the palm try is generated.

例えばk=3の場合に、0*0,0**、0*1の枝を組み合わせて、2ビットである0*の枝とする(3ビットの最上位ビットはいずれも0である)。0*は、3ビットのうち上位側の2ビットに対応する。
また、1*0,1**、1*1の枝を組み合わせて、2ビットである1*の枝とする(3ビットの最上位ビットはいずれも1である)。1*は、3ビットのうち上位側の2ビットに対応する。
また、*00,*01,*10,*11,*0*、*1*、**0,**1,***を組み合わせて、1ビットである*の枝とする(3ビットの最上位ビットはいずれも*である)。*は、3ビットのうち最上位の1ビットに対応する。
その他に、例えば3ビットチャンクの最下位ビットにドントケアビットを有する4つの枝(00*、01*、10*、11*)が残る。以上の結果、ドントケアビットを含む19個のドントケア枝が、7個のドントケア枝に減らされる。
For example, when k=3, the 0*0, 0**, and 0*1 branches are combined to form a 2-bit 0* branch (the most significant bits of the 3 bits are all 0). 0* corresponds to the upper two bits of the three bits.
Also, the 1*0, 1**, and 1*1 branches are combined to form a 2-bit 1* branch (the most significant bit of the 3 bits is all 1). 1* corresponds to the upper two bits of the three bits.
Also, combine *00, *01, *10, *11, *0*, *1*, **0, **1, **** to form a 1-bit branch of * (3-bit The most significant bits are all *). * corresponds to the most significant 1 bit among the 3 bits.
In addition, there remain four branches (00*, 01*, 10*, 11*) having, for example, a don't care bit in the least significant bit of the 3-bit chunk. As a result of the above, 19 don't care branches containing don't care bits are reduced to 7 don't care branches.

図9は、kビット幅のパームトライを模式的に示す。図の例ではk=3である。なお、図9のパームトライは説明用に例示したものであり、図2のテーブルのエントリは反映させられていない。
図10は、比較例として、3分木の例を示す。3分木では全てのノードで、1ビットの判定を行い、3通り(0,1,*)に分岐させられている。
図11は、図10の3分木に図9のパームトライを重ねたもので、3分木とパームトライの構造の違いを比較しやすくしたものである。但し、図11においては、図9の部分木(破線で示す三角)の表記は見やすさのため省略している。
FIG. 9 schematically shows a k-bit wide palm trie. In the illustrated example, k=3. Note that the palm try in FIG. 9 is an example for explanation, and the entries in the table in FIG. 2 are not reflected therein.
FIG. 10 shows an example of a ternary tree as a comparative example. In the ternary tree, every node makes a 1-bit determination and branches into three ways (0, 1, *).
FIG. 11 shows the palm trie shown in FIG. 9 superimposed on the tertiary tree shown in FIG. 10 to make it easier to compare the differences in structure between the ternary tree and the palm trie. However, in FIG. 11, the representation of the subtree (triangle indicated by a broken line) in FIG. 9 is omitted for ease of viewing.

図9のパームトライにおいて下側の8個の黒丸のノードは、根ノードから完全一致枝につながる子ノードである。根ノードからこれらの子ノードにつながる8個の完全一致枝には左から順番に000,001,010,011,100,101,110,111が割り当てられている。すなわち、左から順番にこれら8個のノードは000,001,010,011,100,101,110,111を、プレフィクスとして有する。完全一致枝につながるノードを完全一致ノードと呼ぶ。以下の説明で、XXX(Xは0又は1又は*)の枝につながる子ノードをXXXのノードを記載する場合がある。例えば010のノードは、010を割り当てられた枝につながる子ノードである。 In the palm trie of FIG. 9, the eight black circle nodes at the bottom are child nodes that connect the root node to the exact match branch. 000, 001, 010, 011, 100, 101, 110, and 111 are assigned to the eight perfect match branches connecting from the root node to these child nodes in order from the left. That is, in order from the left, these eight nodes have 000,001,010,011,100,101,110,111 as prefixes. A node connected to a perfect match branch is called a perfect match node. In the following description, a child node connected to a branch of XXX (X is 0, 1, or *) may be described as a node of XXX. For example, the node 010 is a child node connected to the branch assigned 010.

パームトライにおいて7個の斜線が施された丸は、ドントケア枝につながる子ノード(ドントケアの遷移条件(第2遷移条件)が満たされる場合に遷移するノード)である。ドントケア枝は矢印付きの実線で示されている。ドントケア枝につながるノードをドントケアノードと呼ぶ。ドントケア枝に割り当てられた複数ビット(3ビット以下のビット数)は最下位にドントケアビットを有する。 The seven hatched circles in the palm try are child nodes connected to the don't care branch (nodes that transition when the don't care transition condition (second transition condition) is satisfied). Don't care branches are shown as solid lines with arrows. A node connected to a don't care branch is called a don't care node. A plurality of bits (3 or less bits) assigned to the don't care branch have a don't care bit at the lowest position.

完全一致ノードの全部又は一部、及びドントケアノードの全部又は一部には、ビットインデクス、ポインタ、キーデータ、バリュー、優先度が含まれている。ポインタのみを含む、完全一致ノード又はドントケアノードも存在し得る。ビットインデクス、ポインタ、キーデータ、バリュー、優先度のいずれも含まないノード(ヌルノード)も存在し得る。検索キーにおいてビットインデクスが示すビットから、上位側に向けてk個のビットが、ビットインデクスによって特定されるk個のビット(kビットチャンク)である。ビットインデクスによって特定されるk個のビットが、検索キーにおいて遷移条件の成否の判定の対象とするチャンク(kビットチャンク)となる。例えば、ビット幅k=3の場合において、検索キーが01101000であり、ビットインデクスが5であるとき、5~7ビット目である011が、ビットインデクスによって特定されるkビットチャンクである。すなわち011が、検索キーにおいて遷移条件の成否の判定の対象となる3ビットチャンクとなる。但し、最下位を0ビット目としている。 All or part of the exact match node and all or part of the don't care node include a bit index, pointer, key data, value, and priority. There may also be exact match nodes or don't care nodes that contain only pointers. There may also be nodes (null nodes) that do not include any bit index, pointer, key data, value, or priority. The k bits in the search key from the bit indicated by the bit index toward the higher order side are the k bits (k bit chunk) specified by the bit index. The k bits specified by the bit index become a chunk (k-bit chunk) that is the target of determining whether the transition condition is satisfied in the search key. For example, in the case of bit width k=3, when the search key is 01101000 and the bit index is 5, the 5th to 7th bits, 011, are the k-bit chunk specified by the bit index. In other words, 011 is the 3-bit chunk that is the target of determining whether the transition condition is satisfied or not in the search key. However, the least significant bit is the 0th bit.

図9のパームトライを探索する場合、対象となるノードにおいて、検索キーにおけるkビットチャンクに対して、8個の完全一致ノードから1つの完全一致ノードが選択される。さらに、7個のドントケアノードのうち、k個のドントケアノードが探索される(探索の手順は後述する)。一部のノード(完全一致ノード及び一部のドントケアノード)の下側には破線の三角が示され、この三角は、当該一部のノードを根ノードとする部分木を表している。パームトライの構造は、パームトライを生成する元となるキーデータセットに依存し、図示している部分木の一部が存在しない場合もあり得る。部分木の探索は、部分木の根ノードから行われる。部分木の構成は、図9の木のうち破線で示す部分木以外の構成部分と同様である。 When searching the palm try in FIG. 9, one exact match node is selected from eight exact match nodes for the k-bit chunk in the search key at the target node. Further, among the seven don't care nodes, k don't care nodes are searched (the search procedure will be described later). A dashed triangle is shown below some of the nodes (exact match nodes and some don't care nodes), and this triangle represents a subtree whose root node is the some of the nodes. The structure of the palm trie depends on the key data set from which the palm trie is generated, and some of the illustrated subtrees may not exist. The subtree search is performed from the root node of the subtree. The configuration of the subtree is the same as the constituent parts of the tree in FIG. 9 other than the subtree indicated by the broken line.

矢印付きの実線は、前述したようにドントケア枝に対応し、ドントケアノードの探索手順を表している。例えば3ビットチャンクが011の場合、01*、0*、*の順でドントケアノードが探索される。これについて詳細に説明すると以下の通りである。検索キーにおいて対象となる3ビットチャンクに対して右ビットシフト演算を行うことによって、ドントケア枝に割り当てられているビットのうち最下位の*ビットを除いたプレフィクスが得られる。 The solid line with an arrow corresponds to the don't care branch, as described above, and represents the search procedure for the don't care node. For example, if the 3-bit chunk is 011, don't care nodes are searched in the order of 01*, 0*, *. This will be explained in detail as follows. By performing a right bit shift operation on the target 3-bit chunk in the search key, a prefix excluding the lowest * bit among the bits assigned to the don't care branch is obtained.

例えば、検索キーにおける対象となる3ビットチャンクが011であるとする。右ビットシフト演算により01となり、この01は、01*から*を除いたものに一致する。したがって、01*のドントケアノードからドントケアノードの探索を開始し、次に0*のドントケアノード、その次に、*のドントケアノードを探索する。なお、探索の順序は逆でもよいし、その他の順序でもよい。図には011の完全一致ノードから01*のドントケアノードにつながる矢印付きの実線が示されており、011の完全一致ノードの後、01*のドントケアノードに進むことを示している。また01*のドントケアノードから0*のドントケアノードにつながる矢印付きの実線が示されており、ドントケアノード01*の後、ドントケアノード0*に進むことを示している。また0*のドントケアノードから*のドントケアノードにつながる矢印付きの実線が示されており、ドントケアノード0*の後、ドントケアノード0*に進むことを示している。01*と0*と*とは、いずれも最下位のビットがドントケアビットである(すなわち、最下位のビットが1及び0のいずれであることも許容されている)。なおここでは完全一致ノードの探索を先に行う例を示したが、これに限定されず、ドントケアノードの探索を先に行ってもよい。 For example, assume that the target 3-bit chunk in the search key is 011. The right bit shift operation yields 01, and this 01 matches 01* minus *. Therefore, the search for don't care nodes is started from the don't care node of 01*, then the don't care node of 0*, and then the don't care node of *. Note that the search order may be reversed or may be performed in any other order. The figure shows a solid line with an arrow connecting from the exact match node 011 to the don't care node 01*, indicating that after the exact match node 011, proceed to the don't care node 01*. Also, a solid line with an arrow connecting from the don't care node 01* to the don't care node 0* is shown, indicating that the process proceeds to the don't care node 0* after the don't care node 01*. Also, a solid line with an arrow connecting from the don't care node 0* to the don't care node * is shown, indicating that after the don't care node 0*, proceed to the don't care node 0*. In each of 01*, 0*, and *, the least significant bit is a don't care bit (that is, the least significant bit is allowed to be either 1 or 0). Although an example has been shown in which a complete match node is searched first, the present invention is not limited to this, and a don't care node may be searched first.

ドントケア枝のビット幅サイズは、組み合わせるドントケア枝のkビットにおける最上位のドントケアビットの位置に応じて変化する。前述した0*0,0**、0*1の枝を組み合わせて、0*の枝とする場合に、最上位のドントケアビットは最上位から2番目なので、ビット幅サイズは2である。1*0,1**、1*1の枝を組み合わせて、1*の枝とする場合、最上位のドントケアビットは最上位から2番目なので、ビット幅サイズは2である。*00,*01,*10,*11,*0*、*1*、**0,**1,***を組み合わせて、*の枝とする場合、最上位のドントケアビットは最上位ビットなので、ビット幅サイズは1である。 The bit width size of the don't care branch changes depending on the position of the most significant don't care bit among the k bits of the don't care branches to be combined. When the 0*0, 0**, and 0*1 branches described above are combined to form the 0* branch, the most significant don't care bit is the second from the most significant bit, so the bit width size is 2. When combining 1*0, 1**, and 1*1 branches to form a 1* branch, the most significant don't care bit is the second from the most significant bit, so the bit width size is 2. When combining *00, *01, *10, *11, *0*, *1*, **0, **1, *** to form a branch of *, the top don't care bit is the top Since it is a bit, the bit width size is 1.

但し、検索キーのチャンクを示すビット幅サイズはkビットの固定長であるが、探索の際は、kビットチャンクの一部が、ドントケア枝のkビット幅以下のビットに対して判定に用いられ得る。このため、判定の際にキーの長さ(ビット幅)に関するミスマッチが生じる場合がある。 However, although the bit width size indicating the chunk of the search key is a fixed length of k bits, during the search, a part of the k bit chunk is used for judgment for bits smaller than the k bit width of the don't care branch. obtain. Therefore, a mismatch regarding the key length (bit width) may occur during determination.

そこで、本実施形態では、検索キーにおける最下位のチャンク(下位ビット側のチャンク)に対するビットインデクスとして、―k(“-”はマイナス)より大きい負の値を許容する。k=3であれば、-1と、-2を許容する。負の値のビットインデクスによって特定されるkビットのうち、実際には存在しないビットは、検索キーからチャンクを抽出する際は、0として扱う。 Therefore, in this embodiment, a negative value larger than -k ("-" is a minus) is allowed as the bit index for the lowest chunk (chunk on the lower bit side) in the search key. If k=3, -1 and -2 are allowed. Of the k bits specified by the negative value bit index, bits that do not actually exist are treated as 0 when extracting a chunk from the search key.

本実施形態に係るkビット幅のパームトライは、完全一致枝用の2個の子ノードと、ドントケア枝用の2-1個の子ノードを有する。効率的な探索を行うためには、検索キーのチャンク、又は当該チャンクから計算される値に基づき、探索する枝(遷移先のノード)を高速に特定できることが望ましい。 The k-bit wide palm trie according to this embodiment has 2 k child nodes for exact match edges and 2 k -1 child nodes for don't care edges. In order to perform an efficient search, it is desirable to be able to quickly specify the branch to be searched (transition destination node) based on the chunk of the search key or the value calculated from the chunk.

図12は、本実施形態に係るパームトライのノードにおいて子ノードへのポインタを取得するためのデータ構造の例を示す。2つの連続配列(contiguous array)の例が示される。図12の上の連続配列は、完全一致枝用であり、図12の下の連続配列は、ドントケア枝用である。連続配列はメモリ上の連続する領域に格納された配列である。連続配列における複数の要素はメモリ上に一定サイズで連続して配置されている。連続配列の下側のカッコ付きの番号は、連続配列の各要素のインデクス(以下、配列インデクス)である。配列インデクスを指定することで、要素を指定することができる。指定された要素に格納されたポインタ(アドレス)に進むことで、次のノードに進むことができる。 FIG. 12 shows an example of a data structure for acquiring a pointer to a child node in a palm try node according to this embodiment. An example of two contiguous arrays is shown. The upper continuous array in FIG. 12 is for the exact match branch, and the lower continuous array in FIG. 12 is for the don't care branch. A continuous array is an array stored in consecutive areas of memory. A plurality of elements in a continuous array are arranged consecutively in memory with a fixed size. The number in parentheses at the bottom of the continuous array is the index of each element in the continuous array (hereinafter referred to as array index). You can specify an element by specifying an array index. By proceeding to the pointer (address) stored in the specified element, it is possible to proceed to the next node.

完全一致枝用の連続配列においては、検索キーにおいて対象となるチャンク(k=3であれば、3ビット幅のチャンク)によって1つの要素が特定される。検索キーにおいて対象となるチャンクが“100”であれば、遷移条件“100”が満たされ、“100”の要素に格納されたポインタ(アドレス)が示すノードに進む。 In the continuous array for a perfect match edge, one element is specified by the target chunk (if k=3, a 3-bit wide chunk) in the search key. If the target chunk in the search key is "100", the transition condition "100" is satisfied and the process proceeds to the node indicated by the pointer (address) stored in the element "100".

ドントケア枝用の連続配列においては、連続配列において特定すべき配列インデクス(yとする)が、以下の式(1)で算出される。すなわち式(1)により、ビットインデクスで指定されるkビット幅のビット列に対して用いる配列インデクスが算出される
y=2+g-1 ・・・(1)
ここで“チャンクのプレフィクス”を定義する。“チャンクのプレフィクス”は、kビットのチャンクのうち先頭側からドントケアビット値(*)が現れるまでの部分である。
hは、チャンクのプレフィクスにおいて先頭側の2値(0又は1)の長さを示すパラメータである。換言すると、hは、チャンクのプレフィクスのうち先頭ビットからドントケアビット値(*)より前までの長さ(ビット長)である。
gは、チャンクのプレフィクスにおいて先頭側の2値の部分を10進数で表した値を示すパラメータである。
In the continuous array for the don't care branch, the array index (referred to as y) to be specified in the continuous array is calculated using the following equation (1). In other words, the array index used for the k-bit width bit string specified by the bit index is calculated using equation (1): y=2 h +g-1 (1)
Define the “chunk prefix” here. The “chunk prefix” is the portion of the k-bit chunk from the beginning until the don't care bit value (*) appears.
h is a parameter indicating the length of the leading binary value (0 or 1) in the chunk prefix. In other words, h is the length (bit length) of the prefix of the chunk from the first bit to before the don't care bit value (*).
g is a parameter indicating a value expressed in decimal notation of the binary part at the beginning of the chunk prefix.

図13は、k=3の場合に、チャンクと、チャンクのプレフィクスと、hと、gとの関係を示した表である。例えば、チャンク0*1の場合、先頭側から*までの部分“0*”がチャンクのプレフィクスである。チャンクのプレフィクスにおいて*より前の部分は“0”のみであるため、hは1である。*より前の部分である“0”を10進数で表すと0であるためgは0である。よって、y=1である。したがって、あるノードからドントケア枝を進む場合に、ドントケア枝のkビットチャンクが0*1である場合、ドントケア用の連続配列において配列インデクスが[1]の要素に格納されたポインタが示すノードに進めばよい。
同様に、チャンクが10*の場合、先頭側から*までの部分“10*”がチャンクのプレフィクスである。チャンクのプレフィクスにおいて*より前の部分は“10”であるため、hは2である。*より前の部分である“10”を10進数で表すと2であるため、gは2である。よってy=5である。したがって、あるノードからドントケア枝を進む場合に、ドントケア枝のkビットチャンクが10*である場合、ドントケア用の連続配列において配列インデクスが[5]の要素に格納されたポインタが示すノードに進めばよい。
FIG. 13 is a table showing the relationship between chunks, chunk prefixes, h, and g when k=3. For example, in the case of chunk 0*1, the part "0*" from the beginning to * is the chunk prefix. Since the part before * in the chunk prefix is only "0", h is 1. Since "0", which is the part before *, is 0 when expressed in decimal notation, g is 0. Therefore, y=1. Therefore, when proceeding from a certain node to a don't care branch, if the k-bit chunk of the don't care branch is 0*1, proceed to the node indicated by the pointer stored in the element with array index [1] in the don't care continuous array. Bye.
Similarly, when the chunk is 10*, the part "10*" from the beginning to * is the prefix of the chunk. Since the part before * in the chunk prefix is "10", h is 2. Since "10", which is the part before *, is expressed in decimal notation as 2, g is 2. Therefore, y=5. Therefore, when proceeding down a don't care branch from a certain node, if the k-bit chunk of the don't care branch is 10*, if we proceed to the node indicated by the pointer stored in the element with array index [5] in the don't care continuous array, good.

これによりドントケア枝用の遷移条件を満たす要素を高速に特定できるため、効率的なノードの探索が可能となる。 This makes it possible to quickly identify elements that satisfy the transition conditions for don't care branches, making it possible to search for nodes efficiently.

図14は、k(k=3)のビット幅のパームトライにおけるノードの構造の一例を示す図である。パームトライのノードは、前述した完全一致枝用の連続配列と、ドントケア枝用の連続配列とを有する。完全一致枝用の遷移条件は、ビットインデクスで特定されるkビットのそれぞれが第1値又は第2値のいずれか一方であることを定めた第1遷移条件に対応する。ドントケア枝用の遷移条件は、ビットインデクスで特定されるビットの少なくとも1つの特定のビットが第1値及び第2値のいずれであることも許容する第2遷移条件に対応する。ビットインデクスは、検索キーにおいて参照するk(本実施形態ではk=3)個のビットを指定する参照情報の一例である。 FIG. 14 is a diagram illustrating an example of a node structure in a palm trie with a bit width of k (k=3). The palm try nodes have the above-described continuous array for the exact match branch and the continuous array for the don't care branch. The transition condition for the exact match branch corresponds to a first transition condition that specifies that each of the k bits specified by the bit index has either the first value or the second value. The transition condition for the don't care branch corresponds to a second transition condition that allows at least one specific bit of the bits specified by the bit index to be either the first value or the second value. The bit index is an example of reference information that specifies k (k=3 in this embodiment) bits to be referenced in the search key.

また第1実施形態と同様、ノードは、ビットインデクス、2値のビット列(図のキーデータ(2値))、マスク用のビット列(図のキーデータ(3値マスク))、バリュー、優先度を有する。第1実施形態ではビットインデクスによって1つのビットを指定したが、本実施形態では3ビットを指定する場合を想定する。その他の項目の説明は第1実施形態と同じであるため詳細な説明を省略する。 Also, as in the first embodiment, the node stores a bit index, a binary bit string (key data (binary) in the figure), a bit string for a mask (key data (ternary mask) in the figure), a value, and a priority. have In the first embodiment, one bit was specified by a bit index, but in this embodiment, a case is assumed in which three bits are specified. Since the description of other items is the same as in the first embodiment, detailed description will be omitted.

検索キー生成部14の動作は第1実施形態と同様である。検索処理部15の動作もkが1から3になったことに起因する動作を除けば、基本的に第1実施形態と同様である。本実施形態ではドントケア枝の探索に関しては、前述した効率的な方法により、最大で3個の枝の探索を部分木ごとに行う。 The operation of the search key generation unit 14 is similar to that in the first embodiment. The operation of the search processing unit 15 is also basically the same as in the first embodiment, except for the operation caused by k changing from 1 to 3. In this embodiment, when searching for don't care branches, a maximum of three branches are searched for each subtree using the efficient method described above.

図15は、第2実施形態に係るパームトライの探索動作の一例を示すフローチャートである。まず対象となるノードで、ビットインデクスにより特定されるkビット幅のビットチャンクを検索キーのチャンクとする(S11)。本フローの開始時は、対象となるノードは、パームトライの根ノードである。本実施形態ではkビット幅のチャンクは連続するk個のビットとするが、離散的に配置されたk個のビットをkビットチャンクとすることも排除されない。 FIG. 15 is a flowchart illustrating an example of a palm try search operation according to the second embodiment. First, in a target node, a k-bit wide bit chunk specified by a bit index is set as a search key chunk (S11). At the start of this flow, the target node is the root node of the palm trie. In this embodiment, a k-bit wide chunk is made up of k consecutive bits, but it is not excluded that k bits arranged discretely can be made into a k-bit chunk.

対象となるノードにおいて、チャンクに対して遷移条件を満たす(チャンクに合致する)完全一致ノードを特定し、特定した完全一致ノードに進む(S12)。またチャンクに対して遷移条件を満たすドントケアノード(例えば3つ)を特定し、特定したドントケアノードに進む(同S12)。ドントケアノードの特定は、前述した方法により効率的に行われる。 In the target node, a complete matching node that satisfies the transition condition for the chunk (matches the chunk) is identified, and the process proceeds to the identified exact matching node (S12). Further, don't care nodes (for example, three) that satisfy the transition conditions for the chunk are specified, and the process proceeds to the specified don't care nodes (S12). Don't care nodes are efficiently identified by the method described above.

ステップS12から進んだノード(完全一致ノード及びドントケアノード)がヌルノードか否かを判定する(S13)。ヌルノードである場合は(S13のYES)、当該ノードでの探索を終了する(S18)。すなわち、探索結果としてヌルを返す。 It is determined whether the nodes advanced from step S12 (complete match nodes and don't care nodes) are null nodes (S13). If the node is a null node (YES in S13), the search for the node is ended (S18). In other words, null is returned as the search result.

一方、進んだ先のノードがヌルノードでない場合は、当該ノードが部分木を有するかを判断する(S14)。部分木を有する場合は、当該ノードを根ノードとする部分木に対して、本フローチャートの処理を再帰的に実行する(S15)。部分木を有さない場合(S14のNO)又はステップS15の後、進んだ先のノードのビットインデクスが、進む前のノードのビットインデクス以上か否かを判断する(S16)。すなわち、進んだ先のノードのビットインデクスが、進む前のノードのビットインデクス以上であるとのビットインデクス条件が満たされるか否かを判断する。但し、進んだ先のノードが、ヌルノードではない葉ノードの場合、葉ノードのポインタが指すノードにさらに進む。そして、進んだ先のノードのビットインデクスが、上記の進む前のノードのインデクス以上か否かを判断する。 On the other hand, if the destination node is not a null node, it is determined whether the node has a subtree (S14). If there is a subtree, the process of this flowchart is recursively executed for the subtree whose root node is the node (S15). If there is no subtree (NO in S14) or after step S15, it is determined whether the bit index of the next node is greater than or equal to the bit index of the previous node (S16). That is, it is determined whether the bit index condition that the bit index of the next node is greater than or equal to the bit index of the previous node is satisfied. However, if the destination node is a leaf node that is not a null node, the process continues to the node pointed to by the leaf node pointer. Then, it is determined whether the bit index of the next node is greater than or equal to the index of the previous node.

進んだ先のノードのビットインデクスが、進む前のインデクス以上である場合は(S16のYES)、進んだ先のノードの情報を検索結果の候補として取得し(S17)、本探索を終了する。検索キーがノードのキーデータに合致することを確認できた場合に、検索結果の候補として取得してもよい。ノードの情報は、例えばキーデータとバリューと優先度等を含む。一方、ステップS16において進んだ先のノードのビットインデクスが、進む前のノードのビットインデクスより小さい場合(S16のNO)、ステップS18に進む。 If the bit index of the next node is greater than or equal to the previous index (YES in S16), information on the next node is acquired as a search result candidate (S17), and the main search ends. If it is confirmed that the search key matches the key data of the node, it may be acquired as a search result candidate. The node information includes, for example, key data, value, priority, and the like. On the other hand, if the bit index of the next node is smaller than the bit index of the previous node (NO in S16), the process proceeds to step S18.

全ての探索が終了したかを判断し(S19)、まだ終了していない探索が存在する場合(NO)、待機する。全ての探索が終了した場合(S19のYES)、取得された検索結果の候補のうち最も優先度の高い候補を検索結果とする(S20)。すなわち、探索により複数の検索結果の候補が得られた場合、これら複数の候補が示す優先度を比較し、優先度が最も高い候補を検索結果として選択する。検索結果を含むノードが、検索キーに合致するノードとなる。検索結果の候補が1つの場合は、当該候補を検索結果として取得する。検索結果は、少なくともノードのバリューを含み、その他、キーデータ又は優先度の少なくとも一方を含んでもよい。 It is determined whether all searches have been completed (S19), and if there are searches that have not yet been completed (NO), the process waits. When all searches are completed (YES in S19), the candidate with the highest priority among the acquired search result candidates is set as the search result (S20). That is, when a plurality of search result candidates are obtained through the search, the priorities of the plurality of candidates are compared, and the candidate with the highest priority is selected as the search result. The node containing the search result is the node that matches the search key. If there is one search result candidate, that candidate is acquired as the search result. The search result includes at least the value of the node, and may also include at least one of key data and priority.

以下、本実施形態に係るパームトライの探索の具体例を説明する。 A specific example of the palm try search according to this embodiment will be described below.

図16は、図2に示すテーブルの複数のエントリ1~9に対して生成したkビット幅のパームトライ(拡張パームトライ)の例を示す。矢印付きの実線は、図9の例と同様、ドントケア枝に対する探索手続(探索順序)の一例を表している。ノードの番号はノードID(図2のテーブルのエントリID)に対応する。“Bit”はビットインデクスである。 FIG. 16 shows an example of a k-bit wide palm try (extended palm try) generated for multiple entries 1 to 9 of the table shown in FIG. 2. A solid line with an arrow represents an example of a search procedure (search order) for a don't care branch, as in the example of FIG. The node number corresponds to the node ID (entry ID in the table of FIG. 2). “Bit” is a bit index.

図17は、図16のパームトライにおける部分木T1の例を示す。図18は、図16のパームトライにおける部分木T2の例を示す。図19は、図16のパームトライにおける部分木T3の例を示す。図20は、図16のパームトライにおける部分木T4と、部分木T4につながる部分木T5の例を示す。図21は、図16のパームトライにおける部分木T6の例を示す。図22は、図16のパームトライにおける部分木T7の例を示す。図23は、図16のパームトライにおける部分木T8の例を示す。 FIG. 17 shows an example of the subtree T1 in the palm try of FIG. 16. FIG. 18 shows an example of the subtree T2 in the palm try of FIG. 16. FIG. 19 shows an example of the subtree T3 in the palm try of FIG. 16. FIG. 20 shows an example of subtree T4 in the palm try of FIG. 16 and subtree T5 connected to subtree T4. FIG. 21 shows an example of subtree T6 in the palm try of FIG. 16. FIG. 22 shows an example of the subtree T7 in the palm try of FIG. 16. FIG. 23 shows an example of subtree T8 in the palm try of FIG. 16.

図16のパームトライにおいて8ビットの検索キー01110101に対する探索を行う例を説明する。 An example of searching for the 8-bit search key 01110101 in the palm try of FIG. 16 will be described.

根ノードであるノード2のビットインデクスは5であり、最下位ビットを0ビット目として、7~5ビット目の3ビットである011が、検索キー01110101においてチャンクとして特定される。前述した方法により探索すべきドントケア枝として01*、0*、*を割り当てられたドントケア枝を特定し、これらのドントケア枝を探索する。 The bit index of node 2, which is the root node, is 5, and with the least significant bit being the 0th bit, 011, which is the 3rd bit of the 7th to 5th bits, is specified as a chunk in the search key 01110101. Don't care branches assigned 01*, 0*, * are identified as don't care branches to be searched by the method described above, and these don't care branches are searched.

まず01*のノード(つまり上位3ビットとして01*のプレフィクスを有するノード)は、次のノード5へのポインタを有するのみで、部分木を有さないため、0*のノード5に進む。 First, the 01* node (that is, the node having a prefix of 01* as the upper 3 bits) only has a pointer to the next node 5 and does not have a subtree, so the process proceeds to 0* node 5.

ノード5は8ビットの上位2ビットとして0*のプレフィクスを有する。ノード5のビットインデクスは-2であり、0~―2ビット目の3ビットである100が、検索キー01110101におけるチャンクとして特定される。-2ビット目、-1ビット目は前述したように0として扱う。ノード5の部分木T2(図18参照)においてチャンクに合致するドントケア枝を探索すると、*が割り当てられたドントケア枝が見つかる。このドントケア枝を進んだ先のノード(葉ノード)は自ノード5を示しており、ビットインデクス条件(進んだ後のノードのビットインデクスが、進む前のビットインデクス以上)を満たしている。また検索キーはノード5のキーデータに合致する。よって、ノード5の情報を検索結果の候補として取得する。ノード5から、部分木T2において100が割り当てられた完全一致枝を進むとヌルノードとなり、探索結果としてヌルを返す。 Node 5 has a prefix of 0* as the upper two bits of the 8 bits. The bit index of node 5 is -2, and 100, which is the 3 bits from bit 0 to bit -2, is specified as a chunk in search key 01110101. The -2nd bit and -1st bit are treated as 0 as described above. When searching for a don't care branch that matches the chunk in the subtree T2 of node 5 (see FIG. 18), a don't care branch to which * is assigned is found. The destination node (leaf node) on this don't care branch indicates the own node 5, and satisfies the bit index condition (the bit index of the node after proceeding is greater than or equal to the bit index before proceeding). Further, the search key matches the key data of node 5. Therefore, information on node 5 is acquired as a candidate for the search result. Proceeding from node 5 to the exact match branch to which 100 is assigned in subtree T2, it becomes a null node and returns null as the search result.

次に、ノード2から*のノード(つまり上位1ビットとして*のプレフィクスを有するノード)に進むと、このノードはヌルノードであるため、探索結果としてヌルを返す。 Next, when proceeding from node 2 to the * node (that is, the node having the prefix * as the upper 1 bit), since this node is a null node, null is returned as the search result.

一方、根ノードであるノード2から完全一致枝を探索すると、011を割り当てられた枝が見つかり、この枝からノード8に進む。ノード8のビットインデクスは2であり、検索キー01110101において4~2ビット目の3ビットである101が、検索キー01110101のチャンクとして特定される。ノード8の部分木T4(図21参照)において10*のノードへ進むと、進んだ先のノード(葉ノード)は自ノード8を示すポインタを有する葉ノードであり、自ノード8へ戻る。ビットインデクス条件が満たされ、また検索キーはノード5のキーデータに合致する。よって、ノード8の情報を検索結果の候補として取得する。一方、ノード8から、101が割り当てられた完全一致枝を進むとヌルノードになるため、探索結果としてヌルを返す。 On the other hand, when a complete matching branch is searched from node 2, which is the root node, a branch assigned 011 is found, and the process proceeds to node 8 from this branch. The bit index of node 8 is 2, and 101, which is the 4th to 2nd bits of the search key 01110101, is specified as the chunk of the search key 01110101. When proceeding to the 10* node in the subtree T4 of node 8 (see FIG. 21), the next node (leaf node) is a leaf node that has a pointer indicating the own node 8, and the process returns to the own node 8. The bit index condition is satisfied and the search key matches the key data of node 5. Therefore, information on node 8 is obtained as a candidate for search results. On the other hand, proceeding from node 8 to the exact match branch to which 101 is assigned results in a null node, so null is returned as the search result.

一方、ノード8から、1*のノードに進むとこのノードはヌルノードであり、次に、*のノード1に進む。ノード1のビットインデクスは-1である。検索キー01110101において1~-1ビット目である101が特定される。すなわち1~0ビット目は末尾の2つのビットの01である。-1ビット目は存在しないため、前述したように0として扱う。よって01と0を結合して010となる。部分木T4につながる部分木T5において、010に対するドントケア枝及び完全一致枝に対する子ノードは全てヌルである。なお、部分木T5においてドントケアノードは全てヌルであるため省略している。 On the other hand, when proceeding from node 8 to node 1*, this node is a null node, and then proceed to node 1 of *. The bit index of node 1 is -1. In the search key 01110101, 101, which is the 1st to -1st bits, is specified. That is, the 1st to 0th bits are 01 of the last two bits. Since the -1st bit does not exist, it is treated as 0 as described above. Therefore, 01 and 0 are combined to become 010. In the subtree T5 connected to the subtree T4, the child nodes for the don't care branch and exact match branch for 010 are all null. Note that in the subtree T5, all don't care nodes are null, so they are omitted.

以上からノード5の情報とノード8の情報との2つが検索結果の候補として得られた。これら2つの候補の優先度を比較すると、ノード5の情報の優先度P7は、ノード8の情報の優先度P2より高いため、ノード5の情報が検索結果として取得される。 From the above, two items, information on node 5 and information on node 8, were obtained as search result candidates. Comparing the priorities of these two candidates, the priority P7 of the information on node 5 is higher than the priority P2 of the information on node 8, so the information on node 5 is acquired as the search result.

以上、本実施形態によれば、複数のドントケア枝を組み合わせて1つの枝としたことにより、k(kは2以上の整数)ビット幅の単位で探索を行う場合の木の深さを浅くしたパームトライを実現できる。このパームトライを用いることで、探索のステップ数を低減できるため、検索速度を向上させることができる。また検索キーのチャンクから、探索すべきk個のドントケアノードのポインタを高速に特定できるため、検索速度を向上させることができる。 As described above, according to the present embodiment, by combining multiple don't care branches into one branch, the depth of the tree when searching in units of k (k is an integer greater than or equal to 2) bit width is reduced. Palm try can be achieved. By using this palm try, the number of search steps can be reduced, so the search speed can be improved. Furthermore, since the pointers of the k don't care nodes to be searched can be quickly identified from the chunk of the search key, the search speed can be improved.

(変形例1)
変形例1では、上述した第2実施形態のノードのサイズを低減する(ノードを圧縮する)。第2実施形態の図14で示したノードの構造では、完全一致枝用のポインタと、ドントケア枝用のポインタとをそれぞれ最大個数用意していた。このため、ポインタが示すノードがヌルノードの場合も、ヌルノードのメモリ領域を確保しておく必要がある。また配列サイズも大きくなる。本変形例では、配列のサイズを低減し、ヌルノードのメモリ領域を節約する。
(Modification 1)
In modification 1, the size of the node in the second embodiment described above is reduced (the node is compressed). In the node structure shown in FIG. 14 of the second embodiment, the maximum number of pointers for exact match branches and pointers for don't care branches are prepared. Therefore, even if the node indicated by the pointer is a null node, it is necessary to reserve a memory area for the null node. The array size also increases. In this modification, the size of the array is reduced to save the memory area of the null node.

図24は、第2実施形態と同様のノード構造においてヌルノードを示すポインタを斜線で示した例を示す。 FIG. 24 shows an example in which a pointer indicating a null node is indicated by diagonal lines in a node structure similar to that of the second embodiment.

図25は、図24のノード構造を圧縮した、変形例1に係るノード構造を示す。完全一致枝用に、ベースアドレス(Base1)とビットマップとが設けられる。ビットマップは、図24と同じ遷移条件の順番で、遷移先のノードがヌルノードの場合を0、非ヌルノードの場合を1によって示している。例えばビットマップの一番左のビットは遷移条件“000”に対応し、遷移先のノードはヌルノードである。左から3番目のビットは遷移条件“010”に対応し、遷移先のノードは非ヌルノードである。遷移先のノードが非ヌルノードである場合、ベースアドレスに、該当する遷移条件に対応するビットの左側にある1の個数に応じたオフセットを加算することで、ポインタ(遷移先のノードのアドレス)を算出する。ポインタの算出式は、以下の式(2)である。 FIG. 25 shows a node structure according to modification example 1, which is a compressed version of the node structure shown in FIG. A base address (Base1) and a bitmap are provided for the exact match branch. The bitmap has the same order of transition conditions as in FIG. 24, with 0 indicating that the transition destination node is a null node and 1 indicating that it is a non-null node. For example, the leftmost bit of the bitmap corresponds to the transition condition "000", and the transition destination node is a null node. The third bit from the left corresponds to the transition condition "010", and the transition destination node is a non-null node. If the transition destination node is a non-null node, the pointer (address of the transition destination node) is set by adding an offset according to the number of 1s to the left of the bit corresponding to the applicable transition condition to the base address. calculate. The pointer calculation formula is the following formula (2).

ポインタ=Base1+オフセット値×(左側にある1の個数) 式(2) Pointer = Base1 + Offset value × (Number of 1s on the left) Formula (2)

例えばビットマップの左から3番目のビットに対応する遷移条件“010”の場合、左側にある1の個数はゼロであるため、ベースアドレス(Base1)がポインタとなる。例えばビットマップの左から5番目のビットに対応する遷移条件“100”の場合、左側にある1の個数は1つであるため、ベースアドレス+オフセット値がポインタとなる。遷移条件“001”の場合は、遷移先のノードは、ビットマップの値が0であるからヌルノードであると判定し、遷移を行わない。 For example, in the case of the transition condition "010" corresponding to the third bit from the left of the bitmap, the number of 1's on the left side is zero, so the base address (Base1) becomes the pointer. For example, in the case of the transition condition "100" corresponding to the fifth bit from the left of the bitmap, the number of 1's on the left side is one, so the base address + offset value becomes the pointer. If the transition condition is "001", the transition destination node is determined to be a null node because the bitmap value is 0, and no transition is performed.

このように、特定した遷移条件の順番に応じたオフセットと、ベースアドレス(Base1)とに基づき、遷移先のノードのアドレスを算出する。これによりヌルノードのメモリ領域を確保する必要がないため、メモリ領域を節約できる。 In this way, the address of the transition destination node is calculated based on the offset according to the specified order of the transition conditions and the base address (Base1). As a result, there is no need to reserve a memory area for a null node, so the memory area can be saved.

ドントケア枝用も同様に、ベースアドレス(Base2)とビットマップとが設けられる。ビットマップは、図24と同じ遷移条件の順番で、遷移先のノードがヌルノードの場合を0、非ヌルノードの場合を1によって示している。例えばビットマップの左から2番目のビットに対応する遷移条件“0*”の場合、遷移先のノードはヌルノードである。ビットマップの一番左のビットに対応する遷移条件“*”の場合、遷移先のノードは非ヌルノードである。遷移先のノードが非ヌルノードである場合、ベースアドレス(Base2)に、該当する遷移条件に対応するビットの左側にある1の個数に応じたオフセットを加算することで、ポインタ(遷移先のノードのアドレス)を算出する。ポインタの算出式は、以下の式(3)である。 Similarly, a base address (Base2) and a bitmap are provided for the don't care branch. The bitmap has the same order of transition conditions as in FIG. 24, with 0 indicating that the transition destination node is a null node and 1 indicating that it is a non-null node. For example, in the case of the transition condition "0*" corresponding to the second bit from the left of the bitmap, the transition destination node is a null node. In the case of the transition condition "*" corresponding to the leftmost bit of the bitmap, the transition destination node is a non-null node. If the transition destination node is a non-null node, the pointer (transition destination node address). The pointer calculation formula is the following formula (3).

ポインタ=Base2+オフセット値×(左側にある1の個数) 式(3) Pointer = Base2 + offset value x (number of 1s on the left) Formula (3)

例えば遷移条件“*”の場合、左側にある1の個数はゼロであるため、ベースアドレス(Base2)がポインタとなる。 For example, in the case of the transition condition "*", the number of 1's on the left side is zero, so the base address (Base2) becomes the pointer.

このように、特定した遷移条件の順番に応じたオフセットと、ベースアドレス(Base2)とに基づき、遷移先のノードのアドレスを算出する。これによりヌルノードのメモリ領域を確保する必要がないため、メモリ領域を節約できる。 In this way, the address of the transition destination node is calculated based on the offset according to the specified order of the transition conditions and the base address (Base2). As a result, there is no need to reserve a memory area for a null node, so the memory area can be saved.

(変形例2)
本変形例2では、あるノードから遷移する遷移する可能性がある他の全てのノードのうち最大の優先度の情報を当該ノードに保持させる。最大の優先度が、当該ノードの優先度より低い場合、当該ノードから他のノードへの遷移を行わない。これにより無駄な探索を省略し、処理を高速化できる。
(Modification 2)
In the present modification example 2, a node holds information on the highest priority among all other nodes that may transition from a certain node. If the maximum priority is lower than the priority of the node, the node does not transition to another node. This eliminates unnecessary searches and speeds up processing.

図26は、変形例2に係るノードの構造の例を示す。当該ノードから遷移する遷移する可能性がある他のノードのうち最大の優先度の情報が保持されている。図の例では最大優先度がP4である。当該ノードに処理が進んだ場合、まず当該ノードの優先度を、最大優先度と比較し、当該ノードの優先度が最大優先度より高い場合は、以降の探索を省略する。図子の例では、最大の優先度P4がノードの優先度P7より低いため、このノードから他のノードへの探索は行わない。 FIG. 26 shows an example of a node structure according to the second modification. Information about the highest priority among other nodes that may transition from the node is held. In the illustrated example, the maximum priority is P4. When processing progresses to the node, the priority of the node is first compared with the maximum priority, and if the priority of the node is higher than the maximum priority, the subsequent search is omitted. In the illustrated example, since the maximum priority P4 is lower than the node priority P7, no search is performed from this node to other nodes.

変形例2の拡張例として、遷移条件ごとに、遷移条件に応じた遷移先のノード以降で遷移する可能性のあるすべてのノードのうちの最大優先度を保持してもよい。この場合、自ノードの優先度より高い優先度の遷移条件のみ、当該遷移条件が満たされた場合にノード遷移を行う。 As an expanded example of Modification 2, for each transition condition, the maximum priority among all nodes that may transition after the transition destination node according to the transition condition may be held. In this case, node transition is performed only when the transition condition with a higher priority than the own node is satisfied.

(変形例3)
第2実施形態で記載したように、進んだ先のノードのビットインデクスが進む前のビットインデクス以上の場合にビットインデクス条件が満たされ、進んだ先のノードの情報が検索結果の候補として特定された。例えば図21では、110の葉ノードからノード4に進んだ際に、ノード4の情報が検索結果の候補(検索キーに合致するノード)として特定された。ノード4の情報を110の葉ノードに格納しておき、葉ノードからノード4への遷移を省略することで、探索の演算を簡単にできる。つまり、遷移先のノード(ノード4)へ遷移する前のノード(110の葉ノード)に、検索キーに合致するノード4の情報を含める。検索処理部15は、ノード4へ遷移せずに、110のノードから、ノード4の情報を取得し、取得した情報に基づき検索キーに合致するノードを特定する。
(Modification 3)
As described in the second embodiment, when the bit index of the next node is greater than or equal to the previous bit index, the bit index condition is satisfied, and the information of the next node is identified as a search result candidate. Ta. For example, in FIG. 21, when proceeding from leaf node 110 to node 4, information on node 4 is identified as a search result candidate (a node that matches the search key). By storing the information of node 4 in the leaf node 110 and omitting the transition from the leaf node to node 4, the search calculation can be simplified. That is, information about node 4 that matches the search key is included in the node (leaf node 110) before transition to the transition destination node (node 4). The search processing unit 15 acquires information about the node 4 from the nodes 110 without transitioning to the node 4, and identifies a node that matches the search key based on the acquired information.

例えば110のノード(上位ノードへの遷移を有する葉ノード)に、当該ノードが葉ノードであるとの情報(検索キーに合致する上位ノードの情報が検索結果として保持されていることを示す情報)と、ノード4の情報とを格納しておく。ノード4の情報は、例えばノード4のバリューと優先度を含み、その他、キーデータを含んでもよい。ノードの処理を行う際、葉ノードであるとの情報が格納されている場合には、葉ノードに保持されている検索結果の候補を取得し、以降の探索を省略する。図21の例では、検索処理部15は、110のノードの処理において、葉ノードであるとの情報が格納されていることを検出した場合、110のノードに格納されているノード4の情報を検索結果の候補として取得する。 For example, for node 110 (a leaf node with a transition to a higher-level node), information indicating that the node is a leaf node (information indicating that information on higher-level nodes that matches the search key is held as a search result) and information about node 4 are stored. The information on the node 4 includes, for example, the value and priority of the node 4, and may also include key data. When processing a node, if information indicating that it is a leaf node is stored, search result candidates held in the leaf node are obtained and subsequent searches are omitted. In the example of FIG. 21, when the search processing unit 15 detects that information indicating that it is a leaf node is stored in the processing of the node 110, the search processing unit 15 searches the information of the node 4 stored in the node 110. Obtained as a search result candidate.

(第3実施形態)
前述した実施形態における各装置(情報処理装置又は通信装置)の一部又は全部は、ハードウェアで構成されていてもよいし、CPU(Central Processing Unit)、又はGPU(Graphics Processing Unit)等が実行するソフトウェア(プログラム)の情報処理で構成されてもよい。ソフトウェアの情報処理で構成される場合には、前述した実施形態における各装置の少なくとも一部の機能を実現するソフトウェアを、フレキシブルディスク、CD-ROM(Compact Disc-Read Only Memory)、又はUSB(Universal Serial Bus)メモリ等の非一時的な記憶媒体(非一時的なコンピュータ可読媒体)に収納し、コンピュータに読み込ませることにより、ソフトウェアの情報処理を実行してもよい。また、通信ネットワークを介して当該ソフトウェアがダウンロードされてもよい。さらに、ソフトウェアがASIC(Application Specific Integrated Circuit)、又はFPGA(Field Programmable Gate Array)等の回路に実装されることにより、情報処理がハードウェアにより実行されてもよい。
(Third embodiment)
Part or all of each device (information processing device or communication device) in the embodiments described above may be configured by hardware, or may be executed by a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), etc. It may also be configured by information processing of software (program). In the case where the software is configured by software information processing, the software that realizes at least some of the functions of each device in the above-described embodiments may be stored on a flexible disk, CD-ROM (Compact Disc-Read Only Memory), or USB (Universal Software information processing may be executed by storing the information in a non-temporary storage medium (non-temporary computer-readable medium) such as Serial Bus (Serial Bus) memory and reading it into a computer. Further, the software may be downloaded via a communication network. Furthermore, information processing may be performed by hardware by implementing software in a circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array).

ソフトウェアを収納する記憶媒体の種類は限定されるものではない。記憶媒体は、磁気ディスク、又は光ディスク等の着脱可能なものに限定されず、ハードディスク、又はメモリ等の固定型の記憶媒体であってもよい。また、記憶媒体は、コンピュータ内部に備えられてもよいし、コンピュータ外部に備えられてもよい。 The type of storage medium that stores software is not limited. The storage medium is not limited to a removable one such as a magnetic disk or an optical disk, but may be a fixed storage medium such as a hard disk or memory. Further, the storage medium may be provided inside the computer or may be provided outside the computer.

図27は、前述した実施形態における各装置(情報処理装置又は通信装置)のハードウェア構成の一例を示すブロック図である。各装置は、一例として、プロセッサ91と、主記憶装置92(メモリ)と、補助記憶装置93(メモリ)と、ネットワークインタフェース94と、デバイスインタフェース95と、を備え、これらがバス96を介して接続されたコンピュータ90として実現されてもよい。 FIG. 27 is a block diagram showing an example of the hardware configuration of each device (information processing device or communication device) in the embodiment described above. Each device includes, for example, a processor 91, a main storage device 92 (memory), an auxiliary storage device 93 (memory), a network interface 94, and a device interface 95, which are connected via a bus 96. It may be realized as a computer 90.

図27のコンピュータ90は、各構成要素を一つ備えているが、同じ構成要素を複数備えていてもよい。また、図27では、1台のコンピュータ90が示されているが、ソフトウェアが複数台のコンピュータにインストールされて、当該複数台のコンピュータそれぞれがソフトウェアの同一の又は異なる一部の処理を実行してもよい。この場合、コンピュータそれぞれがネットワークインタフェース94等を介して通信して処理を実行する分散コンピューティングの形態であってもよい。つまり、前述した実施形態における各装置(情報処理装置又は通信装置)は、1又は複数の記憶装置に記憶された命令を1台又は複数台のコンピュータが実行することで機能を実現するシステムとして構成されてもよい。また、端末から送信された情報をクラウド上に設けられた1台又は複数台のコンピュータで処理し、この処理結果を端末に送信するような構成であってもよい。 Although the computer 90 in FIG. 27 includes one of each component, it may include a plurality of the same components. Furthermore, although one computer 90 is shown in FIG. 27, the software may be installed on multiple computers, and each of the multiple computers may execute the same or different part of the software. Good too. In this case, a form of distributed computing may be used in which each computer communicates via the network interface 94 or the like to execute processing. In other words, each device (information processing device or communication device) in the embodiments described above is configured as a system that realizes functions by having one or more computers execute instructions stored in one or more storage devices. may be done. Alternatively, the information transmitted from the terminal may be processed by one or more computers provided on the cloud, and the processing results may be sent to the terminal.

前述した実施形態における各装置(情報処理装置又は通信装置)の各種演算は、1又は複数のプロセッサを用いて、又は、ネットワークを介した複数台のコンピュータを用いて、並列処理で実行されてもよい。また、各種演算が、プロセッサ内に複数ある演算コアに振り分けられて、並列処理で実行されてもよい。また、本開示の処理、手段等の一部又は全部は、ネットワークを介してコンピュータ90と通信可能なクラウド上に設けられたプロセッサ及び記憶装置の少なくとも一方により実行されてもよい。このように、前述した実施形態における各装置は、1台又は複数台のコンピュータによる並列コンピューティングの形態であってもよい。 Various calculations of each device (information processing device or communication device) in the embodiments described above may be executed in parallel using one or more processors or multiple computers via a network. good. Further, various calculations may be distributed to a plurality of calculation cores within the processor and executed in parallel. Further, a part or all of the processing, means, etc. of the present disclosure may be executed by at least one of a processor and a storage device provided on a cloud that can communicate with the computer 90 via a network. In this way, each device in the embodiments described above may be in the form of parallel computing using one or more computers.

プロセッサ91は、コンピュータの制御装置及び演算装置を含む電子回路(処理回路、Processing circuit、Processing circuitry、CPU、GPU、FPGA、又はASIC等)であってもよい。また、プロセッサ91は、専用の処理回路を含む半導体装置等であってもよい。プロセッサ91は、電子論理素子を用いた電子回路に限定されるものではなく、光論理素子を用いた光回路により実現されてもよい。また、プロセッサ91は、量子コンピューティングに基づく演算機能を含むものであってもよい。 The processor 91 may be an electronic circuit (processing circuit, processing circuitry, CPU, GPU, FPGA, ASIC, etc.) including a computer control device and an arithmetic device. Further, the processor 91 may be a semiconductor device or the like including a dedicated processing circuit. The processor 91 is not limited to an electronic circuit using an electronic logic element, but may be realized by an optical circuit using an optical logic element. Further, the processor 91 may include an arithmetic function based on quantum computing.

プロセッサ91は、コンピュータ90の内部構成の各装置等から入力されたデータやソフトウェア(プログラム)に基づいて演算処理を行い、演算結果や制御信号を各装置等に出力することができる。プロセッサ91は、コンピュータ90のOS(Operating System)や、アプリケーション等を実行することにより、コンピュータ90を構成する各構成要素を制御してもよい。 The processor 91 can perform arithmetic processing based on data and software (programs) input from each device in the internal configuration of the computer 90, and can output calculation results and control signals to each device. The processor 91 may control each component making up the computer 90 by executing the OS (Operating System) of the computer 90, applications, and the like.

前述した実施形態における各装置(情報処理装置又は通信装置)は、1又は複数のプロセッサ91により実現されてもよい。ここで、プロセッサ91は、1チップ上に配置された1又は複数の電子回路を指してもよいし、2つ以上のチップあるいは2つ以上のデバイス上に配置された1又は複数の電子回路を指してもよい。複数の電子回路を用いる場合、各電子回路は有線又は無線により通信してもよい。 Each device (information processing device or communication device) in the embodiment described above may be realized by one or more processors 91. Here, the processor 91 may refer to one or more electronic circuits arranged on one chip, or one or more electronic circuits arranged on two or more chips or two or more devices. You can also point. When using multiple electronic circuits, each electronic circuit may communicate by wire or wirelessly.

主記憶装置92は、プロセッサ91が実行する命令及び各種データ等を記憶する記憶装置であり、主記憶装置92に記憶された情報がプロセッサ91により読み出される。補助記憶装置93は、主記憶装置92以外の記憶装置である。なお、これらの記憶装置は、電子情報を格納可能な任意の電子部品を意味するものとし、半導体のメモリでもよい。半導体のメモリは、揮発性メモリ、不揮発性メモリのいずれでもよい。前述した実施形態における各装置(情報処理装置又は通信装置)において各種データを保存するための記憶装置は、主記憶装置92又は補助記憶装置93により実現されてもよく、プロセッサ91に内蔵される内蔵メモリにより実現されてもよい。例えば、前述した実施形態における記憶部は、主記憶装置92又は補助記憶装置93により実現されてもよい。 The main storage device 92 is a storage device that stores instructions and various data to be executed by the processor 91, and information stored in the main storage device 92 is read out by the processor 91. The auxiliary storage device 93 is a storage device other than the main storage device 92. Note that these storage devices are any electronic components capable of storing electronic information, and may be semiconductor memories. Semiconductor memory may be either volatile memory or nonvolatile memory. The storage device for storing various data in each device (information processing device or communication device) in the embodiments described above may be realized by the main storage device 92 or the auxiliary storage device 93, and may be realized by the built-in storage device built in the processor 91. It may also be realized by memory. For example, the storage unit in the embodiment described above may be realized by the main storage device 92 or the auxiliary storage device 93.

記憶装置(メモリ)1つに対して、複数のプロセッサが接続(結合)されてもよいし、単数のプロセッサが接続されてもよい。プロセッサ1つに対して、複数の記憶装置(メモリ)が接続(結合)されてもよい。前述した実施形態における各装置(情報処理装置又は通信装置)が、少なくとも1つの記憶装置(メモリ)とこの少なくとも1つの記憶装置(メモリ)に接続(結合)される複数のプロセッサで構成される場合、複数のプロセッサのうち少なくとも1つのプロセッサが、少なくとも1つの記憶装置(メモリ)に接続(結合)される構成を含んでもよい。また、複数台のコンピュータに含まれる記憶装置(メモリ))とプロセッサによって、この構成が実現されてもよい。さらに、記憶装置(メモリ)がプロセッサと一体になっている構成(例えば、L1キャッシュ、L2キャッシュを含むキャッシュメモリ)を含んでもよい。 A plurality of processors may be connected (combined) to one storage device (memory), or a single processor may be connected to one storage device (memory). A plurality of storage devices (memories) may be connected (combined) to one processor. In the case where each device (information processing device or communication device) in the above-described embodiment is composed of at least one storage device (memory) and a plurality of processors connected (coupled) to the at least one storage device (memory) , at least one of the plurality of processors may be connected (coupled) to at least one storage device (memory). Further, this configuration may be realized by a storage device (memory) and a processor included in a plurality of computers. Furthermore, a configuration in which a storage device (memory) is integrated with a processor (for example, a cache memory including an L1 cache and an L2 cache) may be included.

ネットワークインタフェース94は、無線又は有線により、通信ネットワーク97に接続するためのインタフェースである。ネットワークインタフェース94は、既存の通信規格に適合したもの等、適切なインタフェースを用いればよい。ネットワークインタフェース94により、通信ネットワーク97を介して接続された外部装置98Aと情報のやり取りが行われてもよい。なお、通信ネットワーク97は、WAN(Wide Area Network)、LAN(Local Area Network)、PAN(Personal Area Network)等の何れか、又は、それらの組み合わせであってよく、コンピュータ90と外部装置98Aとの間で情報のやり取りが行われるものであればよい。WANの一例としてインターネット等があり、LANの一例としてIEEE802.11やイーサネット(登録商標)等があり、PANの一例としてBluetooth(登録商標)やNFC(Near Field Communication)等がある。 The network interface 94 is an interface for connecting to the communication network 97 wirelessly or by wire. As the network interface 94, an appropriate interface such as one that complies with existing communication standards may be used. The network interface 94 may exchange information with an external device 98A connected via the communication network 97. Note that the communication network 97 may be any one of a WAN (Wide Area Network), a LAN (Local Area Network), a PAN (Personal Area Network), etc., or a combination thereof, and can be used to connect the computer 90 and the external device 98A. It is sufficient that information is exchanged between them. Examples of WAN include the Internet, examples of LAN include IEEE802.11 and Ethernet (registered trademark), and examples of PAN include Bluetooth (registered trademark) and NFC (Near Field Communication).

デバイスインタフェース95は、外部装置98Bと直接接続するUSB等のインタフェースである。 The device interface 95 is an interface such as a USB that is directly connected to the external device 98B.

外部装置98Aはコンピュータ90とネットワークを介して接続されている装置である。外部装置98Bはコンピュータ90と直接接続されている装置である。 The external device 98A is a device connected to the computer 90 via a network. External device 98B is a device directly connected to computer 90.

外部装置98A又は外部装置98Bは、一例として、入力装置であってもよい。入力装置は、例えば、カメラ、マイクロフォン、モーションキャプチャ、各種センサ、キーボード、マウス、又はタッチパネル等のデバイスであり、取得した情報をコンピュータ90に与える。また、パーソナルコンピュータ、タブレット端末、又はスマートフォン等の入力部とメモリとプロセッサを備えるデバイスであってもよい。 The external device 98A or the external device 98B may be an input device, for example. The input device is, for example, a device such as a camera, microphone, motion capture, various sensors, keyboard, mouse, or touch panel, and provides the acquired information to the computer 90. Alternatively, the device may be a device including an input section, a memory, and a processor, such as a personal computer, a tablet terminal, or a smartphone.

また、外部装置98A又は外部装置98Bは、一例として、出力装置でもよい。出力装置は、例えば、LCD(Liquid Crystal Display)、CRT(Cathode Ray Tube)、PDP(Plasma Display Panel)、又は有機EL(Electro Luminescence)パネル等の表示装置であってもよいし、音声等を出力するスピーカ等であってもよい。また、パーソナルコンピュータ、タブレット端末、又はスマートフォン等の出力部とメモリとプロセッサを備えるデバイスであってもよい。 Further, the external device 98A or the external device 98B may be an output device, for example. The output device may be a display device such as an LCD (Liquid Crystal Display), a CRT (Cathode Ray Tube), a PDP (Plasma Display Panel), or an organic EL (Electro Luminescence) panel, or output audio or the like. It may also be a speaker or the like. Alternatively, the device may be a device including an output unit, a memory, and a processor, such as a personal computer, a tablet terminal, or a smartphone.

また、外部装置98Aまた外部装置98Bは、記憶装置(メモリ)であってもよい。例えば、外部装置98Aはネットワークストレージ等であってもよく、外部装置98BはHDD等のストレージであってもよい。 Further, the external device 98A or the external device 98B may be a storage device (memory). For example, the external device 98A may be a network storage or the like, and the external device 98B may be a storage such as an HDD.

また、外部装置98A又は外部装置98Bは、前述した実施形態における各装置(情報処理装置又は通信装置)の構成要素の一部の機能を有する装置でもよい。つまり、コンピュータ90は、外部装置98A又は外部装置98Bの処理結果の一部又は全部を送信又は受信してもよい。 Further, the external device 98A or the external device 98B may be a device having some functions of the components of each device (information processing device or communication device) in the embodiments described above. That is, the computer 90 may transmit or receive part or all of the processing results of the external device 98A or 98B.

本明細書(請求項を含む)において、「a、b及びcの少なくとも1つ(一方)」又は「a、b又はcの少なくとも1つ(一方)」の表現(同様な表現を含む)が用いられる場合は、a、b、c、a-b、a-c、b-c、又はa-b-cのいずれかを含む。また、a-a、a-b-b、a-a-b-b-c-c等のように、いずれかの要素について複数のインスタンスを含んでもよい。さらに、a-b-c-dのようにdを有する等、列挙された要素(a、b及びc)以外の他の要素を加えることも含む。 In this specification (including claims), the expression "at least one (one) of a, b, and c" or "at least one (one) of a, b, or c" (including similar expressions) When used, it includes any of a, b, c, a-b, a-c, b-c, or a-b-c. Further, each element may include multiple instances, such as a-a, a-b-b, a-a-b-b-c-c, etc. Furthermore, it also includes adding other elements other than the listed elements (a, b and c), such as having d as in a-b-c-d.

本明細書(請求項を含む)において、「データを入力として/データに基づいて/に従って/に応じて」等の表現(同様な表現を含む)が用いられる場合は、特に断りがない場合、各種データそのものを入力として用いる場合や、各種データに何らかの処理を行ったもの(例えば、ノイズ加算したもの、正規化したもの、各種データの中間表現等)を入力として用いる場合を含む。また「データに基づいて/に従って/に応じて」何らかの結果が得られる旨が記載されている場合、当該データのみに基づいて当該結果が得られる場合を含むとともに、当該データ以外の他のデータ、要因、条件、及び/又は状態等にも影響を受けて当該結果が得られる場合をも含み得る。また、「データを出力する」旨が記載されている場合、特に断りがない場合、各種データそのものを出力として用いる場合や、各種データに何らかの処理を行ったもの(例えば、ノイズ加算したもの、正規化したもの、各種データの中間表現等)を出力とする場合も含む。 In this specification (including claims), when expressions such as "using data as input/based on data/in accordance with/according to" (including similar expressions) are used, unless otherwise specified, This includes cases where various data itself is used as input, and cases where various data subjected to some processing (for example, noise added, normalized, intermediate representation of various data, etc.) are used as input. In addition, if it is stated that a certain result is obtained "based on/according to/according to data", this includes cases where the result is obtained only based on the data, and other data other than the data, It may also include cases where the results are obtained under the influence of factors, conditions, and/or states. In addition, if it is stated that "data will be output", if there is no special notice, various data itself may be used as output, or data that has been processed in some way (for example, data with added noise, normal This also includes cases in which the output is digitized data, intermediate representations of various data, etc.).

本明細書(請求項を含む)において、「接続される(connected)」及び「結合される(coupled)」との用語が用いられる場合は、直接的な接続/結合、間接的な接続/結合、電気的(electrically)な接続/結合、通信的(communicatively)な接続/結合、機能的(operatively)な接続/結合、物理的(physically)な接続/結合等のいずれをも含む非限定的な用語として意図される。当該用語は、当該用語が用いられた文脈に応じて適宜解釈されるべきであるが、意図的に或いは当然に排除されるのではない接続/結合形態は、当該用語に含まれるものして非限定的に解釈されるべきである。 In this specification (including the claims), when the terms "connected" and "coupled" are used, the terms "connected" and "coupled" refer to direct connection/coupling and indirect connection/coupling. , electrically connected/coupled, communicatively connected/coupled, functionally connected/coupled, physically connected/coupled, etc., without limitation. intended as a term. The term should be interpreted as appropriate depending on the context in which the term is used, but forms of connection/coupling that are not intentionally or naturally excluded are not included in the term. Should be construed in a limited manner.

本明細書(請求項を含む)において、「AがBするよう構成される(A configured to B)」との表現が用いられる場合は、要素Aの物理的構造が、動作Bを実行可能な構成を有するとともに、要素Aの恒常的(permanent)又は一時的(temporary)な設定(setting/configuration)が、動作Bを実際に実行するように設定(configured/set)されていることを含んでよい。例えば、要素Aが汎用プロセッサである場合、当該プロセッサが動作Bを実行可能なハードウェア構成を有するとともに、恒常的(permanent)又は一時的(temporary)なプログラム(命令)の設定により、動作Bを実際に実行するように設定(configured)されていればよい。また、要素Aが専用プロセッサ又は専用演算回路等である場合、制御用命令及びデータが実際に付属しているか否かとは無関係に、当該プロセッサの回路的構造が動作Bを実際に実行するように構築(implemented)されていればよい。 In this specification (including the claims), when the expression "A configured to B" is used, it means that the physical structure of element A is capable of performing operation B. configuration, and includes a permanent or temporary setting/configuration of element A being configured/set to actually perform operation B. good. For example, if element A is a general-purpose processor, the processor has a hardware configuration that can execute operation B, and can perform operation B by setting a permanent or temporary program (instruction). It only needs to be configured to actually execute. In addition, if element A is a dedicated processor or a dedicated arithmetic circuit, the circuit structure of the processor is configured to actually execute operation B, regardless of whether control instructions and data are actually attached. It is sufficient if it has been implemented.

本明細書(請求項を含む)において、含有又は所有を意味する用語(例えば、「含む(comprising/including)」及び有する「(having)等)」が用いられる場合は、当該用語の目的語により示される対象物以外の物を含有又は所有する場合を含む、open-endedな用語として意図される。これらの含有又は所有を意味する用語の目的語が数量を指定しない又は単数を示唆する表現(a又はanを冠詞とする表現)である場合は、当該表現は特定の数に限定されないものとして解釈されるべきである。 In this specification (including the claims), when terms meaning inclusion or possession (for example, "comprising/including" and "having", etc.) are used, the object of the term It is intended as an open-ended term, including the case of containing or possessing something other than the object indicated. If the object of a term meaning inclusion or possession is an expression that does not specify a quantity or suggests a singular number (an expression with a or an as an article), the expression shall be interpreted as not being limited to a specific number. It should be.

本明細書(請求項を含む)において、ある箇所において「1つ又は複数(one or more)」又は「少なくとも1つ(at least one)」等の表現が用いられ、他の箇所において数量を指定しない又は単数を示唆する表現(a又はanを冠詞とする表現)が用いられているとしても、後者の表現が「1つ」を意味することを意図しない。一般に、数量を指定しない又は単数を示唆する表現(a又はanを冠詞とする表現)は、必ずしも特定の数に限定されないものとして解釈されるべきである。 In this specification (including the claims), expressions such as "one or more" or "at least one" are used in some places, and quantities are specified in other places. Even if an expression is used that suggests no or singular (an expression with the article a or an), it is not intended that the latter expression means "one". In general, expressions that do not specify a quantity or imply a singular number (expressions with the article a or an) should be construed as not necessarily being limited to a particular number.

本明細書において、ある実施例の有する特定の構成について特定の効果(advantage/result)が得られる旨が記載されている場合、別段の理由がない限り、当該構成を有する他の1つ又は複数の実施例についても当該効果が得られると理解されるべきである。但し当該効果の有無は、一般に種々の要因、条件、及び/又は状態等に依存し、当該構成により必ず当該効果が得られるものではないと理解されるべきである。当該効果は、種々の要因、条件、及び/又は状態等が満たされたときに実施例に記載の当該構成により得られるものに過ぎず、当該構成又は類似の構成を規定したクレームに係る発明において、当該効果が必ずしも得られるものではない。 In this specification, if it is stated that a specific effect (advantage/result) can be obtained with respect to a specific configuration of a certain embodiment, unless there is a reason to the contrary, one or more other components having the configuration may be used. It should be understood that the same effect can also be obtained with the embodiment. However, it should be understood that the presence or absence of the said effect generally depends on various factors, conditions, and/or states, and that the said effect is not necessarily obtained by the said configuration. The effect is only obtained by the configuration described in the Examples when various factors, conditions, and/or states, etc. are satisfied, and in the claimed invention that specifies the configuration or a similar configuration. However, this effect is not necessarily obtained.

本明細書(請求項を含む)において、「最大化(maximize)」等の用語が用いられる場合は、グローバルな最大値を求めること、グローバルな最大値の近似値を求めること、ローカルな最大値を求めること、及びローカルな最大値の近似値を求めることを含み、当該用語が用いられた文脈に応じて適宜解釈されるべきである。また、これら最大値の近似値を確率的又はヒューリスティックに求めることを含む。同様に、「最小化(minimize)」等の用語が用いられる場合は、グローバルな最小値を求めること、グローバルな最小値の近似値を求めること、ローカルな最小値を求めること、及びローカルな最小値の近似値を求めることを含み、当該用語が用いられた文脈に応じて適宜解釈されるべきである。また、これら最小値の近似値を確率的又はヒューリスティックに求めることを含む。同様に、「最適化(optimize)」等の用語が用いられる場合は、グローバルな最適値を求めること、グローバルな最適値の近似値を求めること、ローカルな最適値を求めること、及びローカルな最適値の近似値を求めることを含み、当該用語が用いられた文脈に応じて適宜解釈されるべきである。また、これら最適値の近似値を確率的又はヒューリスティックに求めることを含む。 In this specification (including the claims), when terms such as "maximize" are used, it refers to finding a global maximum value, finding an approximate value of a global maximum value, or finding a local maximum value. and approximating the local maximum value, and should be interpreted as appropriate depending on the context in which the term is used. It also includes finding approximate values of these maximum values probabilistically or heuristically. Similarly, terms such as "minimize" are used to refer to finding a global minimum, finding an approximation to a global minimum, finding a local minimum, and finding a local minimum. It includes approximations of values and should be interpreted as appropriate depending on the context in which the term is used. It also includes finding approximate values of these minimum values probabilistically or heuristically. Similarly, terms such as "optimize" are used to refer to finding a global optimum, finding an approximation to a global optimum, finding a local optimum, and determining a local optimum. It includes approximations of values and should be interpreted as appropriate depending on the context in which the term is used. It also includes finding approximate values of these optimal values probabilistically or heuristically.

本明細書(請求項を含む)において、複数のハードウェアが所定の処理を行う場合、各ハードウェアが協働して所定の処理を行ってもよいし、一部のハードウェアが所定の処理の全てを行ってもよい。また、一部のハードウェアが所定の処理の一部を行い、別のハードウェアが所定の処理の残りを行ってもよい。本明細書(請求項を含む)において、「1又は複数のハードウェアが第1の処理を行い、前記1又は複数のハードウェアが第2の処理を行う」等の表現が用いられている場合、第1の処理を行うハードウェアと第2の処理を行うハードウェアは同じものであってもよいし、異なるものであってもよい。つまり、第1の処理を行うハードウェア及び第2の処理を行うハードウェアが、前記1又は複数のハードウェアに含まれていればよい。なお、ハードウェアは、電子回路、又は電子回路を含む装置等を含んでよい。 In this specification (including claims), when multiple pieces of hardware perform a predetermined process, each piece of hardware may cooperate to perform the predetermined process, or some of the hardware may perform the predetermined process. You may do all of the above. Further, some hardware may perform part of a predetermined process, and another piece of hardware may perform the rest of the predetermined process. In this specification (including claims), when expressions such as "one or more hardware performs the first process, and the one or more hardware performs the second process" are used , the hardware that performs the first processing and the hardware that performs the second processing may be the same or different. In other words, the hardware that performs the first processing and the hardware that performs the second processing may be included in the one or more pieces of hardware. Note that the hardware may include an electronic circuit, a device including an electronic circuit, or the like.

本明細書(請求項を含む)において、複数の記憶装置(メモリ)がデータの記憶を行う場合、複数の記憶装置(メモリ)のうち個々の記憶装置(メモリ)は、データの一部のみを記憶してもよいし、データの全体を記憶してもよい。 In this specification (including claims), when multiple storage devices (memories) store data, each storage device (memory) among the multiple storage devices (memories) stores only part of the data. It may be stored, or the entire data may be stored.

以上、本開示の実施形態について詳述したが、本開示は上記した個々の実施形態に限定されるものではない。特許請求の範囲に規定された内容及びその均等物から導き出される本発明の概念的な思想と趣旨を逸脱しない範囲において種々の追加、変更、置き換え及び部分的削除等が可能である。例えば、前述した全ての実施形態において、数値又は数式を説明に用いている場合は、一例として示したものであり、これらに限られるものではない。また、実施形態における各動作の順序は、一例として示したものであり、これらに限られるものではない。 Although the embodiments of the present disclosure have been described in detail above, the present disclosure is not limited to the individual embodiments described above. Various additions, changes, substitutions, and partial deletions are possible without departing from the conceptual idea and spirit of the present invention derived from the content defined in the claims and equivalents thereof. For example, in all the embodiments described above, when numerical values or formulas are used in the explanation, they are shown as examples, and the invention is not limited to these. Further, the order of each operation in the embodiment is shown as an example, and the order is not limited to this.

1 情報処理装置(通信装置)
11 受信部
12 パケット処理部
13 記憶部
14 検索キー生成部
15 検索処理部
16 送信部
90 コンピュータ
91 プロセッサ
92 主記憶装置
93 補助記憶装置
94 ネットワークインタフェース
95 デバイスインタフェース
96 バス
97 通信ネットワーク
98A 外部装置
98B 外部装置
140 一時記憶部
1 Information processing device (communication device)
11 Receiving unit 12 Packet processing unit 13 Storage unit 14 Search key generation unit 15 Search processing unit 16 Transmission unit 90 Computer 91 Processor 92 Main storage device 93 Auxiliary storage device 94 Network interface 95 Device interface 96 Bus 97 Communication network 98A External device 98B External Device 140 Temporary storage unit

Claims (16)

検索キーにおいて参照するk(kは1以上の整数)個のビットを指定した参照情報と、前記参照情報により指定されるビットの値に応じて遷移先のノードを定めた少なくとも1つの遷移条件と、を含む複数のノードを有するデータ構造に対して、前記検索キーに合致するノードの検索を行う検索処理部を備え、
少なくとも1つのノードにおける前記遷移条件の少なくとも1つは、前記参照情報により指定されるビットの少なくとも1つの特定のビットが第1値及び第2値のいずれであることを許容し、
前記検索処理部は、前記少なくとも1つの遷移条件のうち前記参照情報により指定されるビットが満たしている遷移条件を特定し、特定した前記遷移条件が定めるノードに遷移することにより、前記検索キーに合致するノードの検索を行う
情報処理装置。
Reference information specifying k bits (k is an integer of 1 or more) to be referenced in a search key, and at least one transition condition that defines a transition destination node according to the value of the bit specified by the reference information. , a search processing unit that searches for a node that matches the search key in a data structure having a plurality of nodes including;
At least one of the transition conditions in at least one node allows at least one specific bit of the bits specified by the reference information to be either a first value or a second value;
The search processing unit specifies a transition condition that is satisfied by the bit specified by the reference information among the at least one transition condition, and transitions to a node specified by the specified transition condition, thereby determining the search key. An information processing device that searches for matching nodes.
前記検索処理部は、前記参照情報により指定されるビットが満たしている遷移条件が複数存在する場合、複数の特定した遷移条件ごとに、特定した前記遷移条件が定めるノードに遷移する
請求項1に記載の情報処理装置。
According to claim 1, when there are a plurality of transition conditions satisfied by the bits specified by the reference information, the search processing unit transitions to a node defined by the specified transition condition for each of the plurality of specified transition conditions. The information processing device described.
前記少なくとも1つの遷移条件は、少なくとも1つの第1遷移条件と、少なくとも1つの第2遷移条件とを含み、
第1遷移条件は、前記参照情報により指定されるビットのそれぞれが第1値又は第2値のいずれか一方であることを定めており、
前記第2遷移条件は、前記参照情報により指定されるビットの少なくとも特定のビットが前記第1値及び前記第2値のいずれであることを許容している
請求項1又は2に記載の情報処理装置。
The at least one transition condition includes at least one first transition condition and at least one second transition condition,
The first transition condition specifies that each of the bits specified by the reference information is either a first value or a second value,
The information processing according to claim 1 or 2, wherein the second transition condition allows at least a specific bit of the bits specified by the reference information to be either the first value or the second value. Device.
前記検索処理部は、前記参照情報により指定されるビットの右ビットシフト演算に基づき、前記参照情報により指定されるビットが満たしている前記第2遷移条件を特定する
請求項3に記載の情報処理装置。
The information processing according to claim 3, wherein the search processing unit specifies the second transition condition satisfied by the bit specified by the reference information based on a right bit shift operation of the bit specified by the reference information. Device.
前記参照情報により指定される前記k個のビットは、前記検索キーに含まれる複数のビットのうち連続するk個のビットである
請求項1~4のいずれか一項に記載の情報処理装置。
The information processing apparatus according to claim 1, wherein the k bits specified by the reference information are k consecutive bits among a plurality of bits included in the search key.
前記ノードは、バリューと、優先度とを有し、
前記検索処理部は、検索により見つかった複数のノードに含まれるバリューを検索結果の候補として取得し、
前記検索処理部は、前記複数のノードの優先度に基づき、複数の前記候補から選択した1つを、前記検索結果とする
請求項1~5のいずれか一項に記載の情報処理装置。
The node has a value and a priority,
The search processing unit acquires values included in a plurality of nodes found by the search as search result candidates;
The information processing device according to any one of claims 1 to 5, wherein the search processing unit selects one of the plurality of candidates as the search result based on the priorities of the plurality of nodes.
前記少なくとも1つの遷移条件は、複数の第2遷移条件を含み、
前記複数の第2遷移条件が前記第1値及び前記第2値のいずれであることを許容するビットは互いに異なっている
請求項3に記載の情報処理装置。
the at least one transition condition includes a plurality of second transition conditions,
The information processing device according to claim 3, wherein bits that allow the plurality of second transition conditions to be either the first value or the second value are different from each other.
前記複数の第2遷移条件は、前記参照情報により指定されるビットの最下位のビットのみが前記第1値及び前記第2値のいずれであることを許容する
請求項7に記載の情報処理装置。
The information processing device according to claim 7, wherein the plurality of second transition conditions allow only the least significant bit of the bits specified by the reference information to be either the first value or the second value. .
前記検索処理部は、遷移先のノードの参照情報が、前記遷移先のノードへ遷移する前のノードの参照情報と同じビット又は前記ビットより上位のビットを指定している場合、前記遷移先のノードを前記検索キーに合致するノードとする
請求項1~8のいずれか一項に記載の情報処理装置。
When the reference information of the transition destination node specifies the same bit as the reference information of the node before transitioning to the transition destination node or a bit higher than the bit, the search processing unit specifies the transition destination node. The information processing device according to claim 1, wherein the node is a node that matches the search key.
前記ノードはキーデータを有し、
前記検索処理部は、前記検索キーに一致するキーデータを有するノードを前記検索キーに合致するノードとする
請求項1~9のいずれか一項に記載の情報処理装置。
the node has key data;
The information processing apparatus according to any one of claims 1 to 9, wherein the search processing unit sets a node having key data matching the search key as a node matching the search key.
前記ノードは、前記遷移条件が定めるノード以降に遷移する可能性があるノードのうち最大の優先度を有しており、
前記検索処理部は、前記最大の優先度が前記ノードの優先度より低い場合、前記遷移条件が定めるノードへの遷移を行わない
請求項6に記載の情報処理装置。
The node has the highest priority among the nodes that may transition after the node defined by the transition condition,
The information processing device according to claim 6, wherein the search processing unit does not perform transition to the node defined by the transition condition when the maximum priority is lower than the priority of the node.
前記ノードは、前記少なくとも1つの遷移条件の順番に関する情報と、ベースアドレスとを含み、
前記検索処理部は、特定した前記遷移条件の順番に応じたオフセットと、前記ベースアドレスとに基づき、特定した前記遷移条件が定める遷移先のノードのアドレスを算出し、算出したアドレスに基づき前記遷移先のノードに遷移する
請求項1~11のいずれか一項に記載の情報処理装置。
The node includes information regarding the order of the at least one transition condition and a base address,
The search processing unit calculates an address of a transition destination node defined by the specified transition condition based on an offset according to the specified order of the transition condition and the base address, and executes the transition based on the calculated address. The information processing device according to any one of claims 1 to 11, wherein the information processing device transitions to a previous node.
前記遷移先のノードへ遷移する前のノードは、前記検索キーに合致する前記遷移先のノードの情報を含み、
前記検索処理部は、前記遷移先のノードへ遷移する前のノードから、前記遷移先のノードの情報を取得し、取得した情報に基づき、前記遷移先のノードを前記検索キーに合致するノードとして特定する
請求項9に記載の情報処理装置。
The node before transitioning to the transition destination node includes information about the transition destination node that matches the search key,
The search processing unit acquires information about the transition destination node from a node before transitioning to the transition destination node, and based on the acquired information, determines the transition destination node as a node that matches the search key. The information processing device according to claim 9.
パケットを受信する受信部と、
前記パケットのヘッダに基づき前記検索キーを生成する生成部と、
前記検索処理部は、前記検索キーに基づき前記データ構造における前記ノードの検索を行い、
前記ノードはパケットに対して行う処理を示すバリューを含み、
前記検索で見つかったノードに含まれるバリューに応じた処理を前記パケットに対して行うパケット処理部を備えた
請求項1~13のいずれか一項に記載の情報処理装置。
a receiving unit that receives the packet;
a generation unit that generates the search key based on the header of the packet;
The search processing unit searches for the node in the data structure based on the search key,
The node includes a value indicating processing to be performed on the packet,
The information processing apparatus according to any one of claims 1 to 13, further comprising a packet processing unit that performs processing on the packet according to a value included in a node found in the search.
検索キーにおいて参照するk(kは1以上の整数)個のビットを指定した参照情報と、前記参照情報により指定されるビットの値に応じて遷移先のノードを定めた少なくとも1つの遷移条件と、を含む複数のノードを有するデータ構造に対して、前記検索キーに合致するノードの検索を行うステップを備え、
少なくとも1つのノードにおける前記遷移条件の少なくとも1つは、前記参照情報により指定されるビットの少なくとも1つが第1値及び第2値のいずれであることを許容し、
前記ステップは、前記少なくとも1つの遷移条件のうち前記参照情報により指定されるビットが満たしている遷移条件を特定し、特定した前記遷移条件が定めるノードに遷移する行うことにより、前記検索キーに合致するノードの検索を行う
情報処理方法。
Reference information specifying k bits (k is an integer of 1 or more) to be referenced in a search key, and at least one transition condition that defines a transition destination node according to the value of the bit specified by the reference information. , a step of searching for a node that matches the search key in a data structure having a plurality of nodes including;
At least one of the transition conditions in at least one node allows at least one of the bits specified by the reference information to be either a first value or a second value;
The step includes identifying a transition condition that is satisfied by the bit specified by the reference information among the at least one transition condition, and transitioning to a node specified by the identified transition condition, thereby matching the search key. An information processing method that searches for nodes.
検索キーにおいて参照するk(kは1以上の整数)個のビットを指定した参照情報と、前記参照情報により指定されるビットの値に応じて遷移先のノードを定めた少なくとも1つの遷移条件と、を含む複数のノードを有するデータ構造に対して、前記検索キーに合致するノードの検索を行うステップをコンピュータに実行させ、
少なくとも1つのノードにおける前記遷移条件の少なくとも1つは、前記参照情報により指定されるビットの少なくとも1つの特定のビットが第1値及び第2値のいずれであることも許容し、
前記ステップは、前記少なくとも1つの遷移条件のうち前記参照情報により指定されるビットが満たしている遷移条件を特定し、特定した前記遷移条件が定めるノードに遷移することにより、前記検索キーに合致するノードの検索を行う
コンピュータプログラム。
Reference information specifying k bits (k is an integer of 1 or more) to be referenced in a search key, and at least one transition condition that defines a transition destination node according to the value of the bit specified by the reference information. causing a computer to perform a step of searching for a node that matches the search key in a data structure having a plurality of nodes including;
At least one of the transition conditions in at least one node allows at least one specific bit of the bits specified by the reference information to be either a first value or a second value;
The step includes identifying a transition condition that is satisfied by the bit specified by the reference information among the at least one transition condition, and transitioning to a node defined by the identified transition condition, thereby matching the search key. A computer program that searches for nodes.
JP2020186097A 2020-11-06 2020-11-06 Information processing device, information processing method and computer program Pending JP2024022699A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2020186097A JP2024022699A (en) 2020-11-06 2020-11-06 Information processing device, information processing method and computer program
PCT/JP2021/040841 WO2022097725A1 (en) 2020-11-06 2021-11-05 Information processing device, information processing method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2020186097A JP2024022699A (en) 2020-11-06 2020-11-06 Information processing device, information processing method and computer program

Publications (1)

Publication Number Publication Date
JP2024022699A true JP2024022699A (en) 2024-02-21

Family

ID=81458336

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2020186097A Pending JP2024022699A (en) 2020-11-06 2020-11-06 Information processing device, information processing method and computer program

Country Status (2)

Country Link
JP (1) JP2024022699A (en)
WO (1) WO2022097725A1 (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6662184B1 (en) * 1999-09-23 2003-12-09 International Business Machines Corporation Lock-free wild card search data structure and method
US7054315B2 (en) * 2001-09-17 2006-05-30 Pmc-Sierra Ltd. Efficiency masked matching
JP4527753B2 (en) * 2007-07-03 2010-08-18 株式会社エスグランツ Bit string search device, search method and program
JP6085577B2 (en) * 2014-02-26 2017-02-22 日本電信電話株式会社 Retrieval tree generation / retrieval apparatus, method, and program

Also Published As

Publication number Publication date
WO2022097725A1 (en) 2022-05-12

Similar Documents

Publication Publication Date Title
US10764181B2 (en) Pipelined evaluations for algorithmic forwarding route lookup
CN108370352B (en) High speed flexible packet classification using network processors
US9495479B2 (en) Traversal with arc configuration information
US8180803B2 (en) Deterministic finite automata (DFA) graph compression
US7949683B2 (en) Method and apparatus for traversing a compressed deterministic finite automata (DFA) graph
CN105122745B (en) Efficient longest prefix match technology for the network equipment
JP4452183B2 (en) How to create a programmable state machine data structure to parse the input word chain, how to use the programmable state machine data structure to find the resulting value corresponding to the input word chain, deep wire speed A method for performing packet processing, a device for deep packet processing, a chip embedding device, and a computer program including programming code instructions (method and device for deep packet processing)
CN104881422B (en) Engine, method and software defined network for generating lookups and making decisions
US8010481B2 (en) Pattern matching technique for high throughput network processing
CN110301120A (en) Flow point class device, method and system
US20080013532A1 (en) Apparatus for hardware-software classification of data packet flows
US9979648B1 (en) Increasing entropy across routing table segments
JP5807676B2 (en) Packet classifier, packet classification method, and packet classification program
US9985885B1 (en) Aggregating common portions of forwarding routes
US20220060419A1 (en) Systems for building data structures with highly scalable algorithms for a distributed lpm implementation
US7633886B2 (en) System and methods for packet filtering
Nikolenko et al. How to represent IPv6 forwarding tables on IPv4 or MPLS dataplanes
JP5673667B2 (en) Packet classifier, packet classification method, packet classification program
JP2024022699A (en) Information processing device, information processing method and computer program
JP5682442B2 (en) Packet classifier, packet classification method, and packet classification program
Chiu et al. The design and implementation of a latency-aware packet classification for OpenFlow protocol based on FPGA
US11245625B2 (en) Generating entries in a content addressable memory of a network device
US9032142B2 (en) System and method for storing integer ranges in a memory
US10476785B2 (en) IP routing search
CN111193746A (en) Security policy matching method and device, electronic equipment and medium