Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and device for adding, searching and deleting longest match table entry of B-tree

A longest matching and entry technology, applied in the field of communication, can solve the problem that the B tree cannot achieve the longest matching, etc.

Inactive Publication Date: 2011-06-29
HUAWEI TECH CO LTD
View PDF2 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

At present, the B tree cannot achieve the longest match

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for adding, searching and deleting longest match table entry of B-tree
  • Method and device for adding, searching and deleting longest match table entry of B-tree
  • Method and device for adding, searching and deleting longest match table entry of B-tree

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0030] Embodiment 1. A method for adding entries to the longest matching B-tree, such as image 3 shown, including:

[0031] A1. Obtain the longest matching entry of length W that needs to be added to the B-tree, where W is a natural number.

[0032] The longest match entry can be expressed in the form: 10101011XXXXXX / 8, 10101011XXXXXXXX / 8, 01XXX / 2, etc., where the first represents the longest match entry with a length of 14 bits and a mask length of 8, and the second Indicates the longest match entry with a length of 16 bits and a mask length of 8, and the third indicates the longest match entry with a length of 5 bits and a mask length of 2.

[0033] For the longest matching entry, the so-called "matching" refers to the partial or full length of the field corresponding to the mask length of the entry to be matched, which is the same as the field corresponding to the mask length of the matched entry. For example, for the to-be-matched entry 01110 / 5, the matched entries 01XX...

Embodiment 2

[0043] Embodiment 2: A method for adding entries to the longest matching B-tree. Compared with Embodiment 1, this embodiment further increases the content of the entries of non-leaf nodes in the B-tree, so that better achieve the longest match. Process such as Figure 4 shown, including:

[0044] B1. Obtain the longest matching entry of length W that needs to be added to the B-tree, where W is a natural number.

[0045] B2. Generate the value of the table entry to be inserted according to the longest matching table entry that needs to be added. For simplicity, in this example, a 1-bit extension is used, and the expanded table entry value to be inserted has W+1 bits. The fields corresponding to the mask length in the table entry are the same.

[0046] B3. Compare the value of the entry to be inserted with the entry value of the existing entry in the B-tree according to the set comparison order, and determine the position to be added.

[0047] In this embodiment, each entry...

Embodiment 3

[0060] Embodiment 3, a kind of table entry search method for the longest matching B-tree, as Image 6 shown, including:

[0061] C1. Obtain the longest matching table entry of length W that needs to be searched in the B-tree, where W is a natural number.

[0062] C2. Generate the value of the to-be-checked table item according to the longest matching table item to be searched.

[0063] The generation method can refer to the method of obtaining the exact entry value by extending the longest matching entry in the first embodiment. Since the expanded precise entry in this example is used for searching, it can be called the value of the entry to be looked up. , in the case of extending 1 bit, the value of the entry to be looked up has W+1 bits, starting from the low order, the field before the bit whose first value is the set value corresponds to the mask in the longest matching entry The length field is the same.

[0064] C3. Compare the value of the entry to be looked up with...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiment of the invention discloses a method and a device for adding, searching and deleting the longest match table entry of a B-tree. In the embodiment of the invention, the longest match table entry is expanded, and the expanded bit is used for expressing the hash mask length information of the longest match table entry, so that the longest match table entry is changed into a precise table entry with a precise value, the precise table entry acquired after expansion is used for performing operation such as addition, searching, deletion and the like based on the B-tree, and the longestmatch based on the B-tree can be realized.

Description

technical field [0001] The present invention relates to the field of communication technologies, in particular to a method and device for adding, searching and deleting entries of a longest matching B-tree. Background technique [0002] Lookup is one of the key technologies for many communication devices, such as routers. At present, there are search methods based on various data structures. Among them, B-tree (including binary tree) has become a more general search technology because of its small search times and high speed. [0003] The search can include two different types: exact match and longest match. At present, an exact matching search method can be realized based on the B-tree. [0004] figure 1 An example of the process of adding an exact entry in a B-tree (the structure of the B-tree can be large on the left and small on the right or small on the left and large on the right, in this example, it is small on the left and large on the right) is given. figure 1 T...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 李晚龙
Owner HUAWEI TECH CO LTD