(2014¦~07¤ë22¤é 18:45), Dickens wrote:
> Hi,
> My goal is to calculate the traffics from flows and switch ports.
> So that, I try to get the counts, set the tx_bytes, rx_bytes(port stats), and 
> bytes_count(flow stats) with zero, but I¡¦m stuck with sending by RESTful api.
> 
> I trace the Ryu source code and openflow spec, it seems Ryu support the 
> OPFlowMod with attributes.
> But, is there any way to do that by using RESTful api?

1) set to zero the counts of "port stats"

As far as I know, it is impossible in the spec of OpenFlow.

2) set to zero the counts of "flow stats"

Is possible.
When sending a flow_mod, please set to "4" flags.
"4" means OFPFF RESET COUNTS.

OF 1.3.4 spec (6.4 Flow Table Modification Messages) says:

    If the OFPFF_RESET_COUNTS flag is set, the flow entry counters must be 
cleared.

Examples are as follows.

    curl -d '{"cookie": "1",
              "dpid": "1",
              "priority": "23999",
              "idle_timeout": "0",
              "hard_timeout": "0",
              "flags":"4",
              "table_id": "0",
              "match": {"in_port": "1"},
              "actions": [{"type":"OUTPUT","port":"5"}]}' 
http://127.0.0.1:8080/stats/flowentry/modify";

> Or any suggestions to do calculating the traffic?

I would like suggest the following, what do you think?

  1. get stats
  2. wait for a certain period of time
  3. get stats again
  4. calculates the difference between 1 and 3

> 
> Thanks for your answering.
> 
> 
> 
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> Ryu-devel mailing list
> Ryu-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
> 

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to