From: Flavio Fernandes Date: Tue, 22 Apr 2014 15:39:36 +0000 (-0400) Subject: Bug-590: Packet loss on first time ping test X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~186^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=5202e22213895b8e4fce9acb8dd9b35fbeb2a25d Bug-590: Packet loss on first time ping test In this commit, we are addressing 2 issues that could cause the exception (ie first ip packet) to be lost. What is observed with this bug is that the non-arp packet -- in this case the icmp packet -- is being 'exceptioned' to the SimpleForwarding code path because the node has not yet been programmed with flows that would allow it to forward the packet to its destination w/out involving the controller. Change #1: In cases when the src and dst ip are of hosts in the same node, the getRoute() call is going to return 'null'. That is because the IRouting lookup will not find a path when src and dst nodes are the same. Change #2: When looking up the rulesDB, the key used was using the destHost and the node of the incoming connector. It should be the destHost and the node of the destHost. Kudos go 100% to Giovanni on this. Change-Id: I4861acd6ab6d7efe14b50d7537e4b920bffc8a75 Signed-off-by: Flavio Fernandes --- diff --git a/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java b/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java index b9d8fee986..d3cefd41b3 100644 --- a/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java +++ b/opendaylight/samples/simpleforwarding/src/main/java/org/opendaylight/controller/samples/simpleforwarding/internal/SimpleForwardingImpl.java @@ -999,12 +999,18 @@ public class SimpleForwardingImpl implements IfNewHostNotify, return; } HostNodeConnector destHost = hostTracker.hostFind(dIP); + /* + * In cases when incoming and outgoing connectors are in the same node, there is no need + * to verify that there is a route. Because of that, we will only need routing.getRoute() + * if we know that src and dst nodes are different. + */ if (destHost != null - && (routing == null || + && (incomingNodeConnector.getNode().equals(destHost.getnodeconnectorNode()) || + routing == null || routing.getRoute(incomingNodeConnector.getNode(), destHost.getnodeconnectorNode()) != null)) { log.trace("Host {} is at {}", dIP, destHost.getnodeConnector()); - HostNodePair key = new HostNodePair(destHost, incomingNodeConnector.getNode()); + HostNodePair key = new HostNodePair(destHost, destHost.getnodeconnectorNode()); // If SimpleForwarding is aware of this host, it will try to install // a path. Forward packet until it's done.