NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-app-delay-tracer.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef CCNX_APP_DELAY_TRACER_H
21 #define CCNX_APP_DELAY_TRACER_H
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 
25 #include "ns3/ptr.h"
26 #include "ns3/simple-ref-count.h"
27 #include <ns3/nstime.h>
28 #include <ns3/event-id.h>
29 #include <ns3/node-container.h>
30 
31 #include <tuple>
32 #include <list>
33 
34 namespace ns3 {
35 
36 class Node;
37 class Packet;
38 
39 namespace ndn {
40 
41 class App;
42 
47 class AppDelayTracer : public SimpleRefCount<AppDelayTracer> {
48 public:
55  static void
56  InstallAll(const std::string& file);
57 
65  static void
66  Install(const NodeContainer& nodes, const std::string& file);
67 
76  static void
77  Install(Ptr<Node> node, const std::string& file);
78 
91  static Ptr<AppDelayTracer>
92  Install(Ptr<Node> node, shared_ptr<std::ostream> outputStream);
93 
100  static void
101  Destroy();
102 
108  AppDelayTracer(shared_ptr<std::ostream> os, Ptr<Node> node);
109 
115  AppDelayTracer(shared_ptr<std::ostream> os, const std::string& node);
116 
120  ~AppDelayTracer();
121 
127  void
128  PrintHeader(std::ostream& os) const;
129 
130 private:
131  void
132  Connect();
133 
134  void
135  LastRetransmittedInterestDataDelay(Ptr<App> app, uint32_t seqno, Time delay, int32_t hopCount);
136 
137  void
138  FirstInterestDataDelay(Ptr<App> app, uint32_t seqno, Time delay, uint32_t rextCount,
139  int32_t hopCount);
140 
141 private:
142  std::string m_node;
143  Ptr<Node> m_nodePtr;
144 
145  shared_ptr<std::ostream> m_os;
146 };
147 
148 } // namespace ndn
149 } // namespace ns3
150 
151 #endif // CCNX_CS_TRACER_H
Copyright (c) 2011-2015 Regents of the University of California.
static void Install(const NodeContainer &nodes, const std::string &file)
Helper method to install tracers on the selected simulation nodes.
ndn App
Copyright (c) 2011-2015 Regents of the University of California.
Definition: ndn-app.cpp:28
Tracer to obtain application-level delays.
Copyright (c) 2011-2015 Regents of the University of California.
static void Destroy()
Explicit request to remove all statically created tracers.
AppDelayTracer(shared_ptr< std::ostream > os, Ptr< Node > node)
Trace constructor that attaches to all applications on the node using node&#39;s pointer.
static void InstallAll(const std::string &file)
Helper method to install tracers on all simulation nodes.
void PrintHeader(std::ostream &os) const
Print head of the trace (e.g., for post-processing)