Extending CcnxConsumerCbr class. Now it supports option to randomize sending time (uniform or exponential distribution).
diff --git a/apps/ccnx-consumer-cbr.cc b/apps/ccnx-consumer-cbr.cc
index 1727bcd..abf4bc2 100644
--- a/apps/ccnx-consumer-cbr.cc
+++ b/apps/ccnx-consumer-cbr.cc
@@ -52,6 +52,10 @@
                    StringValue ("1.0"),
                    MakeDoubleAccessor (&CcnxConsumerCbr::m_frequency),
                    MakeDoubleChecker<double> ())
+    .AddAttribute ("Randomize", "Type of send time randomization: none (default), uniform, exponential",
+                   StringValue ("none"),
+                   MakeStringAccessor (&CcnxConsumerCbr::SetRandomize, &CcnxConsumerCbr::GetRandomize),
+                   MakeStringChecker ())
     ;
 
   return tid;
@@ -59,24 +63,67 @@
     
 CcnxConsumerCbr::CcnxConsumerCbr ()
   : m_frequency (1.0)
+  , m_firstTime (true)
+  , m_random (0)
 {
   NS_LOG_FUNCTION_NOARGS ();
   m_seqMax = std::numeric_limits<uint32_t>::max ();
 }
 
+CcnxConsumerCbr::~CcnxConsumerCbr ()
+{
+  if (m_random)
+    delete m_random;
+}
+
 void
 CcnxConsumerCbr::ScheduleNextPacket ()
 {
   // double mean = 8.0 * m_payloadSize / m_desiredRate.GetBitRate ();
   // std::cout << "next: " << Simulator::Now().ToDouble(Time::S) + mean << "s\n";
 
-  if (!m_sendEvent.IsRunning ())
+  if (m_firstTime)
+    {
+      m_sendEvent = Simulator::Schedule (Seconds (0.0),
+                                         &CcnxConsumer::SendPacket, this);
+      m_firstTime = false;
+    }
+  else if (!m_sendEvent.IsRunning ())
     m_sendEvent = Simulator::Schedule (
-                                       // Seconds(m_randExp.GetValue ()),
-                                       Seconds(1.0 / m_frequency),
+                                       (m_random == 0) ?
+                                         Seconds(1.0 / m_frequency)
+                                       :
+                                         Seconds(m_random->GetValue ()),
                                        &CcnxConsumer::SendPacket, this);
 }
 
+void
+CcnxConsumerCbr::SetRandomize (const std::string &value)
+{
+  if (m_random)
+    delete m_random;
+
+  else if (value == "uniform")
+    {
+      m_random = new UniformVariable (0.0, 2 * 1.0 / m_frequency);
+    }
+  else if (value == "exponential")
+    {
+      m_random = new ExponentialVariable (1.0 / m_frequency, 50 * 1.0 / m_frequency);
+    }
+  else
+    m_random = 0;
+
+  m_randomType = value;  
+}
+
+std::string
+CcnxConsumerCbr::GetRandomize () const
+{
+  return m_randomType;
+}
+
+
 ///////////////////////////////////////////////////
 //          Process incoming packets             //
 ///////////////////////////////////////////////////
diff --git a/apps/ccnx-consumer-cbr.h b/apps/ccnx-consumer-cbr.h
index 03558ed..8f84a5b 100644
--- a/apps/ccnx-consumer-cbr.h
+++ b/apps/ccnx-consumer-cbr.h
@@ -41,6 +41,7 @@
    * Sets up randomizer function and packet sequence number
    */
   CcnxConsumerCbr ();
+  virtual ~CcnxConsumerCbr ();
 
   // From CcnxApp
   // virtual void
@@ -59,6 +60,12 @@
    */
   virtual void
   ScheduleNextPacket ();
+
+  void
+  SetRandomize (const std::string &value);
+
+  std::string
+  GetRandomize () const;
   
 private:
   // void
@@ -74,8 +81,10 @@
   // GetDesiredRate () const;
   
 protected:
-  ExponentialVariable m_randExp; // packet inter-arrival time generation (Poisson process)
   double              m_frequency; // Frequency of interest packets (in hertz)
+  bool                m_firstTime;
+  RandomVariable      *m_random;
+  std::string         m_randomType;
 };
 
 } // namespace ns3
diff --git a/apps/ccnx-consumer.cc b/apps/ccnx-consumer.cc
index eafa77d..66da4b8 100644
--- a/apps/ccnx-consumer.cc
+++ b/apps/ccnx-consumer.cc
@@ -243,6 +243,7 @@
 
   Ptr<Packet> packet = Create<Packet> ();
   packet->AddHeader (interestHeader);
+  NS_LOG_DEBUG ("Interest packet size: " << packet->GetSize ());
 
   m_protocolHandler (packet);
 
diff --git a/apps/ccnx-consumer.h b/apps/ccnx-consumer.h
index 0709a40..9a30fef 100644
--- a/apps/ccnx-consumer.h
+++ b/apps/ccnx-consumer.h
@@ -54,6 +54,7 @@
    * Sets up randomizer function and packet sequence number
    */
   CcnxConsumer ();
+  virtual ~CcnxConsumer () {};
 
   // From CcnxApp
   // virtual void