21 #include "ns3/simple-net-device.h"
22 #include "ns3/simulator.h"
23 #include "ns3/packet.h"
39 .SetGroupName (
"Network")
A Error channel, introducing deterministic delays on even/odd packets.
Time m_duplicateTime
Duplicate time in Duplicate mode.
virtual Ptr< NetDevice > GetDevice(std::size_t i) const
uint8_t m_duplicateState
Counter for even/odd packets in Duplicate mode.
bool m_jumping
Flag for Jumping mode.
std::vector< Ptr< SimpleNetDevice > > m_devices
devices connected by the channel
void SetJumpingTime(Time delay)
Set the delay for the odd packets (even ones are not delayed)
virtual void Send(Ptr< Packet > p, uint16_t protocol, Mac48Address to, Mac48Address from, Ptr< SimpleNetDevice > sender)
A packet is sent by a net device.
void SetJumpingMode(bool mode)
Set if the odd packets are delayed (even ones are not delayed ever)
virtual void Add(Ptr< SimpleNetDevice > device)
Attached a net device to the channel.
void SetDuplicateMode(bool mode)
Set if the odd packets are duplicated (even ones are not duplicated ever)
Time m_jumpingTime
Delay time in Jumping mode.
void SetDuplicateTime(Time delay)
Set the delay for the odd duplicate packets (even ones are not duplicated)
uint8_t m_jumpingState
Counter for even/odd packets in Jumping mode.
bool m_duplicate
Flag for Duplicate mode.
virtual std::size_t GetNDevices(void) const
static TypeId GetTypeId(void)
Get the type ID.
Ptr< Packet > Copy(void) const
performs a COW copy of the packet.
A simple channel, for simple things and testing.
void Receive(Ptr< Packet > packet, uint16_t protocol, Mac48Address to, Mac48Address from)
Receive a packet from a connected SimpleChannel.
static void ScheduleWithContext(uint32_t context, Time const &delay, FUNC f, Ts &&... args)
Schedule an event with the given context.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.