|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
67 #include "ns3/object.h"
68 #include "ns3/random-variable-stream.h"
393 std::list<uint32_t>
GetList (
void)
const;
399 void SetList (
const std::list<uint32_t> &packetlist);
440 std::list<uint32_t>
GetList (
void)
const;
446 void SetList (
const std::list<uint32_t> &packetlist);
a unique identifier for an interface.
virtual ~ReceiveListErrorModel()
void SetRandomVariable(Ptr< RandomVariableStream > ranVar)
virtual bool DoCorruptBit(Ptr< Packet > p)
Corrupt a packet (bit unit).
std::list< uint32_t > PacketList
Typedef: packet sequence number list.
uint8_t m_counter
internal state counter.
The simplest error model, corrupts even packets and does not corrupt odd ones.
void SetBurstRate(double rate)
double GetBurstRate(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
PacketList m_packetList
container of Uid of packets to corrupt
void SetUnit(enum ErrorUnit error_unit)
Provide a list of Packet uids to corrupt.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
std::list< uint32_t > GetList(void) const
virtual void DoReset(void)
Re-initialize any state.
virtual bool DoCorrupt(Ptr< Packet > p)
Corrupt a packet according to the specified model.
General error model that can be used to corrupt packets.
bool IsEnabled(void) const
uint32_t m_currentBurstSz
the current burst size
void Enable(void)
Enable the error model.
void Reset(void)
Reset any state associated with the error model.
virtual bool DoCorrupt(Ptr< Packet > p)
Corrupt a packet according to the specified model.
double GetRate(void) const
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoReset(void)
Re-initialize any state.
bool m_enable
True if the error model is enabled.
PacketList m_packetList
container of sequence number of packets to corrupt
virtual void DoReset(void)=0
Re-initialize any state.
uint32_t m_timesInvoked
number of times the error model has been invoked
Ptr< RandomVariableStream > m_burstStart
the error decision variable
virtual ~BinaryErrorModel()
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoReset(void)
Re-initialize any state.
Determine which bursts of packets are errored corresponding to an underlying distribution,...
void SetList(const std::list< uint32_t > &packetlist)
static TypeId GetTypeId(void)
Get the type ID.
static TypeId GetTypeId(void)
Get the type ID.
virtual bool DoCorrupt(Ptr< Packet > p)=0
Corrupt a packet according to the specified model.
void SetList(const std::list< uint32_t > &packetlist)
static TypeId GetTypeId(void)
Get the type ID.
A base class which provides memory management and object aggregation.
void Disable(void)
Disable the error model.
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
double m_burstRate
the burst error event
std::list< uint32_t >::const_iterator PacketListCI
Typedef: packet Uid list const iterator.
enum ErrorUnit m_unit
Error rate unit.
std::list< uint32_t >::const_iterator PacketListCI
Typedef: packet sequence number list const iterator.
virtual ~RateErrorModel()
virtual bool DoCorruptPkt(Ptr< Packet > p)
Corrupt a packet (packet unit).
RateErrorModel::ErrorUnit GetUnit(void) const
bool IsCorrupt(Ptr< Packet > pkt)
Note: Depending on the error model, this function may or may not alter the contents of the packet upo...
virtual bool DoCorrupt(Ptr< Packet > p)
Corrupt a packet according to the specified model.
void SetRandomBurstSize(Ptr< RandomVariableStream > burstSz)
static TypeId GetTypeId(void)
Get the type ID.
void SetRate(double rate)
virtual bool DoCorruptByte(Ptr< Packet > p)
Corrupt a packet (Byte unit).
Ptr< RandomVariableStream > m_ranvar
rng stream
Determine which packets are errored corresponding to an underlying distribution, rate,...
std::list< uint32_t > PacketList
Typedef: packet Uid list.
virtual ~BurstErrorModel()
virtual ~ListErrorModel()
uint32_t m_counter
keep track of the number of packets being errored until it reaches m_burstSize
virtual void DoReset(void)
Re-initialize any state.
Ptr< RandomVariableStream > m_burstSize
the number of packets being flagged as errored
virtual void DoReset(void)
Re-initialize any state.
virtual bool DoCorrupt(Ptr< Packet > p)
Corrupt a packet according to the specified model.
Provide a list of Packets to corrupt.
std::list< uint32_t > GetList(void) const
void SetRandomVariable(Ptr< RandomVariableStream >)
virtual bool DoCorrupt(Ptr< Packet > p)
Corrupt a packet according to the specified model.