Build a set of PointToPointNetDevice objects. More...
#include "point-to-point-helper.h"
Public Member Functions | |
PointToPointHelper () | |
Create a PointToPointHelper to make life easier when creating point to point networks. | |
~PointToPointHelper () override | |
void | DisableFlowControl () |
Disable flow control only if you know what you are doing. | |
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. | |
void | SetDeviceAttribute (std::string name, const AttributeValue &value) |
Set an attribute value to be propagated to each NetDevice created by the helper. | |
template<typename... Ts> | |
void | SetQueue (std::string type, Ts &&... args) |
Each point to point net device must have a queue to pass packets through. | |
Public Member Functions inherited from ns3::PcapHelperForDevice | |
PcapHelperForDevice () | |
Construct a PcapHelperForDevice. | |
virtual | ~PcapHelperForDevice () |
Destroy a PcapHelperForDevice. | |
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. | |
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. | |
void | EnablePcap (std::string prefix, Ptr< NetDevice > nd, bool promiscuous=false, bool explicitFilename=false) |
Enable pcap output the indicated net device. | |
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. | |
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. | |
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. | |
Public Member Functions inherited from ns3::AsciiTraceHelperForDevice | |
AsciiTraceHelperForDevice () | |
Construct an AsciiTraceHelperForDevice. | |
virtual | ~AsciiTraceHelperForDevice () |
Destroy an AsciiTraceHelperForDevice. | |
void | EnableAscii (Ptr< OutputStreamWrapper > stream, NetDeviceContainer d) |
Enable ascii trace output on each device in the container which is of the appropriate type. | |
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. | |
void | EnableAscii (Ptr< OutputStreamWrapper > stream, Ptr< NetDevice > nd) |
Enable ascii trace output on the indicated net device. | |
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. | |
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. | |
void | EnableAscii (std::string prefix, NetDeviceContainer d) |
Enable ascii trace output on each device in the container which is of the appropriate type. | |
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. | |
void | EnableAscii (std::string prefix, Ptr< NetDevice > nd, bool explicitFilename=false) |
Enable ascii trace output on the indicated net device. | |
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. | |
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. | |
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. | |
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. | |
Private Member Functions | |
void | EnableAsciiInternal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename) override |
Enable ascii trace output on the indicated net device. | |
void | EnablePcapInternal (std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename) override |
Enable pcap output the indicated net device. | |
Private Attributes | |
ObjectFactory | m_channelFactory |
Channel Factory. | |
ObjectFactory | m_deviceFactory |
Device Factory. | |
bool | m_enableFlowControl |
whether to enable flow control | |
ObjectFactory | m_queueFactory |
Queue Factory. | |
Build a set of PointToPointNetDevice objects.
Normally we eschew multiple inheritance, however, the classes PcapUserHelperForDevice and AsciiTraceUserHelperForDevice are "mixins".
Definition at line 32 of file point-to-point-helper.h.
ns3::PointToPointHelper::PointToPointHelper | ( | ) |
Create a PointToPointHelper to make life easier when creating point to point networks.
Definition at line 34 of file point-to-point-helper.cc.
References m_channelFactory, m_deviceFactory, m_enableFlowControl, m_queueFactory, and ns3::ObjectFactory::SetTypeId().
|
inlineoverride |
Definition at line 41 of file point-to-point-helper.h.
void ns3::PointToPointHelper::DisableFlowControl | ( | ) |
Disable flow control only if you know what you are doing.
By disabling flow control, this NetDevice will be sent packets even if there is no room for them (such packets will be likely dropped by this NetDevice). Also, any queue disc installed on this NetDevice will have no effect, as every packet enqueued to the traffic control layer queue disc will be immediately dequeued.
Definition at line 55 of file point-to-point-helper.cc.
References m_enableFlowControl.
|
overrideprivatevirtual |
Enable ascii trace output on the indicated net device.
NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.
stream | The output stream object to use when logging ascii traces. |
prefix | Filename prefix to use for ascii trace files. |
nd | Net device for which you want to enable tracing. |
explicitFilename | Treat the prefix as an explicit filename if true |
Implements ns3::AsciiTraceHelperForDevice.
Definition at line 95 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.
|
overrideprivatevirtual |
Enable pcap output the indicated net device.
NetDevice-specific implementation mechanism for hooking the trace and writing to the trace file.
prefix | Filename prefix to use for pcap files. |
nd | Net device for which you want to enable tracing. |
promiscuous | If true capture all possible packets available at the device. |
explicitFilename | Treat the prefix as an explicit filename if true |
Implements ns3::PcapHelperForDevice.
Definition at line 61 of file point-to-point-helper.cc.
References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::DLT_PPP, ns3::PcapHelper::GetFilenameFromDevice(), ns3::PcapHelper::HookDefaultSink(), and NS_LOG_INFO.
NetDeviceContainer ns3::PointToPointHelper::Install | ( | NodeContainer | c | ) |
c | a set of 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 220 of file point-to-point-helper.cc.
References ns3::NodeContainer::Get(), ns3::NodeContainer::GetN(), Install(), and NS_ASSERT.
Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), ns3::PointToPointDumbbellHelper::PointToPointDumbbellHelper(), ns3::PointToPointStarHelper::PointToPointStarHelper(), ns3::PointToPointEpcHelper::AddEnb(), ns3::NoBackhaulEpcHelper::AddX2Interface(), ns3::BriteTopologyHelper::ConstructTopology(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LteCellSelectionTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), Ns3TcpCubicTestCase::DoRun(), experiment(), Install(), Install(), Install(), and Install().
NetDeviceContainer ns3::PointToPointHelper::Install | ( | Ptr< Node > | a, |
Ptr< Node > | b ) |
a | first node |
b | second node |
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 227 of file point-to-point-helper.cc.
References ns3::Mac48Address::Allocate(), ns3::ObjectFactory::Create(), ns3::CreateObject(), ns3::MpiInterface::GetSystemId(), ns3::MpiInterface::IsEnabled(), m_channelFactory, m_deviceFactory, m_enableFlowControl, m_queueFactory, ns3::MakeCallback(), ns3::PointToPointNetDevice::Receive(), and ns3::ObjectFactory::SetTypeId().
NetDeviceContainer ns3::PointToPointHelper::Install | ( | Ptr< Node > | a, |
std::string | bName ) |
a | first node |
bName | name of second node |
Saves you from having to construct a temporary NodeContainer.
Definition at line 298 of file point-to-point-helper.cc.
References ns3::Names::Find(), and Install().
NetDeviceContainer ns3::PointToPointHelper::Install | ( | std::string | aName, |
Ptr< Node > | b ) |
aName | Name of first node |
b | second node |
Saves you from having to construct a temporary NodeContainer.
Definition at line 305 of file point-to-point-helper.cc.
References ns3::Names::Find(), and Install().
NetDeviceContainer ns3::PointToPointHelper::Install | ( | std::string | aNode, |
std::string | bNode ) |
aNode | Name of first node |
bNode | Name of second node |
Saves you from having to construct a temporary NodeContainer.
Definition at line 312 of file point-to-point-helper.cc.
References ns3::Names::Find(), and Install().
void ns3::PointToPointHelper::SetChannelAttribute | ( | std::string | name, |
const AttributeValue & | value ) |
Set an attribute value to be propagated to each Channel created by the helper.
name | the name of the attribute to set |
value | the value of the attribute to set |
Set these attribute on each ns3::PointToPointChannel created by PointToPointHelper::Install
Definition at line 49 of file point-to-point-helper.cc.
References m_channelFactory, and ns3::ObjectFactory::Set().
Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), ns3::PointToPointEpcHelper::AddEnb(), ns3::NoBackhaulEpcHelper::AddX2Interface(), ns3::BriteTopologyHelper::ConstructTopology(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LteCellSelectionTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), Ns3TcpCubicTestCase::DoRun(), and experiment().
void ns3::PointToPointHelper::SetDeviceAttribute | ( | std::string | name, |
const AttributeValue & | value ) |
Set an attribute value to be propagated to each NetDevice created by the helper.
name | the name of the attribute to set |
value | the value of the attribute to set |
Set these attributes on each ns3::PointToPointNetDevice created by PointToPointHelper::Install
Definition at line 43 of file point-to-point-helper.cc.
References m_deviceFactory, and ns3::ObjectFactory::Set().
Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), ns3::PointToPointEpcHelper::AddEnb(), ns3::NoBackhaulEpcHelper::AddX2Interface(), ns3::BriteTopologyHelper::ConstructTopology(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LteCellSelectionTestCase::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), Ns3TcpCubicTestCase::DoRun(), and experiment().
void ns3::PointToPointHelper::SetQueue | ( | std::string | type, |
Ts &&... | args ) |
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.
Ts | [deduced] Argument types |
type | the type of queue | |
[in] | args | Name and AttributeValue pairs to set. |
Set the type of queue to create and associated to each PointToPointNetDevice created through PointToPointHelper::Install.
Definition at line 190 of file point-to-point-helper.h.
References ns3::QueueBase::AppendItemTypeIfNotPresent(), m_queueFactory, ns3::ObjectFactory::Set(), and ns3::ObjectFactory::SetTypeId().
Referenced by Ns3TcpCubicTestCase::DoRun().
|
private |
Channel Factory.
Definition at line 179 of file point-to-point-helper.h.
Referenced by PointToPointHelper(), Install(), and SetChannelAttribute().
|
private |
Device Factory.
Definition at line 180 of file point-to-point-helper.h.
Referenced by PointToPointHelper(), Install(), and SetDeviceAttribute().
|
private |
whether to enable flow control
Definition at line 181 of file point-to-point-helper.h.
Referenced by PointToPointHelper(), DisableFlowControl(), and Install().
|
private |
Queue Factory.
Definition at line 178 of file point-to-point-helper.h.
Referenced by PointToPointHelper(), Install(), and SetQueue().