如果Openflow交换机中同一个流有多个转发规则怎么办?

What if there are multiple forwarding rules for the same flow in the Openflow switch?

我正在尝试使用 POX 控制器来控制流量路径。我知道 Open vSwitch 会选择具有最高优先级的转发规则。但是,如果我为具有相同优先级的现有流插入新的转发规则,会发生什么情况。 Open vSwitch会随机选择一条规则匹配吗?

OpenFlow 1.3 specification 说:

If there are multiple matching flow entries with the same highest priority, the selected flow entry is explicitly undefined.

较早的 OpenFlow 1.0 specification 指出:

If multiple entries have the same priority, the switch is free to choose any ordering.

Open vSwitch docs and this other source here 说:

OpenFlow leaves behavior undefined when two or more flows with the same priority can match a single packet. Some users expect "sensible" behavior, such as more specific flows taking precedence over less specific flows, but OpenFlow does not specify this and Open vSwitch does not implement it. Users should therefore take care to use priorities to ensure the behavior that they expect.

我知道目前还不清楚,但是根据这些来源,由用户来处理发生具有相同优先级的流条目重叠的情况。用户应该注意设置正确的优先级,并且交换机可以根据供应商的需要自由实施处理此问题的方法。例如,该开关可能 select 最新的流条目,正如您所说,它发生在您的案例中。