[OPNFLWPLUG-509] Failed to create flow entries which change UDP destination port. Created: 19/Jun/15  Updated: 27/Sep/21  Resolved: 22/Jun/15

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Hideyuki Tai Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 3817

 Description   

OpenFlow plugin failed to create flow entries which change UDP destination port.
I observed this issue in the latest distribution build in the stable/lithium branch.

I saw the following WARN message when I tried to install a flow entry which contained an action modify UDP destination port.

2015-06-18 11:15:03,315 | WARN | entLoopGroup-6-2 | OFEncoder | 213 - org.opendaylight.openflowjava.openflow-protocol-impl - 0.6.0.SNAPSHOT | Message serialization failed
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCaseBuilder$UdpSrcCaseImpl cannot be cast to org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCase
at org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmUdpDstSerializer.serialize(OxmUdpDstSerializer.java:26)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmUdpDstSerializer.serialize(OxmUdpDstSerializer.java:21)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetFieldActionSerializer.serialize(OF13SetFieldActionSerializer.java:52)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetFieldActionSerializer.serialize(OF13SetFieldActionSerializer.java:30)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.util.ListSerializer.serializeList(ListSerializer.java:42)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.instruction.AbstractActionInstructionSerializer.writeActions(AbstractActionInstructionSerializer.java:40)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.instruction.ApplyActionsInstructionSerializer.serialize(ApplyActionsInstructionSerializer.java:33)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.instruction.ApplyActionsInstructionSerializer.serialize(ApplyActionsInstructionSerializer.java:24)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.util.ListSerializer.serializeList(ListSerializer.java:42)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.serialize(FlowModInputMessageFactory.java:56)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.serialize(FlowModInputMessageFactory.java:32)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory.messageToBuffer(SerializationFactory.java:35)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:46)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:29)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)[144:io.netty.codec:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:705)[118:io.netty.transport:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:763)[118:io.netty.transport:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:698)[118:io.netty.transport:4.0.26.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:684)[118:io.netty.transport:4.0.26.Final]
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:940)[118:io.netty.transport:4.0.26.Final]
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:234)[118:io.netty.transport:4.0.26.Final]
at org.opendaylight.openflowjava.protocol.impl.core.connection.ChannelOutboundQueue.flush(ChannelOutboundQueue.java:188)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.core.connection.ChannelOutboundQueue.access$000(ChannelOutboundQueue.java:37)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at org.opendaylight.openflowjava.protocol.impl.core.connection.ChannelOutboundQueue$1.run(ChannelOutboundQueue.java:81)[213:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.SNAPSHOT]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:328)[119:io.netty.common:4.0.26.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350)[118:io.netty.transport:4.0.26.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)[119:io.netty.common:4.0.26.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)[119:io.netty.common:4.0.26.Final]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_75]



 Comments   
Comment by Hideyuki Tai [ 19/Jun/15 ]

This problem always occurs with OpenFlow 1.3 switches.

Therefore, I think the bug-fix should be merged in Lithium.

Comment by Hideyuki Tai [ 19/Jun/15 ]

I observed this issue on Lithium-RC1 (06/16).

How to reproduce the issue
==========================

1. Run the Lithium-RC1.

./bin/karaf

You can get the RC1 from the above link:
https://nexus.opendaylight.org/content/repositories/automatedweeklyreleases-1064/org/opendaylight/integration/distribution-karaf/0.3.0-Lithium-RC1-v201506160017/

2. Install the following feature on the Karaf console.

feature:install odl-openflowplugin-flow-services-rest

3. Run Mininet with an OpenFlow 1.3 switch.

sudo mn --controller=remote,ip=192.168.2.62 --switch ovsk,protocols=OpenFlow13

4. Try to install a flow entry to OpenFlow 1.3 switch via RESTCONF.

curl -v --user "admin":"admin" -H "Accept: application/xml" -H \
"Content-type: application/xml" -X PUT \
http://localhost:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1 \
-d '<?xml version="1.0" encoding="UTF-8" standalone="no"?><flow xmlns="urn:opendaylight:flow:inventory"><priority>2</priority><flow-name>Foo</flow-name><match><ethernet-match><ethernet-type><type>2048</type></ethernet-type></ethernet-match><ip-match><ip-protocol>17</ip-protocol></ip-match><ipv4-destination>10.0.10.2/24</ipv4-destination></match><id>1</id><table_id>0</table_id><instructions><instruction><order>0</order><apply-actions><action><order>0</order><set-tp-dst-action><port>5</port></set-tp-dst-action></action></apply-actions></instruction></instructions></flow>'

Here is also the pretty format version of the xml.

<?xml version='1.0' encoding='utf-8'?>
<flow xmlns="urn:opendaylight:flow:inventory">
<priority>
2
</priority>
<flow-name>
Foo
</flow-name>
<match>
<ethernet-match>
<ethernet-type>
<type>
2048
</type>
</ethernet-type>
</ethernet-match>
<ip-match>
<ip-protocol>
17
</ip-protocol>
</ip-match>
<ipv4-destination>
10.0.10.2/24
</ipv4-destination>
</match>
<id>
1
</id>
<table_id>
0
</table_id>
<instructions>
<instruction>
<order>
0
</order>
<apply-actions>
<action>
<order>
0
</order>
<set-tp-dst-action>
<port>
5
</port>
</set-tp-dst-action>
</action>
</apply-actions>
</instruction>
</instructions>
</flow>

At this time, you would see the following WARN message in the karaf.log.

2015-06-19 03:57:45,087 | WARN | entLoopGroup-6-1 | OFEncoder | 187 - org.opendaylight.openflowjava.openflow-protocol-impl - 0.6.0.Lithium-RC1-v201506160017 | Message serialization failed
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpSrcCaseBuilder$UdpSrcCaseImpl cannot be cast to org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.UdpDstCase
at org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmUdpDstSerializer.serialize(OxmUdpDstSerializer.java:26)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]
at org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmUdpDstSerializer.serialize(OxmUdpDstSerializer.java:21)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]
at org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetFieldActionSerializer.serialize(OF13SetFieldActionSerializer.java:52)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]
at org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetFieldActionSerializer.serialize(OF13SetFieldActionSerializer.java:30)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]

5. Check the flow table of the switch on the Mininet.

mininet> dpctl dump-flows -O OpenFlow13

      • s1 ------------------------------------------------------------------------
        OFPST_FLOW reply (OF1.3) (xid=0x2):

You would see that the flow entry is not installed.

Comment by Hideyuki Tai [ 19/Jun/15 ]

I've submitted the patch into the stable/lithium branch of the openflowplugin.git.

https://git.opendaylight.org/gerrit/#/c/22960/

I've confirmed that the issue is not occurred with the patch.
I can successfully install a flow entry which change UDP destination port for OpenFlow 1.3 switch.

Comment by Hideyuki Tai [ 19/Jun/15 ]

Also, I observed the same issue for ICMP code field.

I sent the following XML to the RESTCONF to install a flow entry which change the ICMP code field.

<?xml version='1.0' encoding='utf-8'?>
<flow xmlns="urn:opendaylight:flow:inventory">
<priority>
2
</priority>
<flow-name>
Foo
</flow-name>
<match>
<ethernet-match>
<ethernet-type>
<type>
2048
</type>
</ethernet-type>
</ethernet-match>
<ip-match>
<ip-protocol>
1
</ip-protocol>
</ip-match>
<ipv4-destination>
10.0.10.2/24
</ipv4-destination>
</match>
<id>
1
</id>
<table_id>
0
</table_id>
<instructions>
<instruction>
<order>
0
</order>
<apply-actions>
<action>
<order>
0
</order>
<set-tp-dst-action>
<port>
1
</port>
</set-tp-dst-action>
</action>
</apply-actions>
</instruction>
</instructions>
</flow>

I saw the following WARN message in the karaf.log.

2015-06-19 04:40:48,100 | WARN | entLoopGroup-6-1 | OFEncoder | 187 - org.opendaylight.openflowjava.openflow-protocol-impl - 0.6.0.Lithium-RC1-v201506160017 | Message serialization failed
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4CodeCaseBuilder$Icmpv4CodeCaseImpl cannot be cast to org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.Icmpv4TypeCase
at org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv4TypeSerializer.serialize(OxmIcmpv4TypeSerializer.java:26)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]
at org.opendaylight.openflowjava.protocol.impl.serialization.match.OxmIcmpv4TypeSerializer.serialize(OxmIcmpv4TypeSerializer.java:21)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]
at org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetFieldActionSerializer.serialize(OF13SetFieldActionSerializer.java:52)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]
at org.opendaylight.openflowjava.protocol.impl.serialization.action.OF13SetFieldActionSerializer.serialize(OF13SetFieldActionSerializer.java:30)[187:org.opendaylight.openflowjava.openflow-protocol-impl:0.6.0.Lithium-RC1-v201506160017]

Comment by Hideyuki Tai [ 22/Jun/15 ]

https://git.opendaylight.org/gerrit/#/c/22960/ (master)
https://git.opendaylight.org/gerrit/#/c/23012/ (stable/lithium)

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