Software Defined Networking
1748171 Members
4159 Online
108758 Solutions
New Discussion

HP VAN SDN Controller v2.4.5 - Can't get flow entries from switch

 
PaMartins
Occasional Contributor

HP VAN SDN Controller v2.4.5 - Can't get flow entries from switch

Hi,

 

I've been struggling with a problem on my application. I need to use HP Controller Service getFlowStats function to get all the flow entries that I install on a specific switch.

 

The problem is that I can get all the flow entries on the switch except the flow that I really want to retrieve: it's a flow where I want to push a Vlan Header to the packets that match, set it's VlanId to 100 and send it to a specific port.

 

Using ovs-ofctl dump-flows we can see the the flow was correctly installed:

cookie=0x64, duration=115.19s, table=1, n_packets=0, n_bytes=0, priority=50000,ip actions=push_vlan:0x8100,set_field:100->vlan_vid,NORMAL

 

I'll attach screen shoots of Wireshark logs to show the flow-add message with the flow that I created and the of_flow_stats_reply logs. They both show the correct flow entry being added and being sent to the controller.

 

The strange part is that using tools like Wireshark and Mininets ovs-ofct dump-flows I can see that the flow is correctly installed on the datapath and packets that hit it get marked with the appropriate Vlan tag, but when I try to retrieve it using ControllerService.getFlowStats( DataPathId , TableId ), the return message shows:


MySdnLab: PacketListener: flow stats -> {fstats:tid=null,pri=0,match=null,...}

 

Trying to solve this problem I included a Flow Remove Flag on the flow entry to see if the switch would send it back when it's idle Timeout expires and it did and return message was correct.

 

So I would like to ask if someone could help me with this issue, I'll even put the code I used to build the flow and send it to the controller and the code to get it's stats.

 

Thank you,
PM

 

/**************//***********************/

 

private void setPushVlanFlow (DataPathId dpId){
       OfmMutableFlowMod smallflowMod = (OfmMutableFlowMod) MessageFactory.create(PV, MessageType.FLOW_MOD);

       MutableMatch match = MatchFactory.createMatch(PV)
.addField(FieldFactory.createBasicField(PV, OxmBasicFieldType.ETH_TYPE, EthernetType.IPv4));
       smallflowMod.match((Match) match.toImmutable());

       int lowLabel = 100;

       Action vlanActionPush = ActionFactory.createAction(PV, ActionType.PUSH_VLAN, EthernetType.VLAN );
       Action vlanActionSetField = ActionFactory.createActionSetField(PV, OxmBasicFieldType.VLAN_VID, VlanId.valueOf(lowLabel));
       Action outputAction = ActionFactory.createAction(PV, ActionType.OUTPUT, Port.NORMAL);

       InstrMutableAction write = InstructionFactory.createMutableInstruction( PV, InstructionType.APPLY_ACTIONS);
       write.addAction(vlanActionPush)
                 .addAction(vlanActionSetField)
                 .addAction(outputAction);
       smallflowMod.addInstruction( (Instruction) write.toImmutable() ) ; 


       smallflowMod.command(FlowModCommand.ADD)
                                  .hardTimeout( 0 )
                                  .idleTimeout( 10 )
                                  .cookie(lowLabel)
                                  .tableId( TableId.valueOf( 1 )  )
                                  .priority( 50000 )
                                  .bufferId( BufferId.NO_BUFFER );

 

       try {
                    mControllerService.sendFlowMod( (OfmFlowMod)smallflowMod.toImmutable(), dpId );
                    LOG.info("MySdnLab: SwitchListener handleSmallFlows: successfully for src node " + dpId.toString());

       } catch (OpenflowException e) {
                     // TODO Auto-generated catch block
                     LOG.info("MySdnLab: SwitchListener Set Initial Flows: DNS exception {}", e);
       }
}
/*************************//**************************/

public void run() {
      // TODO Auto-generated method stub
      LOG.info("MySdnLab: PacketListener: Print Flow entries on device -> " + auxDpId.toString());
      List<MBodyFlowStats> Statslist = mControllerService.getFlowStats( auxDaId , TableId.ALL);

      for(MBodyFlowStats flowStats : Statslist){
                LOG.info("MySdnLab: PacketListener: flow stats -> " + flowStats.toString());
      }
}

 

2 REPLIES 2
ssrirama
Advisor

Re: HP VAN SDN Controller v2.4.5 - Can't get flow entries from switch

I hesitate to say this may be an issue that HP will have to deal with. It seems like you've gone through the appropriate process for loading the flow, verifying its installation on the switch, and verifying that it is being used when the match parameters are satisfied. Given that, you should be seeing stats for your flows; if you are not getting results...there may be a bigger issue present.

 

To be clear, is it the case that you are getting stats back for your flow but they are incorrect/null/0 or is it the case that you get stats back for every flow on the switch and the flow your app programmitically installs is missing?

Joetel
Frequent Advisor

Re: HP VAN SDN Controller v2.4.5 - Can't get flow entries from switch

Hi PaMartin,

 

Do I understand correctly that when your application does the getFlowStats( auxDaId , TableId.ALL), all flows on the switch are returned except the one your application has send itself? And at the same time it does show up in the ovs-ofctl dump-flows output? Could you perhaps post both outputs? Thanks!

 

Best regards,

 

Wouter

HP SDN CoE Team