65 #include "ns3/object.h"
66 #include "ns3/random-variable-stream.h"
391 std::list<uint64_t>
GetList()
const;
397 void SetList(
const std::list<uint64_t>& packetlist);
437 std::list<uint32_t>
GetList()
const;
443 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.
void DoReset() override
Re-initialize any state.
~BinaryErrorModel() override
static TypeId GetTypeId()
Get the type ID.
bool DoCorrupt(Ptr< Packet > p) override
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)
bool DoCorrupt(Ptr< Packet > p) override
Corrupt a packet according to the specified model.
Ptr< RandomVariableStream > m_burstSize
the number of packets being flagged as errored
uint32_t m_currentBurstSz
the current burst size
double GetBurstRate() const
void DoReset() override
Re-initialize any state.
static TypeId GetTypeId()
Get the type ID.
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
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
~BurstErrorModel() override
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.
void Reset()
Reset any state associated with the error model.
void Enable()
Enable the error model.
virtual bool DoCorrupt(Ptr< Packet > p)=0
Corrupt a packet according to the specified model.
virtual void DoReset()=0
Re-initialize any state.
static TypeId GetTypeId()
Get the type ID.
void Disable()
Disable the error model.
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.
bool DoCorrupt(Ptr< Packet > p) override
Corrupt a packet according to the specified model.
~ListErrorModel() override
void DoReset() override
Re-initialize any state.
std::list< uint64_t > PacketList
Typedef: packet Uid list.
void SetList(const std::list< uint64_t > &packetlist)
std::list< uint64_t > GetList() const
static TypeId GetTypeId()
Get the type ID.
PacketList m_packetList
container of Uid of packets to corrupt
std::list< uint64_t >::const_iterator PacketListCI
Typedef: packet Uid list const iterator.
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).
ErrorUnit m_unit
Error rate unit.
void SetRate(double rate)
void DoReset() override
Re-initialize any state.
virtual bool DoCorruptBit(Ptr< Packet > p)
Corrupt a packet (bit unit).
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void SetUnit(ErrorUnit error_unit)
static TypeId GetTypeId()
Get the type ID.
~RateErrorModel() override
bool DoCorrupt(Ptr< Packet > p) override
Corrupt a packet according to the specified model.
Ptr< RandomVariableStream > m_ranvar
rng stream
virtual bool DoCorruptPkt(Ptr< Packet > p)
Corrupt a packet (packet unit).
void SetRandomVariable(Ptr< RandomVariableStream >)
RateErrorModel::ErrorUnit GetUnit() const
Provide a list of Packets to corrupt.
std::list< uint32_t > PacketList
Typedef: packet sequence number list.
void DoReset() override
Re-initialize any state.
bool DoCorrupt(Ptr< Packet > p) override
Corrupt a packet according to the specified model.
std::list< uint32_t >::const_iterator PacketListCI
Typedef: packet sequence number list const iterator.
static TypeId GetTypeId()
Get the type ID.
~ReceiveListErrorModel() override
uint32_t m_timesInvoked
number of times the error model has been invoked
std::list< uint32_t > GetList() const
PacketList m_packetList
container of sequence number of packets to corrupt
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.