Simple Point To Point Channel. More...
#include <point-to-point-channel.h>
Classes | |
class | Link |
Public Member Functions | |
PointToPointChannel () | |
Create a PointToPointChannel. | |
void | Attach (Ptr< PointToPointNetDevice > device) |
Attach a given netdevice to this channel. | |
virtual Ptr< NetDevice > | GetDevice (uint32_t i) const |
virtual uint32_t | GetNDevices (void) const |
Get number of devices on this channel. | |
Ptr< PointToPointNetDevice > | GetPointToPointDevice (uint32_t i) const |
virtual bool | TransmitStart (Ptr< Packet > p, Ptr< PointToPointNetDevice > src, Time txTime) |
Transmit a packet over this channel. | |
![]() | |
Channel () | |
virtual | ~Channel () |
uint32_t | GetId (void) const |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Initialize (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Protected Member Functions | |
Time | GetDelay (void) const |
Ptr< PointToPointNetDevice > | GetDestination (uint32_t i) const |
Ptr< PointToPointNetDevice > | GetSource (uint32_t i) const |
bool | IsInitialized (void) const |
Private Types | |
enum | WireState { INITIALIZING, IDLE, TRANSMITTING, PROPAGATING } |
Private Attributes | |
Time | m_delay |
Link | m_link [N_DEVICES] |
int32_t | m_nDevices |
TracedCallback< Ptr< const Packet >, Ptr< NetDevice > , Ptr< NetDevice >, Time, Time > | m_txrxPointToPoint |
Static Private Attributes | |
static const int | N_DEVICES = 2 |
Simple Point To Point Channel.
This class represents a very simple point to point channel. Think full duplex RS-232 or RS-422 with null modem and no handshaking. There is no multi-drop capability on this channel – there can be a maximum of two point-to-point net devices connected.
There are two "wires" in the channel. The first device connected gets the [0] wire to transmit on. The second device gets the [1] wire. There is a state (IDLE, TRANSMITTING) associated with each wire.
ns3::PointToPointChannel is accessible through the following paths with Config::Set and Config::Connect:
Definition at line 47 of file point-to-point-channel.h.
|
private |
Definition at line 147 of file point-to-point-channel.h.
ns3::PointToPointChannel::PointToPointChannel | ( | ) |
Create a PointToPointChannel.
By default, you get a channel that has zero transmission delay.
Definition at line 52 of file point-to-point-channel.cc.
References NS_LOG_FUNCTION_NOARGS.
void ns3::PointToPointChannel::Attach | ( | Ptr< PointToPointNetDevice > | device | ) |
Attach a given netdevice to this channel.
device | pointer to the netdevice to attach to the channel |
Definition at line 62 of file point-to-point-channel.cc.
References IDLE, ns3::PointToPointChannel::Link::m_dst, m_link, m_nDevices, ns3::PointToPointChannel::Link::m_src, ns3::PointToPointChannel::Link::m_state, N_DEVICES, NS_ASSERT, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::PointToPointNetDevice::Attach(), and PointToPointTest::DoRun().
|
protected |
Definition at line 128 of file point-to-point-channel.cc.
References m_delay.
Referenced by ns3::PointToPointRemoteChannel::TransmitStart().
|
protected |
Definition at line 140 of file point-to-point-channel.cc.
References ns3::PointToPointChannel::Link::m_dst, and m_link.
Referenced by ns3::PointToPointRemoteChannel::TransmitStart().
i | index of NetDevice to retrieve |
This method must be implemented by subclasses.
Implements ns3::Channel.
Definition at line 121 of file point-to-point-channel.cc.
References GetPointToPointDevice(), and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::PointToPointNetDevice::GetRemote().
|
virtual |
Get number of devices on this channel.
Implements ns3::Channel.
Definition at line 106 of file point-to-point-channel.cc.
References m_nDevices, and NS_LOG_FUNCTION_NOARGS.
Referenced by ns3::PointToPointNetDevice::GetRemote().
Ptr< PointToPointNetDevice > ns3::PointToPointChannel::GetPointToPointDevice | ( | uint32_t | i | ) | const |
Definition at line 113 of file point-to-point-channel.cc.
References m_link, ns3::PointToPointChannel::Link::m_src, NS_ASSERT, and NS_LOG_FUNCTION_NOARGS.
Referenced by GetDevice().
|
protected |
Definition at line 134 of file point-to-point-channel.cc.
References m_link, and ns3::PointToPointChannel::Link::m_src.
Referenced by ns3::PointToPointRemoteChannel::TransmitStart().
|
static |
Reimplemented from ns3::Channel.
Reimplemented in ns3::PointToPointRemoteChannel.
Definition at line 33 of file point-to-point-channel.cc.
References m_delay, m_txrxPointToPoint, ns3::MakeTraceSourceAccessor(), ns3::Seconds(), and ns3::TypeId::SetParent().
|
protected |
Definition at line 146 of file point-to-point-channel.cc.
References INITIALIZING, m_link, and NS_ASSERT.
Referenced by ns3::PointToPointRemoteChannel::TransmitStart().
|
virtual |
Transmit a packet over this channel.
p | Packet to transmit |
src | Source PointToPointNetDevice |
txTime | Transmit time to apply |
Reimplemented in ns3::PointToPointRemoteChannel.
Definition at line 83 of file point-to-point-channel.cc.
References ns3::Packet::GetUid(), INITIALIZING, m_delay, ns3::PointToPointChannel::Link::m_dst, m_link, ns3::PointToPointChannel::Link::m_src, m_txrxPointToPoint, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::PointToPointNetDevice::Receive(), and ns3::Simulator::ScheduleWithContext().
Referenced by ns3::PointToPointNetDevice::TransmitStart().
|
private |
Definition at line 128 of file point-to-point-channel.h.
Referenced by GetDelay(), GetTypeId(), and TransmitStart().
Definition at line 164 of file point-to-point-channel.h.
Referenced by Attach(), GetDestination(), GetPointToPointDevice(), GetSource(), IsInitialized(), and TransmitStart().
|
private |
Definition at line 129 of file point-to-point-channel.h.
Referenced by Attach(), and GetNDevices().
|
private |
The trace source for the packet transmission animation events that the device can fire. Arguments to the callback are the packet, transmitting net device, receiving net device, transmission time and packet receipt time.
Definition at line 145 of file point-to-point-channel.h.
Referenced by GetTypeId(), and TransmitStart().
|
staticprivate |
Definition at line 126 of file point-to-point-channel.h.
Referenced by Attach().