diff --git a/api/src/main/java/org/opencord/aaa/AaaStatistics.java b/api/src/main/java/org/opencord/aaa/AaaStatistics.java
index 9764427..921de5f 100644
--- a/api/src/main/java/org/opencord/aaa/AaaStatistics.java
+++ b/api/src/main/java/org/opencord/aaa/AaaStatistics.java
@@ -16,36 +16,61 @@
 
 package org.opencord.aaa;
 
+import java.util.LinkedList;
 import java.util.concurrent.atomic.AtomicLong;
 
 public class AaaStatistics {
-    //Number of access accept packets sent to the server
+    // Number of access accept packets sent to the server
     private AtomicLong acceptResponsesRx = new AtomicLong();
-    //Number of access reject packets sent to the server
+    // Number of access reject packets sent to the server
     private AtomicLong rejectResponsesRx = new AtomicLong();
-    //Number of access challenge packets sent to the server
+    // Number of access challenge packets sent to the server
     private AtomicLong challengeResponsesRx = new AtomicLong();
-    //Number of access request packets sent to the server
+    // Number of access request packets sent to the server
     private AtomicLong accessRequestsTx = new AtomicLong();
-    //Number of access request packets pending a response from the server
+    // Number of access request packets pending a response from the server
     private AtomicLong pendingRequests = new AtomicLong();
-    //Number of packets of an unknown RADIUS type received from the accounting server
+    // Number of packets of an unknown RADIUS type received from the accounting
+    // server
     private AtomicLong unknownTypeRx = new AtomicLong();
-    //Number of access response packets received from the server with an invalid validator
+    // Number of access response packets received from the server with an invalid
+    // validator
     private AtomicLong invalidValidatorsRx = new AtomicLong();
-    //Number of dropped packets received from the accounting server
+    // Number of dropped packets received from the accounting server
     private AtomicLong droppedResponsesRx = new AtomicLong();
-    //Number of malformed access response packets received from the server
+    // Number of malformed access response packets received from the server
     private AtomicLong malformedResponsesRx = new AtomicLong();
-    //Number of packets received from an unknown server
+    // Number of packets received from an unknown server
     private AtomicLong unknownServerRx = new AtomicLong();
-    //Roundtrip packet time to the accounting server
+    // Roundtrip packet time to the accounting server
     private AtomicLong requestRttMilis = new AtomicLong();
-    //Number of access request packets retransmitted to the server
+    // Number of access request packets retransmitted to the server
     private AtomicLong requestReTx = new AtomicLong();
-    //Number of sessions expired
+    // Number of sessions expired
     private AtomicLong numberOfSessionsExpired = new AtomicLong();
 
+    private LinkedList<Long> packetRoundTripTimeList = new LinkedList<Long>();
+
+    public LinkedList<Long> getPacketRoundTripTimeList() {
+        return packetRoundTripTimeList;
+    }
+
+    public int getPacketRoundTripTimeListSize() {
+        return packetRoundTripTimeList.size();
+    }
+
+    public void clearPacketRoundTripTimeList() {
+        packetRoundTripTimeList.clear();
+    }
+
+    public void getPacketRoundTripTimeListRemoveFirst() {
+        packetRoundTripTimeList.removeFirst();
+    }
+
+    public void getPacketRoundTripTimeListAdd(long time) {
+        packetRoundTripTimeList.add(time);
+    }
+
     public Long getRequestReTx() {
         return requestReTx.get();
     }
@@ -153,4 +178,21 @@
         numberOfDroppedPackets += numberOfSessionsExpired.get();
         this.droppedResponsesRx = new AtomicLong(numberOfDroppedPackets);
     }
+
+    public void resetAllCounters() {
+        clearPacketRoundTripTimeList();
+
+        accessRequestsTx.set(0);
+        acceptResponsesRx.set(0);
+        challengeResponsesRx.set(0);
+        droppedResponsesRx.set(0);
+        invalidValidatorsRx.set(0);
+        malformedResponsesRx.set(0);
+        pendingRequests.set(0);
+        rejectResponsesRx.set(0);
+        requestReTx.set(0);
+        requestRttMilis.set(0);
+        unknownServerRx.set(0);
+        unknownTypeRx.set(0);
+    }
 }
diff --git a/api/src/main/java/org/opencord/aaa/AuthenticationStatisticsService.java b/api/src/main/java/org/opencord/aaa/AuthenticationStatisticsService.java
index bdb9f2d..37a2205 100644
--- a/api/src/main/java/org/opencord/aaa/AuthenticationStatisticsService.java
+++ b/api/src/main/java/org/opencord/aaa/AuthenticationStatisticsService.java
@@ -23,38 +23,42 @@
  */
 
 public interface AuthenticationStatisticsService extends
-        ListenerService<AuthenticationStatisticsEvent, AuthenticationStatisticsEventListener> {
+ListenerService<AuthenticationStatisticsEvent, AuthenticationStatisticsEventListener> {
 
     /**
      * Returns AaaStatistics object.
      *
      * @return AaaStatistics
-    */
+     */
     public AaaStatistics getAaaStats();
-
     /**
      * Returns AuthenticationStatisticsDelegate object.
      *
      * @return AuthenticationStatisticsDelegate
-    */
+     */
     public AuthenticationStatisticsDelegate getStatsDelegate();
 
     /**
      * Handle the roundTrip time of Radius Packet.
      *
      * @param identifier identifier of incoming radius packet
-    */
+     */
     public void handleRoundtripTime(byte identifier);
 
     /**
      * Calculate average roundTrip time of multiple Packets.
-    */
+     */
     public void calculatePacketRoundtripTime();
 
     /**
      * Put the identifier value to map.
      *
      * @param identifier identifier of incoming radius packet
-    */
+     */
     public void putOutgoingIdentifierToMap(byte identifier);
+
+   /**
+    * Reset all the values of aaa counters to 0.
+    */
+    public void resetAllCounters();
 }
diff --git a/app/src/main/java/org/opencord/aaa/impl/AaaResetCountersCommand.java b/app/src/main/java/org/opencord/aaa/impl/AaaResetCountersCommand.java
new file mode 100644
index 0000000..79ada3b
--- /dev/null
+++ b/app/src/main/java/org/opencord/aaa/impl/AaaResetCountersCommand.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2016-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.opencord.aaa.impl;
+
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.opencord.aaa.AuthenticationStatisticsService;
+
+/**
+ * Reset value of all aaa statistics counters to 0.
+ */
+@Command(scope = "onos", name = "reset-aaa-counters", description = "Reset value of all aaa statistics counters to 0 ")
+public class AaaResetCountersCommand extends AbstractShellCommand {
+
+    @Override
+    protected void execute() {
+        AuthenticationStatisticsService aaaStatisticsManager = AbstractShellCommand
+                .get(AuthenticationStatisticsService.class);
+        aaaStatisticsManager.resetAllCounters();
+    }
+}
diff --git a/app/src/main/java/org/opencord/aaa/impl/AaaShowCountersCommand.java b/app/src/main/java/org/opencord/aaa/impl/AaaShowCountersCommand.java
new file mode 100644
index 0000000..0717f9a
--- /dev/null
+++ b/app/src/main/java/org/opencord/aaa/impl/AaaShowCountersCommand.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2016-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.opencord.aaa.impl;
+
+import org.apache.karaf.shell.commands.Command;
+import org.onosproject.cli.AbstractShellCommand;
+import org.opencord.aaa.AaaStatistics;
+import org.opencord.aaa.AuthenticationStatisticsService;
+
+/**
+ * Display current value of all aaa statistics counters.
+ */
+@Command(scope = "onos", name = "show-aaa-counters",
+description = "Display current value of all aaa statistics counters")
+public class AaaShowCountersCommand extends AbstractShellCommand {
+    @Override
+    protected void execute() {
+
+        AaaStatistics aaaStats = new AaaStatistics();
+
+        AuthenticationStatisticsService aaaStatisticsManager =
+                AbstractShellCommand.get(AuthenticationStatisticsService.class);
+        aaaStats = aaaStatisticsManager.getAaaStats();
+
+        System.out.format("%30s %10d\n", "AccessRequestsTx", aaaStats.getAccessRequestsTx());
+        System.out.format("%30s %10d\n", "ChallengeResponsesRx", aaaStats.getChallengeResponsesRx());
+        System.out.format("%30s %10d\n", "RequestReTx", aaaStats.getRequestReTx());
+        System.out.format("%30s %10d\n", "AcceptResponsesRx", aaaStats.getAcceptResponsesRx());
+        System.out.format("%30s %10d\n", "RejectResponsesRx", aaaStats.getRejectResponsesRx());
+        System.out.format("%30s %10d\n", "PendingRequests", aaaStats.getPendingRequests());
+        System.out.format("%30s %10d\n", "DroppedResponsesRx", aaaStats.getDroppedResponsesRx());
+        System.out.format("%30s %10d\n", "InvalidValidatorsRx", aaaStats.getInvalidValidatorsRx());
+        System.out.format("%30s %10d\n", "MalformedResponsesRx", aaaStats.getMalformedResponsesRx());
+        System.out.format("%30s %10d\n", "UnknownServerRx", aaaStats.getUnknownServerRx());
+        System.out.format("%30s %10d\n", "UnknownTypeRx", aaaStats.getUnknownTypeRx());
+        System.out.format("%30s %10d\n", "RequestRttMillis", aaaStats.getRequestRttMilis());
+
+  }
+}
diff --git a/app/src/main/java/org/opencord/aaa/impl/AaaStatisticsManager.java b/app/src/main/java/org/opencord/aaa/impl/AaaStatisticsManager.java
index b28d53e..31aad5b 100644
--- a/app/src/main/java/org/opencord/aaa/impl/AaaStatisticsManager.java
+++ b/app/src/main/java/org/opencord/aaa/impl/AaaStatisticsManager.java
@@ -19,7 +19,6 @@
 import static org.slf4j.LoggerFactory.getLogger;
 
 import java.util.HashMap;
-import java.util.LinkedList;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 
@@ -39,21 +38,22 @@
 @Service
 @Component(immediate = true)
 public class AaaStatisticsManager
-        extends AbstractListenerManager<AuthenticationStatisticsEvent, AuthenticationStatisticsEventListener>
-        implements AuthenticationStatisticsService {
+extends AbstractListenerManager<AuthenticationStatisticsEvent, AuthenticationStatisticsEventListener>
+implements AuthenticationStatisticsService {
 
     private AuthenticationStatisticsDelegate statsDelegate;
 
+    @Override
     public AuthenticationStatisticsDelegate getStatsDelegate() {
         return statsDelegate;
     }
 
     private final Logger log = getLogger(getClass());
     private AaaStatistics aaaStats;
-    private LinkedList<Long> packetRoundTripTimeList = new LinkedList<Long>();
     public Map<Byte, Long> outgoingPacketMap = new HashMap<Byte, Long>();
     private static final int PACKET_COUNT_FOR_AVERAGE_RTT_CALCULATION = 5;
 
+    @Override
     public AaaStatistics getAaaStats() {
         return aaaStats;
     }
@@ -71,23 +71,31 @@
         eventDispatcher.removeSink(AuthenticationStatisticsEvent.class);
     }
 
+    @Override
     public void handleRoundtripTime(byte inPacketIdentifier) {
         long inTimeInMilis = System.currentTimeMillis();
         if (outgoingPacketMap.containsKey(inPacketIdentifier)) {
-            if (packetRoundTripTimeList.size() > PACKET_COUNT_FOR_AVERAGE_RTT_CALCULATION) {
-                packetRoundTripTimeList.removeFirst();
+            if (aaaStats.getPacketRoundTripTimeListSize() > PACKET_COUNT_FOR_AVERAGE_RTT_CALCULATION) {
+                aaaStats.getPacketRoundTripTimeListRemoveFirst();
             }
-            packetRoundTripTimeList.add(inTimeInMilis - outgoingPacketMap.get(inPacketIdentifier));
+            aaaStats.getPacketRoundTripTimeListAdd(inTimeInMilis - outgoingPacketMap.get(inPacketIdentifier));
         }
     }
 
+    @Override
+    public void resetAllCounters() {
+        aaaStats.resetAllCounters();
+    }
+
+    @Override
     public void calculatePacketRoundtripTime() {
-        if (packetRoundTripTimeList.size() > 0) {
-            long avg = (long) packetRoundTripTimeList.stream().mapToLong(i -> i).average().getAsDouble();
+        if (aaaStats.getPacketRoundTripTimeListSize() > 0) {
+            long avg = (long) aaaStats.getPacketRoundTripTimeList().stream().mapToLong(i -> i).average().getAsDouble();
             aaaStats.setRequestRttMilis(new AtomicLong(avg));
         }
     }
 
+    @Override
     public void putOutgoingIdentifierToMap(byte outPacketIdentifier) {
         outgoingPacketMap.put(outPacketIdentifier, System.currentTimeMillis());
     }
diff --git a/app/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/app/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index b83f750..d9c9d24 100644
--- a/app/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/app/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -1,5 +1,5 @@
 <!--
-  ~ Copyright 2016-present Open Networking Foundation
+  ~Copyright 2016-present Open Networking Foundation
   ~
   ~ Licensed under the Apache License, Version 2.0 (the "License");
   ~ you may not use this file except in compliance with the License.
@@ -22,5 +22,11 @@
         <command>
             <action class="org.opencord.aaa.impl.AaaResetDeviceCommand"/>
         </command>
+        <command>
+            <action class="org.opencord.aaa.impl.AaaResetCountersCommand"/>
+        </command>
+        <command>
+            <action class="org.opencord.aaa.impl.AaaShowCountersCommand"/>
+        </command>
     </command-bundle>
 </blueprint>
