Research project for simulating Content Steering in DASH streaming with multiple decision strategies, controlled non-stationary scenarios, and an automated analysis pipeline.
This repository implements:
- A Flask steering service with strategies:
epsilon_greedyucb1d_ucblinucb(contextual bandit)oracle_best_choicerandomno_steering
- A dynamic latency oracle with:
- geographic impact (distance/proximity)
- temporal jitter
- latency events (shock/spam)
- route/network variation and movement smoothing
- 3 simulated cache servers in containers (Caddy) with local HTTPS
- Manual execution (browser + player) and automated batch execution (
run_scenarios.py) - Analysis pipeline for log aggregation and graph generation
streaming-service/: Docker cache services (3 nodes)steering-service/: Flask API + RL strategies + latency oracleclient/: web interface to run browser simulationsanalysis/: aggregation and graph scriptsrun_scenarios.py: scenario-based experiment orchestrator
You can use this project in two ways:
- Run locally on Linux (your own environment)
- Run inside the provided VM (dataset already included)
- Linux
- Python 3.10+
- Docker + Docker Compose plugin (
docker compose) mkcert- Modern web browser
Optional (recommended):
- Your user in the
dockergroup to avoid usingsudoin all Docker commands.
Download the dataset from:
Then place the dataset folder at the project root, like this:
./dataset/Eldorado/4sec/avc/manifest.mpd
At the project root:
python -m pip install --upgrade pip
python -m pip install -r steering-service/requirements.txtVM download link:
Important note:
- The code inside the VM may be outdated.
- The correct flow is to clone the current repository version and reuse the dataset already present in the VM.
Recommended steps inside the VM:
cd ~/Documents
git clone https://github.com/alissonpef/Content-Steering content-steeringNow move/copy the existing dataset folder from the VM into the new clone. Common example:
cp -r ~/Documents/content-steering-tutorial/dataset ~/Documents/content-steering/Then enter the new project and install dependencies:
cd ~/Documents/content-steering
python -m pip install --upgrade pip
python -m pip install -r steering-service/requirements.txtImportant for both scenarios:
- Containers mount
../datasetinto/srvthroughstreaming-service/docker-compose.yml. - If
datasetis not in the active repository root, the caches start but cannot serve media.
At the project root:
./create_certs.shThis script generates certificates for:
video-streaming-cache-1video-streaming-cache-2video-streaming-cache-3steering-service
At the project root:
./starting_streaming.shThe script:
- starts the 3 cache containers
- detects container IP addresses
- updates
/etc/hostswith cache hosts andsteering-service
To stop:
./stop_streaming.shUse 2 terminals.
At the project root:
python3 steering-service/src/app.py --strategy linucbOther available strategies:
python3 steering-service/src/app.py --strategy d_ucb
python3 steering-service/src/app.py --strategy ucb1
python3 steering-service/src/app.py --strategy epsilon_greedy
python3 steering-service/src/app.py --strategy oracle_best_choice
python3 steering-service/src/app.py --strategy random
python3 steering-service/src/app.py --strategy no_steeringUseful options:
-vor--verbosefor detailed logs--log_suffix <suffix>to distinguish logs
At the project root:
python3 -m http.server 8001Open in browser:
http://127.0.0.1:8001/client/index.html
The run_scenarios.py script runs combinations of strategy × scenario × repetition.
Current scenarios:
- Baseline (static)
- Mobility (spatial movement)
- Latency Shock / Spam (temporal event)
Example (run everything, 1 repetition per combination):
python3 run_scenarios.pyAdditional examples:
python3 run_scenarios.py --strategies linucb d_ucb ucb1 --runs 3
python3 run_scenarios.py --scenarios 1 2 --runs 2
python3 run_scenarios.py --skip-analysis
python3 run_scenarios.py --skip-dockerLog output by scenario:
logs/raw/baseline/logs/raw/mobility/logs/raw/spam/
Example (baseline):
python3 analysis/aggregate_logs.py linucb --input_dir logs/raw/baseline --output_dir logs/processedpython3 analysis/plotting/generate_graphs.py logs/raw/baseline/log_linucb_1.csvpython3 analysis/plotting/generate_aggregated_graphs.py logs/processed/log_linucb_average.csvpython3 analysis/plotting/generate_boxplots.pypython3 analysis/plotting/generate_compare_graphs.pypython3 analysis/analyze_server_choices.pyResults are saved in results/ and processed logs in logs/processed/.
Content-steering/
├── client/
├── dataset/
├── logs/
│ ├── raw/
│ │ ├── baseline/
│ │ ├── mobility/
│ │ └── spam/
│ └── processed/
├── analysis/
├── steering-service/
├── streaming-service/
└── run_scenarios.py
- Caches start but video does not load: verify
dataset/is at the project root. - Hostname/certificate error: run
./create_certs.shand./starting_streaming.shagain. - Docker permission denied: adjust Docker user permissions or run Docker commands with
sudo. - No module named ...: reinstall
requirements.txt.
Demo video: