openvswitch的qos比较简单。

rate-limit

rate-limit限速策略是简单粗暴的将超出的数据包进行丢弃,这对于udp来说将是一场噩梦。

对vm网卡限速4M:

$ sudo ovs-vsctl set interface wptMgmt-300 ingress_policing_rate=4000 (1)
$ sudo ovs-vsctl set interface wptMgmt-300 ingress_policing_burst=400 (2)

$ sudo ovs-vsctl list interface wptMgmt-300
_uuid               : f017a3da-5e90-4800-85f5-9624a2fd9e4e
admin_state         : up
bfd                 : {}
bfd_status          : {}
cfm_fault           : []
cfm_fault_status    : []
cfm_flap_count      : []
cfm_health          : []
cfm_mpid            : []
cfm_remote_mpids    : []
cfm_remote_opstate  : []
duplex              : full
external_ids        : {attached-mac="52:54:00:64:63:4E", iface-id="be162b53-df44-2f6b-1891-11b94d945d02", iface-status=active, vm-id="88b3cd91-0b9d-940a-141c-79a7b088cef9"}
ifindex             : 141
ingress_policing_burst: 400
ingress_policing_rate: 4000
lacp_current        : []
link_resets         : 1
link_speed          : 10000000
link_state          : up
mac                 : []
mac_in_use          : "fe:54:00:64:63:4e"
mtu                 : 1500
name                : "wptMgmt-300"
ofport              : 13
ofport_request      : []
options             : {}
other_config        : {}
statistics          : {collisions=0, rx_bytes=238, rx_crc_err=0, rx_dropped=0, rx_errors=0, rx_frame_err=0, rx_over_err=0, rx_packets=3, tx_bytes=147911, tx_dropped=0, tx_errors=0, tx_packets=1784}
status              : {driver_name=tun, driver_version="1.6", firmware_version="N/A"}
type                : ""
1 rate
2 burst

policy

有人认为ovs所提供的qos很鸡肋,我想应该是无法实现L7的应用识别吧,如果能够使用htb进行traffic shaping,还是有一定的用处的。