Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nlnetlabs/try-tries-and-trees
https://github.com/nlnetlabs/try-tries-and-trees
routing-algorithm rust tree-structure trie-tree
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nlnetlabs/try-tries-and-trees
- Owner: NLnetLabs
- License: bsd-3-clause
- Created: 2021-03-03T15:15:17.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-12-09T16:35:59.000Z (about 2 years ago)
- Last Synced: 2024-05-01T10:25:32.422Z (8 months ago)
- Topics: routing-algorithm, rust, tree-structure, trie-tree
- Language: Rust
- Homepage:
- Size: 14.1 MB
- Stars: 19
- Watchers: 17
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 `## 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.