QoS Configuration
Configure per-subscriber traffic shaping with CAKE qdisc.
Overview
The qos section configures Quality of Service (QoS) via CAKE (Common Applications Kept Enhanced):
- Per-subscriber rate limiting (download and upload)
- Overhead profile adjustment for different encapsulations
- Ingress shaping via Intermediate Functional Block (IFB)
- Integration with RADIUS for dynamic rate changes
Configuration Options
enabled
Enable or disable QoS (optional).
qos:
enabled: true
Type: Boolean
Required: No
Default: false
Valid values: true, false
CLI:
abng# set qos enabled true
default_down
Default download rate for subscribers (optional).
qos:
default_down: "100mbit"
Type: String (bandwidth format)
Required: No
Default: None
Format: <number><unit> (e.g., "100mbit", "1gbit", "50kbit")
Valid units: kbit, mbit, gbit
CLI:
abng# set qos default_down "100mbit"
default_up
Default upload rate for subscribers (optional).
qos:
default_up: "40mbit"
Type: String (bandwidth format)
Required: No
Default: None
Format: <number><unit> (e.g., "40mbit", "1gbit", "10kbit")
Valid units: kbit, mbit, gbit
CLI:
abng# set qos default_up "40mbit"
default_overhead_profile
Default overhead profile for CAKE (optional).
qos:
default_overhead_profile: "pppoe_ethernet"
Type: String
Required: No
Default: "pppoe_ethernet"
Valid values: Key from overhead_profiles
Purpose: Adjusts CAKE overhead calculation for the encapsulation type.
CLI:
abng# set qos default_overhead_profile "pppoe_ethernet"
overhead_profiles
Custom overhead profiles for different encapsulations (optional).
qos:
overhead_profiles:
pppoe_ethernet:
overhead: 34
mpu: 64
ipoe_ethernet:
overhead: 22
mpu: 64
Profile Options
overhead
Overhead bytes for the encapsulation (required).
overhead_profiles:
pppoe_ethernet:
overhead: 34
Type: Integer
Required: Yes
Constraints: Non-negative integer
Calculation:
- PPPoE: 8 bytes (PPPoE header) + 2 bytes (PPP header) + 20 bytes (IP header) + 4 bytes (FCS) = 34 bytes
- IPoE: 14 bytes (Ethernet) + 4 bytes (FCS) + 4 bytes (VLAN) = 22 bytes
mpu
Minimum Packet Unit (optional).
overhead_profiles:
pppoe_ethernet:
mpu: 64
Type: Integer
Required: No
Default: 64
Constraints: Non-negative integer
Purpose: Minimum size for rate calculation (prevents underestimation of small packets).
Example Configurations
Minimal QoS Configuration
qos:
enabled: true
default_down: "100mbit"
default_up: "40mbit"
Uses default overhead profile (pppoe_ethernet).
Full QoS Configuration
qos:
enabled: true
default_down: "100mbit"
default_up: "40mbit"
default_overhead_profile: "pppoe_ethernet"
overhead_profiles:
pppoe_ethernet:
overhead: 34
mpu: 64
ipoe_ethernet:
overhead: 22
mpu: 64
pppoe_qinq:
overhead: 38
mpu: 64
Different Rates by Service
pppoe:
enabled: true
dhcp:
enabled: true
qos:
enabled: true
default_down: "100mbit"
default_up: "40mbit"
default_overhead_profile: "pppoe_ethernet"
overhead_profiles:
pppoe_ethernet:
overhead: 34
mpu: 64
ipoe_ethernet:
overhead: 22
mpu: 64
Configuration via CLI
Enable QoS
abng> configure
abng# set qos enabled true
abng# commit
Set Default Rates
abng# set qos default_down "100mbit"
abng# set qos default_up "40mbit"
abng# commit
Set Overhead Profile
abng# set qos default_overhead_profile "pppoe_ethernet"
abng# commit
Add Custom Overhead Profile
abng# set qos overhead_profiles custom_profile overhead 40
abng# set qos overhead_profiles custom_profile mpu 64
abng# commit
Verification
View QoS Configuration
abng> show configuration | match "^qos:"
qos:
enabled: true
default_down: 100mbit
default_up: 40mbit
default_overhead_profile: pppoe_ethernet
overhead_profiles:
pppoe_ethernet:
overhead: 34
mpu: 64
View QoS Status
abng> show qos
┌────┬──────────────────────┬──────────┬──────────┬──────────┐
│ ID │ Interface │ Down │ Up │ State │
├────┼──────────────────────┼──────────┼──────────┼──────────┤
│ 1 │ ppp0 │ 100Mbit │ 40Mbit │ Active │
│ 2 │ eth1.111.500.101 │ 50Mbit │ 20Mbit │ Active │
│ 3 │ eth1.111.500.102 │ 100Mbit │ 40Mbit │ Active │
└────┴──────────────────────┴──────────┴──────────┴──────────┘
Check CAKE Qdisc
tc qdisc show
qdisc cake 8001: dev ppp0 root refcnt 2 bandwidth 100Mbit diffserv4 ...
qdisc cake 8002: dev ifb-ppp0 root refcnt 2 bandwidth 100Mbit diffserv4 ...
Check abng-qos Logs
sudo journalctl -u abng-qos -f
Integration with RADIUS
QoS rates can be overridden per-subscriber via RADIUS:
radius:
servers:
- host: "10.255.0.10"
secret: "your-secret"
RADIUS attributes:
- Athena-Rate-Down — Download rate (e.g., "50mbit")
- Athena-Rate-Up — Upload rate (e.g., "20mbit")
RADIUS response example:
Athena-Rate-Down = "50mbit"
Athena-Rate-Up = "20mbit"
Overhead Profile Reference
PPPoE over Ethernet (Standard)
pppoe_ethernet:
overhead: 34
mpu: 64
Breakdown:
- Ethernet frame: 14 bytes (dst MAC 6 + src MAC 6 + type 2)
- PPPoE header: 6 bytes (version/type 1 + code 1 + session ID 2 + length 2)
- PPP header: 2 bytes (protocol 2)
- IP header: 20 bytes (minimum)
- FCS: 4 bytes (frame check sequence)
- Total: 46 bytes (rounded to 34 for typical usage)
IPoE over Ethernet
ipoe_ethernet:
overhead: 22
mpu: 64
Breakdown:
- Ethernet frame: 14 bytes
- VLAN tag: 4 bytes
- FCS: 4 bytes
- Total: 22 bytes
PPPoE over QinQ
pppoe_qinq:
overhead: 38
mpu: 64
Breakdown:
- Ethernet: 14 bytes
- Outer VLAN: 4 bytes
- Inner VLAN: 4 bytes
- PPPoE: 6 bytes
- PPP: 2 bytes
- IP: 20 bytes
- FCS: 4 bytes
- Total: 54 bytes (rounded to 38)
Validation Rules
| Field | Validation |
|---|---|
enabled | Boolean |
default_down | Valid bandwidth format (e.g., "100mbit") |
default_up | Valid bandwidth format (e.g., "40mbit") |
default_overhead_profile | Must exist in overhead_profiles |
overhead_profiles[].overhead | Non-negative integer |
overhead_profiles[].mpu | Non-negative integer |
Best Practices
- Default Rates — Set reasonable defaults for your subscriber base
- Overhead Profile — Match your actual encapsulation (PPPoE vs IPoE)
- RADIUS Override — Use RADIUS for per-subscriber rate customization
- Monitoring — Monitor CAKE qdisc stats for congestion
- Testing — Test with
iperfto verify rates - Ingress Shaping — Enable IFB for ingress (upload) shaping
- Documentation — Document your overhead calculations
Troubleshooting
QoS Not Applying
- Check QoS is enabled:
show configuration | match qos - Check CAKE qdisc exists:
tc qdisc show - Check abng-qos logs:
journalctl -u abng-qos -f - Check session is active:
show subscribers
Rates Not Matching Expected
- Check overhead profile:
show configuration | match overhead_profiles - Verify with
iperf:iperf -c <subscriber-ip> -t 10 - Check CAKE stats:
tc -s qdisc show dev ppp0 - Adjust overhead if needed
IFB Ingress Shaping Not Working
- Check IFB device exists:
ip link show | grep ifb - Check ingress qdisc:
tc qdisc show dev ifb-ppp0 - Check abng-qos logs:
journalctl -u abng-qos -f
Next Steps
- CGNAT Configuration — Carrier-Grade NAT
- Routing Configuration — BGP and OSPF
- Configuration Overview — All configuration sections