- Community Home
- >
- Networking
- >
- Software Defined Networking
- >
- How to use "set_field"
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2013 03:12 AM
11-28-2013 03:12 AM
How to use "set_field"
I want to create a flow that before packets send egress port, change the destination ip.
I use the RSdoc on HP VAN SDN Controller 2.0, below is flow JSON string
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{"flow": {
"priority": 30000,
"table_id": 0,
"idle_timeout": 60,
"match": [
{"ipv4_src": "10.0.0.2"},
{"ipv4_dst": "10.0.0.22"},
{"ip_proto": "tcp"},
{"eth_type": "ipv4"},
{"tcp_dst": "80"}
],
"instructions": [
{"apply_actions": [{"set_field" : [{"ipv4_dst": "10.0.0.25"}]},
{"output": 66}]}]
}}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
then result is below
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
HTTP Status 500 - com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
type Exception report
message com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.ClassCastException: com.fasterxml.jackson.databind.node.ArrayNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
com.hp.of.json.ActionCodec.decodeSetField(ActionCodec.java:286)
com.hp.of.json.ActionCodec.decode(ActionCodec.java:238)
com.hp.of.json.InstructionCodec.decodeActions(InstructionCodec.java:211)
com.hp.of.json.InstructionCodec.decode(InstructionCodec.java:173)
com.hp.of.json.OfmFlowModCodec.decodeInstructions(OfmFlowModCodec.java:223)
com.hp.of.json.OfmFlowModCodec.decode(OfmFlowModCodec.java:181)
com.hp.of.json.OfmFlowModCodec.decode(OfmFlowModCodec.java:46)
com.hp.of.json.OfJsonCodec.decode(OfJsonCodec.java:59)
com.hp.of.json.OfJsonCodec.decode(OfJsonCodec.java:42)
com.hp.util.json.JSON.fromJson(JSON.java:68)
com.hp.sdn.rs.FlowProvider.create(FlowProvider.java:73)
com.hp.sdn.rs.DatapathsResource.createFlow(DatapathsResource.java:355)
sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1511)
com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1442)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391)
com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381)
com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538)
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716)
javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
com.hp.util.rs.SecurityFilter.doFilter(SecurityFilter.java:94)
com.hp.util.rs.auth.AbstractTokenAuthFilter.doFilter(AbstractTokenAuthFilter.java:106)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
If I removed "set_field" then I can receive 200 OK.
Above JSON string has problem? Please let me know how to use "set_field".
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2013 03:38 AM - edited 11-28-2013 03:39 AM
11-28-2013 03:38 AM - edited 11-28-2013 03:39 AM
Re: How to use "set_field"
Hi,
You can follow the intructions here to check the JSON Schema. This will help a lot.
The value of "set_field" should be "flow_match_field" object.
In the original JSON, you are passing an array ( the square brackets [])
{"set_field" : [{"ipv4_dst": "10.0.0.25"}]}
To fix this, simply remove the square brackets []
{"set_field" : {"ipv4_dst": "10.0.0.25"}}
So the new JSON would be...
{
"flow": {
"priority": 30000,
"table_id": 0,
"idle_timeout": 60,
"match": [
{
"ipv4_src": "10.0.0.2"
},
{
"ipv4_dst": "10.0.0.22"
},
{
"ip_proto": "tcp"
},
{
"eth_type": "ipv4"
},
{
"tcp_dst": "80"
}
],
"instructions": [
{
"apply_actions": [
{
"set_field": {
"ipv4_dst": "10.0.0.25"
}
},
{
"output": 66
}
]
}
]
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2013 06:50 PM
11-28-2013 06:50 PM
Re: How to use "set_field"
Thanks for your answer.
Fixed JSON was good, but I receive below.
{
"error": "java.lang.IllegalArgumentException",
"message": "{ofm:[V_1_3,ERROR,76,3091],BAD_ACTION/BAD_SET_TYPE,#dataBytes=64,OFM-cause:[V_1_3,FLOW_MOD,128,3091]}"
}
OFS Specification describe that "BAD_ACTION/BAD_SET_TYPE" is Unsupported type in SET_FIELD action.
HP OFS not ready for changing IP ( port too) ?
I hope HP support flow_match_field's some property. ( ipv4_src, ipv4_dst, udp_src, udp_dst, ... )
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2013 04:00 AM - edited 12-01-2013 04:01 AM
12-01-2013 04:00 AM - edited 12-01-2013 04:01 AM
Re: How to use "set_field"
Check the HP OpenFlow Administrators Guide - Appendix A (p68)
There are several diagrams that show the capabilities of the OpenFlow implementation on HP switches.
This shows that the IP Src/IP Dst fields are currently not settable :(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-01-2013 03:15 PM
12-01-2013 03:15 PM
Re: How to use "set_field"
It can be done in software, but you should be carefull with the resources.
you could set the table_id to the software table. (OF 1.3)
"table_id": 200,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2014 05:47 AM
03-05-2014 05:47 AM
Re: How to use "set_field"
Hi,
Please let us know if your problem is solved.
Please feel free to reply incase you have more questions around the same topic or open a new thread if new topic.
If you feel your question has been answered, please do let us know by marking this response as an accepted solution.
Thanks
HP SDN Team