[OPNFLWPLUG-270] Cannot set Mac Address in the Action Field Created: 09/Sep/14  Updated: 27/Sep/21  Resolved: 11/Nov/14

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

Type: Bug
Reporter: Shuva Jyoti Kar Assignee: Shuva Jyoti Kar
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Attachments: PNG File Screenshot from 2014-09-02 17:52:32.png     JPEG File error.JPG    
External issue ID: 1772

 Description   

code segment

ActionBuilder ab = createActionBuilder(order);
SetDlDstActionCaseBuilder caseBuilder = new SetDlDstActionCaseBuilder();
SetDlDstActionBuilder dstBuilder = new SetDlDstActionBuilder();
dstBuilder.setAddress(new MacAddress(mac));
caseBuilder.setSetDlDstAction(dstBuilder.build());
ab.setAction(caseBuilder.build());
ab.build();

or:

MacAddress addr = new MacAddress(mac);
return new ActionBuilder().setAction(
new SetFieldCaseBuilder().setSetField(
new SetFieldBuilder().setEthernetMatch(
new EthernetMatchBuilder().setEthernetDestination(
new EthernetDestinationBuilder().setAddress(addr).build())
.build()).build()).build()).setKey(new ActionKey(0)).build();

Error :

>
>
> Unable to serialize MAC address for
> input: MacAddress [_value=00:01:02:03:04:05].
>

java.lang.IllegalArgumentException: Invalid character 'M' encountered
at
org.opendaylight.openflowjava.util.ByteBufUtils.macAddressToBytes(ByteBufUtils.java:260)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.serialization.match.AbstractOxmMacAddressSerializer.serialize(AbstractOxmMacAddressSerializer.java:26)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.serialization.match.AbstractOxmMacAddressSerializer.serialize(AbstractOxmMacAddressSerializer.java:20)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer.serializeMatchEntries(OF13MatchSerializer.java:89)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer.serialize(OF13MatchSerializer.java:50)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.util.OF13MatchSerializer.serialize(OF13MatchSerializer.java:34)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.serialization.factories.MultipartRequestInputFactory.serializeFlowBody(MultipartRequestInputFactory.java:220)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.serialization.factories.MultipartRequestInputFactory.serialize(MultipartRequestInputFactory.java:109)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.serialization.factories.MultipartRequestInputFactory.serialize(MultipartRequestInputFactory.java:70)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory.messageToBuffer(SerializationFactory.java:36)
~[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:41)
[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:26)
[bundlefile:na]
at
io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:111)
[bundlefile:4.0.19.Final]
at
io.netty.channel.DefaultChannelHandlerContext.invokeWrite(DefaultChannelHandlerContext.java:666)
[bundlefile:4.0.19.Final]
at
io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:724)
[bundlefile:4.0.19.Final]
at
io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:659)
[bundlefile:4.0.19.Final]
at
io.netty.channel.DefaultChannelHandlerContext.write(DefaultChannelHandlerContext.java:645)
[bundlefile:4.0.19.Final]
at
io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:878)
[bundlefile:4.0.19.Final]
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:231)
[bundlefile:4.0.19.Final]
at
org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue.flush(ChannelOutboundQueue.java:184)
[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue.access$000(ChannelOutboundQueue.java:39)
[bundlefile:na]
at
org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue$1.run(ChannelOutboundQueue.java:83)
[bundlefile:na]
at
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:341)
[bundlefile:4.0.19.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346)
[bundlefile:4.0.19.Final]
at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116)



 Comments   
Comment by Shuva Jyoti Kar [ 09/Sep/14 ]

Attachment Screenshot from 2014-09-02 17:52:32.png has been added with description: Debugged MatchconvertorImplto find the mac address is wrongly set.

Comment by Abhijit Kumbhare [ 09/Sep/14 ]

Assigning it to Prasanna - in the meeting we had discussed this was a user error - but lets see.

Comment by Shuva Jyoti Kar [ 11/Sep/14 ]

The Mac address in the addflowinputbuilder is actually set incorrectly

Comment by Shuva Jyoti Kar [ 11/Sep/14 ]

Attachment error.JPG has been added with description: The Mac address in the flow input builder is actually set incorrectly

Comment by Abhijit Kumbhare [ 11/Sep/14 ]

Anil,

I don't think it will be the case but could this be anything to do with the MAC address comparator bug?

  • Abhijit
Comment by Anil Vishnoi [ 11/Sep/14 ]

Hi Abhijit,

No, comparator comes to the picture where we fetch statistics data from switch. I believe this issue is happening while sending flow down to the switch.

Thanks
Anil

Comment by Abhijit Kumbhare [ 16/Sep/14 ]

Prasanna had sent the following note to Shuva after investigation:

Hello,
As discussed please move the bug(Mac address issue) to MD-SAL and assign it to default user.

Abhijit:
Shuva bypassed MD-SAL and tested with plugin and library and MAC address provision works.
Rgds
Prasanna

Comment by Devin Avery [ 16/Sep/14 ]

Hello - A summary of the problem / solution was request at the MD-SAL status meeting today.

Could someone please summarize what the problem is and what the propose solution is? People are just interested in what is going on with this one.

Thank you!

Devin

Comment by Robert Varga [ 18/Sep/14 ]

Can you expand your problem report with the type of "mac" and how it is being initialized?

Comment by Tony Tkacik [ 18/Sep/14 ]

Added testcase which shows this is not bug of MD-SAL.

https://git.opendaylight.org/gerrit/11307

Testcase write correctly constructed mac address in flow:
ethernet-match with source mac, source destination and also apply-actions
with set-dl-dst and set-dl-src.

Then testcase read it and compares MAC address value with original one.
This showcase MD-SAL did not change mac address as was supplied by user.

As Robert mentioned, please show how this flow was constructed, because everything points it is user bug, when some did something as:

MacAddress original;
MacAddress mac = new MacAddress(original.toString()) instead of
new MacAddress(original) or new MacAddress(original.getValue()).

Returning it back to Openflowplugin, since submitted test case shows it is not Openflowplugin bug.

Also integration testsuite https://jenkins.opendaylight.org/integration/job/integration-master-csit-base-of13/2629/robot/report/log.html
reports flow with mac address as working.

Comment by Michal Rehak [ 18/Sep/14 ]

The attachment clearly shows that value of exposed MacAddress contains toString output of some probably internal instance of mac address:

getAddress "MacAddressvalue="

Comment by Michal Rehak [ 18/Sep/14 ]

The attachment clearly shows that value of exposed MacAddress contains toString output of some (probably internal) instance of mac address:

getAddress=MacAddress [_value=MacAddress [_value=a0:b1:c2:d3:e4:35]]

MacAddress.toString() looks like this:
java.lang.StringBuilder builder = new java.lang.StringBuilder(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev100924.MacAddress.class.getSimpleName()).append(" [");
boolean first = true;

if (_value != null) {
if (first)

{ first = false; }

else

{ builder.append(", "); }

builder.append("_value=");
builder.append(_value);
}
return builder.append(']').toString();

where _value is of type String and contains mac address in hex-format.

Correct dump would look like this:
getAddress=MacAddress [_value=a0:b1:c2:d3:e4:35]

Assigning to reporter.

Comment by VLN Mehar Simhadri [ 19/Sep/14 ]

The anamoly is identified in the org.opendaylight.controller.frm.impl.FlowForwarder which implements the DataChangeListener interface.

Is it possible that the issue is in the DataListener code path?

Comment by VLN Mehar Simhadri [ 19/Sep/14 ]

The anomaly is identified in the org.opendaylight.controller.frm.impl.FlowForwarder which implements the DataChangeListener interface.

Is it possible that the issue is in the DataListener code path?

Comment by VLN Mehar Simhadri [ 19/Sep/14 ]

The anomaly is identified in the org.opendaylight.controller.frm.impl.FlowForwarder which implements the DataChangeListener interface.

Is it possible that the issue is in the DataListener code path?

Comment by Michal Rehak [ 19/Sep/14 ]

Hi Mehar,
the attached picture of debug session is reason to believe that corrupted flow was created at the beginning of the pipeline:

1. app/user creates flow
2. send it to datastore/config (using API or restconf)
3. FlowForwarder is notified and invokes appropriate rpc on corresponding service provider
4. openflowplugin translates flow from MD-SAL model to OFJava-API model and invokes OFJava rpc
5. OFJavaRPC encodes the input into flowMod message and writes it to byteBuffer
6. Netty.io sends content of the buffer to corresponding switch

So if:

  • the malformed macAddress was observed in FlowForwarder (3.).
  • and there exist flows containing macAddress which successfully pass this pipeline
    then the input at the very beginning of the pipeline should be checked. And as it was already noted - there is probably somewhere copy constructor of macAddress invoked with string presentation of macAddress instead of object reference or macAddress.getValue().

Please check input.

Comment by Abhijit Kumbhare [ 22/Sep/14 ]

Moved to Helium 1 as SFC (sfcofl2) is not blocked on this and there is still an opinion from the OpenFlow plugin team that there was an issue with the input (see Michal Rehak's last comment).

Comment by Viera Zelcamova [ 11/Nov/14 ]

no response

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