Questions tagged [tc]
TC is the linux tool used to manipulate the traffic control functionality in the kernel.
240
questions
23
votes
3
answers
44k
views
Tc: ingress policing and ifb mirroring
I'm trying to setup traffic shaping on a Linux gateway as written here. The script needs to be customized because I have multiple LAN interfaces. So to shape the LAN side I am planning to create a ifb ...
23
votes
4
answers
45k
views
Using tc to delay packets to only a single IP address
I am new to using tc and netem. I want to delay packets being sent to a specific IP address. However, the commands below cause all packets on the system to be delayed, instead of just to the IP ...
15
votes
3
answers
48k
views
Resetting a queue discipline back to the default pfifo_fast one?
I'm trying to temporarily set a rate-limited queue discipline and then remove it a bit later:
# /sbin/tc qdisc add dev eth1 root tbf rate 600kbit latency 50ms burst 1540
# /sbin/tc qdisc del dev eth1 ...
12
votes
5
answers
6k
views
tc u32 --- how to match L2 protocols in recent kernels?
I have a nice shaper, with hashed filtering, built at a linux bridge. In short, br0 connects external and internal physical interfaces, VLAN tagged packets are bridged "transparently" (I ...
12
votes
2
answers
3k
views
Linux TC class/filter numbering
I'm currently working on a traffic shaping solution for ISP-level companies, and came to an interesting (kindof philosophical) problem.
Looking about the number of endpoints the system should handle (...
9
votes
2
answers
22k
views
deleting filters in tc
I have added a filter in tc as follows:
tc filter add dev eth0 parent 1: protocol ip handle 6 fw flowid 1:6
This should be sending packets marked by iptables with '--set-mark 6' to class 1:6. The ...
7
votes
2
answers
4k
views
Traffic shaping: tc filter catch all filter
How Can I configure a "catch all" filter with tc filter?
I tested with the following code but it gave me the error: "Unknown filter "1:100", hence option "protocol" is unparsable":
tc filter add ...
7
votes
0
answers
921
views
How to limit bandwidth per VPN connection?
I have a StrongSwan (IKEv2) server setup and would like to limit each VPN connection to 512kb/s.
After researching I came across tc in Ubuntu. I don't quite understand it and am fighting through the ...
6
votes
3
answers
1k
views
Advanced dynamic routing with external program
I need to build a system in which i am able to route packets based on a number of parameters, such as port/protocol etc, which are somehow "normal", but also on other aspects, such as queue length, ...
6
votes
1
answer
5k
views
Network shaping using `tc netem` doesn't seem to work
I'm trying to simply delay traffic targeted for certain IP address on Ubuntu 16.06 box with no luck.
There are plenty of resources as this this this or this that I studied.
I ended up with these two ...
5
votes
1
answer
23k
views
Linux Traffic Control: qdisc mq
On my Linux system I see this:
# ip link list
....
2: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT qlen 1000
....
What's qdisc mq? In http://lartc.org/lartc....
5
votes
1
answer
18k
views
Debian7 and tc qdisc issue : RTNETLINK answers: No such file or directory
I've been searching for few days now but couldn't find the solution to my problem.
I have a VPS running Debian 7, and I have root access.
I am trying to add some traffic shaping (using HTB), so the ...
5
votes
2
answers
4k
views
lxc bandwidth control using tc
I am trying to restrict bandwidth inside my containers.
I have tried using the following commands , But I think it is not getting effective.
cd /sys/fs/cgroup/net_cls/
echo 0x1001 > A/net_cls....
5
votes
1
answer
14k
views
How can I limit the upload/download bandwidth on my CentOS server?
How can I limit the upload and download bandwidth on my CentOS server? This is a box with a single interface, eth0.
Ideally, I would like a command-line solution (I've been trying to use tc), ...
5
votes
1
answer
6k
views
VLAN based rate limiting using tc
I have been trying to perform VLAN based rate limiting on an academic project I am working on. The project uses Openflow (with Beacon controller) and the network is emulated using Mininet. The network ...
5
votes
2
answers
1k
views
nginx clobbering sftp traffic during peak times - is tc the answer?
This is probably a continuation of my previous (unanswered) question because the underlying cause is probably the same.
I have a Linux server with nginx and sshd running on it. It's on a shared ...
5
votes
1
answer
7k
views
Difference between HTB Rate and Ceil Values
What is the difference between the HTB rate and Ceil values?
5
votes
1
answer
1k
views
Bandwidth Throttling using tc qdiscs
I am trying to limit the bandwidth between a simple iperf server and client, using a third, passive machine acting as a bridge. With no interference, iperf returns a bandwidth of ~90 Mbits/sec. My ...
5
votes
1
answer
1k
views
Trying to understand HTB subclasses rate
I'm currently studying the opportunity of using an Ubuntu server to provide QoS instead of my consumer-class router. I've read a lot of resources about tc and HTB queuing disciplines - which look to ...
4
votes
1
answer
17k
views
How to do traffic shaping (rate limiting) with TC per OpenVPN client
This question is related to another question with a great answer and script from @Oliver.
The goal: I want to modify/extend the script provided in this answer to suit my requirements, which are as ...
4
votes
3
answers
5k
views
Making iptables recognize youtube streams and large files
I use Ubuntu server 10.04 with the stock kernel as a NAT router. I use iptables and tc to do port based traffic prioritization. It is working fine. I have given http higher priority. So my network ...
4
votes
2
answers
2k
views
Linux qos: tc DRR qdisc does not work
There is tc queue discipline DRR(Dificite Round Robin) .
It has same capabilities, as HTB, but instead of using buckets, filled with tokens, it just assignes every queue some Dificit Counter. On ...
4
votes
1
answer
1k
views
Using tc to decrease bandwidth to a specific destination address
I am trying to find the shortest path between two hosts H1 and H2 using Dijkstra code. Setting a condition in one of the switches on that path.
the condition is: if the packet sending to H2 then ...
4
votes
1
answer
7k
views
Limiting bandwidth on Ubuntu Linux
I am in the situation where I have to simulate a P2P-environment (for my masters thesis in computer science). To do that I am using Docker with Ubuntu to create a bunch of virtual machines that is ...
4
votes
2
answers
4k
views
Traffic shaping: tc filter attached to an HTB class?
Can I attach a tc filter to an HTB class rather than to an HTB qdisc?
For example:
tc class add dev $IF_LAN parent 1:100 classid 1:180 htb rate 19kbit ceil 2000kbit prio 4
where:
1:100 -> Is ...
4
votes
1
answer
591
views
Inject Delay between Virtual Machines in a VLAN
We'd like to simulate the impact of locality using VMs within a on a public cloud (say AWS EC2).
To do this, we would like to inject delays in packets such that we can simulate a particular network ...
4
votes
2
answers
7k
views
Limiting bandwidth on internal interface on Linux gateway
I am responsible for a Linux-based (it runs Debian) branch office router that takes a single high-speed Internet connection (eth2) and turns it into about 20 internal networks, each with a seperate ...
4
votes
2
answers
762
views
Matching last fragment of IP packets using tc or ipfilter
I am transmitting UDP packets of say 2900 bytes. Due to fragmentation, packet is divided in 2 IP fragments. My tc u32 filter (more fragments bit and IP/PORT combination) matches only first fragment ...
4
votes
1
answer
2k
views
linux tc htb bandwidth ceil being ignored and giving improper results
I'm setting up some htb packet queues like so:
tc qdisc add dev eth0 root handle 10: htb
tc qdisc add dev eth1 root handle 10: htb
tc class add dev eth0 parent 10: classid 10:1012 htb rate 750kbps ...
4
votes
1
answer
4k
views
Meaning of requeues of tc command
I ran this tc bellow and it outputs requeues with high number, do you know what this requeues means? By the way, it keeps increasing over the time.
I look at man tc but I couldn't find anything.
$ ...
4
votes
0
answers
1k
views
Limiting incoming traffic with tc police
I have a requirement to limit the total incoming traffic to 5mbit. I know this can be achieved by using the following tc command:
tc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 ...
4
votes
0
answers
3k
views
Linux Traffic Controller (Linux tc): hierarchical token bucket (htb) packet queue size
In my Linux router, I am using the following configuration to limit the rate of traffic towards port 44444 of a client in the LAN (client address is 192.168.10.2, connected through the router's eth1 ...
4
votes
2
answers
2k
views
HTB.init / tc behind NAT
I have an Ubuntu 10 box that I'm trying to set up as a bandwidth-shaping router.
The machine has one WAN interface, eth0 and two LAN interfaces, eth1 and eth2. NAT is configured using MASQUERADE as ...
3
votes
4
answers
14k
views
How to match port range using u32 filter
with "u32 match ip sport 80" in Linux tc I can match port 80, but how can I match a port range 10000 - 20000 ?
3
votes
2
answers
4k
views
How to limit speed for every device per MAC address in the gateway via Linux command "tc"?
I have a gateway whose OS is Linux.Assume my downlink bandwidth is 100 Mbps. I want to limit the max download speed to 1Mbps for every device which uses this gateway.In other words, if there are 100 ...
3
votes
1
answer
4k
views
How to remove the ingress delay introduced using tc
I learned that we can introduce delay to ingress packets using tc by following the commands specified in :
https://wiki.linuxfoundation.org/networking/netem#...
3
votes
2
answers
6k
views
tc prio qdisc for priorization of mysql traffic
I am struggling with tc prio qdisc for a few hours now.
I have read the lartc Documentation, Examples and HowTos, but this whole thing is kinda new for me and somewhat confusing :)
So this is my ...
3
votes
1
answer
9k
views
How to add latency and bandwidth-limit interface using tc?
I know I can add latency to an interface using this command:
# tc qdisc add dev eth0 root netem delay 50ms
In addition to latency, I want to limit the bandwidth of this interface to 100kbps.
How ...
3
votes
3
answers
5k
views
TC hashing filters - single rule deletion
For traffic shaping I'm currently using a setup that looks exactly like the setup from LARTC, on this page:
http://lartc.org/howto/lartc.adv-filter.hashing.html
I have a simple problem with that - ...
3
votes
5
answers
1k
views
QoS configuration for a medium ISP
What is the best Linux-based QoS platform to implement a configuration where all 256Kbps DSL clients (all belong to the same IP range) get a guaranteed speed of 200Kbps with single QoS rule?
3
votes
1
answer
3k
views
Multiqueue tun/tap interface
I am trying to understand how Multiqueue tuntap interface works. Following the instructions provided at: https://www.kernel.org/doc/Documentation/networking/tuntap.txt
I was able to create multiple ...
3
votes
1
answer
1k
views
linux tc qdisc pie (aqm) configuration with limited bandwidth
I would like to configure AQM PIE by using tc-qdisc, but at the same time I would like to limit the bandwidth to 1Mb/s.
I have used similar configuration with fq_codel, i.e. I have limited the ...
3
votes
1
answer
8k
views
Implementing HTB, NetEM, and TBF traffic control simultaneously
I am working on a bash utility that will use several aspects of the tc Linux command line utility to emulate various network conditions. I have successfully constructed several qdisc hierarchies, one ...
3
votes
2
answers
4k
views
how to limit upload bandwidth per user in linux?
Can anyone provide the tc command to limit upload bandwidth per user in Debian Lenny?
I found that to mark packets per user with iptables I can use the following command
iptables -t mangle -A OUTPUT ...
3
votes
1
answer
2k
views
tc: one qdisc for two classes (multiqueue)
The default tc configuration on my server is:
# tc class show dev ens5
class mq :1 root
class mq :2 root
# tc qdisc show dev ens5
qdisc mq 0: root
qdisc fq 0: parent :2 limit 10000p flow_limit 100p ...
3
votes
2
answers
1k
views
Can TC (Linux Qos Utility) limit bandwidth usage of target applications?
We have many applications running on the same server machine which is inside a network of servers. We want limit the bandwidth of our applications to specific value. So here are some choices: ...
3
votes
0
answers
2k
views
Adding some delay to a specific port on localhost using tc and netem
I'm going to simulate a network latency on three different ports of local host by using tc (traffic control for Linux) commands.
I run the following code:
!/bin/bash
tc qdisc add dev lo root handle 1:...
3
votes
0
answers
2k
views
How to configure per IP bandwidth control using TC?
Requirements:
There is an arbitrary number of users per group. Bandwidth for any particular group is 1000kbps. Bandwidth for each user in a group is 70 kbps. At any time no user should not consume ...
3
votes
1
answer
5k
views
How to limit outgoing traffic per IP Address using Linux TC
I want to limit outgoing traffic per IP address. For example I have a network interface eth0, having 1Gbps of bandwidth.
I want to limit the whole network interface to 1Mbps each destination IP ...
2
votes
3
answers
3k
views
QOS on ubuntu server
I want to run the following script on ubuntu server. eth1 is NAT interface, and eth2 is the WAN interface which has a static public ip:
TCA="tc class add dev eth2"
TFA="tc filter add dev eth2"
TQA="...