Skip to content

COMSYS/xPrio

Repository files navigation

xPrio Framework

xPrio is a reinforcement learning-based resource prioritization approach combining crosslayer signals from browser and transport layer into resource priorities. This repo contains our simulation, training and evaluation code.

Publication

  • Constantin Sander, Ike Kunze, Hendrik Buschbaum and Klaus Wehrle: xPrio: Crosslayer Web Resource Prioritization at Runtime. Proc. ACM Netw. 4, CoNEXT2, Article 27 (June 2026), 16 pages. https://doi.org/10.1145/3808675

If you use any portion of our work, please consider citing our publication.

@article{2026-sander-xprio,
   title = {{xPrio: Crosslayer Web Resource Prioritization at Runtime}},
   year = {2026},
   issue_date = {June 2026},
   publisher = {Association for Computing Machinery},
   volume = {4},
   number = {CoNEXT2},
   articleno = {27},
   numpages = {16},
   journal = {Proc. ACM Netw.},
   DOI = {https://doi.org/10.1145/3808675},
   author = {Sander, Constantin and Kunze, Ike and Buschbaum, Hendrik and Wehrle, Klaus}
}

Using our Code

Building ns-3 Simulation

  1. Clone ns-3 3.41
git clone https://github.com/nsnam/ns-3-dev-git
cd ns-3-dev-git
git checkout 2209a5abd18be77c6c865c837368b4e459ae7c8e
  1. Clone xPrio into ns-3 scratch folder and build dependencies
git clone --recursive https://www.github.com/COMSYS/xPrio
./xPrio/simulation/build_deps.sh
  1. Clone, patch and install ns3-gym in contrib folder
git clone https://github.com/tkn-tub/ns3-gym.git ./opengym
cd opengym/
git checkout 6007f4b3811af0cffcacf9a6151e5b9d2f4ef3ae
git apply ../../scratch/xPrio/simulation/ns3gym.patch
pip3 install --user ./model/ns3gym
  1. Build
./ns3 configure
./ns3 build xPrio

Building and Install Testbed

  1. Check out Chromium in browsertime/docker/chromium according to https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md
  2. Apply our tracing and reuse patch on commit 91ad1c4f1b187a13b6189ea80b20a5b642143bbf
git checkout 91ad1c4f1b187a13b6189ea80b20a5b642143bbf
git apply ../../chromium.patch
  1. Build Chromium according to https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md
  2. Build adapted Browsertime container in browsertime/docker/
./build.sh
  1. Build go_fastcgi server in go_fastcgi
./build.sh
  1. Build h2o in h2o
mkdir build
cd build
cmake -DWITH_MRUBY=OFF ..
make install

Build and Install Adapted Pillow for Schedule Processing

git clone https://github.com/python-pillow/Pillow
cd Pillow
git checkout 9b4fae77178e827ab17118fbc89c739ffd6a0fab
git apply ../trace_to_schedule/pillow.patch
python3 -m pip install .

Creating Simulation Schedules

  1. Record mahimahi websites via https://github.com/worenga/mitmproxy2mahimahi
  2. Adapt configs/snapshots.json for websites
  3. Run inference on websites
python3 inference.py <namespacename> --eval configs/snapshots.json
  1. Run trace processing
python3 trace_to_schedule.py output/<browsertimeresult>

Training on Simulation

  1. Adapt config/model.json and config/schedules.json to your websites
python3 train.py --configfile configs/model.json

Logs and model weights can be found under results/logs and results/experiences

Evaluating Model on Testbed

  1. Adapt configs/test.json according to your websites
python3 inference.py <namespacename> --eval configs/test.json

About

Reinforcement learning-based resource prioritization approach using runtime-available crosslayer information

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors