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 table entry technology, applied in the field of communication, can solve the problem that B-tree cannot achieve the longest matching

Inactive Publication Date: 2013-06-12
HUAWEI TECH CO LTD
View PDF2 Cites 0 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 matching entry can be expressed in the form: 10101011XXXXXX / 8, 10101011XXXXXXXX / 8, 01XXX / 2, etc., where the first one represents the longest matching entry with a length of 14 bits and a mask length of 8, and the second Indicates the longest matching entry with a length of 16 bits and a mask length of 8, and the third one represents the longest matching entry with a length of 5 bits and a mask length of 2.

[0033] For the longest matching entry, the so-called "match" 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 ma...

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 non-leaf node entries in the B-tree, enabling 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 entry to be inserted according to the longest matching entry to be added. For the sake of simplicity, in this example, the method of extending 1 bit is adopted. After the expansion, the value of the table item to be inserted has W+1 bits. Starting from the lower bit, the field before the first bit with a value of "1" matches the longest The fields corresponding to the mask length in the 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 t...

Embodiment 3

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

[0061] C1. Obtain the longest matching 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 table item to be searched 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 Embodiment 1. Since the extended exact entry in this example is used for searching, it can be called the value of the table 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 lower bit, the field before the first bit whose 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 table item to be checked 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 invention relates to the field of communication technology, in particular to methods and devices for adding, searching and deleting entries of the longest matching B-tree. Background technique [0002] Lookup is one of the key technologies in many communication devices, such as routers. At present, there are search methods based on various data structures, among which B-tree (including binary tree) has become a more general search technology due to its characteristics of less search times and high speed. [0003] The search can include two different types: exact match and longest match (Longest Match). At present, based on the B-tree, the exact matching search method can be realized. [0004] figure 1 An example of adding a precise entry to a B-tree (the structure of a B-tree can be left large and right small or left small and right large, in this example, left small and right large) is given. figure 1 The precise entry "8" needs to be compared...

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 Patents(China)
IPC IPC(8): G06F17/30
Inventor 李晚龙
Owner HUAWEI TECH CO LTD