0

I am new to Mininet and created a topology. I need to enable ECN in the switch created in the mininet topology.

How to enable ECN in the switch?

Thanks in advance

Regards Hassaan Afridi

1 Answers1

0

Since you use OVS version 2.0.2 your switch supports at least up to OpenFlow version 1.3. Explicit Congestion Notification (ECN) fields implemented from OpenFlow ver 1.1 and above. In order for the field to be applied thought you have to tell to mininet that you are going to use a version above 1.0 which is the default. To launch the mininet topo we have to go with a remote controller so we can pass flow modifications manually. To start mininet in the terminal we go with

sudo mn --topo single,3 --mac --controller remote --switch ovsk,protocols=OpenFlow13

Mininet is ok but we have to create a bridge to talk to the switch and there we will tell the switch that by this bridge we will pass OpenFlow ver 1.3 flow modifications. To do that in a new terminal we ssh at the mininet vm and we create the bridge with

sudo ovs-vsctl set bridge s1 protocols=OpenFlow13

So now we have a door opened to the switch to talk to and pass our flow mods in which we must define the openflow protocol version again. For a single mod we can do something like

sudo ovs-ofctl -O OpenFlow13 add-flow s1 in_port=1,actions=output:2

and

sudo ovs-ofctl -O OpenFlow13 add-flow s1 in_port=2,actions=output:1

Now we have passed 2 flow modifications manually and the ping between h1 and h2 should work perfectly. To install ECN flow mods we can do something like

sudo ovs-ofctl -O OpenFlow13 add-flow s1 dl_type=0x0800,nw_ecn=3,actions=output:3

Notice that as stated in the documentation of OpenFlow

When dl_type=0x0800 or 0x86dd is specified,matches the ecn bits in IP ToS or IPv6 traffic class fields .When dl_type is wildcarded or set to a value other than 0x0800 or 0x86dd, the value of nw_ecn is ignored

  • So it means by adding this "flow rule" , "dl_type=0x0800, nw_ecn=3" we are basically enabling switch s1 for ECN, please correct if I am wrong? and what does 3 means in "nw_ecn = 3", because this value can be 0-3 ? – hassaan afridi Jun 08 '16 at 23:15
  • 3 is Congestion Encountered, but this is just an example, you have to match source, dest, have both hosts be aware of ECN usage and much more. – SotirisTsartsaris Jun 08 '16 at 23:50