Page MenuHomeVyOS Platform

Ingress Shaping with IFB No Longer Functional with 1.3
Closed, ResolvedPublic

Description

set interfaces ethernet eth0 redirect 'ifb0'
set interfaces ethernet eth0 traffic-policy out 'spectrum-upstream'
set interfaces input ifb0 traffic-policy out 'spectrum-downstream'
set traffic-policy shaper spectrum-downstream bandwidth '400mbit'
set traffic-policy shaper spectrum-downstream default bandwidth '100%'
set traffic-policy shaper spectrum-downstream default burst '15k'
set traffic-policy shaper spectrum-downstream default queue-type 'fq-codel'
set traffic-policy shaper spectrum-upstream bandwidth '35mbit'
set traffic-policy shaper spectrum-upstream default bandwidth '100%'
set traffic-policy shaper spectrum-upstream default burst '15k'
set traffic-policy shaper spectrum-upstream default queue-type 'fq-codel'

This functions normally on any 1.2 build, 'still' does not work on any 1.3 build (even latest)

egress shaping works fine, ingress does not

Details

Difficulty level
Unknown (require assessment)
Version
VyOS 1.3.0-rc6
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

trystan created this object in space S1 VyOS Public.

Difference between 1.2 and 1.3
1.3 don't have option qdisc ingress ffff: dev eth0 parent ffff:fff1 ----------------

1.2:

vyos@r12-lts# sudo  tc qdisc show
qdisc noqueue 0: dev lo root refcnt 2 
qdisc htb 1: dev eth0 root refcnt 2 r2q 22 default 2 direct_packets_stat 0 direct_qlen 1000
qdisc fq_codel 8004: dev eth0 parent 1:2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb 
qdisc ingress ffff: dev eth0 parent ffff:fff1 ---------------- 
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev ifb0 root refcnt 2 r2q 13 default 2 direct_packets_stat 0 direct_qlen 32
qdisc fq_codel 8003: dev ifb0 parent 1:2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb

1.3:

vyos@r4-1.3# sudo tc qdisc show
qdisc noqueue 0: dev lo root refcnt 2 
qdisc htb 1: dev eth0 root refcnt 2 r2q 22 default 0x2 direct_packets_stat 0 direct_qlen 1000
qdisc fq_codel 8004: dev eth0 parent 1:2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb 
qdisc pfifo_fast 0: dev eth1 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc pfifo_fast 0: dev eth2 root refcnt 2 bands 3 priomap  1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
qdisc htb 1: dev ifb0 root refcnt 2 r2q 13 default 0x2 direct_packets_stat 0 direct_qlen 32
qdisc fq_codel 8003: dev ifb0 parent 1:2 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms memory_limit 32Mb

@trystan can you add this option and re-check?

sudo tc qdisc add dev eth0 handle ffff: ingress

I can confirm that applying

sudo tc qdisc add dev eth0 handle ffff: ingress

After committing the config does not change the behavior. Bug persists.

Still on rc6

After committing the config does not change the behavior. Bug persists.

Still on rc6

Tested in 1.3.0-rc6. Initial configuration:

set interfaces ethernet eth0 redirect 'ifb0'
set interfaces ethernet eth0 traffic-policy out 'spectrum-upstream'
set interfaces input ifb0 traffic-policy out 'spectrum-downstream'
set traffic-policy shaper spectrum-downstream bandwidth '20mbit'
set traffic-policy shaper spectrum-downstream default bandwidth '100%'
set traffic-policy shaper spectrum-downstream default burst '15k'
set traffic-policy shaper spectrum-downstream default queue-type 'fq-codel'
set traffic-policy shaper spectrum-upstream bandwidth '35mbit'
set traffic-policy shaper spectrum-upstream default bandwidth '100%'
set traffic-policy shaper spectrum-upstream default burst '15k'
set traffic-policy shaper spectrum-upstream default queue-type 'fq-codel'
commit

Iperf3

vyos@r4-1.3:~$ sudo iperf3 -c 192.168.122.12 -R
Connecting to host 192.168.122.12, port 5201
Reverse mode, remote host 192.168.122.12 is sending
[  5] local 192.168.122.14 port 49208 connected to 192.168.122.12 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   402 MBytes  3.37 Gbits/sec                  
[  5]   1.00-2.00   sec   412 MBytes  3.45 Gbits/sec                  
^C[  5]   2.00-3.00   sec   424 MBytes  3.57 Gbits/sec

Add 2 lines:

tc qdisc add dev eth0 handle ffff: ingress
tc filter add dev eth0 parent ffff: protocol ip u32 match u32 0 0 action mirred egress redirect dev ifb0

It seems fixed after this:

vyos@r4-1.3# sudo iperf3 -c 192.168.122.12 -R
Connecting to host 192.168.122.12, port 5201
Reverse mode, remote host 192.168.122.12 is sending
[  5] local 192.168.122.14 port 50466 connected to 192.168.122.12 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  2.26 MBytes  19.0 Mbits/sec                  
[  5]   1.00-2.00   sec  2.26 MBytes  19.0 Mbits/sec                  
[  5]   2.00-3.00   sec  2.25 MBytes  18.9 Mbits/sec                  
[  5]   3.00-4.00   sec  2.26 MBytes  19.0 Mbits/sec                  
^C[  5]   4.00-4.14   sec   322 KBytes  18.8 Mbits/sec                  
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-4.14   sec  0.00 Bytes  0.00 bits/sec                  sender
[  5]   0.00-4.14   sec  9.35 MBytes  19.0 Mbits/sec                  receiver
iperf3: interrupt - the client has terminated
[edit]
vyos@r4-1.3#

Update
qdisc handle deleted per each interface commit:

DEBUG/IFCONFIG cmd 'ip link set dev eth0 mtu 1500'
DEBUG/IFCONFIG cmd 'ip -json -detail link list dev eth0'
DEBUG/IFCONFIG returned (out):
[{"ifindex":2,"ifname":"eth0","flags":["BROADCAST","MULTICAST","UP","LOWER_UP"],"mtu":1500,"qdisc":"htb","operstate":"UP","linkmode":"DEFAULT","group":"default","txqlen":1000,"link_type":"ether","address":"52:54:00:5d:46:09","broadcast":"ff:ff:ff:ff:ff:ff","promiscuity":0,"min_mtu":68,"max_mtu":65535,"inet6_addr_gen_mode":"none","num_tx_queues":1,"num_rx_queues":1,"gso_max_size":65536,"gso_max_segs":65535,"ifalias":"FOO-BAR"}]
DEBUG/IFCONFIG cmd 'tc qdisc del dev eth0 handle ffff: ingress 2> /dev/null;tc qdisc del dev eth0 handle 1: root prio 2> /dev/null;set $?=0'
DEBUG/IFCONFIG cmd 'ip link set dev eth0 up'

[edit]
vyos@r4-1.3#

By this code https://github.com/vyos/vyos-1x/blob/a0e115d558001694060c97260ce8b5c66fbb5d4f/python/vyos/ifconfig/interface.py#L1084-L1085

Viacheslav changed the task status from Open to Needs testing.Aug 30 2021, 3:29 PM
Viacheslav claimed this task.

@trystan will be fixed in the next 1.3-beta release.