Search code examples
sdnopenflowopenvswitchpox

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


I am trying to use the POX controller to control the path of flows. I know that the Open vSwitch will choose the forwarding rules that have the highest priority. But what will happen if I insert a new forwarding rule for the existing flow with the same priority. Will the Open vSwitch randomly choose one rule to match?


Solution

  • The OpenFlow 1.3 specification says:

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

    The older OpenFlow 1.0 specification states that:

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

    Open vSwitch docs and this other source here says:

    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.

    It is unclear, I know, but based on these sources, it is up to the user to deal with situations where a flow entry overlap with same priorities occurs. The user should take care of setting the right priorities and the switch is free to implement a way to deal with this as the vendor desires. The switch may, for instance, select the newest flow entry, as you said it happened in your case.