[OPNFLWPLUG-167] OF13 TunnelID Match Failures Created: 20/May/14  Updated: 27/Sep/21  Resolved: 12/Aug/14

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

Type: Bug
Reporter: Brent Salisbury Assignee: Brent Salisbury
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: PC


External issue ID: 1035

 Description   

Flowmods in the Neutron plugin have been failing recently. TunnelID matches are failing in OpenflowpluginTestCommandProvider. I narrowed this one down to the mask causing issues.

OSGI output from HEAD
---------------------
// OpenflowpluginTestCommandProvider
osgi> addMDFlow openflow:143948071978317 f77
2014-05-20 01:54:54.139 EDT [Gogo shell] INFO o.o.o.t.OpenflowpluginTestCommandProvider - TunnelID Match Called
2014-05-20 01:54:54.140 EDT [Gogo shell] INFO o.o.o.t.OpenflowpluginTestCommandProvider - TunnelID Match Called tunnel.getTunnelID ==> 10668
gogo: IllegalArgumentException: Invalid range: -1099511627519, expected: [[0‥18446744073709551615]].

When I comment out the mask the flowmod succeeds:
------------------------------------------------
private static MatchBuilder createTunnelIDMatch() {
MatchBuilder match = new MatchBuilder();
TunnelBuilder tunnel = new TunnelBuilder(); // tunnel id match
tunnel.setTunnelId(BigInteger.valueOf(10668));

// Commented out
// byte[] mask = new byte[]

{ (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 }

;
// tunnel.setTunnelMask(new BigInteger(mask));

match.setTunnel(tunnel.build());
return match;
}

OSGI output with a successful flowmod after commenting out the mask:
--------------------------------------------------------------------
2014-05-20 02:12:07.703 EDT [md-sal-binding-notification-46] INFO o.o.o.t.FlowEventListenerLoggingImpl - flow to be added..........................FlowAdded [_flowRef=FlowRef [_value=KeyedInstanceIdentifier

{targetType=interface org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow, path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=openflow:143948071978317]]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table[key=TableKey [_id=2]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow[key=FlowKey [_id=Uri [_value=200]]]]}

], _barrier=false, _cookieMask=FlowCookie [_value=10], _flags=FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=true], _flowName=FooXf77, _installHw=false, _instructions=Instructions [_instruction=[Instruction [_order=0, _key=InstructionKey [_order=0], _instruction=ApplyActionsCase [_applyActions=ApplyActions [_action=[Action [_order=0, _key=ActionKey [_order=0], _action=SetFieldCase [_setField=SetField [_tunnel=Tunnel [_tunnelId=10668, augmentation=[]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], _match=Match [_tunnel=Tunnel [_tunnelId=10668, augmentation=[]], augmentation=[]], _strict=false, _cookie=FlowCookie [_value=10], _hardTimeout=0, _idleTimeout=0, _priority=2, _tableId=2, _transactionId=TransactionId [_value=26], augmentation=[]]
2014-05-20 02:12:07.703 EDT [md-sal-binding-notification-47] INFO o.o.o.t.FlowEventListenerLoggingImpl - flow to be added..........................FlowAdded [_flowRef=FlowRef [_value=KeyedInstanceIdentifier

{targetType=interface org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow, path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=openflow:143948071978317]]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table[key=TableKey [_id=2]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow[key=FlowKey [_id=Uri [_value=200]]]]}

], _barrier=false, _cookieMask=FlowCookie [_value=10], _flags=FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=true], _flowName=FooXf77, _installHw=false, _instructions=Instructions [_instruction=[Instruction [_order=0, _key=InstructionKey [_order=0], _instruction=ApplyActionsCase [_applyActions=ApplyActions [_action=[Action [_order=0, _key=ActionKey [_order=0], _action=SetFieldCase [_setField=SetField [_tunnel=Tunnel [_tunnelId=10668, augmentation=[]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], _match=Match [_tunnel=Tunnel [_tunnelId=10668, augmentation=[]], augmentation=[]], _strict=false, _cookie=FlowCookie [_value=10], _hardTimeout=0, _idleTimeout=0, _priority=2, _tableId=2, _transactionId=TransactionId [_value=26], augmentation=[]]
2014-05-20 02:12:07.703 EDT [md-sal-binding-notification-48] INFO o.o.o.t.FlowEventListenerLoggingImpl - flow to be added..........................FlowAdded [_flowRef=FlowRef [_value=KeyedInstanceIdentifier

{targetType=interface org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow, path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=openflow:143948071978317]]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode, org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table[key=TableKey [_id=2]], org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow[key=FlowKey [_id=Uri [_value=200]]]]}

], _barrier=false, _cookieMask=FlowCookie [_value=10], _flags=FlowModFlags [_cHECKOVERLAP=false, _rESETCOUNTS=false, _nOPKTCOUNTS=false, _nOBYTCOUNTS=false, _sENDFLOWREM=true], _flowName=FooXf77, _installHw=false, _instructions=Instructions [_instruction=[Instruction [_order=0, _key=InstructionKey [_order=0], _instruction=ApplyActionsCase [_applyActions=ApplyActions [_action=[Action [_order=0, _key=ActionKey [_order=0], _action=SetFieldCase [_setField=SetField [_tunnel=Tunnel [_tunnelId=10668, augmentation=[]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], _match=Match [_tunnel=Tunnel [_tunnelId=10668, augmentation=[]], augmentation=[]], _strict=false, _cookie=FlowCookie [_value=10], _hardTimeout=0, _idleTimeout=0, _priority=2, _tableId=2, _transactionId=TransactionId [_value=26], augmentation=[]]
2014-05-20 02:12:07.703 EDT [md-sal-binding-notification-47] INFO o.o.o.t.FlowEventListenerLoggingImpl - added flow Xid.........................26
2014-05-20 02:12:07.703 EDT [md-sal-binding-notification-46] INFO o.o.o.t.FlowEventListenerLoggingImpl - added flow Xid.........................26

OVS flowmod instantiated w/o mask in the method
-----------------------------------------------
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0xa, duration=124.355s, table=2, n_packets=0, n_bytes=0, send_flow_rem priority=2,tun_id=0x29ac actions=set_field:0x29ac->tun_id

I can help debugging the root this week if it isn't obvious to you guys. I need to go through all of the flowmods as this was the first one I started with.

Thanks!
-Brent



 Comments   
Comment by Zoltan Lajos Kis [ 20/May/14 ]

The problem is that BigInteger uses two's complement, so it will interpret the first bit set as the negative sign.

Could you check what happens if you add an extra zero to the front of the byte array?

byte[] mask = new byte[]

{ 0, (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, (byte) 1, (byte) 1 }

;

Comment by Michal Polkorab [ 20/May/14 ]

Another observation:

I have checked the opendaylight-match-types.yang and found this definition:

container "tunnel" {
leaf tunnel-id

{ description "Metadata associated in the logical port"; type uint64; }

leaf tunnel-mask

{ type uint64; }

}

So based on this definition, you should use BigInteger as mask type. It should be enough to use new BigInteger(1, "your byte[]")

I would say that the mask should be modeled as binary type. But that's a question for someone who created this model - why he created it this way.

Regards
Michal Polkorab

Comment by Abhijit Kumbhare [ 22/May/14 ]

Brent,

Is this still happening?

Thanks,
Abhijit

Comment by Brent Salisbury [ 25/May/14 ]

(In reply to Zoltan Lajos Kis from comment #1)
> The problem is that BigInteger uses two's complement, so it will interpret
> the first bit set as the negative sign.
>
> Could you check what happens if you add an extra zero to the front of the
> byte array?
>
> byte[] mask = new byte[]

{ 0, (byte) -1, (byte) -1, (byte) -1, 0, 0, 0, > (byte) 1, (byte) 1 }

;

That did it! Appreciate it Zoltan.

Cheers,
-Brent

Comment by Debolina Bandyopadhyay [ 03/Jun/14 ]

hello,

Is this bug fixed? If yes, I would really appreciate whoever pushed the change also takes over the bug (assign it yourself)

Thanks,
Debolina

Comment by Kamal Rameshan [ 23/Jun/14 ]

Checked the history of OpenflowpluginTestCommandProvider and saw a change from Brent for this bug.
Looks like Brent himself fixed it.

Brent: can you please mark it resolved.

Comment by Abhijit Kumbhare [ 12/Aug/14 ]

Looks like this is fixed as per Kamal's comment. Brent - if this is not - feel free to reopen it.

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