CPqD / ofsoftswitch13

OpenFlow 1.3 switch.
http://cpqd.github.com/ofsoftswitch13
304 stars 192 forks source link

How can i add a new column into the flow table? #299

Open KAMRANMEHBOOB opened 5 years ago

KAMRANMEHBOOB commented 5 years ago

Is it possible to add new column i.e. a new statistic of my own inside the flow table? In which files should i make changes to make it happen?

ederlf commented 5 years ago

Check this out. https://github.com/CPqD/ofsoftswitch13/wiki#development-resources https://github.com/CPqD/ofsoftswitch13/wiki/Overview-of-the-Switch's-Architecture#flow-tables

KAMRANMEHBOOB commented 5 years ago

So is it possible to add new columns in flow table of a switch without writing any API/function in the controller? The doubt that i have is who sets the columns inside the flow table of aswitch, the switch itself or the controller?

ederlf commented 5 years ago

You need to add the field in the switch to support the counters you need.

If you want to collect them from a controller, you also need to support the field in the message that will contain the new field. e.g, you may add it to flow stats, so in your controller API you also need to include the field and modify the function that parses flow stats to also parse the new field.

KAMRANMEHBOOB commented 5 years ago

Thank you for helping me. One issue i have is that my changes inside the codeare not reflected when getting the feature messages for the switch e.g. i have created a new entry inside struct ofl_msg_features_reply structure present inside the ofl-messages.h file and i have also changed the code wherever this structure was being used. In the end i also made changes changes inside the ofl-messages-print.c file so that it displays me with the changes but no change is there in the feature reply message. i am simply declaring a new variable inside the ofl-feature-reply structure and keeping its value equal to n_tabs field. Where am i going wrong?

ederlf commented 5 years ago

Well, it is a guess game to me without seeing the code, but as I said, if you did not change your controller to parse the new field in the feature reply, you will not see it at all.

Also, you may want to check on Wireshark if the message that is sent to the control plane contains the field you have added.