route-origin-validator
Offline Internet route origin validation using RPKI, IRR, and RIRs delegated databases
This python library is designed for validating a large number of routes in one shot. It downloads IRR, RPKI, and delegated databases to avoid network overhead for each query.
Installation
pip install rov
Usage:
Both the command line and python interfaces return status codes for each data source. For IRR and RPKI the possible status codes are:
- NotFound
- Invalid
- Invalid,more-specific
- Valid
For delegated we expect globally reachable resources to be 'assigned'. Resources that are 'reserved' and 'available' should be considered as bogons.
Command line
The command line interface should be used only for a few queries, each query will reload all databases.
>> rov 8.8.8.0/24 15169
{
"query": {
"prefix": "8.8.8.0/24",
"asn": 15169
},
"irr": {
"status": "Valid",
"prefix": "8.8.8.0/24",
"descr": "Google",
"source": "RADB"
},
"rpki": {
"status": "Valid",
"prefix": "8.8.8.0/24",
"maxLength": 24,
"ta": "arin"
},
"delegated": {
"prefix": {
"status": "assigned",
"prefix": "8.0.0.0/9",
"date": "19921201",
"registry": "arin",
"country": "US"
},
"asn": {
"status": "assigned",
"registry": "arin"
}
}
}
>> rov 10.1.0.0/16 15169
{
"query": {
"prefix": "10.1.0.0/16",
"asn": "15169"
},
"irr": {
"status": "NotFound"
},
"rpki": {
"status": "NotFound"
},
"delegated": {
"prefix": {
"status": "reserved",
"prefix": "10.0.0.0/8",
"date": "19940301",
"registry": "iana",
"country": "ZZ"
},
"asn": {
"status": "assigned",
"registry": "arin"
}
}
}
Past RPKI data can also be queried. Currently this only works for RPKI, so the results mix past and recent data. In the following example, the rpki results are for 2018/10/01 but other results correspond to the exectution date.
>> rov 8.8.8.0/24 15169 --rpki_archive 2018/10/01
{
"query": {
"prefix": "8.8.8.0/24",
"asn": 15169
},
"irr": {
"status": "Valid",
"prefix": "8.8.8.0/24",
"descr": "Google",
"source": "RADB"
},
"rpki": {
"status": "NotFound"
},
"delegated": {
"prefix": {
"status": "assigned",
"prefix": "8.0.0.0/9",
"date": "19921201",
"registry": "arin",
"country": "US"
},
"asn": {
"status": "assigned",
"registry": "arin"
}
}
}
In python
For large batches use the python library as follows:
import json
from rov import ROV
# list of routes we want to validate
routes = [
['1.1.1.0/24', 13335],
['2.2.2.0/24', 3215],
['3.3.3.0/24', 16509],
['4.4.4.0/24', 198949],
['5.5.5.0/24', 6805],
]
rov = ROV()
# optional: download latest databases if needed
rov.download_databases()
# read databases, this may take a minute or so
rov.load_databases()
# this should be super fast
for prefix, asn in routes:
state = rov.check(prefix, asn)
print(prefix)
print(json.dumps(state, indent=4))
#1.1.1.0/24
#{
# "query": {
# "prefix": "1.1.1.0/24",
# "asn": 13335
# },
# "irr": {
# "status": "Valid",
# "prefix": "1.1.1.0/24",
# "descr": "APNIC Research and Development\n6 Cordelia St",
# "source": "APNIC"
# },
# "rpki": {
# "status": "Valid",
# "prefix": "1.1.1.0/24",
# "maxLength": 24,
# "ta": "apnic"
# },
# "delegated": {
# "prefix": {
# "status": "assigned",
# "prefix": "1.1.1.0/24",
# "date": "20110811",
# "registry": "apnic",
# "country": "AU"
# },
# "asn": {
# "status": "assigned",
# "registry": "arin"
# }
# }
#}
#2.2.2.0/24
#{
# "query": {
# "prefix": "2.2.2.0/24",
# "asn": 3215
# },
# "irr": {
# "status": "Invalid,more-specific",
# "prefix": "2.2.0.0/16",
# "descr": "France Telecom Orange",
# "source": "RIPE"
# },
# "rpki": {
# "status": "Invalid,more-specific",
# "prefix": "2.0.0.0/12",
# "maxLength": 17,
# "ta": "ripe"
# },
# "delegated": {
# "prefix": {
# "status": "assigned",
# "prefix": "2.0.0.0/12",
# "date": "20100712",
# "registry": "ripencc",
# "country": "FR"
# },
# "asn": {
# "status": "assigned",
# "registry": "ripencc"
# }
# }
#}
#3.3.3.0/24
#{
# "query": {
# "prefix": "3.3.3.0/24",
# "asn": 16509
# },
# "irr": {
# "status": "NotFound"
# },
# "rpki": {
# "status": "Valid",
# "prefix": "3.0.0.0/10",
# "maxLength": 24,
# "ta": "arin"
# },
# "delegated": {
# "prefix": {
# "status": "assigned",
# "prefix": "3.0.0.0/9",
# "date": "20171220",
# "registry": "arin",
# "country": "US"
# },
# "asn": {
# "status": "assigned",
# "registry": "arin"
# }
# }
#}
#4.4.4.0/24
#{
# "query": {
# "prefix": "4.4.4.0/24",
# "asn": 198949
# },
# "irr": {
# "status": "Valid",
# "prefix": "4.4.4.0/24",
# "descr": "dima_training",
# "source": "RADB"
# },
# "rpki": {
# "status": "NotFound"
# },
# "delegated": {
# "prefix": {
# "status": "assigned",
# "prefix": "4.0.0.0/9",
# "date": "19921201",
# "registry": "arin",
# "country": "US"
# },
# "asn": {
# "status": "assigned",
# "registry": "ripencc"
# }
# }
#}
#5.5.5.0/24
#{
# "query": {
# "prefix": "5.5.5.0/24",
# "asn": 6805
# },
# "irr": {
# "status": "Invalid,more-specific",
# "prefix": "5.4.0.0/14",
# "descr": "Telefonica Germany GmbH & Co. OHG",
# "source": "RIPE"
# },
# "rpki": {
# "status": "Invalid,more-specific",
# "prefix": "5.4.0.0/14",
# "maxLength": 14,
# "ta": "ripe"
# },
# "delegated": {
# "prefix": {
# "status": "assigned",
# "prefix": "5.4.0.0/14",
# "date": "20120425",
# "registry": "ripencc",
# "country": "DE"
# },
# "asn": {
# "status": "assigned",
# "registry": "ripencc"
# }
# }
#}
Acknowledgements
This project is supported by MANRS/ISOC, thanks!
Metadata
Release files for rov 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rov-0.6.0.tar.gz | 22.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rov-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.5 kB
Release files / rov-0.6.0.tar.gz
| Download URL | rov-0.6.0.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7033566029bdba95de63b39d1c5def57478d7c96c8d6531f9242c365e853ab9
|
|
BLAKE2b-256 checksum How to use checksums |
7a9fc8fadacb1a42711c4102c9bc9bce4ff62ba0cbc86300709c6d7e8e81d86f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2025.
Transparency logRelease files / rov-0.6.0-py3-none-any.whl
| Download URL | rov-0.6.0-py3-none-any.whl |
|---|---|
| Size | 20.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89c828a0126625fcec34c27ea9fd9e6e3b31485fbe043541935698ea91a40b02
|
|
BLAKE2b-256 checksum How to use checksums |
45f033c77346b9c4b010a9fb17da03362e88191fd73f03757dfa34ae3fe7c777
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2025.
Transparency logSecurity for rov 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for rov-0.6.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.