On Wednesday, July 31, 2013 3:52:32 AM UTC-7, Luca Prete wrote:
What I need is to periodically (let's say 1 minute) know the bandwidth on each point-to-point link of my network via REST API. Then with those data I can install new rules on the switches through the REST API of Floodlight.
Should I manually define on sFlow-RT a new flow for each couple of network cards composing the links of my network? I think this could become hard for a real use in big networks...
You don't need to define any flow metrics to get minute granularity link bandwidth information. The sFlow agents periodically exports interface counters and these automatically appear in sFlow-RT. For example, the query
http://localhost:8008/metric/ALL/ifinutilization,ifoututilization/json reports the busiest link by ingress utilization and the busiest by egress utilization:
[
{
"agent": "10.0.0.30",
"dataSource": "5",
"metricN": 87,
"metricName": "ifinutilization",
"metricValue": 0.7353711844816322,
"updateTime": 1375309669625
},
{
"agent": "10.0.0.30",
"dataSource": "6",
"metricN": 87,
"metricName": "ifoututilization",
"metricValue": 0.5837541370217424,
"updateTime": 1375309666725
}
]
The dataSource value indicates the ifIndex of the interface. If you want to see all the interfaces, then use the following dump query:
The default sFlow counter export period is every 30 seconds, which should be ok if you are only interested in minute by minute data. If you want faster updated, then the flow definition {name:'flowbytes', value:'bytes'} will generate a flow based metric for each interface.
As far as mapping ifIndex numbers to OpenFlow port numbers - you should check the numbering scheme used by your switches. There may be a way to compute the one from the other, or at least create a lookup table for each model of switch.