ONOS - Modification of flow rules

Greetings everyone,

We utilized the ngsdn-tutorial to enable ONOS as an SDN controller with P4 switches. We successfully established our custom topology and tested the host connectivity using ping, which worked flawlessly. Our subsequent objective was to control the data flow by altering the flow rules through the REST API. We observed that deleting certain rules led to expected ping failure, which was in accordance with the ONOS pipeline implementation found on this page: Pipeline design - ONOS - Wiki

However, we encountered difficulties in modifying the flow rules to achieve the desired flow. We also attempted to add groups, but we were unable to locate the necessary hex value of the app cookie.

To clarify, our current experiment involves the topology we have created, which is illustrated in the picture below:

Our objective is to direct the packet flow from switches leaf 2 and 3 exclusively through spine 2, while the packets from switch leaf 1 are directed only through spine 1 for a specified time interval. Following this interval, the packets from leaf 1 will be routed through spine 2.

We are unsure if our approach of modifying the flow rules using the REST API is the correct method for conducting our experiment, and we are curious if there is a better way to achieve our objective.

If using the REST API is indeed the correct approach, we have several questions that we would like to address:

  1. Which flow rules should we modify in order to succeed? Despite our attempts to modify them, we have not yet achieved the desired outcome.
  2. Is modifying the flow rules sufficient or if we need to add/modify groups as well?
  3. If modifying groups is necessary, how can we find the hex value of the app cookie? When using the GET method in the REST API, we receive an app cookie that is a string, and we are struggling to locate its hex value.
  4. Which groups should we modify for our specific situation?

Many Thanks,

Hi @michaelked,

It has been a long time since I used the tutorial ngsdn-tutorial.
You should modify the flow rules that handling the forwarding of the packet, if i remember well is the table0 tha handle the packet forwarding.

  • In general you have to push a flow rule according to the p4 piepline tables and actions, in other words you cannot use the ONOS json syntax (Flow Rules - ONOS - Wiki) or at least you have to check how flow rules are shown in ONOS when you install the ngsdn-tutorial.

  • Then you have to install new flow rules in all the switches that belong to the path tha you want to enstablish.

  • As troubleshooting tools you can capture traffic at the swicthe input and output interface and verify that the counter associated with the flow rule increase.

Best
Davide