Hi,

if I deploy a new forwarding rule based on a specific switch port statistic 
(let suppose that the link is saturated), please how can I make sure that any 
new flow from a host linked to that switch (to the same destination host) will 
follow the new rule instead of using the existing flow mod.
will this be sufficient?

 OFFlowMod flowMod = new OFFlowMod();
 matchFields.setWildcards(OFMatch.OFPFW_ALL & ~OFMatch.OFPFW_DL_SRC);
 flowMod.setMatch(matchFields);

Thanks,
Foli
Le 21 mai 2011 à 09:25, David Erickson a écrit :

Hi Foli-
This is code specific to getting Queue stats from a switch using Beacon.  Are 
you using Beacon as your OpenFlow controller?  What stats are you trying to get?

-David

On 5/20/2011 11:35 PM, Gaba Foli kodjo wrote:
Hi,

I would like to get statistics from the switches. Please is there any tutorial 
explaining how to do this?
I have tried this piece of code that I found online:
public List<OFStatistics> getSwitchQueuesStat(IOFSwitch sw) {
       Future<List<OFStatistics>> future;
       List<OFStatistics> values = null;
if (sw != null) {
           OFStatisticsRequest req = new OFStatisticsRequest();
           OFQueueStatisticsRequest fsr = new OFQueueStatisticsRequest();
           fsr.setPortNumber(OFPort.OFPP_ALL.getValue());
           req.setStatisticType(OFStatisticsType.QUEUE);
           req.setStatistics(Collections.singletonList((OFStatistics)fsr));
           req.setLengthU(req.getLengthU() + fsr.getLength());


try {
               future = sw.getStatistics(req);
               values = future.get(10, TimeUnit.SECONDS);
           } catch (Exception e) {
               System.err.println("Failure retrieving queues");
           }
log.info<http://log.info>("stat obtained are: " + values);
       }
return values;
   }

Is it this right way to get the stats from the switches? I am also missing some 
jar to run this? any tips?

Thanks,

Foli


_______________________________________________
openflow-discuss mailing list
[email protected]<mailto:[email protected]>
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss


_______________________________________________
openflow-discuss mailing list
[email protected]
https://mailman.stanford.edu/mailman/listinfo/openflow-discuss

Reply via email to