TwoQS is a deterministic queue management mechanism for IP routers that guarantees the delivery of in-profile (green) traffic while providing bounded queuing delay. Excess (yellow) traffic is allowed to opportunistically utilize unused network resources and is deterministically discarded only when necessary to preserve the guarantees offered to conformant traffic.
For a complete description of the architecture, algorithms, and performance evaluation, please refer to the accompanying paper:
TwoQS: A Two-Color Queuing Scheme for Green Traffic QoS Protection in IP Networks
.
├── cqs_files/ # Linux kernel queueing disciplines
│ └── iproute2_files/ # Traffic Control (tc) userspace extensions
├── VNX_scenario/ # Virtual testbed and experiment scenarios
│ ├── ExperimentA/
│ └── ExperimentB/
└── README.md
TwoQS has been developed and tested on Linux (Ubuntu is recommended).
Install the required system packages:
sudo apt update
sudo apt install \
build-essential \
linux-headers-$(uname -r) \
make \
gcc \
python3 \
python3-pip \
iproute2 \
tcpreplay \
tcpdumpInstall the required Python libraries:
pip3 install \
scapy==2.6.1 \
matplotlib==3.10.3 \
numpy==2.2.6 \
tikzplotlib==0.10.1The experimental scenarios require VNX (Virtual Networks over Linux).
Installation instructions are available at:
https://web.dit.upm.es/vnxwiki/index.php/Main_Page
The kernel modules are located in:
cqs_files/
Compile the modules:
cd cqs_files
make -C /lib/modules/$(uname -r)/build M=$PWD clean
make -C /lib/modules/$(uname -r)/build M=$PWD modulesLoad the generated kernel modules:
sudo insmod sch_bfifo_cc.ko
sudo insmod sch_cdrr.koTwoQS includes custom Traffic Control (tc) extensions that allow configuring the new queueing disciplines from userspace.
Clone the official iproute2 repository:
git clone https://git.kernel.org/pub/scm/network/iproute2/iproute2.gitCopy the TwoQS source files into the iproute2 source tree:
cp iproute2_files/*.c iproute2/tc/Load header files to the corresponding include/uapi/linux/ directory:
cp iproute2_files/tc_bfifo_cc.h iproute2/include/uapi/linux/Modify iproute2/tc/Makefile and add the new queueing discipline objects to the TCOBJ variable: q_bfifo_cc.o q_cdrr.o
Then build iproute2:
cd iproute2
./configure
makeThe newly built binary can be executed directly as:
./tc/tcTo replace the system-wide tc binary:
sudo cp ./tc/tc /usr/bin/tcAfter installation, the new queueing disciplines will be available through the standard tc command.
The complete experimental testbed is located in:
VNX_scenario/
Deploy the virtual topology:
cd VNX_scenario
sudo vnx -f scenario.xml -tConfigure the routers and marker element:
sudo vnx -f scenario.xml -x config_routersAfter these commands, the experimental environment is ready.
Two experimental scenarios are included with the repository.
cd VNX_scenario/ExperimentA
python3 traffic_gen.py
./run_experiments.shcd VNX_scenario/ExperimentB
python3 traffic_gen.py
./run_experiments.shIf you use TwoQS in your research, please cite:
TwoQS: A Two-Color Queuing Scheme for Green Traffic QoS Protection in IP Networks
This repository contains modifications and derivative works based on Linux kernel code licensed under the GNU General Public License v2.0 or later (GPL-2.0-or-later).
Accordingly, the source code in this repository is distributed under the terms of the GPL-2.0-or-later license.
See the LICENSE file for the complete license text.
Copyright (c) 2026 Aitor Encinas Alonso