Diploma Thesis, Thomas Rieder
The goal of this thesis is to analyze peerings on the Internet. Peerings affect how fast content can be delivered to users. Deliberately deferred peerings can therefore severely impact that useability of certain services for end users. We want to shine some light on who is peering with whom and more importantly who could be peering with whom.
The original Peering Monitoring Dashboard was hosted for the duration of about one year at https://peering.rieder.io. Afterwards I shut down the server and decided to make all results and the thesis itself publically available:
The best way to reproduce the results, is to simply setup the peering dashboard yourself. I hosted my servers at Digitalocean, so this is what this guide is tested on. I suggest using a minimum of 2 cores / 2 GB RAM.
# this guide is based on Ubuntu 16.04.1
# make sure your system is up-to-date
apt update && apt dist-upgrade -y
# install postgres, create a default database & user (you can change the password)
apt install -y postgresql
su postgres << EOF
createdb ripeatlas
psql -c "CREATE USER ripeatlas WITH PASSWORD 'ripeatlas';"
psql -c "GRANT ALL PRIVILEGES ON DATABASE ripeatlas TO ripeatlas;"
EOF
# increase the maximum number of connections
sed -i 's/max_connections = 100/max_connections = 1000/g' /etc/postgresql/9.5/main/postgresql.conf
/etc/init.d/postgresql restart
# install rabbitmq and enable the web-ui
apt install -y rabbitmq-server
echo "[{rabbit, [{loopback_users, []}]}]." > /etc/rabbitmq/rabbitmq.config
service rabbitmq-server restart
rabbitmq-plugins enable rabbitmq_management
# install pgloader
apt install -y pgloader postgresql-9.5-ip4r unzip zip
su postgres << EOF
psql -c "GRANT ALL PRIVILEGES ON DATABASE ripeatlas TO postgres;"
psql -d ripeatlas -c "CREATE EXTENSION if not exists ip4r;"
EOF
# download the measurment results (i.e. the postgresql dump) and restore it
wget https://rieder.io/peering/dl/ripe-atlas-results.zip
unzip ripe-atlas-results.zip
cp ripeatlas.sql /tmp && cd /tmp
su postgres
psql -d ripeatlas < ripeatlas.sql
exit
cd ~
# download the source code
wget https://rieder.io/peering/dl/ripe-atlas-src.zip
unzip ripe-atlas-src.zip
cd ripeatlas
# load aux postgresql tables (this takes a few minutes)
cd misc
# if you changed the database password before, you need to adapt the two *.load files
pgloader asn.load
pgloader geoip.load
cd ..
# for a development setup it is sufficient to start all processes in the foreground (use tmux)
# for a production grade setup you probablly want service wrapper for everything
apt install -y python3-pip libpq-dev python-dev libffi-dev
pip3 install --upgrade pip
pip3 install -r requirements.txt
# you can find working list of versions here
# if you changed any of the passwords, adapt shared/globals.py
# you also need to add your ripe / digitalocean API keys to shared/globals.py
# run the api gateway (new shell)
cd gateway
python3 gateway.py
# run the backend (new shell)
python3 run.py
# run the dashboard
cd dashboard
apt install -y nodejs npm
# workaround for the debian node/nodejs problem
ln -s /usr/bin/nodejs /usr/bin/node
npm install
# this only binds to 127.0.0.1:8080
npm start
# to access it from your own machine:
ssh -l root myserver -L8080:127.0.0.1:8080 -L5000:127.0.0.1:5000
# --> point your browser to http://localhost:8080
# as a good starting point you can look at the measurements from 2016-05 to 2016-08
# this is not a fully-fledged production grade setup
# if you want to make it publically available on the Internet, be sure to harden the server
# * reverse proxy
# * webpack production build
# * run processes as unpriviledged users (systemd services)
# * firewall
# * ...