NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ndn-consumer-cbr.h
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 University of California, Los Angeles
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: Ilya Moiseenko <iliamo@cs.ucla.edu>
19  * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
20  */
21 
22 #ifndef NDN_CONSUMER_CBR_H
23 #define NDN_CONSUMER_CBR_H
24 
25 #include "ndn-consumer.h"
26 
27 namespace ns3 {
28 namespace ndn {
29 
34 class ConsumerCbr: public Consumer
35 {
36 public:
37  static TypeId GetTypeId ();
38 
43  ConsumerCbr ();
44  virtual ~ConsumerCbr ();
45 
46  // From NdnApp
47  // virtual void
48  // OnInterest (const Ptr<const Interest> &interest);
49 
50  // virtual void
51  // OnNack (const Ptr<const Interest> &interest);
52 
53  // virtual void
54  // OnData (const Ptr<const Data> &contentObject,
55  // const Ptr<const Packet> &payload);
56 
57 protected:
61  virtual void
63 
68  void
69  SetRandomize (const std::string &value);
70 
75  std::string
76  GetRandomize () const;
77 
78 private:
79  // void
80  // UpdateMean ();
81 
82  // virtual void
83  // SetPayloadSize (uint32_t payload);
84 
85  // void
86  // SetDesiredRate (DataRate rate);
87 
88  // DataRate
89  // GetDesiredRate () const;
90 
91 protected:
92  double m_frequency; // Frequency of interest packets (in hertz)
93  bool m_firstTime;
94  RandomVariable *m_random;
95  std::string m_randomType;
96 };
97 
98 } // namespace ndn
99 } // namespace ns3
100 
101 #endif
NDN application for sending out Interest packets.
Definition: ndn-consumer.h:47
ConsumerCbr()
Default constructor Sets up randomizer function and packet sequence number.
void SetRandomize(const std::string &value)
Set type of frequency randomization.
std::string GetRandomize() const
Get type of frequency randomization.
virtual void ScheduleNextPacket()
Constructs the Interest packet and sends it using a callback to the underlying NDN protocol...
Ndn application for sending out Interest packets at a "constant" rate (Poisson process) ...