NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-l3-rate-tracer.cpp File Reference
#include "ndn-l3-rate-tracer.hpp"
#include "ns3/node.h"
#include "ns3/packet.h"
#include "ns3/config.h"
#include "ns3/callback.h"
#include "ns3/simulator.h"
#include "ns3/log.h"
#include "ns3/node-list.h"
#include "ns3/ndnSIM/model/ndn-l3-protocol.hpp"
#include "daemon/table/pit-entry.hpp"
#include <fstream>
#include <boost/lexical_cast.hpp>
Include dependency graph for ndn-l3-rate-tracer.cpp:

Go to the source code of this file.

Namespaces

 ns3
 Copyright (c) 2011-2015 Regents of the University of California.
 
 ns3::ndn
 

Macros

#define STATS(INDEX)   std::get<INDEX>(stats.second)
 
#define RATE(INDEX, fieldName)   STATS(INDEX).fieldName / m_period.ToDouble(Time::S)
 
#define PRINTER(printName, fieldName)
 

Variables

ndn L3RateTracer
 Copyright (c) 2011-2016 Regents of the University of California. More...
 
static std::list< std::tuple< shared_ptr< std::ostream >, std::list< Ptr< L3RateTracer > > > > ns3::ndn::g_tracers
 
const double ns3::ndn::alpha = 0.8
 

Macro Definition Documentation

◆ STATS

#define STATS (   INDEX)    std::get<INDEX>(stats.second)

Definition at line 240 of file ndn-l3-rate-tracer.cpp.

◆ RATE

#define RATE (   INDEX,
  fieldName 
)    STATS(INDEX).fieldName / m_period.ToDouble(Time::S)

Definition at line 241 of file ndn-l3-rate-tracer.cpp.

◆ PRINTER

#define PRINTER (   printName,
  fieldName 
)
Value:
STATS(2).fieldName = \
/*new value*/ alpha * RATE(0, fieldName) + /*old value*/ (1 - alpha) * STATS(2).fieldName; \
STATS(3).fieldName = /*new value*/ alpha * RATE(1, fieldName) / 1024.0 \
+ /*old value*/ (1 - alpha) * STATS(3).fieldName; \
\
os << time.ToDouble(Time::S) << "\t" << m_node << "\t"; \
if (stats.first != nfd::face::INVALID_FACEID) { \
os << stats.first << "\t"; \
NS_ASSERT(m_faceInfos.find(stats.first) != m_faceInfos.end()); \
os << m_faceInfos.find(stats.first)->second << "\t"; \
} \
else { \
os << "-1\tall\t"; \
} \
os << printName << "\t" << STATS(2).fieldName << "\t" << STATS(3).fieldName << "\t" \
<< STATS(0).fieldName << "\t" << STATS(1).fieldName / 1024.0 << "\n";
#define STATS(INDEX)
#define RATE(INDEX, fieldName)
const double alpha
const FaceId INVALID_FACEID
indicates an invalid FaceId
Definition: face.hpp:42

Definition at line 243 of file ndn-l3-rate-tracer.cpp.

Referenced by ns3::ndn::L3RateTracer::Print().

Variable Documentation

◆ L3RateTracer

ndn L3RateTracer

Copyright (c) 2011-2016 Regents of the University of California.

This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and contributors.

ndnSIM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ndnSIM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with ndnSIM, e.g., in COPYING.md file. If not, see http://www.gnu.org/licenses/.

Definition at line 35 of file ndn-l3-rate-tracer.cpp.