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