Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Traffic shaping on VLANs / subinterfaces

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
raco.alecs
Posts: 1
Joined: 2022-06-30 07:09

Traffic shaping on VLANs / subinterfaces

#1 Post by raco.alecs »

Hello everybody,

I have a problem with link splitting a 10G network adapter. My goal is to divide this link between 2 vlans as follows:
- Guaranteed 2Gb/s for vlan .100 with the possibility to go up to 10gb/s
- Guaranteed 8Gb/s for vlan .200 with the possibility to go up to 10gb/s.

To accomplish the goal I read various documents but without success. I use TC for HTB traffic control.

This is now the network configuration in /etc/network/interfaces (Note that I tried different configurations such as bridge with vlans under it (ex: br0 / br0.100) with root qdisc on bridge, with subinterfaces etc.):

auto eth0
iface eth0 inet manual
mtu 8996

auto eth0.100
iface eth0.100 inet static
address 192.168.100.1/24
mtu 8996
vlan_raw_device eth0

auto eth0.200
iface eth0.200 inet static
address 192.168.200.1/24
mtu 8996
vlan_raw_device eth0


And the traffic shaping configuration on eth0 (Here I put only to test the filters 2 ceil 2 and 8 ceil 8):

tc qdisc add dev eth0 root handle 1: htb
tc class add dev eth0 parent 1: classid 1:1 htb rate 10gbit
tc class add dev eth0 parent 1:1 classid 1:10 htb rate 2gbit ceil 2gbit
tc class add dev eth0 parent 1:1 classid 1:20 htb rate 8gbit ceil 8gbit
tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10
tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10
tc filter add dev eth0 protocol ip parent 1:10 prio 1 u32 match ip dst 192.168.100.0/24 flowid 1:10
tc filter add dev eth0 protocol ip parent 1:20 prio 1 u32 match ip dst 192.168.200.0/24 flowid 1:20


When i test with iperf3, each time the bandwidth is maximum on both vlans (10gb/s). Exception when I set the default class on qdisc root like this: tc qdisc add dev ens5f0np0 root handle 1: htb default 10

Connecting to host 192.168.100.3, port 5101
[ 5] local 192.168.100.1 port 50912 connected to 192.168.100.3 port 5101
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 238 MBytes 2.00 Gbits/sec 0 559 KBytes

Connecting to host 192.168.200.3, port 5101
[ 5] local 192.168.200.1 port 41782 connected to 192.168.200.3 port 5101
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 238 MBytes 2.00 Gbits/sec 0 568 KBytes


Kernel version: Linux 5.15.35

tc utility, iproute2-5.9.0, libbpf 0.3.0

What am I doing wrong? Please help me because I tried in different ways, including marking packages with iptables.

Post Reply