Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

SRM Configuration Utility

A lightweight utility for configuring L4S Static Rate Management (SRM) using Linux Traffic Control (tc).

Please find the corresponding IETF SRM draft.

Usage

sudo ./config_srm.sh [OPTIONS]

Interfaces

--ing IFNAME
    Ingress interface

--egr IFNAME
    Egress interface

Bridge Mode

Enable Layer-2 forwarding between ingress and egress interfaces.

-b
--bridge

Common Options

--pir RATE
    Peak Information Rate

--cir RATE
    Committed Information Rate

--burst TIME
    Set PBS and CBS simultaneously

--shape RATE
    Configure emulated link rate using HTB

--qdisc OPTION
    Queue discipline (fq or pfifo or dualpi2)

--delay TIME
    Add one-way delay using IFB/netem

Direction-Specific Options

Ingress

--ing-pir RATE
--ing-pbs TIME
--ing-cir RATE
--ing-cbs TIME
--ing-shape RATE
--ing-qdisc OPTION
--ing-delay TIME

Egress

--egr-pir RATE
--egr-pbs TIME
--egr-cir RATE
--egr-cbs TIME
--egr-shape RATE
--egr-qdisc OPTION
--egr-delay TIME

Traffic Processing

Both IPv4 and IPv6 are supported.   SRM processing is applied only to L4S traffic, i.e. packets with ECN codepoints ECT(1) or CE.

Rate <= CIR
    Forward unchanged

CIR < Rate <= PIR
    Mark the ECN field as CE (11)

Rate > PIR
    Drop

Link Shaping

An HTB hierarchy is created to emulate a fixed-rate bottleneck link.

fq / pfifo Modes

HTB Root (Shape)
 |
 +-- Class 1:1
      |
      +-- Class 1:10 (prio 1)
      |
      +-- Class 1:11 (prio 2)

Both child classes share the configured shaping rate and borrow bandwidth from the parent HTB class.

dualpi2 Mode

HTB Root (Shape)
 |
 +-- Class 1:1
      |
      +-- dualpi2

When dualpi2 is selected, all traffic is directed to the DualPI2 queue discipline.

Queue discipline

fq / pfifo

L4S traffic (ECT(1) or CE)
    -> Class 1:10

Non-L4S traffic
    -> Class 1:11

Available queue disciplines:

  • pfifo : single FIFO queue
  • fq : per-flow fair queueing

dualpi2

When dualpi2 is selected, traffic classification and queue coupling are handled internally by the Linux DualPI2 implementation.

Supported Rate Units

bit
Kbit
Mbit
Gbit

bps
Kbps
Mbps
Gbps

Supported Time Units

us
ms
s

Clear Existing Configuration

sudo ./config_srm.sh --clear

Default Configuration

Ingress Interface : enp4s0
Egress Interface  : enp7s0

Ingress
  PIR     : 10Mbit
  PBS     : 4ms
  CIR     : 5Mbit
  CBS     : 4ms
  Shape   : 100Mbit
  Qdisc   : pfifo
  Delay   : 2ms

Egress
  PIR     : 10Mbit
  PBS     : 4ms
  CIR     : 5Mbit
  CBS     : 4ms
  Shape   : 100Mbit
  Qdisc   : pfifo
  Delay   : 2ms

NetworkManager

Interfaces are temporarily set as unmanaged to prevent NetworkManager from overwriting tc configuration.

Running --clear restores NetworkManager control.

Notes

  • Script must be executed as root.
  • Bridge mode is optional and disabled by default.
  • IPv4 and IPv6 are supported.
  • GRO/GSO/TSO are disabled on the interfaces.
  • IFB devices are used for ingress delay emulation.
  • CE marking is applied only to L4S traffic between CIR and PIR.
  • HTB is used to emulate a configurable bottleneck link rate.
    • Child HTB classes use a minimal guaranteed rate and borrow bandwidth from the configured shaping rate.
  • Queue disciplines supported: pfifo, fq, and dualpi2.
    • pfifo provides two aggregate FIFO queues.
    • fq provides per-flow queueing within each traffic class.
    • dualpi2 uses the Linux DualPI2 implementation for coupled L4S/Classic queue management.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages