Skip to content

mahlashrifi/Multibit_Trie_Manager

Repository files navigation

Multibit Trie Manager

This project is the first project for the Network Device Course at AUT, undertaken in Fall 2023. With this tool, you can efficiently create, visualize, update, and search within a multibit trie using various configurations.

Introduction

The Multibit Trie revolutionizes IP address lookup with its efficient organization and lightning-fast search capabilities. By breaking down IP addresses into manageable bits within a trie structure, it optimizes routing tables and networking devices, ensuring rapid and precise navigation through hierarchical architecture. Its versatility extends beyond networking to various applications requiring efficient key-based data retrieval.

Multibit trie structure

The Multibit Trie is an advanced version of the binary trie, enabling each node to have more than two children based on the address bit division, known as the stride. For example, with a stride of 2, each node can accommodate up to 4 children. This structure results in a more compact trie. However, this advantage requires a more complex data structure for each child node. Examples of Multibit Trie with different strides can be found here

Trie vs. Tree

A general-purpose tree can store any data type—numbers, strings, objects, whereas a trie is specifically used for storing sequences, like strings or arrays.

How to Use the tool

For visualization, the Graphviz tool has been utilized. Before running the application, you need to download this tool from here, then use pip install Graphviz for installation.

Upon running the application, you will encounter the following menu:

menu

  1. Set Configuration: Here, you can set the base and stride of the trie. Base input options include binary, decimal, and hexadecimal.

  2. Read File: Input nodes can be obtained from a file. For example, you can find a file which is based on hexadecimal here.

  3. Insert: Add a new IP address to the trie. Insert menu example

    • Prefix: Prefix of the IP address (host).
    • Length: Number of meaningful digits in the set base.
    • Next Hop: Next hop of corresponding prefix.
  4. Visualize: Display the result of your trie. After using this command, you can add nodes to your trie again.

  5. Print: Show the trie by printing its information.

  6. Lookup: Find a prefix in the trie (IP address lookup). It will return the next hop for the entered prefix and the time it took to find the next hop. Lookup result example

  7. Finish: Terminate execution.

Suggestion: When using the insert command, it is advisable to first write the entries in a file and then enter them all at once. This practice makes it easier to identify any issues with the trie. For example, refer to example.txt designed for drawing the trie described in the project definition.

Trie

Screenshots

Results of trie creation and visualization for the project definition example with different strides:

  • Stride = 1
  • Stride = 2
  • Stride = 4
  • Stride = 8

The printed result of this example exists in the Result folder.

About

A Tool for Efficient IP Address Lookup Management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages