A Discrete-Event Network Simulator
API
ns3::PointToPointHelper Class Reference

Build a set of PointToPointNetDevice objects. More...

#include "point-to-point-helper.h"

+ Inheritance diagram for ns3::PointToPointHelper:
+ Collaboration diagram for ns3::PointToPointHelper:

Public Member Functions

 PointToPointHelper ()
 Create a PointToPointHelper to make life easier when creating point to point networks. More...
 
virtual ~PointToPointHelper ()
 
NetDeviceContainer Install (NodeContainer c)
 
NetDeviceContainer Install (Ptr< Node > a, Ptr< Node > b)
 
NetDeviceContainer Install (Ptr< Node > a, std::string bName)
 
NetDeviceContainer Install (std::string aName, Ptr< Node > b)
 
NetDeviceContainer Install (std::string aNode, std::string bNode)
 
void SetChannelAttribute (std::string name, const AttributeValue &value)
 Set an attribute value to be propagated to each Channel created by the helper. More...
 
void SetDeviceAttribute (std::string name, const AttributeValue &value)
 Set an attribute value to be propagated to each NetDevice created by the helper. More...
 
void SetQueue (std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue())
 Each point to point net device must have a queue to pass packets through. More...
 
- Public Member Functions inherited from ns3::PcapHelperForDevice
 PcapHelperForDevice ()
 Construct a PcapHelperForDevice. More...
 
virtual ~PcapHelperForDevice ()
 Destroy a PcapHelperForDevice. More...
 
void EnablePcap (std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false)
 Enable pcap output the indicated net device. More...
 
void EnablePcap (std::string prefix, std::string ndName, bool promiscuous=false, bool explicitFilename=false)
 Enable pcap output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnablePcap (std::string prefix, NetDeviceContainer d, bool promiscuous=false)
 Enable pcap output on each device in the container which is of the appropriate type. More...
 
void EnablePcap (std::string prefix, NodeContainer n, bool promiscuous=false)
 Enable pcap output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnablePcap (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool promiscuous=false)
 Enable pcap output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnablePcapAll (std::string prefix, bool promiscuous=false)
 Enable pcap output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
- Public Member Functions inherited from ns3::AsciiTraceHelperForDevice
 AsciiTraceHelperForDevice ()
 Construct an AsciiTraceHelperForDevice. More...
 
virtual ~AsciiTraceHelperForDevice ()
 Destroy an AsciiTraceHelperForDevice. More...
 
void EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd)
 Enable ascii trace output on the indicated net device. More...
 
void EnableAscii (std::string prefix, std::string ndName, bool explicitFilename=false)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, std::string ndName)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAscii (std::string prefix, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAscii (std::string prefix, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, NodeContainer n)
 Enable ascii trace output on each device (which is of the appropriate type) in the nodes provided in the container. More...
 
void EnableAscii (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAscii (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t deviceid)
 Enable ascii trace output on the device specified by a global node-id (of a previously created node) and associated device-id. More...
 
void EnableAsciiAll (std::string prefix)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 
void EnableAsciiAll (Ptr< OutputStreamWrapper > stream)
 Enable ascii trace output on each device (which is of the appropriate type) in the set of all nodes created in the simulation. More...
 

Private Member Functions

virtual void EnableAsciiInternal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
 Enable ascii trace output on the indicated net device. More...
 
virtual void EnablePcapInternal (std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
 Enable pcap output the indicated net device. More...
 

Private Attributes

ObjectFactory m_channelFactory
 Channel Factory. More...
 
ObjectFactory m_deviceFactory
 Device Factory. More...
 
ObjectFactory m_queueFactory
 Queue Factory. More...
 
ObjectFactory m_remoteChannelFactory
 Remote Channel Factory. More...
 

Detailed Description

Build a set of PointToPointNetDevice objects.

Normally we eschew multiple inheritance, however, the classes PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are "mixins".

Definition at line 43 of file point-to-point-helper.h.

Constructor & Destructor Documentation

ns3::PointToPointHelper::PointToPointHelper ( )

Create a PointToPointHelper to make life easier when creating point to point networks.

Definition at line 41 of file point-to-point-helper.cc.

References m_channelFactory, m_deviceFactory, m_queueFactory, m_remoteChannelFactory, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

virtual ns3::PointToPointHelper::~PointToPointHelper ( )
inlinevirtual

Definition at line 52 of file point-to-point-helper.h.

References EnableAsciiInternal(), EnablePcapInternal(), Install(), SetChannelAttribute(), SetDeviceAttribute(), and SetQueue().

+ Here is the call graph for this function:

Member Function Documentation

void ns3::PointToPointHelper::EnableAsciiInternal ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
Ptr< NetDevice nd,
bool  explicitFilename 
)
privatevirtual

Enable ascii trace output on the indicated net device.

NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.

Parameters
streamThe output stream object to use when logging ascii traces.
prefixFilename prefix to use for ascii trace files.
ndNet device for which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::AsciiTraceHelperForDevice.

Definition at line 117 of file point-to-point-helper.cc.

References ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::AsciiTraceHelper::DefaultDequeueSinkWithContext(), ns3::AsciiTraceHelper::DefaultDropSinkWithContext(), ns3::AsciiTraceHelper::DefaultEnqueueSinkWithContext(), ns3::AsciiTraceHelper::DefaultReceiveSinkWithContext(), ns3::Packet::EnablePrinting(), ns3::AsciiTraceHelper::GetFilenameFromDevice(), ns3::PointToPointNetDevice::GetQueue(), ns3::AsciiTraceHelper::HookDefaultDequeueSinkWithoutContext(), ns3::AsciiTraceHelper::HookDefaultDropSinkWithoutContext(), ns3::AsciiTraceHelper::HookDefaultEnqueueSinkWithoutContext(), ns3::AsciiTraceHelper::HookDefaultReceiveSinkWithoutContext(), ns3::MakeBoundCallback(), and NS_LOG_INFO.

Referenced by ~PointToPointHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PointToPointHelper::EnablePcapInternal ( std::string  prefix,
Ptr< NetDevice nd,
bool  promiscuous,
bool  explicitFilename 
)
privatevirtual

Enable pcap output the indicated net device.

NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.

Parameters
prefixFilename prefix to use for pcap files.
ndNet device for which you want to enable tracing.
promiscuousIf true capture all possible packets available at the device.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::PcapHelperForDevice.

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

References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::DLT_PPP, ns3::PcapHelper::DLT_RAW, anonymous_namespace{print-introspected-doxygen.cc}::file, ns3::PcapHelper::GetFilenameFromDevice(), ns3::PcapHelper::HookDefaultSink(), and NS_LOG_INFO.

Referenced by ~PointToPointHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

NetDeviceContainer ns3::PointToPointHelper::Install ( NodeContainer  c)
Parameters
ca set of nodes
Returns
a NetDeviceContainer for nodes

This method creates a ns3::PointToPointChannel with the attributes configured by PointToPointHelper::SetChannelAttribute, then, for each node in the input container, we create a ns3::PointToPointNetDevice with the requested attributes, a queue for this ns3::NetDevice, and associate the resulting ns3::NetDevice with the ns3::Node and ns3::PointToPointChannel.

Definition at line 226 of file point-to-point-helper.cc.

References ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), and NS_ASSERT.

Referenced by ns3::PointToPointEpcHelper::AddEnb(), ns3::PointToPointEpcHelper::AddX2Interface(), BuildAppsTest(), ClientEmbeddedObjectReceived(), ns3::BriteTopologyHelper::ConstructTopology(), CreateOnOffFlow(), CwndTracer(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), EpcS1uDlTestCase::DoRun(), LteCellSelectionTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), Ns3TcpCwndTestCase1::DoRun(), EpcS1uUlTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), Ns3TcpCwndTestCase2::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), Install(), NotifyHandoverEndOkEnb(), PingRtt(), ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(), ns3::PointToPointStarHelper::PointToPointStarHelper(), PrintGnuplottableEnbListToFile(), Ratio(), RxDrop(), SecondBucketTokensTrace(), SinkRx(), SojournTimeTrace(), TraceCwnd(), TraceNextRx(), Tunnel::Tunnel(), and ~PointToPointHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

NetDeviceContainer ns3::PointToPointHelper::Install ( Ptr< Node a,
Ptr< Node b 
)
Parameters
afirst node
bsecond node
Returns
a NetDeviceContainer for nodes

Saves you from having to construct a temporary NodeContainer. Also, if MPI is enabled, for distributed simulations, appropriate remote point-to-point channels are created.

Definition at line 233 of file point-to-point-helper.cc.

References ns3::NetDeviceContainer::Add(), ns3::Node::AddDevice(), ns3::Mac48Address::Allocate(), third::channel, ns3::ObjectFactory::Create(), ns3::MpiInterface::GetSystemId(), ns3::Node::GetSystemId(), ns3::MpiInterface::IsEnabled(), m_channelFactory, m_deviceFactory, m_queueFactory, m_remoteChannelFactory, ns3::MakeCallback(), and ns3::PointToPointNetDevice::Receive().

+ Here is the call graph for this function:

NetDeviceContainer ns3::PointToPointHelper::Install ( Ptr< Node a,
std::string  bName 
)
Parameters
afirst node
bNamename of second node
Returns
a NetDeviceContainer for nodes

Saves you from having to construct a temporary NodeContainer.

Definition at line 287 of file point-to-point-helper.cc.

References Install().

+ Here is the call graph for this function:

NetDeviceContainer ns3::PointToPointHelper::Install ( std::string  aName,
Ptr< Node b 
)
Parameters
aNameName of first node
bsecond node
Returns
a NetDeviceContainer for nodes

Saves you from having to construct a temporary NodeContainer.

Definition at line 294 of file point-to-point-helper.cc.

References Install().

+ Here is the call graph for this function:

NetDeviceContainer ns3::PointToPointHelper::Install ( std::string  aNode,
std::string  bNode 
)
Parameters
aNodeName of first node
bNodeName of second node
Returns
a NetDeviceContainer for nodes

Saves you from having to construct a temporary NodeContainer.

Definition at line 301 of file point-to-point-helper.cc.

References Install().

+ Here is the call graph for this function:

void ns3::PointToPointHelper::SetChannelAttribute ( std::string  name,
const AttributeValue value 
)

Set an attribute value to be propagated to each Channel created by the helper.

Parameters
namethe name of the attribute to set
valuethe value of the attribute to set

Set these attribute on each ns3::PointToPointChannel created by PointToPointHelper::Install

Definition at line 72 of file point-to-point-helper.cc.

References m_channelFactory, m_remoteChannelFactory, and ns3::ObjectFactory::Set().

Referenced by ns3::PointToPointEpcHelper::AddEnb(), ns3::PointToPointEpcHelper::AddX2Interface(), BuildAppsTest(), ClientEmbeddedObjectReceived(), ns3::BriteTopologyHelper::ConstructTopology(), CreateOnOffFlow(), CwndTracer(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LteCellSelectionTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), Ns3TcpCwndTestCase1::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), Ns3TcpCwndTestCase2::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), modify(), NotifyHandoverEndOkEnb(), PingRtt(), PrintGnuplottableEnbListToFile(), Ratio(), RxDrop(), SecondBucketTokensTrace(), SinkRx(), SojournTimeTrace(), TraceCwnd(), TraceNextRx(), Tunnel::Tunnel(), and ~PointToPointHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PointToPointHelper::SetDeviceAttribute ( std::string  name,
const AttributeValue value 
)

Set an attribute value to be propagated to each NetDevice created by the helper.

Parameters
namethe name of the attribute to set
valuethe value of the attribute to set

Set these attributes on each ns3::PointToPointNetDevice created by PointToPointHelper::Install

Definition at line 66 of file point-to-point-helper.cc.

References m_deviceFactory, and ns3::ObjectFactory::Set().

Referenced by ns3::PointToPointEpcHelper::AddEnb(), ns3::PointToPointEpcHelper::AddX2Interface(), BuildAppsTest(), ClientEmbeddedObjectReceived(), ns3::BriteTopologyHelper::ConstructTopology(), CwndTracer(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), Ns3TcpLossTestCase::DoRun(), Ns3TcpStateTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), BriteTopologyFunctionTestCase::DoRun(), Ns3TcpInteroperabilityTestCase::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), EpcS1uDlTestCase::DoRun(), LteCellSelectionTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), Ns3TcpCwndTestCase1::DoRun(), EpcS1uUlTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), Ns3TcpCwndTestCase2::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), modify(), NotifyHandoverEndOkEnb(), PingRtt(), PrintGnuplottableEnbListToFile(), Ratio(), RxDrop(), SecondBucketTokensTrace(), SinkRx(), SojournTimeTrace(), TraceCwnd(), TraceNextRx(), Tunnel::Tunnel(), and ~PointToPointHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::PointToPointHelper::SetQueue ( std::string  type,
std::string  n1 = "",
const AttributeValue v1 = EmptyAttributeValue (),
std::string  n2 = "",
const AttributeValue v2 = EmptyAttributeValue (),
std::string  n3 = "",
const AttributeValue v3 = EmptyAttributeValue (),
std::string  n4 = "",
const AttributeValue v4 = EmptyAttributeValue () 
)

Each point to point net device must have a queue to pass packets through.

This method allows one to set the type of the queue that is automatically created when the device is created and attached to a node.

Parameters
typethe type of queue
n1the name of the attribute to set on the queue
v1the value of the attribute to set on the queue
n2the name of the attribute to set on the queue
v2the value of the attribute to set on the queue
n3the name of the attribute to set on the queue
v3the value of the attribute to set on the queue
n4the name of the attribute to set on the queue
v4the value of the attribute to set on the queue

Set the type of queue to create and associated to each PointToPointNetDevice created through PointToPointHelper::Install.

Definition at line 50 of file point-to-point-helper.cc.

References ns3::QueueBase::AppendItemTypeIfNotPresent(), m_queueFactory, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().

Referenced by BuildAppsTest(), SojournTimeTrace(), and ~PointToPointHelper().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

ObjectFactory ns3::PointToPointHelper::m_channelFactory
private

Channel Factory.

Definition at line 185 of file point-to-point-helper.h.

Referenced by Install(), PointToPointHelper(), and SetChannelAttribute().

ObjectFactory ns3::PointToPointHelper::m_deviceFactory
private

Device Factory.

Definition at line 187 of file point-to-point-helper.h.

Referenced by Install(), PointToPointHelper(), and SetDeviceAttribute().

ObjectFactory ns3::PointToPointHelper::m_queueFactory
private

Queue Factory.

Definition at line 184 of file point-to-point-helper.h.

Referenced by Install(), PointToPointHelper(), and SetQueue().

ObjectFactory ns3::PointToPointHelper::m_remoteChannelFactory
private

Remote Channel Factory.

Definition at line 186 of file point-to-point-helper.h.

Referenced by Install(), PointToPointHelper(), and SetChannelAttribute().


The documentation for this class was generated from the following files: