/event/json Question

31 views
Skip to first unread message

Huan Chen

unread,
Jun 3, 2022, 10:03:32 AM6/3/22
to sFlow-RT

Thank you for maintaining the community and give our support.

I am starting to use sFlow-RT to detect the elephant flow, but I have some problems with sFlow.

  • l  I use mininet, the topology is as following, and the link capacity is set to be 100Mbps. And I install the sflow-RT on the same VM machine.

fat-tree.png

  • I use the sflow command to set the sflow agent.

sudo ovs-vsctl -- --id=@sflow create sFlow agent=s13 target=\"127.0.0.1:6343\" header=128 sampling=10 polling=1 -- set bridge s13 sflow=@sflow

sudo ovs-vsctl -- --id=@sflow create sFlow agent=s14 target=\"127.0.0.1:6343\" header=128 sampling=10 polling=1 -- set bridge s14 sflow=@sflow

  • I use Rest API to define two flows separately, which are from h1 to h2 and from h3 to h4.

For Flow definition:

http://CollectorIP:8008/flow/flow_1_2/json

{"key":"ipsource,ipdestination,ipprotocol,macsource,macdestination","value":"byte","filter":"ipsource=10.0.0.1&ipdestination=10.0.0.2"}

http://CollectorIP:8008/flow/flow_3_4/json

{"key":"ipsource,ipdestination,ipprotocol,macsource,macdestination","value":"byte","filter":"ipsource=10.0.0.3&ipdestination=10.0.0.4"}

For Threshold Definition:

http://CollectorIP:8008/threshold/threshold_1_2/json

{"metric":"flow_1_2","value":1310720,"timeout":9}

http://CollectorIP:8008/threshold/threshold_3_4/json

{"metric":"flow_3_4","value":1310720,"timeout":9}

  • I use “iperfudp 20M h1 h2” and “iperfudp 5M h3 h4” to generate two udp flows.

And I use flow browse to see the observations.

What I submit in this page is that:

key: ipsource,ipdestination,ipprotocol,macsource,macdestionation

value: bps

filter: (ipsource=10.0.0.1&ipdestionation=10.0.0.2)|(ipsource=10.0.0.3&ipdestionation=10.0.0.4)

browse.png

  •  Problem is that I cannot get the tiggered event by using the Rest API /event/json.
  • But I found that when I use /flow/json, there are three flows: two I defined before and the one from flow browse page.

 {

    "flow_1_2": {

        "filter": "ipsource=10.0.0.1&ipdestination=10.0.0.2",

        "activeTimeout": 60,

        "t": 2,

        "value": "byte",

        "fs": ",",

        "n": 5

    },

    "browse_flows0": {

        "filter": "(ipsource=10.0.0.1&ipdestination=10.0.0.2)|(ipsource=10.0.0.3&ipdestination=10.0.0.4)",

        "t": 2,

        "keys": "ipsource,ipdestination,ipprotocol,macsource,macdestination",

        "activeTimeout": 60,

        "value": "bytes",

        "fs": "_SEP_",

        "n": 10

    },

    "flow_3_4": {

        "filter": "ipsource=10.0.0.3&ipdestination=10.0.0.4",

        "activeTimeout": 60,

        "t": 2,

        "value": "byte",

        "fs": ",",

        "n": 5

    }

}

  • And I try to define the threshold for flow browse one like that:

http://CollectorIP:8008/threshold/test/json

{"metric":" browse_flows0","value":1310720,"timeout":9}

Again I iperfudp 20M h1 h2 and iperf 5M h3 h4,  then I use /event/json and I get the triggered event.

I am wondering why this phenomenon occurs and why I cannot get the triggered event by the setting I did before.

 

Hope for your reply.

Thank you.

Peter Phaal

unread,
Jun 3, 2022, 10:14:10 AM6/3/22
to sFlow-RT
It looks like the value setting in your flow definitions is incorrect, it should be "bytes" not "byte"
Reply all
Reply to author
Forward
0 new messages