20 #ifndef NDN_CONSUMER_H 
   21 #define NDN_CONSUMER_H 
   23 #include "ns3/ndnSIM/model/ndn-common.hpp" 
   27 #include "ns3/random-variable.h" 
   28 #include "ns3/nstime.h" 
   29 #include "ns3/data-rate.h" 
   31 #include "ns3/ndnSIM/model/ndn-common.hpp" 
   32 #include "ns3/ndnSIM/utils/ndn-rtt-estimator.hpp" 
   33 #include "ns3/ndnSIM/utils/ndn-fw-hop-count-tag.hpp" 
   38 #include <boost/multi_index_container.hpp> 
   39 #include <boost/multi_index/tag.hpp> 
   40 #include <boost/multi_index/ordered_index.hpp> 
   41 #include <boost/multi_index/member.hpp> 
   64   OnData(shared_ptr<const Data> contentObject);
 
  146   struct RetxSeqsContainer : 
public std::set<uint32_t> {
 
  149   RetxSeqsContainer m_retxSeqs; 
 
  155     SeqTimeout(uint32_t _seq, Time _time)
 
  177   struct SeqTimeoutsContainer
 
  178     : 
public boost::multi_index::
 
  179         multi_index_container<SeqTimeout,
 
  181                                 indexed_by<boost::multi_index::
 
  182                                              ordered_unique<boost::multi_index::tag<i_seq>,
 
  184                                                               member<SeqTimeout, uint32_t,
 
  187                                              ordered_non_unique<boost::multi_index::
 
  190                                                                   member<SeqTimeout, Time,
 
  191                                                                          &SeqTimeout::time>>>> {
 
  194   SeqTimeoutsContainer m_seqTimeouts; 
 
  196   SeqTimeoutsContainer m_seqLastDelay;
 
  197   SeqTimeoutsContainer m_seqFullDelay;
 
  198   std::map<uint32_t, uint32_t> m_seqRetxCounts;
 
  200   TracedCallback<Ptr<App> , uint32_t , Time , int32_t >
 
  201     m_lastRetransmittedInterestDataDelay;
 
  202   TracedCallback<Ptr<App> , uint32_t , Time ,
 
  203                  uint32_t , int32_t > m_firstInterestDataDelay;
 
Time m_interestLifeTime
LifeTime for interest packet. 
 
virtual void OnTimeout(uint32_t sequenceNumber)
Timeout event. 
 
uint32_t m_seqMax
maximum number of sequence number 
 
void SetRetxTimer(Time retxTimer)
Modifies the frequency of checking the retransmission timeouts. 
 
Time m_offTime
Time interval between packets. 
 
uint32_t m_seq
currently requested sequence number 
 
Time m_retxTimer
Currently estimated retransmission timer. 
 
Ptr< RttEstimator > m_rtt
RTT estimator. 
 
Name m_interestName
NDN Name of the Interest (use Name) 
 
void CheckRetxTimeout()
Checks if the packet need to be retransmitted becuase of retransmission timer expiration. 
 
NDN application for sending out Interest packets. 
 
virtual void OnData(shared_ptr< const Data > contentObject)
Method that will be called every time new Data arrives. 
 
void SendPacket()
Actually send packet. 
 
virtual void ScheduleNextPacket()=0
Constructs the Interest packet and sends it using a callback to the underlying NDN protocol...
 
Opaque type (shared_ptr) representing ID of a scheduled event. 
 
UniformVariable m_rand
nonce generator 
 
Base class that all NDN applications should be derived from. 
 
Consumer()
Default constructor Sets up randomizer function and packet sequence number. 
 
virtual void StopApplication()
Called at time specified by Stop. 
 
EventId m_sendEvent
EventId of pending "send packet" event. 
 
virtual void WillSendOutInterest(uint32_t sequenceNumber)
An event that is fired just before an Interest packet is actually send out (send is inevitable) ...
 
EventId m_retxEvent
Event to check whether or not retransmission should be performed. 
 
static TypeId GetTypeId()
 
Time GetRetxTimer() const 
Returns the frequency of checking the retransmission timeouts. 
 
virtual void StartApplication()
Called at time specified by Start.