how to send flow rules from sflow-rt to ryu controller using REST API

42 views
Skip to first unread message

Habtamu Molla

unread,
Jun 17, 2023, 11:58:57 AM6/17/23
to sFlow-RT
how are you dear peter?
i need to send flow rules  that can do adding flow rules to send to its destination or dropping the flow entries based on sflow-rt program or event outputs.  let me tell you a little hint, i am doing a program that identify the whether the flow is an attack or not.
if the program output display the flow is an attack i need to send flow rule that can drop the flow entry, otherwise i need to send flow rules that can forward flow to its destination.
these flow rules are must be send from sflow-rt to ryu controller using REST API to control the openVswitch flow tables since ryu has  REST API apps that can help to do such things.
Therefore, my question is, how can i  do this?
have you any supportive materials that can help me to achieve the above ideas?


Thanks dear, sorry for my long and continuous question
i am proud by your continuous help

Peter Phaal

unread,
Jun 17, 2023, 12:29:22 PM6/17/23
to sFlow-RT

Habtamu Molla

unread,
Jun 18, 2023, 4:33:41 AM6/18/23
to sFlow-RT
Thanks dear peter for your response,
the example you suggest is js based script, but i need python based samples to adapt my ML model in sflow-rt, based on model prediction i want to take action like forward or drop the entries through REST API.
can you tell me some hint how can i customize the ryu.js script in to python based script?
or if there is any python based script like ryu.js script direct me with more apologize dear

Peter Phaal

unread,
Jun 18, 2023, 12:06:53 PM6/18/23
to sFlow-RT
You should be able to port the embedded JavaScript example to Python by following the examples in Writing Applications. There are some examples on blog.sflow.com that you can modifiy - none of them do exactlly what you want.

Habtamu Molla

unread,
Jun 18, 2023, 12:22:55 PM6/18/23
to sFlow-RT
Thanks a lot dear peter, let me try it
Reply all
Reply to author
Forward
0 new messages