Software Defined Networking
1826738 Members
2579 Online
109702 Solutions
New Discussion

Getting flow stats by cookie or cookiemask

 
DNeto
New Member

Getting flow stats by cookie or cookiemask

Hello,

I'm trying to get Flow Stats information filtering by cookie, but i'm not sure i'm doing it right.

Openflow v1.3.4 docs says i can get individual flows statistics and i tried to get them by Van Controller API with following code:

 

DataPathInfo dataPathInfo = getCoreInfo();

OfmMutableMultipartRequest request = (OfmMutableMultipartRequest) MessageFactory.create(ProtocolVersion.V_1_3, MessageType.MULTIPART_REQUEST, MultipartType.FLOW);
MBodyMutableFlowStatsRequest body = (MBodyMutableFlowStatsRequest)request.getBody();
body.tableId(TableId.ALL);
body.cookie(COOKIE);
body.cookieMask(COOKIE_MASK);
body.match(match); MessageFuture msgFuture = controllerService.send(request.toImmutable(), dataPathInfo.dpid());

 
I'm getting a "UNSATISFIED" MessageFuture and i'm wondering if i forgot some property on body or something else.

1 REPLY 1
sdnindia
Trusted Contributor

Re: Getting flow stats by cookie or cookiemask

Hello DNeto,

 

As per the SDN Programming guide [page 34],

Applications may construct and send messages to datapaths via the “send” methods:

send(OpenflowMessage, DataPathId) : MessageFuture

send(List<OpenflowMessage>, DataPathId) : List<MessageFuture>

 

The returned MessageFuture(s) allow the caller to choose whether to wait synchronously (block until the outcome of the request is known), or whether to do some other

work and then check on the result of the request later.When a message is sent to a datapath, the corresponding MessageFutureencapsulates the state of that request.

Initially the future’s result is UNSATISFIED. Once the outcome is determined, the future is “satisfied” with one of the following results:

• SUCCESS—the request was a success; the reply message is available via reply().

• SUCCESS_NO_REPLY—the request was a success; there is no associated reply.

• OFM_ERROR—the request failed; the datapath issued an error, available via reply().

• EXCEPTION—the request failed due to an exception; available via cause().

 

You can also have a look on the code example [page 34 -35] that attaches a timestamp payload to an ECHO_REQUEST message, then retrieves the timestamp payload from the ECHO_REPLY sent back by the datapath.

 

Please let us know if this helps or you are still facing some problem.

 

Thanks,

HP SDN Team