[AETHER-599][AETHER-418] Implement FabricPipelineTraceable

Changes supporting fabric traceable implementation.

Moreover, it improves the following:
- Ingress-port parsing
- Fixes several issues in the trace print function
- Adds the print of the dropped hit chains
- Updates onos-dependencies to the latest stable version
  and trellis-control to the latest snapshot.

Change-Id: I278f3c099329f8877501142447637782d6af42c7
diff --git a/app/pom.xml b/app/pom.xml
index 932d834..ab47800 100644
--- a/app/pom.xml
+++ b/app/pom.xml
@@ -52,7 +52,7 @@
         </api.description>
         <api.package>org.onosproject.t3.rest</api.package>
 
-        <trellis.api.version>3.0.0</trellis.api.version>
+        <trellis.api.version>3.0.1-SNAPSHOT</trellis.api.version>
     </properties>
 
     <dependencies>
diff --git a/app/src/main/java/org/onosproject/t3/api/StaticPacketTrace.java b/app/src/main/java/org/onosproject/t3/api/StaticPacketTrace.java
index 57e1dce..92f78ed 100644
--- a/app/src/main/java/org/onosproject/t3/api/StaticPacketTrace.java
+++ b/app/src/main/java/org/onosproject/t3/api/StaticPacketTrace.java
@@ -26,10 +26,12 @@
 import org.onosproject.net.flow.TrafficSelector;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
+import java.util.stream.Collectors;
 
 /**
  * Encapsulates the result of tracing a packet (traffic selector) through
@@ -175,7 +177,18 @@
     public List<PipelineTraceableHitChain> getHitChains(DeviceId deviceId) {
         List<PipelineTraceableHitChain> hitChains = hitChainsForDevice.get(deviceId);
         return hitChains == null ? null : ImmutableList.copyOf(hitChains);
+    }
 
+    /**
+     * Return all the dropped hit chains.
+     *
+     * @return the dropped hit chains
+     */
+    public List<PipelineTraceableHitChain> getDroppedHitChains() {
+        return hitChainsForDevice.values().stream()
+                .flatMap(Collection::stream)
+                .filter(PipelineTraceableHitChain::isDropped)
+                .collect(Collectors.toList());
     }
 
     /**
diff --git a/app/src/main/java/org/onosproject/t3/cli/T3CliUtils.java b/app/src/main/java/org/onosproject/t3/cli/T3CliUtils.java
index 8568775..477298c 100644
--- a/app/src/main/java/org/onosproject/t3/cli/T3CliUtils.java
+++ b/app/src/main/java/org/onosproject/t3/cli/T3CliUtils.java
@@ -19,7 +19,7 @@
 import org.apache.commons.lang.StringUtils;
 import org.onosproject.net.ConnectPoint;
 import org.onosproject.net.DataPlaneEntity;
-import org.onosproject.net.DeviceId;
+import org.onosproject.net.PipelineTraceableHitChain;
 import org.onosproject.net.flow.FlowEntry;
 import org.onosproject.net.flow.TrafficTreatment;
 import org.onosproject.net.group.Group;
@@ -91,7 +91,7 @@
                 tracePrint.append("\n");
                 tracePrint.append("Input from " + connectPoint);
                 tracePrint.append("\n");
-                tracePrint = printHitChains(trace, verbose, connectPoint.deviceId(), tracePrint);
+                tracePrint = printHitChains(trace, verbose, connectPoint, tracePrint);
                 tracePrint.append("\n");
             } else {
                 for (ConnectPoint connectPoint : path) {
@@ -100,49 +100,78 @@
                         tracePrint.append("\n");
                         tracePrint.append("    Input from " + connectPoint);
                         tracePrint.append("\n");
-                        tracePrint = printHitChains(trace, verbose, connectPoint.deviceId(), tracePrint);
+                    } else {
+                        tracePrint = printHitChains(trace, verbose, connectPoint, tracePrint);
                     }
                     previous = connectPoint;
                 }
             }
             tracePrint.append(StringUtils.leftPad("\n", 100, '-'));
         }
-        return tracePrint;
-    }
-
-    private static StringBuilder printHitChains(StaticPacketTrace trace, boolean verbose, DeviceId deviceId,
-                                                        StringBuilder tracePrint) {
-        tracePrint.append("    Hit chains ");
-        tracePrint.append(trace.getHitChains(deviceId).size());
+        // Once we have printed all the paths - we print the dropped traceable chains
+        List<PipelineTraceableHitChain> droppedHitChains = trace.getDroppedHitChains();
+        if (droppedHitChains.size() == 0) {
+            return tracePrint;
+        }
+        tracePrint.append("    Dropped Hit chains ");
+        tracePrint.append(droppedHitChains.size());
         tracePrint.append("    \n");
         tracePrint.append("    \n");
         int[] index = {1};
-        trace.getHitChains(deviceId).forEach(hitChain -> {
+        for (PipelineTraceableHitChain hitChain : droppedHitChains) {
             tracePrint.append("    Hit chain " + index[0]++);
             tracePrint.append("    \n");
-            // Print for each chain the matchable entities first
-            hitChain.getHitChain().forEach(dataPlaneEntity -> {
-                if (dataPlaneEntity.getType() == DataPlaneEntity.Type.FLOWRULE) {
-                    printFlow(dataPlaneEntity.getFlowEntry(), verbose, tracePrint);
-                } else if (dataPlaneEntity.getType() == DataPlaneEntity.Type.GROUP) {
-                    printGroup(dataPlaneEntity.getGroupEntry(), verbose, tracePrint);
-                }
-            });
-            // Then the output packet of the current chain
-            tracePrint.append("    Outgoing Packet " + hitChain.getEgressPacket());
-            tracePrint.append("\n");
-            // The output port of the current chain
-            tracePrint.append("    Output through " + hitChain.getOutputPort());
-            tracePrint.append("\n");
-            // Dropped during the processing ?
-            tracePrint.append("    Dropped " + hitChain.isDropped());
-            tracePrint.append("\n");
-            tracePrint.append("\n");
-        });
-
+            printHitChain(verbose, hitChain, tracePrint);
+            tracePrint.append(StringUtils.leftPad("\n", 100, '-'));
+        }
         return tracePrint;
     }
 
+    private static StringBuilder printHitChains(StaticPacketTrace trace, boolean verbose, ConnectPoint outputPort,
+                                                StringBuilder tracePrint) {
+        tracePrint.append("    Hit chains ");
+        List<PipelineTraceableHitChain> hitChainsByDevice = trace.getHitChains(outputPort.deviceId());
+        tracePrint.append(hitChainsByDevice == null ? 0 : trace.getHitChains(outputPort.deviceId()).size());
+        tracePrint.append("    \n");
+        tracePrint.append("    \n");
+        // Do not go further
+        if (hitChainsByDevice == null) {
+            return tracePrint;
+        }
+        int[] index = {1};
+        hitChainsByDevice.forEach(hitChain -> {
+            // Do not print other hit chains
+            if (!outputPort.equals(hitChain.outputPort()) || (hitChain.isDropped())) {
+                return;
+            }
+            tracePrint.append("    Hit chain " + index[0]++);
+            tracePrint.append("    \n");
+            printHitChain(verbose, hitChain, tracePrint);
+        });
+        return tracePrint;
+    }
+
+    private static void printHitChain(boolean verbose, PipelineTraceableHitChain hitChain, StringBuilder tracePrint) {
+        // Print for each chain the matchable entities first
+        hitChain.hitChain().forEach(dataPlaneEntity -> {
+            if (dataPlaneEntity.getType() == DataPlaneEntity.Type.FLOWRULE) {
+                printFlow(dataPlaneEntity.getFlowEntry(), verbose, tracePrint);
+            } else if (dataPlaneEntity.getType() == DataPlaneEntity.Type.GROUP) {
+                printGroup(dataPlaneEntity.getGroupEntry(), verbose, tracePrint);
+            }
+        });
+        // Then the output packet of the current chain
+        tracePrint.append("    Outgoing Packet " + hitChain.egressPacket());
+        tracePrint.append("\n");
+        // The output port of the current chain
+        tracePrint.append("    Output through " + hitChain.outputPort());
+        tracePrint.append("\n");
+        // Dropped during the processing ?
+        tracePrint.append("    Dropped " + hitChain.isDropped());
+        tracePrint.append("\n");
+        tracePrint.append("\n");
+    }
+
     // Prints the flows for a given trace and a specified level of verbosity
     private static void printFlow(FlowEntry f, boolean verbose, StringBuilder tracePrint) {
         if (verbose) {
diff --git a/app/src/main/java/org/onosproject/t3/cli/TroubleshootTraceCommand.java b/app/src/main/java/org/onosproject/t3/cli/TroubleshootTraceCommand.java
index db7d69f..d156f8a 100644
--- a/app/src/main/java/org/onosproject/t3/cli/TroubleshootTraceCommand.java
+++ b/app/src/main/java/org/onosproject/t3/cli/TroubleshootTraceCommand.java
@@ -17,6 +17,7 @@
 package org.onosproject.t3.cli;
 
 import com.google.common.base.Preconditions;
+import com.google.common.primitives.UnsignedLongs;
 import org.apache.karaf.shell.api.action.Command;
 import org.apache.karaf.shell.api.action.Completion;
 import org.apache.karaf.shell.api.action.Option;
@@ -39,6 +40,9 @@
 import org.onosproject.t3.api.StaticPacketTrace;
 import org.onosproject.t3.api.TroubleshootService;
 
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 import static org.onlab.packet.EthType.EtherType;
 
 /**
@@ -49,6 +53,9 @@
         description = "troubleshoots flows and groups between source and destination")
 public class TroubleshootTraceCommand extends AbstractShellCommand {
 
+    private static final Pattern NAMED = Pattern.compile("^(?<deviceid>\\S*)\\/\\[(?<name>\\S*)\\]\\((?<num>\\d+)\\)$");
+
+    private static final Pattern NOT_NAMED = Pattern.compile("^(?<deviceid>\\S*)\\/(?<num>\\d+)$");
 
     private static final String FLOW_SHORT_FORMAT = "    %s, bytes=%s, packets=%s, "
             + "table=%s, priority=%s, selector=%s, treatment=%s";
@@ -141,17 +148,9 @@
             print(service.printNibSummary());
         }
 
-        String[] cpInfo = srcPort.split("/");
-        Preconditions.checkArgument(cpInfo.length == 2, "wrong format of source port");
-        ConnectPoint cp;
-        //Uses input port as a convenience to carry the Controller port, proper flood behaviour is handled in the
+        // Uses input port as a convenience to carry the Controller port, proper flood behaviour is handled in the
         // troubleshoot manager.
-        if (cpInfo[1].equalsIgnoreCase(CONTROLLER)) {
-            cp = new ConnectPoint(DeviceId.deviceId(cpInfo[0]), PortNumber.CONTROLLER);
-        } else {
-            cp = ConnectPoint.deviceConnectPoint(srcPort);
-        }
-
+        ConnectPoint cp = parseConnectPoint(srcPort);
         EtherType type = EtherType.valueOf(ethType.toUpperCase());
 
         //Input Port must be specified
@@ -227,4 +226,27 @@
         print("%s", T3CliUtils.printTrace(trace, verbosity1, verbosity2));
 
     }
+
+    private ConnectPoint parseConnectPoint(String cp) {
+        String deviceId;
+        String name;
+        String num;
+
+        Matcher matcher = NAMED.matcher(cp);
+        // If it is not a named port - try to parse using classic way
+        if (!matcher.matches()) {
+            matcher = NOT_NAMED.matcher(cp);
+            Preconditions.checkArgument(matcher.matches(), "wrong format of source port");
+            deviceId = matcher.group("deviceid");
+            num = matcher.group("num");
+            return new ConnectPoint(DeviceId.deviceId(deviceId),
+                    PortNumber.portNumber(num));
+        }
+        // Named port - decomposes in sub components
+        deviceId = matcher.group("deviceid");
+        name = matcher.group("name");
+        num = matcher.group("num");
+        return new ConnectPoint(DeviceId.deviceId(deviceId),
+                PortNumber.portNumber(UnsignedLongs.parseUnsignedLong(num), name));
+    }
 }
diff --git a/app/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java b/app/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java
index b683351..d7b2d45 100644
--- a/app/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java
+++ b/app/src/main/java/org/onosproject/t3/impl/TroubleshootManager.java
@@ -40,6 +40,7 @@
 import org.onosproject.net.PipelineTraceableInput;
 import org.onosproject.net.PipelineTraceableOutput;
 import org.onosproject.net.PipelineTraceableOutput.PipelineTraceableResult;
+import org.onosproject.net.PipelineTraceablePacket;
 import org.onosproject.net.Port;
 import org.onosproject.net.PortNumber;
 import org.onosproject.net.behaviour.PipelineTraceable;
@@ -426,10 +427,10 @@
         //If the trace has outputs we analyze them all
         for (PipelineTraceableHitChain outputPath : trace.getHitChains(in.deviceId())) {
 
-            ConnectPoint cp = outputPath.getOutputPort();
+            ConnectPoint cp = outputPath.outputPort();
             log.debug("Connect point in {}", in);
             log.debug("Output path {}", cp);
-            log.debug("{}", outputPath.getEgressPacket());
+            log.debug("{}", outputPath.egressPacket());
 
             if (outputPath.isDropped()) {
                 continue;
@@ -441,19 +442,19 @@
             Set<Host> hosts = getHosts(trace);
 
             if (in.equals(cp) && trace.getInitialPacket().getCriterion(Criterion.Type.VLAN_VID) != null &&
-                    outputPath.getEgressPacket().getCriterion(Criterion.Type.VLAN_VID) != null
+                    outputPath.egressPacket().packet().getCriterion(Criterion.Type.VLAN_VID) != null
                     && ((VlanIdCriterion) trace.getInitialPacket().getCriterion(Criterion.Type.VLAN_VID)).vlanId()
-                    .equals(((VlanIdCriterion) outputPath.getEgressPacket().getCriterion(Criterion.Type.VLAN_VID))
-                            .vlanId())) {
+                    .equals(((VlanIdCriterion) outputPath.egressPacket()
+                    .packet().getCriterion(Criterion.Type.VLAN_VID)).vlanId())) {
                 if (trace.getHitChains(in.deviceId()).size() == 1 &&
-                        TroubleshootUtils.computePath(completePath, trace, outputPath.getOutputPort())) {
+                        TroubleshootUtils.computePath(completePath, trace, outputPath.outputPort())) {
                     trace.addResultMessage("Connect point out " + cp + " is same as initial input " + in);
                     trace.setSuccess(false);
                 }
             } else if (!Collections.disjoint(hostsList, hosts)) {
                 //If the two host collections contain the same item it means we reached the proper output
                 log.debug("Stopping here because host is expected destination, reached through {}", completePath);
-                if (TroubleshootUtils.computePath(completePath, trace, outputPath.getOutputPort())) {
+                if (TroubleshootUtils.computePath(completePath, trace, outputPath.outputPort())) {
                     trace.addResultMessage("Reached required destination Host " + cp);
                     trace.setSuccess(true);
                 }
@@ -464,7 +465,7 @@
                 NodeId master = mastershipNib.getMasterFor(cp.deviceId());
                 // TODO if we don't need to print master node id, exclude mastership NIB which is used only here
                 trace.addResultMessage(PACKET_TO_CONTROLLER + " " + master.id());
-                TroubleshootUtils.computePath(completePath, trace, outputPath.getOutputPort());
+                TroubleshootUtils.computePath(completePath, trace, outputPath.outputPort());
             } else if (linkNib.getEgressLinks(cp).size() > 0) {
                 //TODO this can be optimized if we use a Tree structure for paths.
                 //if we already have outputs let's check if the one we are considering starts from one of the devices
@@ -503,7 +504,7 @@
                     ConnectPoint dst = link.dst();
                     //change in-port to the dst link in port
                     Builder updatedPacket = DefaultTrafficSelector.builder();
-                    outputPath.getEgressPacket().criteria().forEach(updatedPacket::add);
+                    outputPath.egressPacket().packet().criteria().forEach(updatedPacket::add);
                     updatedPacket.add(Criteria.matchInPort(dst.port()));
                     log.debug("DST Connect Point {}", dst);
                     //build the elements for that device
@@ -511,15 +512,15 @@
                     //continue the trace along the path
                     getTrace(completePath, dst, trace, isDualHomed);
                 }
-            } else if (edgePortNib.isEdgePoint(outputPath.getOutputPort()) &&
+            } else if (edgePortNib.isEdgePoint(outputPath.outputPort()) &&
                     trace.getInitialPacket().getCriterion(Criterion.Type.ETH_DST) != null &&
                     ((EthCriterion) trace.getInitialPacket().getCriterion(Criterion.Type.ETH_DST))
                             .mac().isMulticast()) {
-                trace.addResultMessage("Packet is multicast and reached output " + outputPath.getOutputPort() +
+                trace.addResultMessage("Packet is multicast and reached output " + outputPath.outputPort() +
                         " which is enabled and is edge port");
                 trace.setSuccess(true);
-                TroubleshootUtils.computePath(completePath, trace, outputPath.getOutputPort());
-                if (!hasOtherOutput(in.deviceId(), trace, outputPath.getOutputPort())) {
+                TroubleshootUtils.computePath(completePath, trace, outputPath.outputPort());
+                if (!hasOtherOutput(in.deviceId(), trace, outputPath.outputPort())) {
                     return trace;
                 }
             } else if (deviceNib.getPort(cp) != null && deviceNib.getPort(cp).isEnabled()) {
@@ -528,10 +529,10 @@
                 //We treat as correct output only if it's not LLDP or BDDP
                 if (!(ethTypeCriterion.ethType().equals(EtherType.LLDP.ethType())
                         && !ethTypeCriterion.ethType().equals(EtherType.BDDP.ethType()))) {
-                    if (TroubleshootUtils.computePath(completePath, trace, outputPath.getOutputPort())) {
+                    if (TroubleshootUtils.computePath(completePath, trace, outputPath.outputPort())) {
                         if (hostsList.isEmpty()) {
-                            trace.addResultMessage("Packet is " + ((EthTypeCriterion) outputPath.getEgressPacket()
-                                    .getCriterion(Criterion.Type.ETH_TYPE)).ethType() + " and reached " +
+                            trace.addResultMessage("Packet is " + ((EthTypeCriterion) outputPath.egressPacket()
+                                    .packet().getCriterion(Criterion.Type.ETH_TYPE)).ethType() + " and reached " +
                                     cp + " with no hosts connected ");
                         } else {
                             IpAddress ipAddress = null;
@@ -547,7 +548,7 @@
                                 if (hostsList.stream().anyMatch(host -> host.ipAddresses().contains(finalIpAddress)) ||
                                         hostNib.getHostsByIp(finalIpAddress).isEmpty()) {
                                     trace.addResultMessage("Packet is " +
-                                            ((EthTypeCriterion) outputPath.getEgressPacket()
+                                            ((EthTypeCriterion) outputPath.egressPacket().packet()
                                                     .getCriterion(Criterion.Type.ETH_TYPE)).ethType() +
                                             " and reached " + cp + " with hosts " + hostsList);
                                 } else {
@@ -556,9 +557,9 @@
                                     trace.setSuccess(false);
                                 }
                             } else {
-                                trace.addResultMessage("Packet is " + ((EthTypeCriterion) outputPath.getEgressPacket()
-                                        .getCriterion(Criterion.Type.ETH_TYPE)).ethType() + " and reached " +
-                                        cp + " with hosts " + hostsList);
+                                trace.addResultMessage("Packet is " + ((EthTypeCriterion) outputPath.egressPacket()
+                                        .packet().getCriterion(Criterion.Type.ETH_TYPE)).ethType()
+                                        + " and reached " + cp + " with hosts " + hostsList);
                             }
                         }
                         trace.setSuccess(true);
@@ -592,7 +593,7 @@
      */
     private boolean hasOtherOutput(DeviceId inDeviceId, StaticPacketTrace trace, ConnectPoint cp) {
         return trace.getHitChains(inDeviceId).stream().filter(groupsInDevice ->
-                !groupsInDevice.getOutputPort().equals(cp)).count() > 0;
+                !groupsInDevice.outputPort().equals(cp)).count() > 0;
     }
 
     /**
@@ -699,23 +700,21 @@
         }
 
         // Applies pipeline processing
-        PipelineTraceableInput input = new PipelineTraceableInput(packet, in, dataPlaneEntities);
+        PipelineTraceableInput input = new PipelineTraceableInput(new PipelineTraceablePacket(packet),
+                in, dataPlaneEntities);
         PipelineTraceableOutput output = pipelineMatchable.apply(input);
 
         // Update the trace
-        List<PipelineTraceableHitChain> hitChains = output.getHitChains();
+        List<PipelineTraceableHitChain> hitChains = output.hitChains();
         hitChains.forEach(hitChain -> trace.addHitChain(in.deviceId(), hitChain));
-        trace.addResultMessage(output.getLog());
+        trace.addResultMessage(output.log());
 
         // If there was an error set the success to false
-        if (output.getResult() != PipelineTraceableResult.SUCCESS) {
+        if (output.result() != PipelineTraceableResult.SUCCESS) {
             TroubleshootUtils.computePath(completePath, trace, null);
             trace.setSuccess(false);
         }
 
-        log.info("Logs -> {}", output.getLog());
-        hitChains.forEach(hitChain -> log.info("HitChain -> {}", hitChain));
-
         // We are done!
         return trace;
     }
@@ -764,7 +763,7 @@
             enabledPorts.forEach(port -> {
                 PipelineTraceableHitChain hitChain = new PipelineTraceableHitChain(
                         new ConnectPoint(port.element().id(), port.number()), ImmutableList.of(),
-                        trace.getInitialPacket());
+                        new PipelineTraceablePacket(trace.getInitialPacket()));
                 trace.addHitChain(in.deviceId(), hitChain);
             });
             return trace;
diff --git a/app/src/test/java/org/onosproject/t3/impl/TroubleshootManagerTest.java b/app/src/test/java/org/onosproject/t3/impl/TroubleshootManagerTest.java
index 3ab8f91..15a4a7e 100644
--- a/app/src/test/java/org/onosproject/t3/impl/TroubleshootManagerTest.java
+++ b/app/src/test/java/org/onosproject/t3/impl/TroubleshootManagerTest.java
@@ -169,10 +169,10 @@
                 traceSuccess.resultMessage().contains(PACKET_TO_CONTROLLER));
         assertTrue("Master should be Master1",
                 traceSuccess.resultMessage().contains(MASTER_1));
-        ConnectPoint connectPoint = traceSuccess.getHitChains(ARP_FLOW_DEVICE).get(0).getOutputPort();
+        ConnectPoint connectPoint = traceSuccess.getHitChains(ARP_FLOW_DEVICE).get(0).outputPort();
         assertEquals("Packet Should go to CONTROLLER", PortNumber.CONTROLLER, connectPoint.port());
         VlanIdCriterion vlanIdCriterion = (VlanIdCriterion) traceSuccess.getHitChains(ARP_FLOW_DEVICE).get(0)
-                .getEgressPacket().getCriterion(Criterion.Type.VLAN_VID);
+                .egressPacket().packet().getCriterion(Criterion.Type.VLAN_VID);
         assertEquals("VlanId should be None", VlanId.NONE, vlanIdCriterion.vlanId());
         log.info("trace {}", traceSuccess.resultMessage());
     }
@@ -188,10 +188,10 @@
                 traceSuccess.resultMessage().contains(PACKET_TO_CONTROLLER));
         assertTrue("Master should be Master1",
                 traceSuccess.resultMessage().contains(MASTER_1));
-        ConnectPoint connectPoint = traceSuccess.getHitChains(ARP_FLOW_VLAN_DEVICE).get(0).getOutputPort();
+        ConnectPoint connectPoint = traceSuccess.getHitChains(ARP_FLOW_VLAN_DEVICE).get(0).outputPort();
         assertEquals("Packet Should go to CONTROLLER", PortNumber.CONTROLLER, connectPoint.port());
         VlanIdCriterion vlanIdCriterion = (VlanIdCriterion) traceSuccess.getHitChains(ARP_FLOW_VLAN_DEVICE).get(0)
-                .getEgressPacket().getCriterion(Criterion.Type.VLAN_VID);
+                .egressPacket().packet().getCriterion(Criterion.Type.VLAN_VID);
         assertEquals("VlanId should be None", VlanId.NONE, vlanIdCriterion.vlanId());
         log.info("trace {}", traceSuccess.resultMessage());
     }
@@ -240,7 +240,7 @@
                 DUAL_FLOW_OUT_CP, 1, 1);
         // Verifying Vlan
         Criterion criterion = traceSuccess.getHitChains(DUAL_FLOW_DEVICE).get(0).
-                getEgressPacket().getCriterion(Criterion.Type.VLAN_VID);
+                egressPacket().packet().getCriterion(Criterion.Type.VLAN_VID);
         assertNotNull("Packet Should have Vlan", criterion);
         VlanIdCriterion vlanIdCriterion = (VlanIdCriterion) criterion;
         assertEquals("Vlan should be 100", VlanId.vlanId((short) 100), vlanIdCriterion.vlanId());
@@ -259,14 +259,14 @@
                 GROUP_FLOW_OUT_CP, 1, 1);
         // Verify the output of the test
         assertTrue("Wrong Output Group", traceSuccess.getHitChains(GROUP_FLOW_DEVICE)
-                .get(0).getHitChain().contains(new DataPlaneEntity(GROUP)));
+                .get(0).hitChain().contains(new DataPlaneEntity(GROUP)));
         assertEquals("Packet should not have MPLS Label", EthType.EtherType.IPV4.ethType(),
-                ((EthTypeCriterion) traceSuccess.getHitChains(GROUP_FLOW_DEVICE)
-                        .get(0).getEgressPacket().getCriterion(Criterion.Type.ETH_TYPE)).ethType());
-        assertNull("Packet should not have MPLS Label", traceSuccess.getHitChains(GROUP_FLOW_DEVICE)
-                .get(0).getEgressPacket().getCriterion(Criterion.Type.MPLS_LABEL));
-        assertNull("Packet should not have MPLS BoS", traceSuccess.getHitChains(GROUP_FLOW_DEVICE)
-                .get(0).getEgressPacket().getCriterion(Criterion.Type.MPLS_BOS));
+                ((EthTypeCriterion) traceSuccess.getHitChains(GROUP_FLOW_DEVICE).get(0)
+                        .egressPacket().packet().getCriterion(Criterion.Type.ETH_TYPE)).ethType());
+        assertNull("Packet should not have MPLS Label", traceSuccess.getHitChains(GROUP_FLOW_DEVICE).get(0)
+                .egressPacket().packet().getCriterion(Criterion.Type.MPLS_LABEL));
+        assertNull("Packet should not have MPLS BoS", traceSuccess.getHitChains(GROUP_FLOW_DEVICE).get(0)
+                .egressPacket().packet().getCriterion(Criterion.Type.MPLS_BOS));
     }
 
     /**
@@ -293,10 +293,10 @@
                 TOPO_FLOW_3_DEVICE, TOPO_FLOW_3_OUT_CP, 2, 1);
         // Verify the multiple output actions
         assertTrue("Incorrect groups",
-                traceSuccess.getHitChains(TOPO_GROUP_FLOW_DEVICE).get(0).getHitChain()
+                traceSuccess.getHitChains(TOPO_GROUP_FLOW_DEVICE).get(0).hitChain()
                         .contains(new DataPlaneEntity(TOPO_GROUP)));
         assertTrue("Incorrect bucket",
-                traceSuccess.getHitChains(TOPO_GROUP_FLOW_DEVICE).get(1).getHitChain()
+                traceSuccess.getHitChains(TOPO_GROUP_FLOW_DEVICE).get(1).hitChain()
                         .contains(new DataPlaneEntity(TOPO_GROUP)));
     }
 
@@ -334,7 +334,7 @@
                 traceSuccess.resultMessage().contains("Packet goes to the controller"));
         assertTrue("Master should be Master1",
                 traceSuccess.resultMessage().contains(MASTER_1));
-        ConnectPoint connectPoint = traceSuccess.getHitChains(LLDP_FLOW_DEVICE).get(0).getOutputPort();
+        ConnectPoint connectPoint = traceSuccess.getHitChains(LLDP_FLOW_DEVICE).get(0).outputPort();
         assertEquals("Packet Should go to CONTROLLER", PortNumber.CONTROLLER, connectPoint.port());
         log.info("trace {}", traceSuccess.resultMessage());
     }
@@ -358,9 +358,9 @@
         assertTrue("Trace should be successful",
                 traceSuccess.resultMessage().contains("reached output"));
         assertEquals("Incorrect Output CP", MULTICAST_OUT_CP_2,
-                traceSuccess.getHitChains(MULTICAST_GROUP_FLOW_DEVICE).get(0).getOutputPort());
+                traceSuccess.getHitChains(MULTICAST_GROUP_FLOW_DEVICE).get(0).outputPort());
         assertEquals("Incorrect Output CP", MULTICAST_OUT_CP,
-                traceSuccess.getHitChains(MULTICAST_GROUP_FLOW_DEVICE).get(1).getOutputPort());
+                traceSuccess.getHitChains(MULTICAST_GROUP_FLOW_DEVICE).get(1).outputPort());
     }
 
     /**
@@ -396,7 +396,7 @@
         assertTrue("Trace should be successful",
                 traceSuccess.resultMessage().contains("Reached required destination Host"));
         assertEquals("Incorrect Output CP", out,
-                traceSuccess.getHitChains(deviceId).get(0).getOutputPort());
+                traceSuccess.getHitChains(deviceId).get(0).outputPort());
 
         return traceSuccess;
     }
diff --git a/pom.xml b/pom.xml
index 6a1b9a9..61f037c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     <parent>
         <groupId>org.onosproject</groupId>
         <artifactId>onos-dependencies</artifactId>
-        <version>2.5.0</version>
+        <version>2.5.1</version>
     </parent>
 
     <groupId>org.onosproject</groupId>