Skip to content

qvest-digital/sch_jens

Repository files navigation

This is a patched version of iproute2 with support for sch_janz,
by Deutsche Telekom LLCTO.

Example:

dev=eth0
rate=1000
sudo tc qdisc add dev $dev root handle 1: janz rate ${rate}kbit

# Invoke jensdmp in its directory:
cd /usr/share/doc/iproute2/examples
javac -d obj JensReaderDemo.java JensReaderLib.java
sudo java -cp obj de.telekom.llcto.jens.reader.JensReaderDemo \
    eth0 /sys/kernel/debug/sch_janz/0001:0
# -or- just this, in the source tree
cd jens && make run if=eth0
# -or- (without Java™ example)
sudo /usr/libexec/jensdmp /sys/kernel/debug/sch_janz/0001:0

sudo tc -s qdisc show dev $dev
sudo tc -s -j qdisc show dev $dev | jq .

sudo tc qdisc del dev $dev root

The debugging filesystem must be mounted for jensdmp:

	$ sudo mount -t debugfs debugfs /sys/kernel/debug

This can also be achieved with an /etc/fstab line as follows:

	debugfs    /sys/kernel/debug  debugfs  defaults  0  0

Trigger a handover simulation:

dev=eth0
rate=1000
sudo tc qdisc change dev $dev handle 1: janz rate ${rate}kbit handover 2000ms

It will return to the given bandwidth once the handover period is over.

────────────────────────────────────────────────────────────────────────

sch_multijens example:

#!/bin/mksh
set -x
dev=eth1
rate=128
if [[ $1 = 1 ]]; then
	sudo iptables -t mangle -A OUTPUT -o $dev -p tcp -j MARK --set-mark 2
	sudo iptables -t mangle -A OUTPUT -o $dev -p udp -j MARK --set-mark 2
	sudo ip6tables -t mangle -A OUTPUT -o $dev -p tcp -j MARK --set-mark 1
	sudo ip6tables -t mangle -A OUTPUT -o $dev -p udp -j MARK --set-mark 1
	sudo tc qdisc add dev $dev root handle 1: multijens uenum 8 rate ${rate}kbit
	if [[ -n $STY ]]; then
		screen -t UE#0 sudo /usr/libexec/jensdmp /sys/kernel/debug/sch_multijens/0001-00:0
		screen -t UE#1 sudo /usr/libexec/jensdmp /sys/kernel/debug/sch_multijens/0001-01:0
		screen -t UE#2 sudo /usr/libexec/jensdmp /sys/kernel/debug/sch_multijens/0001-02:0
	fi
elif [[ $1 = 0 ]]; then
	sudo tc qdisc del dev $dev root
	sudo ip6tables -t mangle -D OUTPUT -o $dev -p udp -j MARK --set-mark 1
	sudo ip6tables -t mangle -D OUTPUT -o $dev -p tcp -j MARK --set-mark 1
	sudo iptables -t mangle -D OUTPUT -o $dev -p udp -j MARK --set-mark 2
	sudo iptables -t mangle -D OUTPUT -o $dev -p tcp -j MARK --set-mark 2
elif [[ $1 = s ]]; then
	sudo tc -s qdisc show dev $dev
elif [[ $1 = j ]]; then
	sudo tc -s -j qdisc show dev $dev | jq .
else
	echo >&2 'E: ./qmb {1|0|s|j}'
fi

# This splits things up in Legacy IP (UE#2), IP (UE#1) and rest (UE#0).
# The rest is, for example, ping (both v4/v6), ARP, IPv6 ND, …

────────────────────────────────────────────────────────────────────────

This is a set of utilities for Linux networking.

Information:
    https://wiki.linuxfoundation.org/networking/iproute2

Download:
    http://www.kernel.org/pub/linux/utils/net/iproute2/

Stable version repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2.git

Development repository:
    git://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git

How to compile this.
--------------------
1. libdbm

arpd needs to have the berkeleydb development libraries. For Debian
users this is the package with a name like libdbX.X-dev.
DBM_INCLUDE points to the directory with db_185.h which
is the include file used by arpd to get to the old format Berkeley
database routines.  Often this is in the db-devel package.

2. make

The makefile will automatically build a config.mk file which
contains definitions of libraries that may or may not be available
on the system such as: ATM, ELF, MNL, and SELINUX.

3. To make documentation, cd to doc/ directory , then
   look at start of Makefile and set correct values for
   PAGESIZE=a4		, ie: a4 , letter ...	(string)
   PAGESPERPAGE=2	, ie: 1 , 2 ...		(numeric)
   and make there. It assumes, that latex, dvips and psnup
   are in your path.

4. This package includes matching sanitized kernel headers because
   the build environment may not have up to date versions. See Makefile
   if you have special requirements and need to point at different
   kernel include files.

Stephen Hemminger
stephen@networkplumber.org

Alexey Kuznetsov
kuznet@ms2.inr.ac.ru

About

tc scheduler based on sch_fq_codel that behaves closer to the E/// PoC scenario

Resources

License

Stars

Watchers

Forks

Packages

No packages published