Ingress Policing Rule and Queue Management for QoS provision over SDN

[Network Topology]

H1----

|

H2--- S1 -----S2----H4

|

H3-----

 

H1,H2,H3 are connected to S1, S1 is connected to S2, and S2 is connected to H4. H1,H2,H3,and H4 are hosts, and S1 and S2 are openvswitch.

 

[mininet script—test1.py (No QoS)]

from mininet.net import Mininet

from mininet.node import Controller, RemoteController, OVSKernelSwitch, UserSwitch, OVSSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import Link, TCLink

 

def topology():

        net = Mininet( controller=RemoteController, link=TCLink, switch=OVSSwitch )

        # Add hosts and switches

        h1= net.addHost( 'h1' )

        h2 = net.addHost( 'h2' )

        h3 = net.addHost( 'h3' )

        h4 = net.addHost( 'h4' )

        s1 = net.addSwitch( 's1' )

        s2 = net.addSwitch( 's2' )

        c0 = net.addController( 'c0', controller=RemoteController, ip='127.0.0.1', port=6633 )

 

        linkopt=dict(bw=10,delay='1ms',loss=0)

        net.addLink( h1, s1 )

        net.addLink( h2, s1 )

        net.addLink( h3, s1 )

        net.addLink( s1, s2 )

        net.addLink( h4, s2, **linkopt)

 

        net.build()

        c0.start()

        s1.start( [c0] )

        s2.start( [c0] )

 

        s1.cmd("ovs-ofctl add-flow s1 in_port=1,actions=output:4")

        s1.cmd("ovs-ofctl add-flow s1 in_port=2,actions=output:4")

        s1.cmd("ovs-ofctl add-flow s1 in_port=3,actions=output:4")

        s1.cmd("ovs-ofctl add-flow s1 in_port=4,actions=output:flood")      

        s2.cmd("ovs-ofctl add-flow s2 in_port=1,actions=output:2")

        s2.cmd("ovs-ofctl add-flow s2 in_port=2,actions=output:1")

 

        print "*** Running CLI"

        CLI( net )

 

        print "*** Stopping network"

        net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()    

 

H1 is sending traffic to H4. At meantime, H3 is sending traffic to H4. The throughput of H1-H4 will be affected by H3-H4.

 

In the beginning, the h1 is sending to h4. The throughput is around 9.71Mbps.

 

When the h3 starts to send the traffic to h4, the throughput of H1-H4 drops.

 

[mininet script ---test2.py (with queue management)

from mininet.net import Mininet

from mininet.node import Controller, RemoteController, OVSKernelSwitch, UserSwitch, OVSSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import Link, TCLink

 

def topology():

        net = Mininet( controller=RemoteController, link=TCLink, switch=OVSSwitch )

        # Add hosts and switches

        h1= net.addHost( 'h1' )

        h2 = net.addHost( 'h2' )

        h3 = net.addHost( 'h3' )

        h4 = net.addHost( 'h4' )

        s1 = net.addSwitch( 's1' )

        s2 = net.addSwitch( 's2' )

        c0 = net.addController( 'c0', controller=RemoteController, ip='127.0.0.1', port=6633 )

 

        linkopt=dict(bw=10,delay='1ms',loss=0)

        net.addLink( h1, s1 )

        net.addLink( h2, s1 )

        net.addLink( h3, s1 )

        net.addLink( s1, s2 )

        net.addLink( h4, s2, **linkopt)

 

        net.build()

        c0.start()

        s1.start( [c0] )

        s2.start( [c0] )

 

        # reserve 3Mbps for q1 at the output port 4 of s1, 7Mbps for q0 (default queue)

        s1.cmd("ovs-vsctl -- set port s1-eth4 qos=@newqos -- --id=@newqos create qos type=linux-htb queues=0=@q0,1=@q1 -- --id=@q0 create queue other-config:min-rate=0 other-config:max-rate=7000000 -- --id=@q1 create queue other-config:min-rate=0 other-config:max-rate=3000000") #bps

 

        #mapping traffic sent from H1 to q1

        s1.cmd("ovs-ofctl add-flow s1 in_port=1,actions=enqueue:4:1")

        s1.cmd("ovs-ofctl add-flow s1 in_port=2,actions=output:4")

        s1.cmd("ovs-ofctl add-flow s1 in_port=3,actions=output:4")

        s1.cmd("ovs-ofctl add-flow s1 in_port=4,actions=output:flood")      

        s2.cmd("ovs-ofctl add-flow s2 in_port=1,actions=output:2")

        s2.cmd("ovs-ofctl add-flow s2 in_port=2,actions=output:1")

 

        print "*** Running CLI"

        CLI( net )

 

        print "*** Stopping network"

        net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()  

 

When H1 is sending traffic to H4, this flow gets 2.92 Mbps.

 

When H3 starts to send traffic to H4, the flow of H1-H4 is not affected by H3-H4 flow.

 

[mininet script ---test3.py (with queue management, but the flows compete in the same queue)

from mininet.net import Mininet

from mininet.node import Controller, RemoteController, OVSKernelSwitch, UserSwitch, OVSSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import Link, TCLink

 

def topology():

        net = Mininet( controller=RemoteController, link=TCLink, switch=OVSSwitch )

        # Add hosts and switches

        h1= net.addHost( 'h1' )

        h2 = net.addHost( 'h2' )

        h3 = net.addHost( 'h3' )

        h4 = net.addHost( 'h4' )

        s1 = net.addSwitch( 's1' )

        s2 = net.addSwitch( 's2' )

        c0 = net.addController( 'c0', controller=RemoteController, ip='127.0.0.1', port=6633 )

 

        linkopt=dict(bw=10,delay='1ms',loss=0)

        net.addLink( h1, s1 )

        net.addLink( h2, s1 )

        net.addLink( h3, s1 )

        net.addLink( s1, s2 )

        net.addLink( h4, s2, **linkopt)

 

        net.build()

        c0.start()

        s1.start( [c0] )

        s2.start( [c0] )

 

        s1.cmd("ovs-vsctl -- set port s1-eth4 qos=@newqos -- --id=@newqos create qos type=linux-htb queues=0=@q0,1=@q1 -- --id=@q0 create queue other-config:min-rate=0 other-config:max-rate=7000000 -- --id=@q1 create queue other-config:min-rate=0 other-config:max-rate=3000000") #bps

 

        s1.cmd("ovs-ofctl add-flow s1 in_port=1,actions=enqueue:4:1")

        s1.cmd("ovs-ofctl add-flow s1 in_port=2,actions=enqueue:4:1")

        s1.cmd("ovs-ofctl add-flow s1 in_port=3,actions=output:4")

        s1.cmd("ovs-ofctl add-flow s1 in_port=4,actions=output:flood")      

        s2.cmd("ovs-ofctl add-flow s2 in_port=1,actions=output:2")

        s2.cmd("ovs-ofctl add-flow s2 in_port=2,actions=output:1")

 

        print "*** Running CLI"

        CLI( net )

 

        print "*** Stopping network"

        net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()  

 

 

When H1 is sending traffic to H4, this flow gets 2.92 Mbps.

 

When the h2 starts to send the traffic to h4, the throughput of H1-H4 drops.

 

[mininet script ---test4.py (with queue management + ingress policing)

from mininet.net import Mininet

from mininet.node import Controller, RemoteController, OVSKernelSwitch, UserSwitch, OVSSwitch

from mininet.cli import CLI

from mininet.log import setLogLevel

from mininet.link import Link, TCLink

 

def topology():

        net = Mininet( controller=RemoteController, link=TCLink, switch=OVSSwitch )

        # Add hosts and switches

        h1= net.addHost( 'h1' )

        h2 = net.addHost( 'h2' )

        h3 = net.addHost( 'h3' )

        h4 = net.addHost( 'h4' )

        s1 = net.addSwitch( 's1' )

        s2 = net.addSwitch( 's2' )

        c0 = net.addController( 'c0', controller=RemoteController, ip='127.0.0.1', port=6633 )

  

        linkopt=dict(bw=10,delay='1ms',loss=0)

        net.addLink( h1, s1)

        net.addLink( h2, s1)

        net.addLink( h3, s1)

        net.addLink( h4, s2, **linkopt)

        net.addLink( s1, s2)

 

        net.build()

        c0.start()

        s1.start( [c0] )

        s2.start( [c0] )

        s1.cmd("ovs-vsctl -- set port s1-eth4 qos=@newqos -- --id=@newqos create qos type=linux-htb queues=0=@q0,1=@q1 -- --id=@q0 create queue other-config:min-rate=0 other-config:max-rate=7000000 -- --id=@q1 create queue other-config:min-rate=0 other-config:max-rate=3000000") #bps

  

        s1.cmd("ovs-ofctl add-flow s1 in_port=1,actions=enqueue:4:1")

        s1.cmd("ovs-ofctl add-flow s1 in_port=2,actions=enqueue:4:1")

        s1.cmd("ovs-ofctl add-flow s1 in_port=3,actions=output:4")

        s1.cmd("ovs-ofctl add-flow s1 in_port=4,actions=output:flood")

        s2.cmd("ovs-ofctl add-flow s2 in_port=1,actions=output:2")

        s2.cmd("ovs-ofctl add-flow s2 in_port=2,actions=output:1") 

        s1.cmd("ovs-vsctl set interface s1-eth1 ingress_policing_rate=1000")  #(in Kbps)

        s1.cmd("ovs-vsctl set interface s1-eth1 ingress_policing_burst=100")  #(in Kb)

        s1.cmd("ovs-vsctl set interface s1-eth2 ingress_policing_rate=2000")

        s1.cmd("ovs-vsctl set interface s1-eth1 ingress_policing_burst=100")

        print "*** Running CLI"

        CLI( net )

 

        print "*** Stopping network"

        net.stop()

 

if __name__ == '__main__':

    setLogLevel( 'info' )

    topology()  

 

In the beginning, the h1 is sending to h4. The throughput is around 976kbps. (Due to the ingress policing: 1Mpbs at the ingress port 1 of s1.)

 

When h2 starts to send traffic to h4, the throughput of flow H1-H4 does not drop. (End to End QoS can be provided.)

 

[References]

http://docs.openvswitch.org/en/latest/howto/qos/

http://hwchiu.logdown.com/posts/197231-config-qos-on-ovs-with-floodlight

 

Dr. Chih-Heng Ke (smallko@gmail.com)

Department of Computer Science and Information Engineering,

National Quemoy University, Kinmen, Taiwan.