[OPNFLWPLUG-319] learning switch fails to install learnt flows Created: 19/Nov/14  Updated: 27/Sep/21  Resolved: 03/Dec/14

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

Type: Bug
Reporter: Bo Yan Assignee: Martin Bobak
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File debug.log     Text File trace.log    
External issue ID: 2407

 Description   

When using the learning switch bundle to install flows reactively, an error is generated which prevents the learnt flows to be installed on the switch. This causes every packet to traverse the controller.

To replicate this scenario:
1. Build the openflowplugin/distribution/base and openflowplugin/samples/learningswitch at master
2. Delete simple forwarding bundle at /plugin/org.opendaylight.controller.samples.simpleforwarding-0.5.0.jar.
3. Install the learning switch bundle learning-switch-0.1.0-SNAPSHOT.jar at /plugin
4. Run the controller, mininet with topo=single,2
5. ping h2 from h1.
6. Print the flow table of s1 with ovs-ofctl. s1 only has the default entry (goto controller) installed without any learned flows installed.

The cause may be a data precondition failure as listed in the following part of the log.

2014-11-18 11:50:24.468 EST [md-sal-binding-notification-3] DEBUG o.o.o.l.LearningSwitchHandler - Received packet via match: Match [_inPort=Uri[_value=openflow:1:2], augmentation=[]]
2014-11-18 11:50:24.468 EST [md-sal-binding-notification-3] DEBUG o.o.o.l.LearningSwitchHandler - Received packet from MAC match: MacAddress [_value=00:00:00:00:00:02], ingress: Uri [_value=openflow:1:2]
2014-11-18 11:50:24.468 EST [md-sal-binding-notification-3] DEBUG o.o.o.l.LearningSwitchHandler - Received packet to MAC match: MacAddress [_value=00:00:00:00:00:01]
2014-11-18 11:50:24.468 EST [md-sal-binding-notification-3] DEBUG o.o.o.l.LearningSwitchHandler - Ethertype: 800
2014-11-18 11:50:24.468 EST [md-sal-binding-notification-3] DEBUG o.o.o.l.LearningSwitchHandler - covering mac path: MacAddress [_value=00:00:00:00:00:02]MacAddress [_value=00:00:00:00:00:01] by [Uri [_value=openflow:1:1]]

..
2014-11-18 11:50:24.474 EST [WriteTxCommit-0] WARN o.o.c.m.s.d.s.i.InMemoryDOMDataStore - Store Tx: DOM-CFG-57 Data Precondition failed for /(urn:opendaylight:inventory?revision=2013-08-19)nodes/node/node[

{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:1}

].
org.opendaylight.yangtools.yang.data.api.schema.tree.ModifiedNodeDoesNotExistException: Node /(urn:opendaylight:inventory?revision=2013-08-19)nodes/node/node[

{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:1}

] does not exist. Cannot apply modification to its children.
at org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.checkSubtreeModificationApplicable(NormalizedNodeContainerModificationStrategy.java:164) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:135) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.checkChildPreconditions(NormalizedNodeContainerModificationStrategy.java:178) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.checkSubtreeModificationApplicable(NormalizedNodeContainerModificationStrategy.java:168) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:135) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.checkChildPreconditions(NormalizedNodeContainerModificationStrategy.java:178) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.checkSubtreeModificationApplicable(NormalizedNodeContainerModificationStrategy.java:168) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:135) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.checkChildPreconditions(NormalizedNodeContainerModificationStrategy.java:178) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.checkSubtreeModificationApplicable(NormalizedNodeContainerModificationStrategy.java:168) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.checkApplicable(SchemaAwareApplyOperation.java:135) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.RootModificationApplyOperation.checkApplicable(RootModificationApplyOperation.java:72) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTree.validate(InMemoryDataTree.java:77) ~[bundlefile:na]
at org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore$ThreePhaseCommitImpl$1.call(InMemoryDOMDataStore.java:246) [bundlefile:na]
at org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore$ThreePhaseCommitImpl$1.call(InMemoryDOMDataStore.java:242) [bundlefile:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65]
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:293) [bundlefile:na]
at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:61) [bundlefile:na]
at org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStore$ThreePhaseCommitImpl.canCommit(InMemoryDOMDataStore.java:242) [bundlefile:na]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMDataCommitCoordinatorImpl$CommitCoordinationTask.canCommitAll(DOMDataCommitCoordinatorImpl.java:209) [bundlefile:na]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMDataCommitCoordinatorImpl$CommitCoordinationTask.canCommitBlocking(DOMDataCommitCoordinatorImpl.java:179) [bundlefile:na]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMDataCommitCoordinatorImpl$CommitCoordinationTask.call(DOMDataCommitCoordinatorImpl.java:150) [bundlefile:na]
at org.opendaylight.controller.md.sal.dom.broker.impl.DOMDataCommitCoordinatorImpl$CommitCoordinationTask.call(DOMDataCommitCoordinatorImpl.java:127) [bundlefile:na]
at org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService$2.call(DeadlockDetectingListeningExecutorService.java:192) [bundlefile:na]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_65]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_65]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]



 Comments   
Comment by Bo Yan [ 19/Nov/14 ]

Attachment debug.log has been added with description: log from the ODL controller

Comment by Martin Bobak [ 24/Nov/14 ]

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

Comment by Bhanu Prakash [ 01/Dec/14 ]

Attachment trace.log has been added with description: log from controller

Comment by Bhanu Prakash [ 01/Dec/14 ]

I still not able to see the flows learned by switch. I am attaching the log file I have collected. I see only the flow, which is to forwardall to controller, am expecting the mac2mac flow to be installed in the switch upon a ping between any of the hosts from mininet. Pls let me know if am doing anything wrong. I have taken the latest code from openflowplugin branch and tested this.
Following is the mininet log:
sudo mn --switch ovsk,protocols=OpenFlow13 --controller=remote --topo linear,2

      • Creating network
      • Adding controller
      • Adding hosts:
        h1 h2
      • Adding switches:
        s1 s2
      • Adding links:
        (h1, s1) (h2, s2) (s1, s2)
      • Configuring hosts
        h1 h2
      • Starting controller
      • Starting 2 switches
        s1 s2
      • Starting CLI:
        mininet> sh ovs-ofctl dump-flows s1 -O OpenFlow13
        OFPST_FLOW reply (OF1.3) (xid=0x2):
        cookie=0xa, duration=15.100s, table=0, n_packets=4, n_bytes=280, send_flow_rem priority=0 actions=CONTROLLER:65535
        mininet> sh ovs-ofctl dump-flows s2 -O OpenFlow13
        OFPST_FLOW reply (OF1.3) (xid=0x2):
        cookie=0xa, duration=25.730s, table=0, n_packets=5, n_bytes=350, send_flow_rem priority=0 actions=CONTROLLER:65535
        mininet> h1 ping -c5 h2
        PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
        64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=96.4 ms
        64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=38.6 ms
        64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=33.3 ms
        64 bytes from 10.0.0.2: icmp_seq=4 ttl=64 time=32.4 ms
        64 bytes from 10.0.0.2: icmp_seq=5 ttl=64 time=35.0 ms

— 10.0.0.2 ping statistics —
5 packets transmitted, 5 received, 0% packet loss, time 4006ms
rtt min/avg/max/mdev = 32.474/47.191/96.418/24.705 ms
mininet> sh ovs-ofctl dump-flows s2 -O OpenFlow13
OFPST_FLOW reply (OF1.3) (xid=0x2):
cookie=0xa, duration=144.259s, table=0, n_packets=20, n_bytes=1540, send_flow_rem priority=0 actions=CONTROLLER:65535

Comment by Michal Rehak [ 01/Dec/14 ]

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

Comment by Bhanu Prakash [ 01/Dec/14 ]

(In reply to michal rehak from comment #4)
> https://git.opendaylight.org/gerrit/#/c/12819/

deeply appreciate and Thank you for prompt reply.
I do have that change in the version of the openflowplugin branch code am using (infact I cloned from git today morning)

below is the code snippet...

93
94 WakeupOnNode wakeupListener = new WakeupOnNode();
95 wakeupListener.setLearningSwitchHandler(learningSwitchHandler);
96 dataChangeListenerRegistration = data.registerDataChangeListener(LogicalDatastoreType.OPERATIONAL,
97 InstanceIdentifier.builder(Nodes.class)
98 .child(Node.class)
99 .augmentation(FlowCapableNode.class)
100 .child(Table.class).toInstance(),
101 wakeupListener,
102 DataBroker.DataChangeScope.SUBTREE);
103 LOG.debug("start() <--");
104 }
105
106 /**

Comment by Martin Bobak [ 02/Dec/14 ]

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

Enforce parents added in mentioned commit seems to fix this issue.

Comment by Bhanu Prakash [ 03/Dec/14 ]

(In reply to Martin Bobak from comment #6)
> https://git.opendaylight.org/gerrit/13299
>
>
> Enforce parents added in mentioned commit seems to fix this issue.

This is working now, Thanks for all the support.

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