Hi, I have some questions about this code: 1) Does this code request to switch OF all flow entries that are kept in Flow Table???
2) How can I get the answer, after sent this request ? Thanks On Mon, Sep 28, 2009 at 9:36 PM, Martin Casado <cas...@nicira.com> wrote: > Ah right, sorry. It looks like flow_stats are not exposed to Python. > Though they are simple to retrieve from C++: > > Here's code where we use it in an internal app: > > /* Compose the ofp_stats_request header. */ > Array_buffer b(0); > ofp_stats_request osr; > osr.header.version = OFP_VERSION; > osr.header.type = OFPT_STATS_REQUEST; > osr.header.xid = ff->xid; > osr.type = htons(OFPST_FLOW); > osr.flags = htons(0); > size_t body_ofs = offsetof(ofp_stats_request, body); > memcpy(b.put(body_ofs), &osr, body_ofs); > > /* Copy the user-provided ofp_flow_stats_request, zeroing the pad > * bytes just in case the caller failed to do so. */ > ofp_flow_stats_request fsr = request; > fsr.match.pad = 0; > memset(&fsr.pad, 0, sizeof fsr.pad); > memcpy(b.put(sizeof request), &request, sizeof request); > > /* Send. */ > ofp_header& oh = b.at<ofp_header>(0); > oh.length = htons(b.size()); > int error = send_openflow_command(dpid, &oh, false); > > > Hi Martin, >> >> There is a difference between aggregated stats, and flow stats. >> In case I need to know the details from all flows individually, I can send >> a flow_stats with all fields wildcarded. The switch will return an array of >> flow_stats structures. >> The similar request for the aggregate type, will return the total number >> of flows for this match, along with packet and byte counts. >> >> In the first case, I can get flow details without having any knowledge for >> the table contents, while for aggregated request, I need to know beforehands >> the flow, and ask for the specific match (which should be unique in the >> table, otherwise it's sum of stats).. >> >> Thanks, >> Yiannis >> >> >> On Sun, Sep 27, 2009 at 8:27 AM, Martin Casado <cas...@nicira.com<mailto: >> cas...@nicira.com>> wrote: >> >> Aggregate stats are flow stats. >> >> Hi all, >> >> Is flow stats message included in current nox tree? I looked >> into swichstats.py and core.py and could only find port, >> table, desc and aggregate stats. If this is the case, any >> particular reason it's not there? >> >> I need to use it for an application to retrieve the traffic >> matrix of my network. >> >> Thanks, >> Yiannis >> >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> nox-dev mailing list >> nox-dev@noxrepo.org <mailto:nox-dev@noxrepo.org> >> >> http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org >> >> >> >> > > _______________________________________________ > nox-dev mailing list > nox-dev@noxrepo.org > http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org > -- Rodrigo de Souza Braga Mestrando em Ciência da Computação Universidade Federal do Amazonas - UFAM
_______________________________________________ nox-dev mailing list nox-dev@noxrepo.org http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org