ns3::PointToPointChannel Class Reference

Simple Point To Point Channel. More...

#include <point-to-point-channel.h>

Inheritance diagram for ns3::PointToPointChannel:
Inheritance graph
[legend]
Collaboration diagram for ns3::PointToPointChannel:
Collaboration graph
[legend]

List of all members.

Classes

class  Link

Public Member Functions

 PointToPointChannel ()
 Create a PointToPointChannel.
void Attach (Ptr< PointToPointNetDevice > device)
 Attach a given netdevice to this channel.
bool TransmitStart (Ptr< Packet > p, Ptr< PointToPointNetDevice > src, Time txTime)
 Attach a given netdevice to this channel.
virtual uint32_t GetNDevices (void) const
 Get number of devices on this channel.
Ptr< PointToPointNetDeviceGetPointToPointDevice (uint32_t i) const
virtual Ptr< NetDeviceGetDevice (uint32_t i) const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::PointToPointChannel.

Private Types

enum  WireState { INITIALIZING, IDLE, TRANSMITTING, PROPAGATING }

Private Attributes

Time m_delay
int32_t m_nDevices
Link m_link [N_DEVICES]

Static Private Attributes

static const int N_DEVICES = 2

Detailed Description

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.

Definition at line 45 of file point-to-point-channel.h.


Member Enumeration Documentation

Enumerator:
INITIALIZING 
IDLE 
TRANSMITTING 
PROPAGATING 

Definition at line 100 of file point-to-point-channel.h.


Constructor & Destructor Documentation

ns3::PointToPointChannel::PointToPointChannel (  ) 

Create a PointToPointChannel.

By default, you get a channel with the name "PointToPoint Channel" that has zero transmission delay.

Definition at line 48 of file point-to-point-channel.cc.

References NS_LOG_FUNCTION_NOARGS.


Member Function Documentation

void ns3::PointToPointChannel::Attach ( Ptr< PointToPointNetDevice device  ) 

Attach a given netdevice to this channel.

Parameters:
device pointer to the netdevice to attach to the channel

Definition at line 58 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, and NS_LOG_FUNCTION.

Ptr< NetDevice > ns3::PointToPointChannel::GetDevice ( uint32_t  i  )  const [virtual]
Parameters:
i index of NetDevice to retrieve
Returns:
one of the NetDevices connected to this channel.

This method must be implemented by subclasses.

Implements ns3::Channel.

Definition at line 113 of file point-to-point-channel.cc.

References GetPointToPointDevice(), and NS_LOG_FUNCTION_NOARGS.

uint32_t ns3::PointToPointChannel::GetNDevices ( void   )  const [virtual]

Get number of devices on this channel.

Returns:
number of devices on this channel

Implements ns3::Channel.

Definition at line 98 of file point-to-point-channel.cc.

References m_nDevices, and NS_LOG_FUNCTION_NOARGS.

Ptr< PointToPointNetDevice > ns3::PointToPointChannel::GetPointToPointDevice ( uint32_t  i  )  const
TypeId ns3::PointToPointChannel::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::PointToPointChannel.

Attributes defined for this type:

  • Delay: Transmission delay through the channel
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 0ns
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::Channel.

Definition at line 32 of file point-to-point-channel.cc.

References ns3::TypeId::AddAttribute(), m_delay, ns3::Seconds(), and ns3::TypeId::SetParent().

bool ns3::PointToPointChannel::TransmitStart ( Ptr< Packet p,
Ptr< PointToPointNetDevice src,
Time  txTime 
)

Attach a given netdevice to this channel.

Parameters:
p Packet to transmit
src Source PointToPointNetDevice
txTime Transmit time to apply

Definition at line 79 of file point-to-point-channel.cc.

References INITIALIZING, m_delay, m_link, ns3::PointToPointChannel::Link::m_src, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::PointToPointNetDevice::Receive(), and ns3::Simulator::Schedule().


Member Data Documentation

Definition at line 97 of file point-to-point-channel.h.

Referenced by GetTypeId(), and TransmitStart().

Definition at line 117 of file point-to-point-channel.h.

Referenced by Attach(), GetPointToPointDevice(), and TransmitStart().

Definition at line 98 of file point-to-point-channel.h.

Referenced by Attach(), and GetNDevices().

const int ns3::PointToPointChannel::N_DEVICES = 2 [static, private]

Definition at line 95 of file point-to-point-channel.h.

Referenced by Attach().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:10:43 2009 for NS-3 by  doxygen 1.6.3