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