NDN application for sending out Interest packets. More...
#include <ndn-consumer.hpp>
Public Member Functions | |
Consumer () | |
Default constructor Sets up randomizer function and packet sequence number. More... | |
virtual | ~Consumer () |
virtual void | OnData (shared_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. More... | |
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. More... | |
virtual | ~App () |
uint32_t | GetId () const |
Get application ID (ID of applications face) More... | |
virtual void | OnInterest (shared_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. More... | |
virtual void | StopApplication () |
Called at time specified by Stop. More... | |
virtual void | ScheduleNextPacket ()=0 |
Constructs the Interest packet and sends it using a callback to the underlying NDN protocol. More... | |
void | CheckRetxTimeout () |
Checks if the packet need to be retransmitted becuase of retransmission timer expiration. More... | |
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. More... | |
Protected Attributes | |
UniformVariable | m_rand |
nonce generator More... | |
uint32_t | m_seq |
currently requested sequence number More... | |
uint32_t | m_seqMax |
maximum number of sequence number More... | |
EventId | m_sendEvent |
EventId of pending "send packet" event. More... | |
Time | m_retxTimer |
Currently estimated retransmission timer. More... | |
EventId | m_retxEvent |
Event to check whether or not retransmission should be performed. More... | |
Ptr< RttEstimator > | m_rtt |
RTT estimator. More... | |
Time | m_offTime |
Time interval between packets. More... | |
Name | m_interestName |
NDN Name of the Interest (use Name) More... | |
Time | m_interestLifeTime |
LifeTime for interest packet. More... | |
Protected Attributes inherited from ns3::ndn::App | |
bool | m_active |
Flag to indicate that application is active (set by StartApplication. More... | |
shared_ptr< Face > | m_face |
and StopApplication) More... | |
TracedCallback< shared_ptr < const Interest >, Ptr< App > , shared_ptr< Face > > | m_receivedInterests |
communicates More... | |
TracedCallback< shared_ptr < const Data >, Ptr< App > , shared_ptr< Face > > | m_receivedDatas |
App-level trace of received Data. More... | |
TracedCallback< shared_ptr < const Interest >, Ptr< App > , shared_ptr< Face > > | m_transmittedInterests |
App-level trace of transmitted Interests. More... | |
TracedCallback< shared_ptr < const Data >, Ptr< App > , shared_ptr< Face > > | m_transmittedDatas |
App-level trace of transmitted Data. More... | |
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 50 of file ndn-consumer.hpp.
ns3::ndn::Consumer::Consumer | ( | ) |
Default constructor Sets up randomizer function and packet sequence number.
Definition at line 78 of file ndn-consumer.cpp.
References m_rtt.
|
inlinevirtual |
Definition at line 60 of file ndn-consumer.hpp.
|
protected |
Checks if the packet need to be retransmitted becuase of retransmission timer expiration.
Definition at line 108 of file ndn-consumer.cpp.
References m_retxEvent, m_retxTimer, m_rtt, and OnTimeout().
Referenced by SetRetxTimer().
|
protected |
Returns the frequency of checking the retransmission timeouts.
Definition at line 102 of file ndn-consumer.cpp.
References m_retxTimer.
Referenced by GetTypeId().
|
static |
Definition at line 47 of file ndn-consumer.cpp.
References GetRetxTimer(), m_interestLifeTime, m_interestName, m_seq, ns3::ndn::MakeNameAccessor(), ns3::ndn::MakeNameChecker(), and SetRetxTimer().
|
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 209 of file ndn-consumer.cpp.
References ns3::ndn::FwHopCountTag::Get(), ns3::ndn::App::m_active, m_rtt, and ns3::ndn::App::OnData().
Referenced by ns3::ndn::ConsumerWindow::OnData().
|
virtual |
Timeout event.
sequenceNumber | time outed sequence number |
Reimplemented in ns3::ndn::ConsumerWindow.
Definition at line 255 of file ndn-consumer.cpp.
References m_rtt, and ScheduleNextPacket().
Referenced by CheckRetxTimeout(), and ns3::ndn::ConsumerWindow::OnTimeout().
|
protectedpure virtual |
Constructs the Interest packet and sends it using a callback to the underlying NDN protocol.
Implemented in ns3::ndn::ConsumerZipfMandelbrot, ns3::ndn::ConsumerWindow, ns3::ndn::ConsumerBatches, and ns3::ndn::ConsumerCbr.
Referenced by OnTimeout(), SendPacket(), and StartApplication().
void ns3::ndn::Consumer::SendPacket | ( | ) |
Actually send packet.
Definition at line 156 of file ndn-consumer.cpp.
References ns3::ndn::App::m_active, ns3::ndn::App::m_face, m_interestLifeTime, m_interestName, m_rand, m_seq, m_seqMax, ns3::ndn::App::m_transmittedInterests, ScheduleNextPacket(), and WillSendOutInterest().
Referenced by ns3::ndn::ConsumerCbr::ScheduleNextPacket(), ns3::ndn::ConsumerBatches::ScheduleNextPacket(), and ns3::ndn::ConsumerWindow::ScheduleNextPacket().
|
protected |
Modifies the frequency of checking the retransmission timeouts.
retxTimer | Timeout defining how frequent retransmission timeouts should be checked |
Definition at line 89 of file ndn-consumer.cpp.
References CheckRetxTimeout(), m_retxEvent, and m_retxTimer.
Referenced by GetTypeId().
|
protectedvirtual |
Called at time specified by Start.
Reimplemented from ns3::ndn::App.
Definition at line 133 of file ndn-consumer.cpp.
References ScheduleNextPacket(), and ns3::ndn::App::StartApplication().
|
protectedvirtual |
Called at time specified by Stop.
Reimplemented from ns3::ndn::App.
Definition at line 144 of file ndn-consumer.cpp.
References m_sendEvent, and ns3::ndn::App::StopApplication().
|
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 269 of file ndn-consumer.cpp.
References m_rtt.
Referenced by SendPacket(), and ns3::ndn::ConsumerWindow::WillSendOutInterest().
|
protected |
LifeTime for interest packet.
Definition at line 140 of file ndn-consumer.hpp.
Referenced by GetTypeId(), and SendPacket().
|
protected |
NDN Name of the Interest (use Name)
Definition at line 139 of file ndn-consumer.hpp.
Referenced by GetTypeId(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), and SendPacket().
|
protected |
Time interval between packets.
Definition at line 138 of file ndn-consumer.hpp.
|
protected |
nonce generator
Definition at line 128 of file ndn-consumer.hpp.
Referenced by ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), and SendPacket().
|
protected |
Event to check whether or not retransmission should be performed.
Definition at line 134 of file ndn-consumer.hpp.
Referenced by CheckRetxTimeout(), and SetRetxTimer().
|
protected |
Currently estimated retransmission timer.
Definition at line 133 of file ndn-consumer.hpp.
Referenced by CheckRetxTimeout(), GetRetxTimer(), and SetRetxTimer().
|
protected |
RTT estimator.
Definition at line 136 of file ndn-consumer.hpp.
Referenced by CheckRetxTimeout(), Consumer(), OnData(), OnTimeout(), ns3::ndn::ConsumerBatches::ScheduleNextPacket(), ns3::ndn::ConsumerWindow::ScheduleNextPacket(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), and WillSendOutInterest().
|
protected |
EventId of pending "send packet" event.
Definition at line 132 of file ndn-consumer.hpp.
Referenced by ns3::ndn::ConsumerCbr::ScheduleNextPacket(), ns3::ndn::ConsumerBatches::ScheduleNextPacket(), ns3::ndn::ConsumerWindow::ScheduleNextPacket(), ns3::ndn::ConsumerZipfMandelbrot::ScheduleNextPacket(), and StopApplication().
|
protected |
currently requested sequence number
Definition at line 130 of file ndn-consumer.hpp.
Referenced by GetTypeId(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), and SendPacket().
|
protected |
maximum number of sequence number
Definition at line 131 of file ndn-consumer.hpp.
Referenced by ns3::ndn::ConsumerCbr::ConsumerCbr(), ns3::ndn::ConsumerCbr::GetTypeId(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), and SendPacket().