Method and device for matching longest prefix based on tree form data structure

A longest prefix matching and data structure technology, applied in data exchange network, electrical digital data processing, special data processing applications, etc., can solve the problem that the query speed cannot meet the line rate requirement, irrelevance, etc.

Active Publication Date: 2009-11-11
HUAWEI TECH CO LTD
View PDF0 Cites 43 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

Trie is a tree structure used to save a large number of strings. It can use the common prefix of the string to save storage space. It has a fast update speed. The query performance is only related to the length of the address and not related to the number of prefixes. characteristics, so using Trie to achieve the longest prefix matching is a relatively common practice. For example, in the prior art, a method of searching and compressing multi-bit Tries is used to find the longest matching prefix. However, in the existing In the process of technical research and practice, the inventor found that if the matching method of compressing multi-bit Trie is used, if the step size is r, only r bits can be read at a time, and its query speed cannot meet the continuously increasing line rate requirements

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 matching longest prefix based on tree form data structure
  • Method and device for matching longest prefix based on tree form data structure
  • Method and device for matching longest prefix based on tree form data structure

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach

[0062] The first type of internal bitmap is based on the prefix extension bitmap, adding a bit width of 2 r The prefix indication bitmap of the bit (Prefix Indication Bitmap), a bit in the prefix indication bitmap is 1, which means that there is a prefix matching the corresponding path in the node, and if a bit is 0, it means that there is no corresponding path in the node. The path matches the prefix. For example, Figure 1C The prefix extension bitmap for node 3 in becomes 1000, and the prefix indication bitmap is 1100.

[0063] Similarly, the next-hop information corresponding to all the prefixes contained in each node is continuously stored in the memory to form an array of leaf nodes. When searching, first find out the corresponding bit of the prefix indication bitmap according to the search keyword, if it is 0, it means that there is no matching prefix in this node; if it is 1, continue to judge whether the corresponding bit in the prefix extension bitmap is 1 , if th...

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 invention discloses a method and a device for matching a longest prefix. The method comprises the following steps: A, reading a search node; B, determining whether the offset domain of the read search node indicates that an upper node has the matched prefix or not, adding the offset domain of the search node to a pointer pointing to a leaf node array in the upper node if the upper node has the matched prefix, updating the current best matching pointer and executing the step C, and executing the step C if the upper node has no matched prefix; C, determining whether the search node has the leaf node or not while determining corresponding bit matching of branch indication domain and search key words of the search node; D, reading the internal bitmap of the search node while determining that the search node does not have the leaf node, computing the longest matching prefix existing in the search node according to the internal bitmap and the pointer pointing to the leaf node array in the search node, updating the current best matching pointer, and computing the address of the leaf node corresponding to the current best matching pointer. The method can improve the search speed.

Description

technical field [0001] The invention relates to the technical fields of communication and computer, in particular to a longest prefix matching method and device based on a tree data structure. Background technique [0002] When a router forwards an IP (Internet Protocol, Internet Protocol) message, it needs to query a routing table according to the destination address of the IP message. The routing table contains multiple routing prefixes, and each routing prefix is ​​usually represented by a string consisting of 0 / 1, for example: 01 * , the symbol at the end of the string " * " indicates that the following bits can take any value. Each routing prefix in the routing table corresponds to a next-hop information. The method adopts the longest prefix matching method. After finding the longest matching prefix, forward the IP message according to the next hop information corresponding to the prefix. The so-called longest prefix matching, for example: if there are two routes in 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): H04L12/56G06F17/30
CPCH04L45/7457H04L45/00H04L45/74591
Inventor 梁军沈士军李猛张娟胡睿龚钧
Owner HUAWEI TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products