Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Traffic Shaping with HTB and SFQ: How QoS Actually Works on Linux

DEV Community·ZeroTrust Architect·21 days ago
#cytGV2uo
Reading 0:00
15s threshold

Quality of Service on Linux is implemented via the kernel's traffic control subsystem ( tc ), part of the iproute2 package. Understanding how it works requires understanding queuing disciplines (qdiscs), classes, and filters — and how they compose into a traffic shaping hierarchy. The tc architecture Every network interface has a root qdisc attached. By default this is pfifo_fast — a simple three-band priority queue. Traffic shaping replaces this with a classful qdisc that can divide bandwidth across traffic classes. # Attach HTB root qdisc to eth0 tc qdisc add dev eth0 root handle 1: htb default 30 # Create parent class (total bandwidth ceiling) tc class add dev eth0 parent 1: classid 1:1 htb rate 100mbit # High-priority class: VoIP and video (guaranteed 20mbit, burst to 100mbit) tc class add dev eth0 parent 1:1 classid 1:10 htb rate 20mbit ceil 100mbit prio 1 # Normal traffic class (guaranteed 70mbit) tc class add dev eth0 parent 1:1 classid 1:20 htb rate 70mbit ceil 100mbit prio 2 # Bulk/background class…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More