blob: 5f0dca622e4bfe226c1448efff3157bbacf6f5dd [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"
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -070027#include "apps/ndn-app.hpp"
28#include "model/ndn-face.hpp"
Alexander Afanasyev37b84c52013-04-26 13:38:52 -070029
Alexander Afanasyev59314802012-11-26 14:56:04 -080030#include "ns3/simulator.h"
31#include "ns3/node-list.h"
32#include "ns3/log.h"
33
34#include <fstream>
35
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080036NS_LOG_COMPONENT_DEFINE("ndn.L3AggregateTracer");
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -080037
38namespace ns3 {
39namespace ndn {
40
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080041static std::list<boost::tuple<boost::shared_ptr<std::ostream>, std::list<Ptr<L3AggregateTracer>>>>
42 g_tracers;
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070043
Alexander Afanasyev5352af32013-07-15 09:51:28 -070044template<class T>
45static inline void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080046NullDeleter(T* ptr)
Alexander Afanasyev5352af32013-07-15 09:51:28 -070047{
48}
49
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070050void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080051L3AggregateTracer::Destroy()
Alexander Afanasyevdb5f3b62013-08-09 17:42:12 -070052{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080053 g_tracers.clear();
Alexander Afanasyevdb5f3b62013-08-09 17:42:12 -070054}
55
56void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080057L3AggregateTracer::InstallAll(const std::string& file, Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyev59314802012-11-26 14:56:04 -080058{
59 using namespace boost;
60 using namespace std;
Alexander Afanasyev37b84c52013-04-26 13:38:52 -070061
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080062 std::list<Ptr<L3AggregateTracer>> tracers;
Alexander Afanasyev5352af32013-07-15 09:51:28 -070063 boost::shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080064 if (file != "-") {
65 boost::shared_ptr<std::ofstream> os(new std::ofstream());
66 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyev59314802012-11-26 14:56:04 -080067
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080068 if (!os->is_open()) {
69 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
70 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -070071 }
Alexander Afanasyev59314802012-11-26 14:56:04 -080072
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080073 outputStream = os;
74 }
75 else {
76 outputStream = boost::shared_ptr<std::ostream>(&std::cout, NullDeleter<std::ostream>);
77 }
Alexander Afanasyev59314802012-11-26 14:56:04 -080078
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080079 for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End(); node++) {
80 Ptr<L3AggregateTracer> trace = Install(*node, outputStream, averagingPeriod);
81 tracers.push_back(trace);
82 }
Alexander Afanasyev59314802012-11-26 14:56:04 -080083
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080084 if (tracers.size() > 0) {
85 // *m_l3RateTrace << "# "; // not necessary for R's read.table
86 tracers.front()->PrintHeader(*outputStream);
87 *outputStream << "\n";
88 }
89
90 g_tracers.push_back(boost::make_tuple(outputStream, tracers));
Alexander Afanasyev59314802012-11-26 14:56:04 -080091}
92
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -070093void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080094L3AggregateTracer::Install(const NodeContainer& nodes, const std::string& file,
95 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyeva68783a2013-06-27 13:39:04 -070096{
97 using namespace boost;
98 using namespace std;
Alexander Afanasyev59314802012-11-26 14:56:04 -080099
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800100 std::list<Ptr<L3AggregateTracer>> tracers;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700101 boost::shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800102 if (file != "-") {
103 boost::shared_ptr<std::ofstream> os(new std::ofstream());
104 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700105
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800106 if (!os->is_open()) {
107 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
108 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700109 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700110
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800111 outputStream = os;
112 }
113 else {
114 outputStream = boost::shared_ptr<std::ostream>(&std::cout, NullDeleter<std::ostream>);
115 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700116
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800117 for (NodeContainer::Iterator node = nodes.Begin(); node != nodes.End(); node++) {
118 Ptr<L3AggregateTracer> trace = Install(*node, outputStream, averagingPeriod);
119 tracers.push_back(trace);
120 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700121
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800122 if (tracers.size() > 0) {
123 // *m_l3RateTrace << "# "; // not necessary for R's read.table
124 tracers.front()->PrintHeader(*outputStream);
125 *outputStream << "\n";
126 }
127
128 g_tracers.push_back(boost::make_tuple(outputStream, tracers));
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700129}
130
Alexander Afanasyev3fe94dc2013-08-09 17:12:12 -0700131void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800132L3AggregateTracer::Install(Ptr<Node> node, const std::string& file,
133 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700134{
135 using namespace boost;
136 using namespace std;
137
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800138 std::list<Ptr<L3AggregateTracer>> tracers;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700139 boost::shared_ptr<std::ostream> outputStream;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800140 if (file != "-") {
141 boost::shared_ptr<std::ofstream> os(new std::ofstream());
142 os->open(file.c_str(), std::ios_base::out | std::ios_base::trunc);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700143
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800144 if (!os->is_open()) {
145 NS_LOG_ERROR("File " << file << " cannot be opened for writing. Tracing disabled");
146 return;
Alexander Afanasyev5352af32013-07-15 09:51:28 -0700147 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700148
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800149 outputStream = os;
150 }
151 else {
152 outputStream = boost::shared_ptr<std::ostream>(&std::cout, NullDeleter<std::ostream>);
153 }
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700154
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800155 Ptr<L3AggregateTracer> trace = Install(node, outputStream, averagingPeriod);
156 tracers.push_back(trace);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700157
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800158 if (tracers.size() > 0) {
159 // *m_l3RateTrace << "# "; // not necessary for R's read.table
160 tracers.front()->PrintHeader(*outputStream);
161 *outputStream << "\n";
162 }
163
164 g_tracers.push_back(boost::make_tuple(outputStream, tracers));
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700165}
166
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700167Ptr<L3AggregateTracer>
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800168L3AggregateTracer::Install(Ptr<Node> node, boost::shared_ptr<std::ostream> outputStream,
169 Time averagingPeriod /* = Seconds (0.5)*/)
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700170{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800171 NS_LOG_DEBUG("Node: " << node->GetId());
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700172
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800173 Ptr<L3AggregateTracer> trace = Create<L3AggregateTracer>(outputStream, node);
174 trace->SetAveragingPeriod(averagingPeriod);
Alexander Afanasyeva68783a2013-06-27 13:39:04 -0700175
176 return trace;
177}
Alexander Afanasyev59314802012-11-26 14:56:04 -0800178
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800179L3AggregateTracer::L3AggregateTracer(boost::shared_ptr<std::ostream> os, Ptr<Node> node)
180 : L3Tracer(node)
181 , m_os(os)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800182{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800183 Reset();
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800184}
185
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800186L3AggregateTracer::L3AggregateTracer(boost::shared_ptr<std::ostream> os, const std::string& node)
187 : L3Tracer(node)
188 , m_os(os)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800189{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800190 Reset();
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800191}
192
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800193L3AggregateTracer::~L3AggregateTracer(){};
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800194
195void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800196L3AggregateTracer::SetAveragingPeriod(const Time& period)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800197{
Alexander Afanasyev59314802012-11-26 14:56:04 -0800198 m_period = period;
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800199 m_printEvent.Cancel();
200 m_printEvent = Simulator::Schedule(m_period, &L3AggregateTracer::PeriodicPrinter, this);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800201}
202
Alexander Afanasyev59314802012-11-26 14:56:04 -0800203void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800204L3AggregateTracer::PeriodicPrinter()
Alexander Afanasyev59314802012-11-26 14:56:04 -0800205{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800206 Print(*m_os);
207 Reset();
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700208
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800209 m_printEvent = Simulator::Schedule(m_period, &L3AggregateTracer::PeriodicPrinter, this);
Alexander Afanasyev59314802012-11-26 14:56:04 -0800210}
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800211
212void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800213L3AggregateTracer::PrintHeader(std::ostream& os) const
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800214{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800215 os << "Time"
216 << "\t"
Alexander Afanasyev59314802012-11-26 14:56:04 -0800217
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800218 << "Node"
219 << "\t"
220 << "FaceId"
221 << "\t"
222 << "FaceDescr"
223 << "\t"
Alexander Afanasyev59314802012-11-26 14:56:04 -0800224
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800225 << "Type"
226 << "\t"
227 << "Packets"
228 << "\t"
Alexander Afanasyev59314802012-11-26 14:56:04 -0800229 << "Kilobytes";
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800230}
231
232void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800233L3AggregateTracer::Reset()
Alexander Afanasyev59314802012-11-26 14:56:04 -0800234{
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700235 for (std::map<shared_ptr<const Face>, boost::tuple<Stats, Stats>>::iterator stats = m_stats.begin();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800236 stats != m_stats.end(); stats++) {
237 stats->second.get<0>().Reset();
238 stats->second.get<1>().Reset();
239 }
Alexander Afanasyev59314802012-11-26 14:56:04 -0800240}
241
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800242#define STATS(INDEX) stats->second.get<INDEX>()
Alexander Afanasyev59314802012-11-26 14:56:04 -0800243
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800244#define PRINTER(printName, fieldName) \
245 os << time.ToDouble(Time::S) << "\t" << m_node << "\t"; \
246 if (stats->first) { \
247 os << stats->first->GetId() << "\t" << *stats->first << "\t"; \
248 } \
249 else { \
250 os << "-1\tall\t"; \
251 } \
252 os << printName << "\t" << STATS(0).fieldName << "\t" << STATS(1).fieldName / 1024.0 << "\n";
Alexander Afanasyev59314802012-11-26 14:56:04 -0800253
254void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800255L3AggregateTracer::Print(std::ostream& os) const
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800256{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800257 Time time = Simulator::Now();
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700258
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700259 for (std::map<shared_ptr<const Face>, boost::tuple<Stats, Stats>>::iterator stats = m_stats.begin();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800260 stats != m_stats.end(); stats++) {
261 if (!stats->first)
262 continue;
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800263
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800264 PRINTER("InInterests", m_inInterests);
265 PRINTER("OutInterests", m_outInterests);
266 PRINTER("DropInterests", m_dropInterests);
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700267
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800268 PRINTER("InNacks", m_inNacks);
269 PRINTER("OutNacks", m_outNacks);
270 PRINTER("DropNacks", m_dropNacks);
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800271
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800272 PRINTER("InData", m_inData);
273 PRINTER("OutData", m_outData);
274 PRINTER("DropData", m_dropData);
275 }
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700276
277 {
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700278 std::map<shared_ptr<const Face>, boost::tuple<Stats, Stats>>::iterator stats =
279 m_stats.find(shared_ptr<const Face>(0));
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800280 if (stats != m_stats.end()) {
281 PRINTER("SatisfiedInterests", m_satisfiedInterests);
282 PRINTER("TimedOutInterests", m_timedOutInterests);
283 }
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700284 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800285}
286
287void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700288L3AggregateTracer::OutInterests(shared_ptr<const Interest> interest, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800289{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800290 m_stats[face].get<0>().m_outInterests++;
291 if (interest->GetWire()) {
292 m_stats[face].get<1>().m_outInterests += interest->GetWire()->GetSize();
293 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800294}
295
296void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700297L3AggregateTracer::InInterests(shared_ptr<const Interest> interest, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800298{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800299 m_stats[face].get<0>().m_inInterests++;
300 if (interest->GetWire()) {
301 m_stats[face].get<1>().m_inInterests += interest->GetWire()->GetSize();
302 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800303}
304
305void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700306L3AggregateTracer::DropInterests(shared_ptr<const Interest> interest, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800307{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800308 m_stats[face].get<0>().m_dropInterests++;
309 if (interest->GetWire()) {
310 m_stats[face].get<1>().m_dropInterests += interest->GetWire()->GetSize();
311 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800312}
313
314void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700315L3AggregateTracer::OutNacks(shared_ptr<const Interest> nack, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800316{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800317 m_stats[face].get<0>().m_outNacks++;
318 if (nack->GetWire()) {
319 m_stats[face].get<1>().m_outNacks += nack->GetWire()->GetSize();
320 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800321}
322
323void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700324L3AggregateTracer::InNacks(shared_ptr<const Interest> nack, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800325{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800326 m_stats[face].get<0>().m_inNacks++;
327 if (nack->GetWire()) {
328 m_stats[face].get<1>().m_inNacks += nack->GetWire()->GetSize();
329 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800330}
331
332void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700333L3AggregateTracer::DropNacks(shared_ptr<const Interest> nack, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800334{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800335 m_stats[face].get<0>().m_dropNacks++;
336 if (nack->GetWire()) {
337 m_stats[face].get<1>().m_dropNacks += nack->GetWire()->GetSize();
338 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800339}
340
341void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700342L3AggregateTracer::OutData(shared_ptr<const Data> data, bool fromCache, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800343{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800344 m_stats[face].get<0>().m_outData++;
345 if (data->GetWire()) {
346 m_stats[face].get<1>().m_outData += data->GetWire()->GetSize();
347 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800348}
349
350void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700351L3AggregateTracer::InData(shared_ptr<const Data> data, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800352{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800353 m_stats[face].get<0>().m_inData++;
354 if (data->GetWire()) {
355 m_stats[face].get<1>().m_inData += data->GetWire()->GetSize();
356 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800357}
358
359void
Spyridon Mastorakise4f0d3c2014-10-29 13:20:03 -0700360L3AggregateTracer::DropData(shared_ptr<const Data> data, shared_ptr<const Face> face)
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800361{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800362 m_stats[face].get<0>().m_dropData++;
363 if (data->GetWire()) {
364 m_stats[face].get<1>().m_dropData += data->GetWire()->GetSize();
365 }
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800366}
367
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700368void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800369L3AggregateTracer::SatisfiedInterests(Ptr<const pit::Entry>)
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700370{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800371 m_stats[0].get<0>().m_satisfiedInterests++;
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700372 // no "size" stats
373}
374
375void
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800376L3AggregateTracer::TimedOutInterests(Ptr<const pit::Entry>)
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700377{
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -0800378 m_stats[0].get<0>().m_timedOutInterests++;
Alexander Afanasyev37b84c52013-04-26 13:38:52 -0700379 // no "size" stats
380}
381
Alexander Afanasyevc9d5c1a2012-11-21 18:00:26 -0800382} // namespace ndn
383} // namespace ns3