blob: 03558edc3237d8ca9cf80e8423e89cadb50a0a30 [file] [log] [blame]
Alexander Afanasyev029d38d2012-01-09 13:50:50 -08001/* -*- 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 CCNX_CONSUMER_CBR_H
23#define CCNX_CONSUMER_CBR_H
24
25#include "ccnx-consumer.h"
26
27namespace ns3
28{
29
30/**
31 * @ingroup ccnx
32 * \brief CCNx application for sending out Interest packets at a "constant" rate (Poisson process)
33 */
34class CcnxConsumerCbr: public CcnxConsumer
35{
36public:
37 static TypeId GetTypeId ();
38
39 /**
40 * \brief Default constructor
41 * Sets up randomizer function and packet sequence number
42 */
43 CcnxConsumerCbr ();
44
45 // From CcnxApp
46 // virtual void
47 // OnInterest (const Ptr<const CcnxInterestHeader> &interest);
48
49 // virtual void
50 // OnNack (const Ptr<const CcnxInterestHeader> &interest);
51
52 // virtual void
53 // OnContentObject (const Ptr<const CcnxContentObjectHeader> &contentObject,
54 // const Ptr<const Packet> &payload);
55
56protected:
57 /**
58 * \brief Constructs the Interest packet and sends it using a callback to the underlying CCNx protocol
59 */
60 virtual void
61 ScheduleNextPacket ();
62
63private:
Alexander Afanasyevb7ad2322012-01-17 22:54:49 -080064 // void
65 // UpdateMean ();
Alexander Afanasyev029d38d2012-01-09 13:50:50 -080066
Alexander Afanasyevb7ad2322012-01-17 22:54:49 -080067 // virtual void
68 // SetPayloadSize (uint32_t payload);
Alexander Afanasyev029d38d2012-01-09 13:50:50 -080069
Alexander Afanasyevb7ad2322012-01-17 22:54:49 -080070 // void
71 // SetDesiredRate (DataRate rate);
Alexander Afanasyev029d38d2012-01-09 13:50:50 -080072
Alexander Afanasyevb7ad2322012-01-17 22:54:49 -080073 // DataRate
74 // GetDesiredRate () const;
Alexander Afanasyev029d38d2012-01-09 13:50:50 -080075
76protected:
77 ExponentialVariable m_randExp; // packet inter-arrival time generation (Poisson process)
Alexander Afanasyevb7ad2322012-01-17 22:54:49 -080078 double m_frequency; // Frequency of interest packets (in hertz)
Alexander Afanasyev029d38d2012-01-09 13:50:50 -080079};
80
81} // namespace ns3
82
83#endif