Giter Site home page Giter Site logo

try-tries-and-trees's Introduction

try-tries-and-trees

This is the experimental research Tries and Trees IP Lookup repository.

Currently we have for you:

  • A simple binary Trie. It can be run by invoking cargo run --release --example simpletrie, cargo run --release --example trie4 for a IPv4 trie and cargo run --release --example trie6.
  • A Treebitmap, can be run likewise: cargo run --release --example bittreemap.

There are also two very crude REPL examples, that take csv files as input:

  • cargo run --release --example load_csv_treebitmap -- ./data/uniq_pfx_asn.csv for the Treebitmap and
  • cargo run --release --example load_csv -- ./data/uniq_pfx_asn.csv for the simple trie.

The ./data/uniq_pfx_asn.csv is derived from a RisWHOIS file and thus approximates a full table.

On the REPL the only thing you can do is: s <PREFIX/LEN>

Treebitmap

The new() constructor of both treebitmaps takes an vec with strides. You can specify a full stride vec, like so: vec![6, 6, 6, 4, 4] or by specifying a vec like so vec![8]. It will fill up with 8 untill it reaches the requested number of bits (32 for IPv3, 128 for IPv6).

Possible stride sizes are 3,4,5,6,7,8

There are two treebitmaps, one that stores prefixes internally in the tree (a vec per node) and a treebitmap that stores it in a global Vec.

Benchmarks

ex.: cargo test --release tests::csv_test_treebitmap::test -- --show-output --test-threads=1

Do not forget ---release, otherwise it will panic, because the timer will overflow!

Enjoy.

try-tries-and-trees's People

Contributors

density215 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

try-tries-and-trees's Issues

Add license

Hi NLnetLabs folks! Really appreciate your efforts on tackling the fundamental problems of networking (as always)! Could you consider adding a license to this repository so that we can potential expand on what you have worked on? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.