Discussion:
[Bridge] Traffic shaping with bridge.
Fu Jiantao
2018-03-10 01:21:55 UTC
Permalink
Hi,

I'm having some problem to make traffic shaping work with bridge, the
topology is below, the same script to set the delay/loss works for
10.34.201.45 and 10.35.201.47, but not working
for 10.35.200.2.

I use ifb device for traffic control, say for example, adding 300ms delay
for dst 10.35.200.2, and I use tcpdump to capture ifb1, and no packets. And
if I set the dst to 10.35.201.47 or 10.35.201.45, it works.

I tried to read the code, the "sch_handle_ingress" is before "rx_handle",
and I can capture packets on enp2s0, but can't figure out why the filter is
not working, 10.35.200.2 is in different subnet with 10.35.201.45, but the
bridge works b/c it just use MAC address, even it's not the typical
scenario to put them in different subnet.

Thanks in advance!

+ tc qdisc add dev enp2s0 ingress

+ tc filter add dev enp2s0 parent ffff: protocol ip prio 1 u32 match ip dst
10.35.200.2 flowid 1:1 action mirred egress redirect dev ifb1

+ tc qdisc add dev ifb1 root netem loss random 0% delay 300ms


+-------------+ 10.35.200.2
| jianfu-sx10 +------------------+
+-------------+ |
|
+-------------+ 10.35.201.45 +--------+ +----------+
10.35.201.10 +-------+
| marcel-sx80 +---------------| switch |-----| emulator
|--------------+ Linus |
+-------------+ +--------+ +----------+ |
+-------+
| enp3s0 enp2s0 |
+-------------+ 10.35.201.47 | |
| jianfu-win +------------------+ |
+-------------+ |
|
+-------------+ 10.22.79.106 |
| anand-sx10 +------------------------------------+-----------+
+-------------+ |
|
+-------------+ 10.22.79.170 |
| jianfu-ttc7 +------------------------------------+
+-------------+

Loading...