Sorry, I was wrong in saying my program can query flow statistics of
large flows. It cant query statistics of flows, no matter large or
small.
But I can query statistics of port. That is successful.
Below is my code to query flow statistics:
size_t size = sizeof(ofp_stats_request) + sizeof(ofp_flow_stats_request);
boost::shared_array<char> raw_of(new char[size]);
ofp_stats_request *ost = (ofp_stats_request*)raw_of.get();
ost->header.version = OFP_VERSION;
ost->header.type = OFPT_STATS_REQUEST;
ost->header.length = htons(size);
ost->header.xid = htonl(STATS_DETAIL_ID);
ost->type = htons(OFPST_FLOW);
ost->flags = htons(0);
ofp_flow_stats_request* ofsr =
(ofp_flow_stats_request*)(((uint8_t*)ost->body)+0);
ofsr->table_id = 0xff; //request for all flow table
ofsr->out_port = OFPP_NONE;
for(.....){//some loop code
ofp_match tmpmatch;
tmpmatch.nw_src=itflow->first.nw_src;
tmpmatch.nw_dst=itflow->first.nw_dst;
tmpmatch.tp_src=itflow->first.tp_src;
tmpmatch.tp_dst=itflow->first.tp_dst;
tmpmatch.nw_proto=itflow->first.nw_proto;
tmpmatch.in_port=itflow->first.in_port;
tmpmatch.wildcards=htonl(OFPFW_DL_VLAN | OFPFW_DL_SRC |
OFPFW_DL_DST | OFPFW_DL_TYPE | OFPFW_TP_SRC | OFPFW_TP_DST );
memcpy(&ofsr->match, &tmpmatch, sizeof(ofp_match));
if( 0 != send_openflow_command((it->first), &ost->header, false) ){
;
}
}
When parsing struct ofp_flow_stats, I find it is exactly the flow I
want to query. But the packet_count and byte_count are always 0.
Is this some setting problem?
On Thu, Dec 10, 2009 at 6:02 PM, Guanyao Huang <[email protected]> wrote:
> Hello
> Sorry to bother others. I one question regarding querying flow
> statistics from switches through struct ofp_stats_request. I am using
> nox 5.0
>
> In my topology I periodically ping between hosts. However, I find the
> packet_count and byte_count from the switch are always 0. I am
> confirmed that I successfully received ofp_flow_stats from the desired
> switch. The central controller maintains flow information and I query
> flows with desired nw_proto, nw_src, nw_dst, tp_src, tp_dst, and
> in_port. Other fields I use wildcard.
>
> When I use tcpreplay to replay some big packets, I find that the
> returned size are not always 0. However, flows in pcap file expire
> quickly and it is not easy to debug.
>
> Is it true that the returned size will always be 0 if the packet is small?
>
_______________________________________________
nox-dev mailing list
[email protected]
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org