LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   does tc prio work across different interfaces? (https://www.linuxquestions.org/questions/linux-networking-3/does-tc-prio-work-across-different-interfaces-4175479949/)

psycroptic 10-07-2013 06:18 PM

does tc prio work across different interfaces?
 
say i have a router with 1 external connection and 2 internal ones. If i'm trying to limit downloads from the external to both of the connections, can I use htb with different prio values, and will the lower-numbered interface be de-prioritized during congestion?

like this:

Code:

tc qdisc add dev eth0 root handle 1: htb default 1
tc class add dev eth0 parent 1: classid 1:1 htb rate 106mbit ceil 106mbit prio 1 burst 15k


tc qdisc add dev eth1 root handle 1: htb default 1
tc class add dev eth1 parent 1: classid 1:1 htb rate 12.5mbit ceil 12.5mbit prio 2 burst 5k

here, i'm expecting that eth1 would be proportionally slowed more than eth0...

Ygrex 10-07-2013 11:56 PM

no, it does not make sense; classes should have the same parent class to get priority work

psycroptic 10-08-2013 01:30 AM

ok thanks, any way that i might get this idea to work?

Ygrex 10-08-2013 11:06 PM

what do you expect to see? with the configuration above bandwidth for both interfaces is limited independently, what is wrong with it in you specific use-case?

psycroptic 10-10-2013 11:15 AM

this router has 2 internal connections, 1 for my main network (eth0 in this example) and 1 for a public wifi network (eth1). They both are on different subnets. What I would like to do is prioritize the main network over the wifi one, such that it gets precedence. But it sounds like this isn't something that the prio option of htb can do...

Optionally, I was thinking about setting a minimum rate to be very low on the wifi network, like this:

Code:

tc qdisc add dev eth1 root handle 1: htb default 1
tc class add dev eth1 parent 1: classid 1:1 htb rate 1mbit ceil 12.5mbit burst 5k

thinking that, if eth0 is saturating the download, eth1 will be reduced to 1mbit... but this doesn't work either. essentially I want these 2 interfaces to "draw" from the same HTB rate pool, if that makes any sense...

Ygrex 10-11-2013 10:35 AM

I do not think it is possible out-of-box with tc, because each interface has its own queue and these queues do not interact with each other; it is possible with user-space daemon though, that can adjust tc settings in a way of any imaginable complexity; I did not ever see such daemon

psycroptic 10-11-2013 04:19 PM

right that's what i was thinking... queues apparently cannot stretch across interfaces.


All times are GMT -5. The time now is 01:45 AM.