Production-grade guide to edge bandwidth management covering architecture patterns, implementation strategies, testing approaches, and operational best practices for enterprise engineering teams.
Edge bandwidth management is the practice of dynamically allocating, monitoring, and optimizing network capacity at the edge of the network—where data originates, processes, and consumes. It matters when devices at the edge, such as IoT sensors, AR/VR headsets, or autonomous vehicle fleets, generate high-volume, time-sensitive data that must be efficiently transported to and from the core or cloud. Bandwidth is constrained, expensive, and often variable, so effective management ensures low latency, reduced cost, and reliable service under load.
Traffic at the edge is rarely uniform. A mix of real-time video streams, periodic telemetry, and sporadic control commands must coexist on limited uplink and downlink pipes. Quality of Service (QoS) policies are the first tool to shape this traffic.
Configure Linux traffic control (tc) rules on edge routers or gateways to classify packets using DSCP or 802.1p tags. Use tc qdisc and tc filter commands with precise ingress and egress configurations.
# Set up root HTB qdisc for hierarchical bandwidth allocation
tc qdisc add dev eth0 root handle 1: htb default 10
# Create classes: video (highest priority), control, telemetry, bulk
tc class add dev eth0 parent 1: handle 1: htb rate 100mbit ceil 100mbit
tc class add dev eth0 parent 1: handle 10: htb rate 50mbit ceil 100mbit prio 1
tc class add dev eth0 parent 1: handle 20: htb rate 20mbit ceil 50mbit prio 2
tc class add dev eth0 parent 1: handle 30: htb rate 5mbit ceil 20mbit prio 3
tc class add dev eth0 parent 1: handle 40: htb rate 1mbit ceil 5mbit prio 4
# Map DSCP values to classes
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \
match ip dscp 0x2e 0xff \
flowid 1:10 # video (DSCP 46 = EF)
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 \
match ip dscp 0x1e 0xff \
flowid 1:20 # control (DSCP 30 = AF4)
tc filter add dev eth0 parent 1: protocol ip prio 3 u32 \
match ip dscp 0x0c 0xff \
flowid 1:30 # telemetry (DSCP 12 = AF1)
tc filter add dev eth0 parent 1: protocol ip prio 4 u32 \
match ip dscp 0x00 0xff \
flowid 1:40 # bulk (DSCP 0 = BE)
The critical failure mode: DSCP values are not consistently applied upstream. A camera stream may set DSCP 46, but the edge switch uses 802.1p priority only, resulting in no class mapping. The solution: enable DSCP-to-802.1p mapping on edge switches and verify with tcpdump -i eth0 -nn -s0 -c10 -v.
s1u and gtpu header fields.Edge bandwidth is rarely static. 5G links fluctuate due to mobility, interference, and congestion. Static QoS policies fail under dynamic conditions.
Use wondershaper to dynamically shape bandwidth based on real-time measurements.
# Install wondershaper
git clone https://github.com/magnifico/wondershaper.git
cd wondershaper && sudo make install
# Set up initial shaping for a 20 Mbps uplink with 5 Mbps downlink
sudo wondershaper -a eth0 20480 5120
# Monitor bandwidth with iperf3 and adjust on-the-fly
iperf3 -c 10.10.10.1 -t 30 -i 1 -u -b 10M -l 1280 -P 4
When bandwidth drops below 15 Mbps, reduce video stream resolution and lower bitrate. Trigger this with a custom script that reads wondershaper stats and adjusts tc rules.
#!/bin/bash
# edge-bandwidth-shaper.sh
interface="eth0"
target_down=15000 # kbps
current_down=$(cat /sys/class/net/$interface/queues/tx_0/rx_bytes | awk '{print $1}' | tail -1)
if (( $(echo "$current_down < $target_down" | bc -l) )); then
echo "Bandwidth below threshold; reducing video quality"
# Adjust tc for video class to 25 Mbps
tc class change dev $interface parent 1: handle 10: htb rate 25mbit ceil 50mbit
# Send signal to video service to downscale
curl -X POST http://video-service:8080/api/v1/resize -d '{"quality": "720p"}'
fi
The key insight: bandwidth shaping is not just about limiting rates—it’s about feedback control. Use ping with jitter and loss to detect bufferbloat, and apply active queue management (AQM) with FQ-CoDel.
# Enable FQ-CoDel on edge interface
tc qdisc add dev eth0 root handle 1: fq_codel
Silent failure: Using fq_codel but forgetting to set quantum and target for the edge’s RTT.
tc qdisc add dev eth0 root handle 1: fq_codel \
quantum 1518 \
target 10000us \
interval 100000us \
memory_limit 10000000
The default target of 10ms is often too aggressive for edge networks with 50–150ms RTT. Set target to 50–100ms to avoid thrashing.
Edge devices produce bursty traffic—e.g., a warehouse robot uploads a 100 MB point cloud every 30 seconds. Without throttling, bursty flows saturate the edge link.
Use token bucket filters in tc to limit bursty traffic.
# Create a token bucket filter for point cloud uploads
tc qdisc add dev eth0 parent 1:10 handle 100: tbf \
rate 10mbit burst 100kbit latency 100ms
Configure token bucket parameters carefully:
rate: sustained bandwidth (e.g., 10 Mbps).burst: maximum burst size (e.g., 100 KB).latency: minimum time to empty the bucket (e.g., 100 ms).Critical mistake: setting burst too low. A 100 MB upload takes 80 seconds at 10 Mbps, but with burst=50kbit, the first 50 KB of data are sent immediately, then the flow is throttled, causing initial latency spikes and underutilization.
Use tbf with rate and burst in kilobits, but latency in milliseconds—a common point of confusion.
Edge-specific failure: using tbf (token bucket) but expecting it to behave like a leaky bucket. The solution: combine tbf with sfq (Stochastic Fairness Queueing) for fairness across flows.
tc qdisc add dev eth0 parent 1:10 handle 100: tbf rate 10mbit burst 100kbit latency 100ms
tc qdisc add dev eth0 parent 100: handle 101: sfq
AR/VR headsets and autonomous vehicles require predictable, low-latency bandwidth. Use traffic shaping with time-based scheduling.
Configure Hierarchical Token Bucket (HTB) with time-based class selection.
# Define time slots for traffic classes
tc qdisc add dev eth0 root handle 1: htb default 10
tc class add dev eth0 parent 1: handle 1: htb rate 100mbit
tc class add dev eth0 parent 1: handle 10: htb rate 20mbit ceil 40mbit prio 1
tc class add dev eth0 parent 1: handle 20: htb rate 10mbit ceil 20mbit prio 2
tc class add dev eth0 parent 1: handle 30: htb rate 5mbit ceil 10mbit prio 3
# Add time-based filter for AR/VR frames
tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \
match ip dscp 0x2e 0xff \
flowid 1:10
tc filter add dev eth0 parent 1: protocol ip prio 2 u32 \
match ip dscp 0x1e 0xff \
flowid 1:20
tc filter add dev eth0 parent 1: protocol ip prio 3 u32 \
match ip dscp 0x0c 0xff \
flowid 1:30
For AR/VR, bandwidth must be reserved per frame. Use Per-Stream Traffic Shaping via DSCP and sequence numbers.
// In edge processing node
void process_ar_frame(uint8_t* frame, size_t len, uint32_t seq_num) {
uint32_t dscp = 0x2e; // EF (46)
uint32_t stream_id = 1000;
// Set DSCP and mark packet with stream ID
set_dscp(frame, dscp);
set_stream_id(frame, stream_id);
set_sequence_number(frame, seq_num);
// Send over UDP
sendto(udp_socket, frame, len, 0, &dest, sizeof(dest));
// Apply per-stream shaping
tc_class_add(eth0, stream_id, rate=15mbit, burst=200kbit);
}
Silent failure: stream IDs are not preserved across network hops. An edge gateway reshapes traffic but loses stream_id due to lack of header compression or segmentation.
Edge-specific failure: a streaming video service uses Flow ID for QoS but does not map Flow ID to Stream ID for per-stream shaping. Result: a 4K video stream is shaped as a single flow, but frame-level timing is lost.
Monitor edge bandwidth with detailed metrics collected via Prometheus and Grafana.
Use bandwidth-monitor, a custom tool that samples tc statistics every 5 seconds.
# prometheus.yml
scrape_configs:
- job_name: 'edge-bandwidth'
static_configs:
- targets: ['edge-gateway:9090']
metrics_path: '/metrics'
relabel_configs:
- source_labels: [__address__]
target_label: instance
Expose metrics via textfile collector:
# /var/lib/prometheus/textfile/edge-bandwidth.prom
# HELP edge_bandwidth_total_bytes Total bytes sent on edge interface
# TYPE edge_bandwidth_total_bytes gauge
edge_bandwidth_total_bytes{interface="eth0"} 1234567890
edge_bandwidth_total_bytes{interface="wlan0"} 987654321
# HELP edge_bandwidth_qdisc_dropped_packets Number of packets dropped by tc qdisc
# TYPE edge_bandwidth_qdisc_dropped_packets gauge
edge_bandwidth_qdisc_dropped_packets{qdisc="fq_codel"} 456
edge_bandwidth_qdisc_dropped_packets{qdisc="tbf"} 123
Critical diagnostic command: tc -s -d qdisc show dev eth0
Output includes:
qdisc fq_codel: packets, bytes, dropped, ecn_marked, backlog, quantum, target, intervalqdisc tbf: rate, burst, latency, bytes, packets, overlimits, dormantError text to watch for:
tc: qdisc tbf: no memory for qdisc
tc: qdisc fq_codel: flow 1000: no memory for flow
tc: qdisc: failed to add filter: No such file or directory
Silent failure: tc rules not persisted across reboots. Use tc save and tc restore.
# Save configuration
sudo tc save dev eth0 > /etc/tc/edge-config.tc
# Restore on boot
sudo tc restore < /etc/tc/edge-config.tc
Use systemd service to ensure tc rules are applied at boot.
# /etc/systemd/system/tc-restore.service
[Unit]
Description=Restore tc qdiscs
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/tc restore < /etc/tc/edge-config.tc
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
fq_codel with target=50000us and quantum=1518 for RTT-optimized queuing.wondershaper and tc feedback loops.tbf and tune burst to match expected data size.tc -s -d and Prometheus metrics.tc rules using tc save/restore.tc error text and tcpdump traces.Bandwidth management at the edge is not a one-time setup—it is a continuous, adaptive process. The moment you stop tuning, your edge devices begin to starve.
This page was rewritten on 10 October 2026. It replaced a templated version whose text was largely shared with other pages in this section and was not specific to its own title. The new text was drafted with a locally run language model, checked by a separate reviewer model for specificity and for invented figures, and measured against its sibling pages for duplication before publication. If anything here is wrong, tell us at [email protected] and we will correct it.
We use cookies for analytics (Google Analytics) and advertising (Google AdSense) to improve your experience and support free content. Privacy Policy