NDN application for sending out Interest packets. More...
#include <ndn-consumer.h>
Public Member Functions | |
Consumer () | |
Default constructor Sets up randomizer function and packet sequence number. | |
virtual void | OnNack (Ptr< const Interest > interest) |
Method that will be called every time new NACK arrives. More... | |
virtual void | OnData (Ptr< const Data > contentObject) |
Method that will be called every time new Data arrives. More... | |
virtual void | OnTimeout (uint32_t sequenceNumber) |
Timeout event. More... | |
void | SendPacket () |
Actually send packet. | |
virtual void | WillSendOutInterest (uint32_t sequenceNumber) |
An event that is fired just before an Interest packet is actually send out (send is inevitable) More... | |
Public Member Functions inherited from ns3::ndn::App | |
App () | |
Default constructor. | |
uint32_t | GetId () const |
Get application ID (ID of applications face) | |
virtual void | OnInterest (Ptr< const Interest > interest) |
Method that will be called every time new Interest arrives. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
Static Public Member Functions inherited from ns3::ndn::App | |
static TypeId | GetTypeId () |
Protected Member Functions | |
virtual void | StartApplication () |
Called at time specified by Start. | |
virtual void | StopApplication () |
Called at time specified by Stop. | |
virtual void | ScheduleNextPacket ()=0 |
Constructs the Interest packet and sends it using a callback to the underlying NDN protocol. | |
void | CheckRetxTimeout () |
Checks if the packet need to be retransmitted becuase of retransmission timer expiration. | |
void | SetRetxTimer (Time retxTimer) |
Modifies the frequency of checking the retransmission timeouts. More... | |
Time | GetRetxTimer () const |
Returns the frequency of checking the retransmission timeouts. More... | |
Protected Member Functions inherited from ns3::ndn::App | |
virtual void | DoDispose () |
Do cleanup when application is destroyed. | |
Protected Attributes | |
UniformVariable | m_rand |
nonce generator | |
uint32_t | m_seq |
currently requested sequence number | |
uint32_t | m_seqMax |
maximum number of sequence number | |
EventId | m_sendEvent |
EventId of pending "send packet" event. | |
Time | m_retxTimer |
Currently estimated retransmission timer. | |
EventId | m_retxEvent |
Event to check whether or not retransmission should be performed. | |
Ptr< RttEstimator > | m_rtt |
RTT estimator. | |
Time | m_offTime |
Time interval between packets. | |
Name | m_interestName |
NDN Name of the Interest (use Name) | |
Time | m_interestLifeTime |
LifeTime for interest packet. | |
Protected Attributes inherited from ns3::ndn::App | |
bool | m_active |
Flag to indicate that application is active (set by StartApplication and StopApplication) | |
Ptr< Face > | m_face |
automatically created application face through which application communicates | |
TracedCallback< Ptr< const Interest >, Ptr< App >, Ptr < Face > > | m_receivedInterests |
App-level trace of received Interests. | |
TracedCallback< Ptr< const Interest >, Ptr< App >, Ptr < Face > > | m_receivedNacks |
App-level trace of received NACKs. | |
TracedCallback< Ptr< const Data >, Ptr< App >, Ptr< Face > > | m_receivedDatas |
App-level trace of received Data. | |
TracedCallback< Ptr< const Interest >, Ptr< App >, Ptr < Face > > | m_transmittedInterests |
App-level trace of transmitted Interests. | |
TracedCallback< Ptr< const Data >, Ptr< App >, Ptr< Face > > | m_transmittedDatas |
App-level trace of transmitted Data. | |
NDN application for sending out Interest packets.
ns3::ndn::Consumer is accessible through the following paths with Config::Set and Config::Connect:
Definition at line 47 of file ndn-consumer.h.
|
protected |
Returns the frequency of checking the retransmission timeouts.
Definition at line 112 of file ndn-consumer.cc.
References m_retxTimer.
|
virtual |
Method that will be called every time new Data arrives.
contentObject | Data header |
payload | payload (potentially virtual) of the Data packet (may include packet tags of original packet) |
Reimplemented from ns3::ndn::App.
Reimplemented in ns3::ndn::ConsumerWindow.
Definition at line 226 of file ndn-consumer.cc.
References ns3::ndn::FwHopCountTag::Get(), ns3::ndn::App::m_active, m_rtt, and ns3::ndn::App::OnData().
Referenced by ns3::ndn::ConsumerWindow::OnData().
|
virtual |
Method that will be called every time new NACK arrives.
interest | Interest header |
Reimplemented from ns3::ndn::App.
Reimplemented in ns3::ndn::ConsumerWindow.
Definition at line 269 of file ndn-consumer.cc.
References ns3::ndn::App::m_active, m_rtt, ns3::ndn::App::OnNack(), and ScheduleNextPacket().
Referenced by ns3::ndn::ConsumerWindow::OnNack().
|
virtual |
Timeout event.
sequenceNumber | time outed sequence number |
Reimplemented in ns3::ndn::ConsumerWindow.
Definition at line 296 of file ndn-consumer.cc.
References m_rtt, and ScheduleNextPacket().
Referenced by CheckRetxTimeout(), and ns3::ndn::ConsumerWindow::OnTimeout().
|
protected |
Modifies the frequency of checking the retransmission timeouts.
retxTimer | Timeout defining how frequent retransmission timeouts should be checked |
Definition at line 97 of file ndn-consumer.cc.
References CheckRetxTimeout(), m_retxEvent, and m_retxTimer.
|
virtual |
An event that is fired just before an Interest packet is actually send out (send is inevitable)
The reason for "before" even is that in certain cases (when it is possible to satisfy from the local cache), the send call will immediately return data, and if "after" even was used, this after would be called after all processing of incoming data, potentially producing unexpected results.
Reimplemented in ns3::ndn::ConsumerWindow.
Definition at line 308 of file ndn-consumer.cc.
References m_rtt.
Referenced by SendPacket(), and ns3::ndn::ConsumerWindow::WillSendOutInterest().