Software Defined Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Problems by adding Flows via REST API of HPE-SDN-Controller V 2.7.18

 
SOLVED
Go to solution
Highlighted
Occasional Advisor

Problems by adding Flows via REST API of HPE-SDN-Controller V 2.7.18

Hi HPE Team,

I am trying to add a Flow via REST API on HPE SDN-Controller Version 2.7.18. I just added a picture to illustrate my method. Below you can see my "test" Flow which I copied from an other user of this forum (sylee). He had the same problem. But he tried to add 2 Flows and not just one. According to him this Flow below was able to add.

{

"flow": {
"priority": 30000,
"table_id": 200,
"idle_timeout": 60,
"match": [
{ "ipv4_src": "10.0.0.1"},
{"ipv4_dst": "10.0.0.22"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}],
"instructions": [{"apply_actions": [{"output": 1}]}]
}

}

But I get this error message. I also tried own Flows but I get always the same error message. I also did authenticate myself at the RSdoc UI. 

{
"error": "java.lang.IllegalArgumentException",
"message": "Failed to validate flowmod: {ofm:[V_1_3,FLOW_MOD,112,452680],cmd=ADD,match={Match(V_1_3):[type=OXM,len=37],fields=ETH_TYPE,IP_PROTO,IPV4_SRC,IPV4_DST,TCP_DST},...}"
}

I use the RSdoc Web REST API via Chromium Browser with Debian 8.9. If u need further information, just ask me. 

I hope you can help me

Regards Tobias

 

 

 

4 REPLIES 4
Highlighted
Occasional Advisor

Re: Problems by adding Flows via REST API of HPE-SDN-Controller V 2.7.18

I am unable to test this right away, but the only extraneous thing I see is the "tcp_dst":"80" ... can you try without the quotes around 80? 

Highlighted
Occasional Advisor

Re: Problems by adding Flows via REST API of HPE-SDN-Controller V 2.7.18

Thanks a lot for your answer.

Meanwhile I found some other discussion here in this forum with the same problem. Furthermore I found the "Main-Problem" in my switch configuration. I had 2 problems:

1. On my HPE 2920 Switch I configured in my OpenFlow instance "table-num sw-table-1 0". But 0 seems not to be allowed, according to the other discussions. Finally I deleted this configuration. (See appendix picture "no_table_num").

2. The port in my above posted flow, isn't part of a VLAN which contains to my OpenFlow instance of_vlan. So I changed my flow a bit and used a correct port and that worked almost fine for me. Here my new flow:

{
"flow":{
"priority":50000,
"hard_timeout":60,
"table_id":100,
"match":[
{
"ipv4_src": "192.168.59.10"
},
{
"eth_type": "ipv4"
},
{
"in_port": 23
}
],
"instructions":[
{
"apply_actions":[
{
"output":24
}
]
}
]
}
}

There is one problem left:

Although I can send the flow now to my switch, I still get an "error" message (see picture error_json)

Code 201 seems to be okay, but this may leads to a problem I am not aware of?

Hope you know this report message. 

Regards Tobias 

 

Highlighted
Solution

Re: Problems by adding Flows via REST API of HPE-SDN-Controller V 2.7.18

Hi Tobias,

It looks like things are operating now. The '201' status code indicates 'created' and should be considered equivalent to 200 when testing for success. Regrettably the "Response Body" is highlighted in red in our JSON web interface, as shown in your "error_json.png" screenshot:

https://restfulapi.net/http-status-201-created

In general, when you see the REST API return a message that says "Failed to validate flowmod", a good rule of thumb is to enable OpenFlow debug messages on the switch. This will only be useful if the switch is in a controlled environment (because you'd be seeing debug for all OpenFlow operations), but it will tell you why the switch is rejecting the flowmod. In your case above, it would remove the guesswork as to what is wrong with the flowmod (ingress port). If you don't see any openflow debug output on the switch, then the flowmod is being rejected by the VAN controller (but that's a rarer case, usually caused by improperly-formatted JSON).

To enable OpenFlow debug on the switch, use:

debug openflow
debug destination session

Then to turn it off, use:

no debug all

I think the result of the "table-num sw-table-1 0" command would be that the switch would use table 0 in the pipeline as a software table, which means no hardware table would be used. For what it's worth, you should only need to use "table-num ..." commands if you're dealing with a non-VAN controller that doesn't understand the HPE Aruba switch pipeline. In all other cases, just using "pipeline-model standard" (tables 0,100,200) or "pipeline-model custom" (flexible tables, only available on 2930F, 3810, 5400R) should be sufficient.

I hope this helps!

Shaun

I am an HPE Employee
Highlighted
Occasional Advisor

Re: Problems by adding Flows via REST API of HPE-SDN-Controller V 2.7.18

Hello Shaun Wackerly,

sorry for the late response and thank you for this information.  I use the Flow-Tables now in that way you mentioned it. I am going to add some other Meters via the REST API next time and there I will use the debug mode.

I hope this will help me there too. Thanks for your support!

Tobias