ndnping: recognize and trace Nack
Change-Id: If47877892c75ae0849375f36430a66e02fb7a608
refs: #3335
diff --git a/tools/ping/client/statistics-collector.hpp b/tools/ping/client/statistics-collector.hpp
index 2ced820..ee67f80 100644
--- a/tools/ping/client/statistics-collector.hpp
+++ b/tools/ping/client/statistics-collector.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
- * Copyright (c) 2015, Arizona Board of Regents.
+ * Copyright (c) 2015-2016, Arizona Board of Regents.
*
* This file is part of ndn-tools (Named Data Networking Essential Tools).
* See AUTHORS.md for complete list of ndn-tools authors and contributors.
@@ -18,6 +18,7 @@
*
* @author: Eric Newberry <enewberry@email.arizona.edu>
* @author: Jerald Paul Abraham <jeraldabraham@email.arizona.edu>
+ * @author: Teng Liang <philoliang@email.arizona.edu>
*/
#ifndef NDN_TOOLS_PING_CLIENT_STATISTICS_COLLECTOR_HPP
@@ -39,10 +40,12 @@
Name prefix; //!< prefix pinged
int nSent; //!< number of pings sent
int nReceived; //!< number of pings received
+ int nNacked; //!< number of nacks received
time::steady_clock::TimePoint pingStartTime; //!< time pings started
double minRtt; //!< minimum round trip time
double maxRtt; //!< maximum round trip time
double packetLossRate; //!< packet loss rate
+ double packetNackedRate; //!< packet nacked rate
double sumRtt; //!< sum of round trip times
double avgRtt; //!< average round trip time
double stdDevRtt; //!< std dev of round trip time
@@ -71,12 +74,18 @@
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
/**
- * @brief Called on ping response received
+ * @brief Called when a Data packet is received
*
* @param rtt round trip time
*/
void
- recordResponse(Rtt rtt);
+ recordData(Rtt rtt);
+
+ /**
+ * @brief Called when a Nack is received
+ */
+ void
+ recordNack();
/**
* @brief Called on ping timeout
@@ -89,6 +98,7 @@
const Options& m_options;
int m_nSent;
int m_nReceived;
+ int m_nNacked;
time::steady_clock::TimePoint m_pingStartTime;
double m_minRtt;
double m_maxRtt;