nsg-ethz / p4-utils

Extension to Mininet that makes P4 networks easier to build
GNU General Public License v2.0
183 stars 67 forks source link

No module sswitch_runtime #27

Open caopeirui opened 2 years ago

caopeirui commented 2 years ago

Hi @edgar-costa :

p4utils/utils/sswitch_thrift_API.py has the import code: from sswitch_runtime import SimpleSwitch from sswitch_runtime.ttypes import * However, 'sswitch_runtime' cannot be found. Where is the sswitch_runtime module?

caopeirui commented 2 years ago

By the way, would you mind telling me the most significant difference between SimpleSwitchThriftAPI and SimpleSwitchP4RuntimeAPI ?

jurijnota commented 2 years ago

Hi @caopeirui, the module sswitch_runtime is included in the behavioral model. You can check out the requirements for P4-Utils here. The difference between the SimpleSwitchThriftAPI and the SimpleSwitchP4RuntimeAPI is that the former is the legacy control plane API of the behavioral model, the latter is a new one based on P4Runtime that aims at becoming the new standard for the control plane of all the P4 devices. Unfortunately, SimpleSwitchP4RuntimeAPI does not support registers operations yet, so you may still want to use the legacy API.

yhx-coder commented 2 years ago

maybe you can find it in the file "behavioral-model/targets/simple_switch/thrift/simple_switch.thrift"

trailll commented 1 year ago

hello,I have met the same problem,and I find file 'sswitch_runtime' in behavioral model ,then i copy it to p4utils/utils/ and slolve the issue,but then it told me that i miss other moudules,when i copy one ,the other apper,all those missing modules can be found in behavioral model,so the issues is caused by bm2?

ryanyyxx commented 1 year ago

This is because the directory of simple_switch is not included in the python path. you can create a path file in /path_to_python/lib/python3.10/site-packages,

vim simple_switch.pth

then you can paste the path of simple_switch in the simple_switch.pth file

/path_to_behavioral-model/targets/simple_switch

MohamadAlAdraa commented 11 months ago

hello,I have met the same problem,and I find file 'sswitch_runtime' in behavioral model ,then i copy it to p4utils/utils/ and slolve the issue,but then it told me that i miss other moudules,when i copy one ,the other apper,all those missing modules can be found in behavioral model,so the issues is caused by bm2?

Hi @trailll,

Where you able to solve the problem?

Thanks

MohamadAlAdraa commented 11 months ago

This is because the directory of simple_switch is not included in the python path. you can create a path file in /path_to_python/lib/python3.10/site-packages,

vim simple_switch.pth

then you can paste the path of simple_switch in the simple_switch.pth file

/path_to_behavioral-model/targets/simple_switch

Hi @ryanyux,

I tried your suggestion but did not work.