All Projects → hroi → treebitmap

hroi / treebitmap

Licence: MIT license
Fast IP lookup table for IPv4/IPv6 prefixes

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to treebitmap

PHP-IPAddress
IP Address utility classes for PHP
Stars: ✭ 63 (-22.22%)
Mutual labels:  ipv6, ipv4
python-iptools
A few useful functions and objects for manipulating ip addresses in python.
Stars: ✭ 68 (-16.05%)
Mutual labels:  ipv6, ipv4
TFTPServer
Managed TFTP server implementation, written in C#. Features: IPv4 and IPv6, blocksize, single port mode, windowed mode, unlimited transfers, MIT licensed
Stars: ✭ 28 (-65.43%)
Mutual labels:  ipv6, ipv4
ipv6calc
ipv6calc
Stars: ✭ 33 (-59.26%)
Mutual labels:  ipv6, ipv4
net-protocol
golang模拟内核协议栈 实现链路层、网络层、传输层、应用层 用户态协议栈 ,基于虚拟网卡TUN/TAP
Stars: ✭ 129 (+59.26%)
Mutual labels:  ipv6, ipv4
ENet-CSharp
A improved fork of ENet, a tried and true networking library. C, C++, C# compatible.
Stars: ✭ 65 (-19.75%)
Mutual labels:  ipv6, ipv4
hphr
Halophile Router (a VyOS-based, SaltStack-automated, NetBox-configured router for small provider networks)
Stars: ✭ 39 (-51.85%)
Mutual labels:  ipv6, ipv4
sync hosts
解除Resilio Sync/BTSync限制china地区 镜像:https://coding.net/u/renerli/p/sync_hosts/git
Stars: ✭ 15 (-81.48%)
Mutual labels:  ipv6, ipv4
php-ip-anonymizer
IP address anonymizer library for PHP
Stars: ✭ 55 (-32.1%)
Mutual labels:  ipv6, ipv4
IP2Location-C-Library
IP2Location C library enables the user to find the country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather station code, weather station name, mobile, usage types, etc that any IP address or hostname originates from.
Stars: ✭ 37 (-54.32%)
Mutual labels:  ipv6, ipv4
masscanned
Let's be scanned. A low-interaction honeypot focused on network scanners and bots. It integrates very well with IVRE to build a self-hosted alternative to GreyNoise.
Stars: ✭ 50 (-38.27%)
Mutual labels:  ipv6, ipv4
ip2location-nginx
Nginx module that allows user to lookup for geolocation information using IP2Location database.
Stars: ✭ 33 (-59.26%)
Mutual labels:  ipv6, ipv4
captcp
A open source program for TCP analysis of PCAP files
Stars: ✭ 110 (+35.8%)
Mutual labels:  ipv6, ipv4
zx-ip-address
Deprecated
Stars: ✭ 96 (+18.52%)
Mutual labels:  ipv6, ipv4
python-string-utils
A handy Python library to validate, manipulate and generate strings
Stars: ✭ 47 (-41.98%)
Mutual labels:  ipv6, ipv4
SixIndicator
SixIndicator is a WebExtension Plugin which indicates via an icon, if you are viewing the website with IPv6 or IPv4.
Stars: ✭ 17 (-79.01%)
Mutual labels:  ipv6, ipv4
ip-finder-cli
The official command line client for IPFinder
Stars: ✭ 11 (-86.42%)
Mutual labels:  ipv6, ipv4
is-localhost-ip
Checks whether given host/DNS name or IPv4/IPv6 address belongs to the local machine
Stars: ✭ 19 (-76.54%)
Mutual labels:  ipv6, ipv4
accomplist
ACCOMPLIST - List Compiler
Stars: ✭ 51 (-37.04%)
Mutual labels:  ipv6, ipv4
tracetrout
A magical reverse traceroute HTTP(S) server
Stars: ✭ 48 (-40.74%)
Mutual labels:  ipv6, ipv4

Tree-Bitmap: Fast lookup table for IPv4/IPv6 prefixes

This crate provides a datastructure for fast IP address lookups. It aims at fast lookup times, and a reasonable memory footprint.

The internal datastructure is based on the Tree-bitmap algorithm described by W. Eatherton, Z. Dittia, G. Varghes.

Documentation

Rustdoc: https://docs.rs/treebitmap/

Illustration

An example illustration of a trie representing a routing table containing 0.0.0.0/0 (foo), 10.0.0.0/8 (bar), 172.16.0.0/12 (baz) and 192.168.0.0/16 (quux).

rfc1918 trie illustration

Internal trie datastructure basics

Node encodes result and child node pointers in a bitmap.

A trie node can encode up to 31 results when acting as an "end node", or 15 results and 16 children/subtrees when acting as a normal/internal node.

Each bit in the bitmap indicates a bit matching pattern:

bit 0 1 2 3 4 5 6 7
match * 0* 1* 00* 01* 10* 11* 000*
bit 8 9 10 11 12 13 14 15
match 001* 010* 011* 100* 101* 110* 111* endnode-bit

The last bit here does not indicate a pattern. It instead indicates if this node is an "end node". End nodes carry double the amount of results but can't encode any child pointers.

bit 16 17 18 19 20 21 22 23
match 0000* 0001* 0010* 0011* 0100* 0101* 0110* 0111*
bit 24 25 26 27 28 29 30 31
match 1000* 1001* 1010* 1011* 1100* 1101* 1110* 1111*

The location of the result value is computed by adding the result_ptr base pointer and its position among set bits.

If the endnode bit is not set, the last 16 bits encodes pointers to child nodes. If bit N is set it means that a child node with segment value N is present. The pointer to the child node is then computed by adding the child_ptr base pointer and its position among set bits.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].