Sie sind auf Seite 1von 10

Tree Bitmap algorithm is a multibit trie algorithm that allows fast searches and allows much faster update

times than other algorithms. A multibit node (representing multiple levels of unibit nodes) has two functions: to point at children multibit nodes, and to produce the next hop pointer for searches in which the longest matching prefix exists within the multibit node.

The tree bitmap algorithm design considers that a multibit trie node is intended to serve two purposesone to direct the search to its child nodes and the other to retrieve the forwarding information corresponding to the best matching prefix that exists in the node.

One bitmap used for storing internal prefixes belonging to that node is referred to as a prefix bitmap and the other bitmap used for storing the pointers to children is referred to as a pointer bitmap. Such a use of two bitmaps obviates leaf pushing, allowing fast insertions and updates.

the tree bitmap attempts to reduce the number of child node pointers by storing all the child nodes of a given trie node contiguously. As a result, only one pointer that points to the beginning of this child node block needs to be stored in the trie node.

An additional advantage is that it reduces the size of the trie nodes. The tree bitmap algorithm attempts to keep the trie nodes as small as possible to reduce the size of a memory access for a given stride. A tree bitmap trie node is expected to contain the pointer bitmap, the prefix bitmap, the base pointer to the child block, and the next-hop information associated with the prefixes in the node. If the nexthop information is stored along with the trie node, it would make the size of the trie node much larger. Instead, the next-hop information is stored separately in an array associated with this node and a pointer to the first element is stored in the trie node

The first bitmap shown vertically is the pointer bitmap, which indicates the position where child pointers exist. In Figure 15.18, this bitmap is referred to as ptrbitarr. It shows that pointers exist for entries 000, 100, and 101. These pointers correspond to three subtries rooted at the entries 000, 100, and 101 in Figure 15.10. Now instead of storing explicit child pointers in a separate array as in the Lulea scheme, the tree bitmap node stores a pointer to the first child trie node as one of the fields in ptrblk. The second bitmap shown horizontally is the prefix bitmap. It stores a list of all the prefixes within the first 3 bits that belong to the node. This bitmap is different from the Lulea scheme because it has a bit assigned for all possible prefixes of 3 bits or less. The bitmap positions are assigned to the prefixes in the order of 1-bit prefixes followed by 2-bit prefixes and so on. A bit in the prefix bitmap is set if that prefix occurs within the trie node. As you can see in Figure 15.10, the the root node contains the prefixes P1, P3, P4 and P9. Hence, the bit positions corresponding to prefixes 0, 001, 1, and 111 are set in the prefix bitmap. The entire tree bitmap data structure for the fixed multibit trie in Figure 15.10 is shown in Figure 15.19.

Das könnte Ihnen auch gefallen