25 #ifndef ONOFF_APPLICATION_H
26 #define ONOFF_APPLICATION_H
28 #include "ns3/address.h"
29 #include "ns3/application.h"
30 #include "ns3/event-id.h"
32 #include "ns3/data-rate.h"
33 #include "ns3/traced-callback.h"
38 class RandomVariableStream;
void StopSending()
Start an Off period.
keep track of time values and allow control of global simulation resolution
virtual void StartApplication(void)
Application specific startup code.
EventId m_sendEvent
Event id of pending "send packet" event.
uint32_t m_pktSize
Size of packets.
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
void ScheduleStartEvent()
Schedule the next On period start.
void CancelEvents()
Cancel all pending events.
Generate traffic to a single destination according to an OnOff pattern.
void ScheduleStopEvent()
Schedule the next Off period start.
a polymophic address class
DataRate m_cbrRateFailSafe
Rate that data is generated (check copy)
Class for representing data rates.
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
EventId m_startStopEvent
Event id for next start or stop event.
void SendPacket()
Send a packet.
TypeId m_tid
Type of the socket used.
The base class for all ns3 applications.
Address m_peer
Peer address.
DataRate m_cbrRate
Rate that data is generated.
Ptr< RandomVariableStream > m_onTime
rng for On Time
Ptr< Socket > GetSocket(void) const
Return a pointer to associated socket.
Ptr< Socket > m_socket
Associated socket.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Ptr< RandomVariableStream > m_offTime
rng for Off Time
TracedCallback< Ptr< const Packet > > m_txTrace
Traced Callback: transmitted packets.
void ScheduleNextTx()
Schedule the next packet transmission.
void StartSending()
Start an On period.
void SetMaxBytes(uint32_t maxBytes)
Set the total number of bytes to send.
void ConnectionSucceeded(Ptr< Socket > socket)
Handle a Connection Succeed event.
virtual ~OnOffApplication()
Time m_lastStartTime
Time last packet sent.
static TypeId GetTypeId(void)
Get the type ID.
an identifier for simulation events.
uint32_t m_maxBytes
Limit total number of bytes sent.
void ConnectionFailed(Ptr< Socket > socket)
Handle a Connection Failed event.
uint32_t m_totBytes
Total bytes sent so far.
bool m_connected
True if connected.
virtual void StopApplication(void)
Application specific shutdown code.
a unique identifier for an interface.
uint32_t m_residualBits
Number of generated, but not sent, bits.