[OPNFLWPLUG-1011] IllegalArgumentException when metadata field is used in learn action Created: 15/May/18  Updated: 04/Jun/18  Resolved: 04/Jun/18

Status: Resolved
Project: OpenFlowPlugin
Component/s: nicira-extensions
Affects Version/s: None
Fix Version/s: Oxygen-SR2, Fluorine

Type: Bug Priority: High
Reporter: Ravindra Thakur Assignee: Ravindra Thakur
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

IllegalArgumentException is thrown when metadata field is used in learn action eg.
sudo ovs-ofctl -v -O Openflow13 add-flow br-int "table=22, priority=0, ip, actions=controller:65535, learn(table=22, priority=10, hard_timeout=10, dl_type=0x0800, NXM_OF_IP_DST[], OXM_OF_METADATA[1..23])"

stack trace:
2018-04-20 11:50:35,966 | WARN | entLoopGroup-9-1 | OFDecoder | 392 - org.opendaylight.openflowplugin.openflowjava.openflow-protocol-impl - 0.6.1.SNAPSHOT | Message deserialization failed
java.lang.IllegalArgumentException: Invalid range: -2147482616, expected: [[0..4294967295]].
at org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder.checkSrcFieldRange(FlowModAddMatchFromFieldBuilder.java:132) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.action.rev140421.flow.mod.spec.flow.mod.spec.flow.mod.add.match.from.field._case.FlowModAddMatchFromFieldBuilder.setSrcField(FlowModAddMatchFromFieldBuilder.java:137) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.nx.codec.action.LearnCodecUtil.readFlowModAddMatchFromField(LearnCodecUtil.java:255) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.nx.codec.action.LearnCodecUtil.readFlowMod(LearnCodecUtil.java:235) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.nx.codec.action.LearnCodecUtil.buildFlowModSpecs(LearnCodecUtil.java:207) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.nx.codec.action.LearnCodec.deserialize(LearnCodec.java:69) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.nx.codec.action.LearnCodec.deserialize(LearnCodec.java:28) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.nx.codec.action.ActionDeserializer.deserialize(ActionDeserializer.java:62) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.nx.codec.action.ActionDeserializer.deserialize(ActionDeserializer.java:22) [388:org.opendaylight.openflowplugin.openflowjava-extension-nicira:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.util.ActionUtil.readAction(ActionUtil.java:68) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.AbstractActionInstructionDeserializer.readActions(AbstractActionInstructionDeserializer.java:73) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.ApplyActionsInstructionDeserializer.deserialize(ApplyActionsInstructionDeserializer.java:31) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.instruction.ApplyActionsInstructionDeserializer.deserialize(ApplyActionsInstructionDeserializer.java:18) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.util.InstructionUtil.readInstruction(InstructionUtil.java:68) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart.MultipartReplyFlowStatsDeserializer.deserialize(MultipartReplyFlowStatsDeserializer.java:107) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart.MultipartReplyFlowStatsDeserializer.deserialize(MultipartReplyFlowStatsDeserializer.java:40) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart.MultipartReplyMessageDeserializer.deserialize(MultipartReplyMessageDeserializer.java:44) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowplugin.impl.protocol.deserialization.multipart.MultipartReplyMessageDeserializer.deserialize(MultipartReplyMessageDeserializer.java:23) [383:org.opendaylight.openflowplugin.impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.deserialization.DeserializationFactory.deserialize(DeserializationFactory.java:56) [392:org.opendaylight.openflowplugin.openflowjava.openflow-protocol-impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.core.OFDecoder.decode(OFDecoder.java:51) [392:org.opendaylight.openflowplugin.openflowjava.openflow-protocol-impl:0.6.1.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.core.OFDecoder.decode(OFDecoder.java:27) [392:org.opendaylight.openflowplugin.openflowjava.openflow-protocol-impl:0.6.1.SNAPSHOT]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88) [102:io.netty.codec:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [107:io.netty.transport:4.1.22.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [102:io.netty.codec:4.1.22.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [102:io.netty.codec:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [107:io.netty.transport:4.1.22.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:310) [102:io.netty.codec:4.1.22.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:284) [102:io.netty.codec:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [107:io.netty.transport:4.1.22.Final]
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) [105:io.netty.handler:4.1.22.Final]
at org.opendaylight.openflowjava.protocol.impl.core.IdleHandler.channelRead(IdleHandler.java:37) [392:org.opendaylight.openflowplugin.openflowjava.openflow-protocol-impl:0.6.1.SNAPSHOT]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1414) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:945) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:146) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) [107:io.netty.transport:4.1.22.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:451) [107:io.netty.transport:4.1.22.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886) [104:io.netty.common:4.1.22.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [104:io.netty.common:4.1.22.Final]
at java.lang.Thread.run(Thread.java:748) [?:?]



 Comments   
Comment by Sunil Kumar M S [ 16/May/18 ]

ecelgp if I execute 'test-openflowplugin-core' on this gerrit patch will it verify this bug? Do we have any test case that can verify this case/bug while executing 'test-openflowplugin-core' on the gerrit patch.

Comment by Luis Gomez [ 20/May/18 ]

No, I do not think we have verification for this specific flow, if someone provides the flow body (json or xml) I can easily add the test case.

Comment by Ravindra Thakur [ 21/May/18 ]

This is the json dump for the flow from inventory-nodes restconf.

{
"id": 22,
"flow": [
{
"id": "L3.187344020222020.22.0L3.",
"priority": 0,
"table_id": 22,
"hard-timeout": 0,
"installHw": true,
"match": {
"ethernet-match": {
"ethernet-type":

{ "type": 2048 }

}
},
"strict": false,
"cookie": 134217732,
"flow-name": "Subnet Route Table Miss",
"instructions": {
"instruction": [
{
"order": 0,
"apply-actions": {
"action": [
{
"order": 0,
"output-action":

{ "max-length": 65535, "output-node-connector": "CONTROLLER" }

},
{
"order": 1,
"openflowplugin-extension-nicira-action:nx-learn": {
"hard-timeout": 10,
"fin-hard-timeout": 0,
"flags": 0,
"idle-timeout": 0,
"table-id": 22,
"cookie": 134217732,
"flow-mods": [
{
"flow-mod-add-match-from-value":

{ "src-ofs": 0, "value": 2048, "flow-mod-num-bits": 16, "src-field": 1538 }

},
{
"flow-mod-add-match-from-field":

{ "src-ofs": 0, "dst-ofs": 0, "dst-field": 4100, "flow-mod-num-bits": 32, "src-field": 4100 }

},
{
"flow-mod-add-match-from-field":

{ "src-ofs": 1, "dst-ofs": 1, "dst-field": 2147484680, "flow-mod-num-bits": 23, "src-field": 2147484680 }

}
],
"fin-idle-timeout": 0,
"priority": 10
}
}
]
}
}
]
},
"idle-timeout": 0,
"barrier": false
}
]
},

Comment by Ravindra Thakur [ 28/May/18 ]

Luis, were you able to add the test case for this?

Generated at Wed Feb 07 20:33:58 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.