Search code examples
sdnmininetopenvswitchonos

Change Open vSwitch's flow table size


I have a question.

I have now configured the topology using mininet. Here I want to limit the flow table size of the switch.

Is there a way to limit the flow table size of the switch??? Or can OpenVSwitch limit it?

Thank you.


Solution

  • Yes, you can instruct Open vSwitch to limit the size of a flow table, either by refusing new flows, or by evicting old flows. From the ovs-vsctl documentation:

    Make flow table 0 on bridge br0 refuse to accept more than 100 flows:
    
        ovs-vsctl -- --id=@ft create Flow_Table flow_limit=100 overflow_policy=refuse -- set Bridge br0 flow_tables=0=@ft
    
    Make flow table 0 on bridge br0 evict flows, with fairness based on the
    matched ingress port, when there are more than 100:
    
        ovs-vsctl -- --id=@ft create Flow_Table flow_limit=100 overflow_policy=evict groups='"NXM_OF_IN_PORT[]"' -- set Bridge br0 flow_tables:0=@ft