https://github.com/dastergon/tc-panel
Geo-Distributed Infrastructure Emulation using Traffic Shaping
https://github.com/dastergon/tc-panel
emulation geo-distributed infrastructure traffic-control
Last synced: about 2 hours ago
JSON representation
Geo-Distributed Infrastructure Emulation using Traffic Shaping
- Host: GitHub
- URL: https://github.com/dastergon/tc-panel
- Owner: dastergon
- License: agpl-3.0
- Created: 2017-10-15T22:31:33.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T23:35:29.000Z (over 7 years ago)
- Last Synced: 2025-03-18T05:51:20.044Z (7 months ago)
- Topics: emulation, geo-distributed, infrastructure, traffic-control
- Language: Python
- Homepage:
- Size: 292 KB
- Stars: 12
- Watchers: 5
- Forks: 2
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Traffic Control Panel (TC Panel)
### About
The Traffic Control Panel also known as TC Panel, is a web application created for the purposes of
my MSc project. It provides a user-friendly interface where researchers and practitioners can design
their own network topologies and emulate them to a pre-existing infrastructure without buying extra
resources to create a real geo-distributed setting. The TC Panel creates an artificial geo-distributed
environment with a diverse range of network characteristics such as latency, bandwidth, packet loss
rate, packet corruption rate, which are afterwards translated into commands that configure the traffic
shaping to the physical machines and create an emulation ofWide Area Networks. The TC Panel is
written in Django, which is a Python web framework that adheres to the Model View Controller
architectural pattern. TC Panel is integrated at the programming level with Ansible, an automation
platform, that facilitates remote command execution, which is responsible for deploying the traffic
shaping characteristics to the machines.TC Panel leverages Linux kernel’s Traffic Control subsystem, in particular, its netem
functionality. NetEm offers parameters to add delay, bandwidth rate, packet loss and other
network characteristics to incoming and outgoing packets on a per-Network Interface Controller
(NIC) basis. It is built on top of the Quality Of Service (QoS) in the Linux kernel, which exposes a
low-level network traffic management interface. Due to its low overhead netem comes in handy for
testing and emulation of Wide Area Networks.The communication between Linux kernel’s subsystem and the userspace occurs through the `tc`
command line utility which is bundled in the iproute2 software package along with other networking
utilities. The tc utility is used to configure the Traffic Control interface in the Linux kernel.The raw ‘tc‘ rules are relatively difficult to create as the syntax is not very friendly and is susceptible to human error. To address that issue, an off-the-shelf wrapper named `tcconfig` is used so that it can be easy to debug and
extend the application at a higher level.### Prerequisites
Before proceeding you need to install the following dependencies:- Python 2.7+
- Django 1.10+
- Ansible 2.3+In addition you should have created an SSH key and your user should be created within the target Linux
system with the proper permissions. To allow your user execute commands with Ansible as root, which is
required for TC Panel your user should have passwordless sudo.### Installation Process (Manual)
In order to install and test the application locally, you need to execute the following sequence of commands.Go to the project folder:
cd /path/to/tc-panel
Copy the local_settings.py.sample sample to a regular file:
cp local_settings.py.sample local_settings.py
In the `/path/to/tc-panel/tc-panel/settings.py` the variable `ANSIBLE_INVENTORY` should be declared to the path that we want:
Example:
ANSIBLE_INVENTORY = "/path/to/hosts"
We can either use a pre-existing Ansible Inventory file or create one to specify all the parameters of the
project.Example of an Ansible Inventory file:
```
[all:vars]
ansible_user=foobaradmin
ansible_become=true
ansible_become_method=sudo
ansible_become_user=root
ansible_connection=ssh[namenodes]
vm1.example.com ansible_host=1.1.1.1 ansible_port=10021
vm2.example.com ansible_host=1.1.1.1 ansible_port=10022
```Install all necessary Python prerequisites:
pip install -r requirements.txt
Create database migrations:
python manage.py makemigrations
The following command applies the migrations:
python manage.py migrate
In order to load various testing fixtures(control_panel/fixtures) into the database, execute the following command:
python manage.py loaddata
To start the server, within the root directory of the project, execute:
python manage.py runserver
Fetch host information:
python manage.py runjobs hourly
Or add it to a cron job by adding the following entry:
@hourly /path/to/my/project/manage.py runjobs hourly
### Authors
* Pavlos Ratis