NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndn-consumer-zipf-mandelbrot.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22 #ifndef NDN_CONSUMER_ZIPF_MANDELBROT_H_
23 #define NDN_CONSUMER_ZIPF_MANDELBROT_H_
24 
25 #include "ns3/ndnSIM/model/ndn-common.hpp"
26 
27 #include "ndn-consumer.hpp"
28 #include "ndn-consumer-cbr.hpp"
29 
30 #include "ns3/ptr.h"
31 #include "ns3/log.h"
32 #include "ns3/simulator.h"
33 #include "ns3/packet.h"
34 #include "ns3/callback.h"
35 #include "ns3/string.h"
36 #include "ns3/uinteger.h"
37 #include "ns3/double.h"
38 #include "ns3/random-variable.h"
39 
40 namespace ns3 {
41 namespace ndn {
42 
52 public:
53  static TypeId
54  GetTypeId();
55 
62  virtual ~ConsumerZipfMandelbrot();
63 
64  virtual void
65  SendPacket();
66  uint32_t
67  GetNextSeq();
68 
69 protected:
70  virtual void
72 
73 private:
74  void
75  SetNumberOfContents(uint32_t numOfContents);
76 
77  uint32_t
78  GetNumberOfContents() const;
79 
80  void
81  SetQ(double q);
82 
83  double
84  GetQ() const;
85 
86  void
87  SetS(double s);
88 
89  double
90  GetS() const;
91 
92 private:
93  uint32_t m_N; // number of the contents
94  double m_q; // q in (k+q)^s
95  double m_s; // s in (k+q)^s
96  std::vector<double> m_Pcum; // cumulative probability
97 
98  UniformVariable m_SeqRng; // RNG
99 };
100 
101 } /* namespace ndn */
102 } /* namespace ns3 */
103 #endif /* NDN_CONSUMER_ZIPF_MANDELBROT_H_ */
Ndn application for sending out Interest packets at a "constant" rate (Poisson process) ...
virtual void ScheduleNextPacket()
Constructs the Interest packet and sends it using a callback to the underlying NDN protocol...
ConsumerZipfMandelbrot()
Default constructor Sets up randomized Number Generator (RNG) Note: m_seq of its parent class Consume...
NDN app requesting contents following Zipf-Mandelbrot Distbituion.