Projects

FerrousIP

Application

High-performance IP intelligence lookup for modern web infrastructure.

FerrousIP lets applications and web servers resolve metadata for IP addresses - country, subnet, ASN, and related network information - with sub-microsecond core lookups.

It ships no data. You provide your own sources, keeping full control over accuracy and compliance. Fully self-hosted: no external dependencies, no API keys, no subscriptions, no vendor lock-in.

Written in Rust and licensed under AGPL-3.0-or-later.

Features

  • Fast - sub-microsecond core lookups, multithreaded request handling.
  • IPv4 and IPv6 - full support for both.
  • Rich metadata - country, subnet, ASN, and network information.
  • Memory-efficient - compressed trie (radix-like) structure.
  • Multiple interfaces - UNIX socket, HTTP API, and CLI.
  • PHP client included - for direct integration in web applications.
  • Self-hosted - bring your own data source; nothing leaves your machine.

Performance

FerrousIP is optimized for low latency and high throughput. In most deployments it is faster than the surrounding application stack - lookup time is rarely the bottleneck. Most latency comes from socket/TCP communication, JSON parsing, and application-layer overhead.

Scenario Latency
Core lookup, IPv4 (hot cache) ~30-60 ns
Core lookup, IPv6 (hot cache) ~3-6 ns
In-process lookup ~800 ns - 1.4 us
UNIX socket (existing connection) ~50 us
UNIX socket (connection setup) ~100 us
PHP integration (end-to-end) ~150 us
Cold start up to ~250 us

Architecture

  • Compressed trie (radix-like) structure for IP range matching
  • Cache-efficient memory layout
  • Multithreaded request handling via Tokio and Actix Web
  • Lightweight daemon design

Data flow

+---------------+     +---------------+     +-----------------+
| Data Source   |---->| Parser        |---->| Compressed Trie |
| (user         |     | (pluggable)   |     |                 |
|  provided)    |     |               |     |                 |
+---------------+     +---------------+     +--------+--------+
                                                     |
                                +--------------------+--------------------+
                                |                    |                    |
                          +-----v-----+       +------v------+      +------v------+
                          | HTTP API  |       | UNIX Socket |      | CLI Lookup  |
                          +-----------+       +-------------+      +-------------+

Interfaces

Interface Use case Performance
UNIX socket High-performance server integration ~50 us
HTTP API Easy integration, remote access Depends on network
CLI Manual lookups, scripting Fast

HTTP API

curl http://localhost:8080/api/v1/query?q=8.8.8.8
{
  "query": "8.8.8.8",
  "ip_version": 4,
  "result": {
    "network": "8.8.8.0",
    "length": 24,
    "country": "US",
    "registry": "arin",
    "autonomous_system": {
      "number": 15169,
      "country": "US",
      "registry": "arin",
      "name": ""
    },
    "bogon": false
  }
}

UNIX socket

echo "8.8.8.8" | socat - UNIX-CONNECT:/run/ferrousip/ferrousip.sock

PHP integration

The included PHP client communicates over the UNIX socket for maximum performance:

$client = new FerrousIP("/run/ferrousip/ferrousip.sock");
$result = $client->lookup("8.8.8.8");

echo $result["country"];   // "US"
echo $result["asn"];       // 15169

Data sources

FerrousIP does not ship with any data - you provide your own. Custom sources can be supported by implementing a new parser.

Format Description
merged-stat NRO delegated statistics (merged from all RIRs)

License

FerrousIP is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).

Copyright (C) 2026 Dauren Bakimbayev.

Disclaimer

FerrousIP does not include or distribute any data. Users are responsible for providing their own data sources and ensuring compliance with applicable terms.

FerrousIP makes no guarantees regarding the accuracy, completeness, or reliability of lookup results. Do not use it as the sole basis for security-critical decisions such as access control or regulatory compliance.

This software is provided "as is", without warranty of any kind. The authors accept no liability for any damages arising from its use. See LICENSE for details.