blob: 708640b2369218d61cbcc8e690874cc08eea5872 [file] [log] [blame]
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -08001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2011 UCLA
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
Alexander Afanasyev0c395372014-12-20 15:54:02 -080021#include "ndn-l3-aggregate-tracer.hpp"
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080022
23#include "ns3/node.h"
24#include "ns3/packet.h"
25#include "ns3/config.h"
26#include "ns3/callback.h"
Alexander Afanasyev0c395372014-12-20 15:54:02 -080027#include "ns3/ndn-app.hpp"
28#include "ns3/ndn-face.hpp"
Alexander Afanasyev0c395372014-12-20 15:54:02 -080029#include "ns3/ndn-pit-entry.hpp"
Alexander Afanasyev37b84c52013-04-26 13:38:52 -070030
Alexander Afanasyev59314802012-11-26 14:56:04 -080031#include "ns3/simulator.h"
32#include "ns3/node-list.h"
33#include "ns3/log.h"
34
35#include <fstream>
36
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080037NS_LOG_COMPONENT_DEFINE("ndn.L3AggregateTracer");
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080038
39namespace ns3 {
40namespace ndn {
41
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080042static std::list<boost::tuple<boost::shared_ptr<std::ostream>, std::list<Ptr<L3AggregateTracer>>>>
43 g_tracers;
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070044
Alexander Afanasyev5352af32013-07-15 09:51:28 -070045template<class T>
46static inline void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080047NullDeleter(T* ptr)
Alexander Afanasyev5352af32013-07-15 09:51:28 -070048{
49}
50
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070051void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080052L3AggregateTracer::Destroy()
Alexander Afanasyevdb5f3b62013-08-09 17:42:12 -070053{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080054 g_tracers.clear();
Alexander Afanasyevdb5f3b62013-08-09 17:42:12 -070055}
56
57void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080058L3AggregateTracer::InstallAll(const std::string& file, Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyev59314802012-11-26 14:56:04 -080059{
60 using namespace boost;
61 using namespace std;
Alexander Afanasyev37b84c52013-04-26 13:38:52 -070062
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080063 std::list<Ptr<L3AggregateTracer>> tracers;
Alexander Afanasyev5352af32013-07-15 09:51:28 -070064 boost::shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080065 if (file != "-") {
66 boost::shared_ptr<std::ofstream> os(new std::ofstream());
67 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyev59314802012-11-26 14:56:04 -080068
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080069 if (!os->is_open()) {
70 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
71 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -070072 }
Alexander Afanasyev59314802012-11-26 14:56:04 -080073
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080074 outputStream = os;
75 }
76 else {
77 outputStream = boost::shared_ptr<std::ostream>(&std::cout, NullDeleter<std::ostream>);
78 }
Alexander Afanasyev59314802012-11-26 14:56:04 -080079
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080080 for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End(); node++) {
81 Ptr<L3AggregateTracer> trace = Install(*node, outputStream, averagingPeriod);
82 tracers.push_back(trace);
83 }
Alexander Afanasyev59314802012-11-26 14:56:04 -080084
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080085 if (tracers.size() > 0) {
86 // *m_l3RateTrace << "# "; // not necessary for R's read.table
87 tracers.front()->PrintHeader(*outputStream);
88 *outputStream << "\n";
89 }
90
91 g_tracers.push_back(boost::make_tuple(outputStream, tracers));
Alexander Afanasyev59314802012-11-26 14:56:04 -080092}
93
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070094void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080095L3AggregateTracer::Install(const NodeContainer& nodes, const std::string& file,
96 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyeva68783a2013-06-27 13:39:04 -070097{
98 using namespace boost;
99 using namespace std;
Alexander Afanasyev59314802012-11-26 14:56:04 -0800100
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800101 std::list<Ptr<L3AggregateTracer>> tracers;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700102 boost::shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800103 if (file != "-") {
104 boost::shared_ptr<std::ofstream> os(new std::ofstream());
105 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700106
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800107 if (!os->is_open()) {
108 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
109 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700110 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700111
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800112 outputStream = os;
113 }
114 else {
115 outputStream = boost::shared_ptr<std::ostream>(&std::cout, NullDeleter<std::ostream>);
116 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700117
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800118 for (NodeContainer::Iterator node = nodes.Begin(); node != nodes.End(); node++) {
119 Ptr<L3AggregateTracer> trace = Install(*node, outputStream, averagingPeriod);
120 tracers.push_back(trace);
121 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700122
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800123 if (tracers.size() > 0) {
124 // *m_l3RateTrace << "# "; // not necessary for R's read.table
125 tracers.front()->PrintHeader(*outputStream);
126 *outputStream << "\n";
127 }
128
129 g_tracers.push_back(boost::make_tuple(outputStream, tracers));
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700130}
131
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -0700132void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800133L3AggregateTracer::Install(Ptr<Node> node, const std::string& file,
134 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700135{
136 using namespace boost;
137 using namespace std;
138
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800139 std::list<Ptr<L3AggregateTracer>> tracers;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700140 boost::shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800141 if (file != "-") {
142 boost::shared_ptr<std::ofstream> os(new std::ofstream());
143 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700144
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800145 if (!os->is_open()) {
146 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
147 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700148 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700149
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800150 outputStream = os;
151 }
152 else {
153 outputStream = boost::shared_ptr<std::ostream>(&std::cout, NullDeleter<std::ostream>);
154 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700155
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800156 Ptr<L3AggregateTracer> trace = Install(node, outputStream, averagingPeriod);
157 tracers.push_back(trace);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700158
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800159 if (tracers.size() > 0) {
160 // *m_l3RateTrace << "# "; // not necessary for R's read.table
161 tracers.front()->PrintHeader(*outputStream);
162 *outputStream << "\n";
163 }
164
165 g_tracers.push_back(boost::make_tuple(outputStream, tracers));
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700166}
167
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700168Ptr<L3AggregateTracer>
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800169L3AggregateTracer::Install(Ptr<Node> node, boost::shared_ptr<std::ostream> outputStream,
170 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700171{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800172 NS_LOG_DEBUG("Node: " << node->GetId());
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700173
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800174 Ptr<L3AggregateTracer> trace = Create<L3AggregateTracer>(outputStream, node);
175 trace->SetAveragingPeriod(averagingPeriod);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700176
177 return trace;
178}
Alexander Afanasyev59314802012-11-26 14:56:04 -0800179
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800180L3AggregateTracer::L3AggregateTracer(boost::shared_ptr<std::ostream> os, Ptr<Node> node)
181 : L3Tracer(node)
182 , m_os(os)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800183{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800184 Reset();
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800185}
186
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800187L3AggregateTracer::L3AggregateTracer(boost::shared_ptr<std::ostream> os, const std::string& node)
188 : L3Tracer(node)
189 , m_os(os)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800190{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800191 Reset();
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800192}
193
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800194L3AggregateTracer::~L3AggregateTracer(){};
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800195
196void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800197L3AggregateTracer::SetAveragingPeriod(const Time& period)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800198{
Alexander Afanasyev59314802012-11-26 14:56:04 -0800199 m_period = period;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800200 m_printEvent.Cancel();
201 m_printEvent = Simulator::Schedule(m_period, &L3AggregateTracer::PeriodicPrinter, this);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800202}
203
Alexander Afanasyev59314802012-11-26 14:56:04 -0800204void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800205L3AggregateTracer::PeriodicPrinter()
Alexander Afanasyev59314802012-11-26 14:56:04 -0800206{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800207 Print(*m_os);
208 Reset();
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700209
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800210 m_printEvent = Simulator::Schedule(m_period, &L3AggregateTracer::PeriodicPrinter, this);
Alexander Afanasyev59314802012-11-26 14:56:04 -0800211}
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800212
213void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800214L3AggregateTracer::PrintHeader(std::ostream& os) const
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800215{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800216 os << "Time"
217 << "\t"
Alexander Afanasyev59314802012-11-26 14:56:04 -0800218
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800219 << "Node"
220 << "\t"
221 << "FaceId"
222 << "\t"
223 << "FaceDescr"
224 << "\t"
Alexander Afanasyev59314802012-11-26 14:56:04 -0800225
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800226 << "Type"
227 << "\t"
228 << "Packets"
229 << "\t"
Alexander Afanasyev59314802012-11-26 14:56:04 -0800230 << "Kilobytes";
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800231}
232
233void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800234L3AggregateTracer::Reset()
Alexander Afanasyev59314802012-11-26 14:56:04 -0800235{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800236 for (std::map<Ptr<const Face>, boost::tuple<Stats, Stats>>::iterator stats = m_stats.begin();
237 stats != m_stats.end(); stats++) {
238 stats->second.get<0>().Reset();
239 stats->second.get<1>().Reset();
240 }
Alexander Afanasyev59314802012-11-26 14:56:04 -0800241}
242
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800243#define STATS(INDEX) stats->second.get<INDEX>()
Alexander Afanasyev59314802012-11-26 14:56:04 -0800244
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800245#define PRINTER(printName, fieldName) \
246 os << time.ToDouble(Time::S) << "\t" << m_node << "\t"; \
247 if (stats->first) { \
248 os << stats->first->GetId() << "\t" << *stats->first << "\t"; \
249 } \
250 else { \
251 os << "-1\tall\t"; \
252 } \
253 os << printName << "\t" << STATS(0).fieldName << "\t" << STATS(1).fieldName / 1024.0 << "\n";
Alexander Afanasyev59314802012-11-26 14:56:04 -0800254
255void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800256L3AggregateTracer::Print(std::ostream& os) const
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800257{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800258 Time time = Simulator::Now();
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700259
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800260 for (std::map<Ptr<const Face>, boost::tuple<Stats, Stats>>::iterator stats = m_stats.begin();
261 stats != m_stats.end(); stats++) {
262 if (!stats->first)
263 continue;
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800264
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800265 PRINTER("InInterests", m_inInterests);
266 PRINTER("OutInterests", m_outInterests);
267 PRINTER("DropInterests", m_dropInterests);
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700268
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800269 PRINTER("InNacks", m_inNacks);
270 PRINTER("OutNacks", m_outNacks);
271 PRINTER("DropNacks", m_dropNacks);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800272
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800273 PRINTER("InData", m_inData);
274 PRINTER("OutData", m_outData);
275 PRINTER("DropData", m_dropData);
276 }
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700277
278 {
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800279 std::map<Ptr<const Face>, boost::tuple<Stats, Stats>>::iterator stats =
280 m_stats.find(Ptr<const Face>(0));
281 if (stats != m_stats.end()) {
282 PRINTER("SatisfiedInterests", m_satisfiedInterests);
283 PRINTER("TimedOutInterests", m_timedOutInterests);
284 }
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700285 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800286}
287
288void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700289L3AggregateTracer::OutInterests(shared_ptr<const Interest> interest, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800290{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800291 m_stats[face].get<0>().m_outInterests++;
292 if (interest->GetWire()) {
293 m_stats[face].get<1>().m_outInterests += interest->GetWire()->GetSize();
294 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800295}
296
297void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700298L3AggregateTracer::InInterests(shared_ptr<const Interest> interest, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800299{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800300 m_stats[face].get<0>().m_inInterests++;
301 if (interest->GetWire()) {
302 m_stats[face].get<1>().m_inInterests += interest->GetWire()->GetSize();
303 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800304}
305
306void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700307L3AggregateTracer::DropInterests(shared_ptr<const Interest> interest, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800308{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800309 m_stats[face].get<0>().m_dropInterests++;
310 if (interest->GetWire()) {
311 m_stats[face].get<1>().m_dropInterests += interest->GetWire()->GetSize();
312 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800313}
314
315void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700316L3AggregateTracer::OutNacks(shared_ptr<const Interest> nack, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800317{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800318 m_stats[face].get<0>().m_outNacks++;
319 if (nack->GetWire()) {
320 m_stats[face].get<1>().m_outNacks += nack->GetWire()->GetSize();
321 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800322}
323
324void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700325L3AggregateTracer::InNacks(shared_ptr<const Interest> nack, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800326{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800327 m_stats[face].get<0>().m_inNacks++;
328 if (nack->GetWire()) {
329 m_stats[face].get<1>().m_inNacks += nack->GetWire()->GetSize();
330 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800331}
332
333void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700334L3AggregateTracer::DropNacks(shared_ptr<const Interest> nack, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800335{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800336 m_stats[face].get<0>().m_dropNacks++;
337 if (nack->GetWire()) {
338 m_stats[face].get<1>().m_dropNacks += nack->GetWire()->GetSize();
339 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800340}
341
342void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700343L3AggregateTracer::OutData(shared_ptr<const Data> data, bool fromCache, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800344{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800345 m_stats[face].get<0>().m_outData++;
346 if (data->GetWire()) {
347 m_stats[face].get<1>().m_outData += data->GetWire()->GetSize();
348 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800349}
350
351void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700352L3AggregateTracer::InData(shared_ptr<const Data> data, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800353{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800354 m_stats[face].get<0>().m_inData++;
355 if (data->GetWire()) {
356 m_stats[face].get<1>().m_inData += data->GetWire()->GetSize();
357 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800358}
359
360void
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -0700361L3AggregateTracer::DropData(shared_ptr<const Data> data, Ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800362{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800363 m_stats[face].get<0>().m_dropData++;
364 if (data->GetWire()) {
365 m_stats[face].get<1>().m_dropData += data->GetWire()->GetSize();
366 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800367}
368
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700369void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800370L3AggregateTracer::SatisfiedInterests(Ptr<const pit::Entry>)
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700371{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800372 m_stats[0].get<0>().m_satisfiedInterests++;
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700373 // no "size" stats
374}
375
376void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800377L3AggregateTracer::TimedOutInterests(Ptr<const pit::Entry>)
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700378{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800379 m_stats[0].get<0>().m_timedOutInterests++;
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700380 // no "size" stats
381}
382
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800383} // namespace ndn
384} // namespace ns3