CPqD / ofsoftswitch13

OpenFlow 1.3 switch.
http://cpqd.github.com/ofsoftswitch13
298 stars 191 forks source link

Problem about Meter Table #308

Open ls760008979 opened 4 years ago

ls760008979 commented 4 years ago

When i do the "Example of the operation of QoS by using Meter Table" in this book https://ryu-sdn.org/resources.html, i found that it can ping well between each switch, but when i use iperf to send udp flow, it doesn't connect well, i want to know why this happen? is it for i have not uninstall the Open vSwitch?

ederlf commented 4 years ago

It might a problem with TCP offloading. Try to turn it off in the hosts that generate traffic:

ethtool -K <interface> tx off
ls760008979 commented 4 years ago

It might a problem with TCP offloading. Try to turn it off in the hosts that generate traffic:

ethtool -K <interface> tx off

It works, but does not show as that book described

ederlf commented 4 years ago

What it does not show? Please provide more information.

ls760008979 commented 4 years ago

What it does not show? Please provide more information.

The topo of this example is s1 connect with s2,s3, each with one host,

  1. i set meter in s2 curl -X POST -d '{"meter_id": "1", "flags": "KBPS", "bands":[{"type":"drop", "rate": "400"}]}' http://localhost:8080/qos/meter/0000000000000002 curl -X POST -d '{"match": {"ip_dscp": "10"}, "actions":{"meter": "1"}}' http://localhost:8080/qos/rules/0000000000000002 and use iperf to send udp flow from h2 to h1 iperf -c 10.0.0.1 -p 5002 -u -b 800K --tos 0x28 but the bandwidth doesn't limited within 400Kbps

  2. set meter in s2 and s3 curl -X POST -d '{"match": {"ip_dscp": "10"}, "actions":{"meter": "1"}}' http://localhost:8080/qos/rules/0000000000000003 curl -X POST -d '{"meter_id": "1", "flags": "KBPS", "bands":[{"type":"DSCP_REMARK", "rate": "400", "prec_level": "1"}]}' http://localhost:8080/qos/meter/0000000000000003 curl -X POST -d '{"match": {"ip_dscp": "26"}, "actions":{"meter": "2"}}' http://localhost:8080/qos/rules/0000000000000002 curl -X POST -d '{"meter_id": "2", "flags": "KBPS", "bands":[{"type":"DSCP_REMARK", "rate": "400", "prec_level": "1"}]}' http://localhost:8080/qos/meter/0000000000000002 and send udp flow to h1 h3: iperf -c 10.0.0.1 -p 5002 -u -b 600K --tos 0x28 h2: iperf -c 10.0.0.1 -p 5001 -u -b 600K --tos 0x68 but these excess traffic are not droped in the same rate h2 h3

ederlf commented 4 years ago

I think the issue is related to the refilling rate of the token bucket that enforces the rate. Give me some time to try a patch I have in mind and test it.

ederlf commented 4 years ago

The refill actually seems fine the way it is. I have tried to reproduce your cases, and the rate is correctly limited under 400Kbps.