InternetHealthReport / internet-yellow-pages

A knowledge graph for the Internet
https://iyp.iijlab.net
GNU General Public License v3.0
43 stars 18 forks source link
bgp database internet ip knowledge-graph neo4j python

Internet Yellow Pages

The Internet Yellow Pages (IYP) is a knowledge database that gathers information about Internet resources (for example ASNs, IP prefixes, and domain names).

Public IYP prototype

Visit https://iyp.iijlab.net to try our online prototype. You will find instructions on how to connect to the prototype and some example queries there. For even more examples, check out the IYP gallery.

Deploy a local IYP instance

We describe the basic process of deploying a local IYP instance below. For more advanced commands see the database documentation.

Prerequisites

Download the database dump

Visit the database dump repository.

Dumps are organized by year, month, and day in this format:

https://ihr-archive.iijlab.net/ihr/iyp/YYYY/MM/DD/iyp-YYYY-MM-DD.dump

Replace YYYY, MM, and DD in the URL with the desired date to access a specific database dump.

The dump file needs to be called neo4j.dump and needs to be put in a folder called dumps (dumps/neo4j.dump). To create the folder and download a dump with curl:

mkdir dumps
curl https://ihr-archive.iijlab.net/ihr/iyp/YYYY/MM/DD/iyp-YYYY-MM-DD.dump -o dumps/neo4j.dump

Set up IYP

To uncompress the dump and start the database run the following command:

mkdir -p data
UID="$(id -u)" GID="$(id -g)" docker compose --profile local up

This creates a data directory containing the database, load the database dump, and start the local IYP instance. This initial setup needs be done only once but it takes some time to completely load the database and start IYP. Please wait until IYP is fully loaded. Also this step won't work if the data directory already contains a database.

This setup keeps the database instance running in the foreground. It can be stopped with Ctrl+C. Afterwards, you can simply start/stop IYP in the background to use it. To update the database with a new dump see Update existing database.

Start/Stop IYP

To start the database, run the following command:

docker start iyp

To stop the database, run the following command:

docker stop iyp

Query the database

Open http://localhost:7474 in your favorite browser. To connect the interface to the database give the default login and password: neo4j and password respectively. Then enter your query in the top input field.

For example, this finds the IXPs and corresponding country codes where IIJ (AS2497) is:

MATCH (iij:AS {asn:2497})-[:MEMBER_OF]-(ix:IXP)--(cc:Country)
RETURN iij, ix, cc

Countries of IXPs where AS2497 is present

IYP gallery

See more query examples in IYP gallery

Contributing

Want to propose a new dataset or implement a crawler? Checkout the documentation for more info.

Changelog

See: https://github.com/InternetHealthReport/internet-yellow-pages/releases

External links