Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to balance network bandwidth between a number of lxc's (which is variable) and the system itself to ensure it stays reachable. My current (not working) approach is as follows:

tc qdisc add dev eth0 root handle 1: drr
tc class add dev eth0 parent 1: classid 1:1 drr
tc class add dev eth0 parent 1: classid 1:2 drr

tc qdisc add dev eth0 parent 1:2 handle 2: drr
tc class add dev eth0 parent 2: classid 2:1 drr
tc class add dev eth0 parent 2: classid 2:2 drr etc.

tc filter add dev eth0 parent 1: prio 10 handle 1 cgroup
tc filter add dev eth0 parent 1: prio 20 handle 2 basic flowid 1:1

This should balance the non-lxc traffic on class 1:1 with the lxc traffic on 1:2. The individual lxc's in turn should be fairly balanced by qdisc 2:. However when I run ping once on the system itself and once in a lxc (with net_cls set to 2:1, echo 0x00020001 > /sys/fs/cgroup/net_cls/lxc/test/net_cls.classid), the lxc packets get dropped while the system traffic is working.

output of tc -s qdisc ls dev eth0

qdisc drr 1: root refcnt 2
 Sent 6700554 bytes 8089 pkt (dropped 942, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
qdisc drr 2: parent 1:2
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0

output of tc -s class ls dev eth0

class drr 1:1 root quantum 1514b
 Sent 6940067 bytes 8320 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 deficit 0b
class drr 1:2 root leaf 2: quantum 1514b
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 deficit 0b
class drr 2:1 root quantum 1514b
 Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
 backlog 0b 0p requeues 0
 deficit 0b

EDIT: If I add a class 1:3 and set the net_cls accordingly, it is working, so the problem must be to access the nested class.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.