Questions tagged [tc]

Tc is used to configure Traffic Control in the Linux kernel.

Filter by
Sorted by
Tagged with
0 votes
1 answer
54 views

How to deterministically vary the delay in programs like netem?

I am trying to set up a network scenario in which there is a variable delay between two nodes. Netem allows to set up a fixed delay and add a jitter according to some probabilistic distribution. ...
1 vote
2 answers
3k views

How do I verify the parameters set using tc command?

I am in need of simulating a high latency and low bandwidth connection for a performance test of my application. I have gone through a number of pages describing the tc command. But, I haven't been ...
0 votes
0 answers
23 views

How to exclude a subnet from TC qdisc rule?

I need to add an artificial delay to outgoing traffic from my server's eth0 interface using the Linux command tc (Traffic Control). I would like to add such a delay to all packets except those ...
2 votes
1 answer
2k views

Using qdisc prio under htb class

I have 2 services, both operate over the same interface. Service A goal is keep high bandwidth while sending massive amount of data. Service B goal is low latency. Service B packets should always ...
1 vote
1 answer
112 views

Traffic shaping ineffective on tun device

I am developing a tunnel application that will provide a low-latency, variable bandwidth link. This will be operating in a system that requires traffic prioritization. However, while traffic towards ...
4 votes
1 answer
7k views

Is it possible to throttle upload bandwidth per `IP` basis using `tc`, `htb` and `iptables` ? (Download limitation not required)

Problem I've searched internet like anything but couldn't find much about limiting upload. The solutions given are not limiting IP basis like this one but LAN as a whole. +-----+ +------...
0 votes
0 answers
19 views

Can tc or nftables change the SA/TA in 802.11 frame?

I am looking for a way to change the SA/TA on a Wi-Fi frame. I need this because I have a VM (running with QEMU and vmnet-bridged) in a MacBook that connects to a Wi-Fi interface, and a laptop ...
0 votes
0 answers
45 views

Traffic control - bandwidth and jitter colidation for Quic

I am currently experimenting with the Quic and TCP protocols, aiming to simulate real network conditions using TC. However, I encountered an issue when attempting to set the bandwidth to 32mbit, with ...
0 votes
0 answers
189 views

Controlling udp traffic with linux tc command

Setup: A client laptop (mac) connected to a Wi-Fi router wirelessly (atheros NIC with dd-wrt firmware). A server (linux) is directly connected to the router over ethernet interface. Now I am testing ...
0 votes
0 answers
35 views

How can I delete just one queue in htb?

I would like to delete just one queue in htb when having two. My script would be the following one: TC=/sbin/tc IF=wlan0 # Interface DNLD=1mbit # DOWNLOAD Limit UPLD=1mbit ...
0 votes
2 answers
190 views

Can netfilter act as a DHCP relay?

I'm wondering whether instead of using a DHCP relay netfilter (be that tc or nftables) can be used to route DHCP broadcast packets to a Docker container attached to a bridge. The reasoning for this is ...
0 votes
0 answers
49 views

Changing packet payload with tc

How can tc be used to match a particular payload of an ingress packet, e.g., if the first 32 bits of payload of an IP/UDP packet are equal to some constant $c, the value $c should be changed to $d? ...
1 vote
1 answer
150 views

MAC address rewriting using tc

I am using tc to change the MAC address of incoming packets on a TAP interface (tap0) as follows where mac_org is the MAC address of a guest in a QEMU virtual machine and mac_new is a different MAC ...
1 vote
1 answer
401 views

Redirect port using TC BPF

I'm want to use TC BPF to redirect incoming traffic from port 80 to port 8080. Below is my own code, but I've also tried the example from man 8 tc-bpf (search for 8080) and I get the same result. #...
1 vote
0 answers
205 views

How to set bandwidth limit using linux tc

In my linux router: interface eth1 total bandwidth is 1gbit I want to divide 1140kbit to GroupA, divide 150kbit to GroupB Set users 10.10.10.158, 10.10.21.5, 10.10.21.6 to GroupB Each user has no ...
0 votes
0 answers
118 views

can i use class and classless qdisc together while using EDT(mq-fq)

i just want to classify tcp and udp packet with filter while using EDT(mq-fq with clsact(direct-action bpf)) because of implement of EDT for using skb->tstamp as packet departure time, fq qdisc ...
0 votes
0 answers
45 views

eBPF program, how to obtain net_device from tc through __sk_buff?

eBPF program, how to obtain net_device from tc through __sk_buff? u32 ifindex = skb->ifindex I can get the ifindex, but how do I convert it to the net_device structure?
0 votes
0 answers
45 views

How can I set different bandwidth limits for multiple terminals using linux tc?

How to set different speed for different terminals? In my case: Total bandwidth is 100Mbits/s. No more than 100 terminals. I want each terminal use no more than 2Mbits/s or 3Mbits/s bindwidth I have ...
0 votes
0 answers
93 views

tc filter action tunnel_key unset to terminate a GENEVE UDP tunnel

I want to terminate a GENEVE UDP tunnel coming from an AWS Gateway load balancer which is mirroring traffic. The idea is to decap the packet into its original form. sudo tc qdisc add dev eth0 handle ...
0 votes
0 answers
39 views

Can no longer ping containers after setting TBF qdisc on Docker0

I am trying to use the tc command to manipulate traffic on the docker0 interface. I run the commands tc qdisc del dev docker0 root tc qdisc add dev docker0 root handle 1: tbf rate 100mbps burst 1600 ...
1 vote
0 answers
567 views

tc filter - error talking to the kernel

I am trying to add a tc flower filter for the geneve protocol and I am getting this error: % sudo tc filter add dev gnv0 protocol ip parent ffff: \ flower geneve_opts 0108:01:020000000000000000/...
0 votes
0 answers
126 views

Impairing ingress traffic with TC on Docker without using IFB

my understanding of Linux networking is rudimentary, but I'm hoping someone can at least point me in the right direction. A common technique for impairing ingress traffic with Linux Traffic Control is ...
0 votes
0 answers
291 views

How to determine which qdiscs a NIC can support?

I am currently trying to test out ETF qdisc scheduler. I am attempting to replace the current qdisc $ tc qdisc show dev em1 qdisc pfifo_fast 0: root refcnt 2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 ...
0 votes
0 answers
242 views

how to use mq's many class queues

mq has many class at default, and it can be attached using qdisc but mq is classless qdisc, so i cant attach filter at mq how can i decided mq's classes decision or classify that many class. tc qdisc ...
1 vote
1 answer
368 views

How to police ingress (input) packets belonging to a cgroup with iptables and tc?

I am trying to limit the download (ingress) rate for a certain app within a cgroup. I was able to limit the upload (egress) rate successfully by marking app's OUTPUT packets in iptables and then set a ...
0 votes
0 answers
367 views

router command to change bandwidth limit for a MAC address

I use DD-WRT to limit WAN bandwidth to one MAC address using DD-WRT's web interface. The key entry in the web interface (in "NAT/QoS" tab's "QOS" tab) is "MAC priority", ...
1 vote
1 answer
1k views

Monitoring packet loss simulated with tc

I found an interesting article that describes how to simulate network issues (like lost packets) on a linux server. On an Ubuntu test VM, I checked which interface is used for internet connectivity, ...
0 votes
0 answers
723 views

How to limit Wireguard bandwidth

I have Debian 11 server with installed Wireguard with wg0 interface and 3 peers. Server bandwidth speed is 100 MBit and traffic is around 500 GB per month. What I need is: these 3 peers can use 100 GB/...
0 votes
0 answers
233 views

When using ipvlan l3, I can't filter packets with iptables

My general intention is to run hypervisor instances in separate network namespaces. I have something that looks promising, but as I dug into trying to make things work with iptables, I found some ...
1 vote
1 answer
632 views

Using tc netem for dynamic delay variations causes packet loss

I'm trying to use tc netem to simulate a short [0.5, 1.5] second increase in delay in the range [0, 1500ms]. This is done with the command: sudo tc qdisc add dev enp37s0 root netem delay 200ms The ...
4 votes
1 answer
467 views

Why does tc-netem on loopback also affects other interfaces?

I'm trying to modify the network behaviour of my server(s), to simulate external/WAN connection behaviours (what ever that means). After doing tc qdisc add dev lo root netem delay 100ms, I can ...
2 votes
1 answer
1k views

Error when trying to corrupt packets in linux terminal (netem)

The following rule corrupts 5% of the packets by introducing a single bit error at a random offset in the packet: sudo tc qdisc change dev ens8 root netem corrupt 5% But recently it gave me the ...
2 votes
0 answers
127 views

How can I perform the same traffic shaping on all transmit queues

I'm trying to use the mq qdisc for performance but I need to add other qdiscs below it to shape traffic. It seems natural to me that one would want the same shaping, regardless of queue and it seems ...
4 votes
0 answers
2k views

How can I limit bandwidth per connection using tc?

I am pretty new to Linux and tc command and lately I have been looking for a solution to limit bandwidth per connection using the tc command. I have a server application that handles requests from ...
1 vote
0 answers
228 views

Add extra latency on top of existing tc qdiscs

On a system with an existing multi-stage qdisc setup, we need to introduce extra latency (at least fixed, but fixed with a small variation would be a nice option to have). The canonical way to do this ...
0 votes
1 answer
536 views

Setting the throughput with TC QDISC affects TCP but no UDP

I am new to tc qdisc and I have been creating a script to change throughput, delay and losses. However, when I try to change the throughput levels I only see an effect on TCP traffic and not on the ...
0 votes
0 answers
758 views

Illegal "match" error when applying Linux tc, u32 filters mask

I want apply the following rules for TOS based traffic shaping. All rules works but the final rule which mask the IP header shows illegal "match" error sudo tc qdisc del dev tun0 root handle ...
1 vote
1 answer
3k views

How to delay traffic and limit bandwidth at the same time with tc (Traffic Control)?

I want to throttle bandwidth and add delay to a network interface to simulate satellite communication. For example 800ms delay and 1mb/s. The following limits the bandwidth correctly but does not ...
0 votes
0 answers
429 views

tc traffic shaping with HTB and CQB causes packet transmission gap inconsistencies

I am sorry if this is duplicate of https://serverfault.com/q/1076769/822163. I created that first and then realized the Linux and Unix stack exchange is the right place. Problem: When the tc HTB or ...
0 votes
0 answers
38 views

Constrain bandwidth on a network interface

I want to limit bandwidth on the wlp2s0 network interface of my laptop. As far as I understood tc, it should be the tool to go. So I tried the following: tc qdisc add dev wlp2s0 root handle 1: htb ...
0 votes
0 answers
345 views

qdisc netem is adding too much delay

I'm running the following command in order to simulate delay + jitter on a veth pair (Mininet). sudo tc qdisc add dev h1-eth0 root netem delay 100ms 5ms When only specifying a 100ms (without the 5ms ...
1 vote
1 answer
2k views

can I use multiple qdiscs per device?

Can I add multiple qdiscs to the same device with tc, or is it only possible to use one qdisc per device? Also, can a qdisc contain child qdiscs, or only child classes? i.e. is it possible to do tc ...
5 votes
2 answers
2k views

Unwanted defragmentation of forwarded ipv4 packets

I want to handle ip fragments in user-space, and I am using the iptables NF_QUEUE to direct packets to user-space. The problem is that IPv4 packets are always re-assembled and delivered as one packet ...
0 votes
0 answers
36 views

Linux Traffic Control (tc) - Enforces Only Average Bandwidth Usage or Also Prevents Spikes

I would like to "level off" bandwidth spikes coming out of Kubernetes pod. Setting Linux tc to 10MB enforces average usage of 10MB or also prevent spikes of over 10MB? Is tc the way to ...
2 votes
1 answer
2k views

Can TC rules persist beyond a reboot? Where?

I am trying to determine whether rules put in place using tc persist beyond a reboot (I do not believe they do by default), and whether there is any way to cause them to persist, or if the best you ...
4 votes
1 answer
2k views

Traffic shaping with tc does not work

I want to limit the outgoing traffic to a specific bandwidth. My Code: tc qdisc add dev vif1.0 root handle 1: htb default 30 tc class add dev vif1.0 parent 1: classid 1:1 htb rate 1mbit tc class add ...
0 votes
0 answers
2k views

Linux tc filter add - errors RTNETLINK answers: Operation not supported

I'm working on the network simulation to create some traffic on specific ports , and trying to inject the network delay. I'm using the linux tc utility to do this operations. So i'm new to the tc ...
1 vote
0 answers
41 views

set asymmetric bandwidth on an interface

I'm coding a simple application using docker-compose and docker networks (images based on ubuntu). One of my services is a client with a network interface given from docker. All my services are on my ...
-1 votes
1 answer
2k views

Installing wondershaper on Debian 10

# apt-get install wondershaper # wondershaper wlan0 24000 16000 Now what?! How can I tell if it's running? How can I get it to start automatically after a reboot? (And configure it.) None of the ...
1 vote
1 answer
742 views

Forcefully enable fq_pie

I am very interested in setting up fq_pie queue discipline for TCP congestion control. If I write net.core.default_qdisc = fq_pie to /etc/sysctl.d/90-override.conf, it should enable fq_pie on latest ...