https://github.com/oxidecomputer/poptrie
A poptrie implementation
https://github.com/oxidecomputer/poptrie
Last synced: 4 months ago
JSON representation
A poptrie implementation
- Host: GitHub
- URL: https://github.com/oxidecomputer/poptrie
- Owner: oxidecomputer
- License: mpl-2.0
- Created: 2023-07-07T05:33:04.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-04T04:03:08.000Z (over 2 years ago)
- Last Synced: 2025-02-10T00:58:01.521Z (over 1 year ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 18
- Watchers: 23
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Poptrie
A poptrie is a data structure and set of algorithms for performing longest
prefix match of an IP address over a set of IP prefixes. Its primary use is
implementing routing tables.
Poptrie was created by Asai and Ohara in:
> Asai, Hirochika, and Yasuhiro Ohara. "Poptrie: A compressed trie with
> population count for fast and scalable software IP routing table lookup."
> ACM SIGCOMM Computer Communication Review 45.4 (2015): 57-70.
This is a dependency free `no_std` implementation to facilitate use in OS
kernels.
Performance analysis versus a naive LPM table is the following for a single
lookup. The naive lookup scales linearly and quickly exceeds the realm of
acceptable performance for data plane networking while the poptrie has near
constant scaling.
```
┌────────┬─────────┬────────┬─────────┐
│ Routes │ Poptrie │ Naive │ Speedup │
├────────┼─────────┼────────┼─────────┤
│ 100 │ 5.9 ns │ 426 ns │ 72x │
├────────┼─────────┼────────┼─────────┤
│ 1,000 │ 5.9 ns │ 4.9 µs │ 830x │
├────────┼─────────┼────────┼─────────┤
│ 10,000 │ 10.3 ns │ 32 µs │ 3,100x │
└────────┴─────────┴────────┴─────────┘
````