Uploaded image for project: 'ONOS'
  1. ONOS
  2. ONOS-7434

Adding Group using ONOS REST taking about 3 times longer



    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.13.0
    • Fix Version/s: 1.13.0
    • Component/s: None
    • Labels:


      It started to fail to add group using REST api after commit :



      Steps to procedure:

      1. Have 1+1 ( one node for onos, the other for mininet )
      2. ONOS_APP = drivers, openflow
      3. stc setup
      4. Have 1 switch with 4 hosts linked topology. ( Mininet topology python file code provided on the bottom ). Name it topo-group.py. Place it on ~/mininet/custom/
      5. run  sudo -E python ~/mininet/custom/topo-group.py
      6. On mininet, set onos controller to the switch ( make sure to replace *ONOS-IP-ADDRESS with your onos ip address ) : 
        sh ovs-vsctl set-controller s1 tcp:*ONOS-IP-ADDRESS*:6653
      1. Run Following command to post group using Rest API on the other window. ( make sure to replace *ONOS-IP-ADDRESS*with your onos ip address ) :
        curl --user onos:rocks --request POST --header "Content-Type: application/json" --data '{"buckets": [{"treatment": {"instructions": [{"type": "OUTPUT", "port": "2"}]}}, {"treatment": {"instructions": [{"type": "OUTPUT", "port": "3"}]}}, {"treatment": {"instructions": [{"type": "OUTPUT", "port": "4"}]}}], "type": "ALL", "groupId": "1", "appCookie": "0x1234abcd"}' http://*ONOS-IP-ADDRESS*:8181/onos/v1/groups/of:0000000000000001
      1. Start Timer that will time how long it would take to add groups. Then run following get method to watch the state of groups. Wait for it to be changed from PENDING_ADD to ADD. ( make sure to replace *ONOS-IP-ADDRESS*with your onos ip address ):
        watch -n1 'curl -u onos:rocks -X GET http://*ONOS-IP-ADDRESS*:8181/onos/v1/groups/of:0000000000000001/0x1234abcd'



      # !/usr/bin/python
      Custom topology for Mininet
      from mininet.topo import Topo
      from mininet.net import Mininet
      from mininet.node import Host, RemoteController
      from mininet.node import Node
      from mininet.node import CPULimitedHost
      from mininet.link import TCLink
      from mininet.cli import CLI
      from mininet.log import setLogLevel
      from mininet.util import dumpNodeConnections
      from mininet.node import ( UserSwitch, OVSSwitch, IVSSwitch )
      class MyTopo( Topo ):
          def __init__( self, **opts ):
              # Initialize topology
              Topo.__init__( self, **opts )
              # IPv4 hosts
              host1 = self.addHost( 'h1', ip='' )
              host2 = self.addHost( 'h2', ip='' )
              host3 = self.addHost( 'h3', ip='' )
              host4 = self.addHost( 'h4', ip='' )
              s1 = self.addSwitch( 's1' )
              self.addLink( s1, host1 )
              self.addLink( s1, host2 )
              self.addLink( s1, host3 )
              self.addLink( s1, host4 )
              topos = { 'mytopo': ( lambda: MyTopo() ) }
      def setupNetwork():
          "Create network"
          topo = MyTopo()
          network = Mininet( topo=topo, autoSetMacs=True, autoStaticArp=True, controller=None )
          CLI( network )
      if __name__ == '__main__':
          setLogLevel( 'info' )
          # setLogLevel( 'debug' )


      Our test plan does :
      1. adding group with all type
      2. remove it ( sleep for 10 seconds)
      3. adding group with indirect type

      While it goes from 2 to 3, it failed to install with the log message :
      `Group already exists with the same key 0x1234ABCD in dev:of:0000000000000001 with id:0x1`.

      It takes extra amount of time to add/remove group due to the extra checking on group stats capability every time.

      Since the test sleeps only for 10 seconds after removing the group, it fail to remove the group throughout.

      It usually took about 4-8 seconds to add/remove group before that change but now it takes about 17-24 seconds.



        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            tom Thomas Vachuska
            dlim15 Devin Lim
            0 Vote for this issue
            2 Start watching this issue