Measure bandwidth of each link

1,566 views
Skip to first unread message

Luca Prete

unread,
Jul 30, 2013, 3:49:07 AM7/30/13
to sflo...@googlegroups.com
Hi,

I've an OpenFlow testbed based on software switches (OVS) and Floodlight.
I would like to measure the bandwidth used on each link of my network and get the following parameters to act on the Floodlight controller:

- src switch (agent)
- src port (or ifindex for the moment would be ok)
- dst switch
- dst port

I've already connected the switches as described in the tutorials. Both ifoututilization (or ifinutilization) remains to 0.

Other question: is there a reference guide where I can find all possible values for keys, value and filter (used for creating a flow)?


Thank you, cheers,

Luca P.

Peter Phaal

unread,
Jul 30, 2013, 10:55:51 AM7/30/13
to sflo...@googlegroups.com
You can get the topology information from Floodlight. The /wm/core/controller/switches/json and /wm/topology/links/json calls allow you to identify the switches and ports connecting to each link.


The sFlow-RT /flowkeys/json lists the flow attributes that can be used to define flows. The list will vary based on the traffic running on your network (e.g. if there is no IPv6 traffic, then the IPv6 keys won't be shown).

The link utilizations may be reported as zero if there is very little traffic (or the link capacity isn't being reported). Are you seeing data if you report ifinoctets/ifoutoctets?

Are you using Mininet? The following examples pull together data from sFlow-RT, Mininet and Floodlight:

Luca Prete

unread,
Jul 31, 2013, 6:52:32 AM7/31/13
to sflo...@googlegroups.com
Hi Peter,

First of all thanks for your quick reply!
I already use the Floodlight APIs but as already described in other threads it is currently difficult to map the openflow interfaces with the ifindexes provided by sFlow.
I've already read the examples on Mininet that you reported but "unfortunatelly" I'm using most of all istances of Open vSwitch and (in few days I hope) hardware switches.
I realized just now that ifin/ifout utilization was just a percentage and not an absoulte value in byte as I thought....

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...
More than this, I should manually map the OF interface number with the ifindex!!

Do you have any different idea?

Thanks again,

Luca

Peter Phaal

unread,
Jul 31, 2013, 6:38:28 PM7/31/13
to sflo...@googlegroups.com


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.

Luca Prete

unread,
Aug 1, 2013, 11:03:23 AM8/1/13
to sflo...@googlegroups.com
Hi Peter,

With the flow definition and the dump query I finally got my results!
About matching ifindex and ofports I think it is impossibile for the moment! Thus, for research purposes (and a small network environment) I manually create a table of corrispondence in mysql db on the same machine...It's very bad but at the moment it seems that's the only solution.

I tried also to find in sflow the interface name (i.e. eth2), exported Floodlight as well with the openflow port number....but I didn't find anything...maybe I missed anything?

Cheers,

Luca

Peter Phaal

unread,
Aug 1, 2013, 11:29:49 AM8/1/13
to Luca Prete, sflo...@googlegroups.com
You should be able to get the mapping between ifIndex and ifName using SNMP.

The OVS trunk now includes support for reporting ifIndex values.


You should ask your switch vendor when they plan to upgrade.


--
You received this message because you are subscribed to the Google Groups "sFlow-RT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sflow-rt+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages