From 7961b68852febc72c970b54bd7953459f9998e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 12 Mar 2018 17:46:54 +0100 Subject: [PATCH] chg: Update readme --- README.md | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/README.md b/README.md index f57188b..fa1b94d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,94 @@ # BGP-Ranking New version of BGP Ranking, complete rewrite in python3.6+ and an ARDB backend + +# Directory structure + +*Config files*: `listimport / modules_config / *.json` + +*Per-module parsers*: `listimport / parsers` + +*Libraries* : `listimport / libs` + +# Raw dataset directory structure + +## Files to import + +` / / ` + +## Last modified date (if possible) and lock file + +` / / / meta` + +## Imported files less than 2 months old + +` / / / archive` + +## Imported files more than 2 months old + +` / / / archive / deep` + +# Databases + +## Intake (redis, port 6379) + +*Usage*: All the modules push their entries in this database. + +Creates the following hashes: + +```python +UUID = {'ip': , 'source': , 'datetime': } +``` + +Creates a set `intake` for further processing containing all the UUIDs. + + +## Pre-Insert (redis, port 6380) + + +*Usage*: Make sure th IPs are global, validate input from the intake module. + +Pop UUIDs from `intake`, get the hashes with that key + +Creates the following hashes: + +```python +UUID = {'ip': , 'source': , 'datetime': , 'date': } +``` + +Creates a set `to_insert` for further processing containing all the UUIDs. + +Creates a set `for_ris_lookup` to lookup on the RIS database. Contains all the IPs. + +## Routing Information Service cache (redis, port 6381) + +*Usage*: Lookup IPs against the RIPE's RIS database + +Pop IPs from `for_ris_lookup`. + +Creates the following hashes: + +```python +IP = {'asn': , 'prefix': , 'description': } +``` + + +## Long term storage (ardb, port 16379) + +*Usage*: Stores the IPs with the required meta informations required for ranking. + +Pop UUIDs from `to_insert`, get the hashes with that key + +Use the IP from that hash to get the RIS informations. + +Creates the following sets: + +```python +# All the sources, by day +|sources = set([, ...]) +# All the ASNs by source, by day +| -> set([, ...]) +# All the prefixes, by ASN, by source, by day +|| -> set([, ...]) +# All the tuples (ip, datetime), by prefixes, by ASN, by source, by day +||| -> set([|, ...]) +```