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

aggregate IP/TCP/UDP functionality to existing Nodes. More...

#include "internet-stack-helper.h"

+ Inheritance diagram for ns3::InternetStackHelper:
+ Collaboration diagram for ns3::InternetStackHelper:

Public Member Functions

 InternetStackHelper (const InternetStackHelper &o)
 Copy constructor. More...
 
 InternetStackHelper (void)
 Create a new InternetStackHelper which uses a mix of static routing and global routing by default. More...
 
virtual ~InternetStackHelper (void)
 Destroy the InternetStackHelper. More...
 
int64_t AssignStreams (NodeContainer c, int64_t stream)
 Assign a fixed random variable stream number to the random variables used by this model. More...
 
void Install (NodeContainer c) const
 For each node in the input container, aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and, ns3::Tcp classes. More...
 
void Install (Ptr< Node > node) const
 Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provided node. More...
 
void Install (std::string nodeName) const
 Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provided node. More...
 
void InstallAll (void) const
 Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation. More...
 
InternetStackHelperoperator= (const InternetStackHelper &o)
 Copy constructor. More...
 
void Reset (void)
 Return helper internal state to that of a newly constructed one. More...
 
void SetIpv4ArpJitter (bool enable)
 Enable/disable IPv4 ARP Jitter. More...
 
void SetIpv4StackInstall (bool enable)
 Enable/disable IPv4 stack install. More...
 
void SetIpv6NsRsJitter (bool enable)
 Enable/disable IPv6 NS and RS Jitter. More...
 
void SetIpv6StackInstall (bool enable)
 Enable/disable IPv6 stack install. More...
 
void SetRoutingHelper (const Ipv4RoutingHelper &routing)
 
void SetRoutingHelper (const Ipv6RoutingHelper &routing)
 Set IPv6 routing helper. More...
 
void SetTcp (std::string tid)
 set the Tcp stack which will not need any other parameter. More...
 
- Public Member Functions inherited from ns3::PcapHelperForIpv4
 PcapHelperForIpv4 ()
 Construct a PcapHelperForIpv4. More...
 
virtual ~PcapHelperForIpv4 ()
 Destroy a PcapHelperForIpv4. More...
 
void EnablePcapIpv4 (std::string prefix, Ipv4InterfaceContainer c)
 Enable pcap output on each Ipv4 and interface pair in the container. More...
 
void EnablePcapIpv4 (std::string prefix, NodeContainer n)
 Enable pcap output on all Ipv4 and interface pairs existing in the nodes provided in the container. More...
 
void EnablePcapIpv4 (std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename=false)
 Enable pcap output the indicated Ipv4 and interface pair. More...
 
void EnablePcapIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename=false)
 Enable pcap output the indicated Ipv4 and interface pair using a Ptr<Ipv4> previously named using the ns-3 object name service. More...
 
void EnablePcapIpv4 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
 Enable pcap output on the Ipv4 and interface pair specified by a global node-id (of a previously created node) and interface. More...
 
void EnablePcapIpv4All (std::string prefix)
 Enable pcap output on all Ipv4 and interface pairs existing in the set of all nodes created in the simulation. More...
 
- Public Member Functions inherited from ns3::PcapHelperForIpv6
 PcapHelperForIpv6 ()
 Construct a PcapHelperForIpv6. More...
 
virtual ~PcapHelperForIpv6 ()
 Destroy a PcapHelperForIpv6. More...
 
void EnablePcapIpv6 (std::string prefix, Ipv6InterfaceContainer c)
 Enable pcap output on each Ipv6 and interface pair in the container. More...
 
void EnablePcapIpv6 (std::string prefix, NodeContainer n)
 Enable pcap output on all Ipv6 and interface pairs existing in the nodes provided in the container. More...
 
void EnablePcapIpv6 (std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename=false)
 Enable pcap output the indicated Ipv6 and interface pair. More...
 
void EnablePcapIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename=false)
 Enable pcap output the indicated Ipv6 and interface pair using a Ptr<Ipv6> previously named using the ns-3 object name service. More...
 
void EnablePcapIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
 Enable pcap output on the Ipv6 and interface pair specified by a global node-id (of a previously created node) and interface. More...
 
void EnablePcapIpv6All (std::string prefix)
 Enable pcap output on all Ipv6 and interface pairs existing in the set of all nodes created in the simulation. More...
 
- Public Member Functions inherited from ns3::AsciiTraceHelperForIpv4
 AsciiTraceHelperForIpv4 ()
 Construct an AsciiTraceHelperForIpv4. More...
 
virtual ~AsciiTraceHelperForIpv4 ()
 Destroy an AsciiTraceHelperForIpv4. More...
 
void EnableAsciiIpv4 (Ptr< OutputStreamWrapper > stream, Ipv4InterfaceContainer c)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAsciiIpv4 (Ptr< OutputStreamWrapper > stream, NodeContainer n)
 Enable ascii trace output on all Ipv4 and interface pairs existing in the nodes provided in the container. More...
 
void EnableAsciiIpv4 (Ptr< OutputStreamWrapper > stream, Ptr< Ipv4 > ipv4, uint32_t interface)
 Enable ascii trace output on the indicated Ipv4 and interface pair. More...
 
void EnableAsciiIpv4 (Ptr< OutputStreamWrapper > stream, std::string ipv4Name, uint32_t interface)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAsciiIpv4 (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t interface, bool explicitFilename)
 Enable ascii trace output on the Ipv4 and interface pair specified by a global node-id (of a previously created node) and interface. More...
 
void EnableAsciiIpv4 (std::string prefix, Ipv4InterfaceContainer c)
 Enable ascii trace output on each Ipv4 and interface pair in the container. More...
 
void EnableAsciiIpv4 (std::string prefix, NodeContainer n)
 Enable ascii trace output on all Ipv4 and interface pairs existing in the nodes provided in the container. More...
 
void EnableAsciiIpv4 (std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename=false)
 Enable ascii trace output on the indicated Ipv4 and interface pair. More...
 
void EnableAsciiIpv4 (std::string prefix, std::string ipv4Name, uint32_t interface, bool explicitFilename=false)
 Enable ascii trace output the indicated Ipv4 and interface pair using an Ipv4 previously named using the ns-3 object name service. More...
 
void EnableAsciiIpv4 (std::string prefix, uint32_t nodeid, uint32_t deviceid, bool explicitFilename)
 Enable ascii trace output on the Ipv4 and interface pair specified by a global node-id (of a previously created node) and interface. More...
 
void EnableAsciiIpv4All (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...
 
void EnableAsciiIpv4All (std::string prefix)
 Enable ascii trace output on all Ipv4 and interface pairs existing in the set of all nodes created in the simulation. More...
 
- Public Member Functions inherited from ns3::AsciiTraceHelperForIpv6
 AsciiTraceHelperForIpv6 ()
 Construct an AsciiTraceHelperForIpv6. More...
 
virtual ~AsciiTraceHelperForIpv6 ()
 Destroy an AsciiTraceHelperForIpv6. More...
 
void EnableAsciiIpv6 (Ptr< OutputStreamWrapper > stream, Ipv6InterfaceContainer c)
 Enable ascii trace output on each device in the container which is of the appropriate type. More...
 
void EnableAsciiIpv6 (Ptr< OutputStreamWrapper > stream, NodeContainer n)
 Enable ascii trace output on all Ipv6 and interface pairs existing in the nodes provided in the container. More...
 
void EnableAsciiIpv6 (Ptr< OutputStreamWrapper > stream, Ptr< Ipv6 > ipv6, uint32_t interface)
 Enable ascii trace output on the indicated Ipv6 and interface pair. More...
 
void EnableAsciiIpv6 (Ptr< OutputStreamWrapper > stream, std::string ipv6Name, uint32_t interface)
 Enable ascii trace output the indicated net device using a device previously named using the ns-3 object name service. More...
 
void EnableAsciiIpv6 (Ptr< OutputStreamWrapper > stream, uint32_t nodeid, uint32_t interface)
 Enable ascii trace output on the Ipv6 and interface pair specified by a global node-id (of a previously created node) and interface. More...
 
void EnableAsciiIpv6 (std::string prefix, Ipv6InterfaceContainer c)
 Enable ascii trace output on each Ipv6 and interface pair in the container. More...
 
void EnableAsciiIpv6 (std::string prefix, NodeContainer n)
 Enable ascii trace output on all Ipv6 and interface pairs existing in the nodes provided in the container. More...
 
void EnableAsciiIpv6 (std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename=false)
 Enable ascii trace output on the indicated Ipv6 and interface pair. More...
 
void EnableAsciiIpv6 (std::string prefix, std::string ipv6Name, uint32_t interface, bool explicitFilename=false)
 Enable ascii trace output the indicated Ipv6 and interface pair using an Ipv6 previously named using the ns-3 object name service. More...
 
void EnableAsciiIpv6 (std::string prefix, uint32_t nodeid, uint32_t interface, bool explicitFilename)
 Enable ascii trace output on the Ipv6 and interface pair specified by a global node-id (of a previously created node) and interface. More...
 
void EnableAsciiIpv6All (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...
 
void EnableAsciiIpv6All (std::string prefix)
 Enable ascii trace output on all Ipv6 and interface pairs existing in the set of all nodes created in the simulation. More...
 

Private Member Functions

bool AsciiHooked (Ptr< Ipv4 > ipv4)
 checks if there is an hook to an ascii output stream More...
 
bool AsciiHooked (Ptr< Ipv6 > ipv6)
 checks if there is an hook to an ascii output stream More...
 
virtual void EnableAsciiIpv4Internal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)
 Enable ascii trace output on the indicated Ipv4 and interface pair. More...
 
virtual void EnableAsciiIpv6Internal (Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)
 Enable ascii trace output on the indicated Ipv6 and interface pair. More...
 
virtual void EnablePcapIpv4Internal (std::string prefix, Ptr< Ipv4 > ipv4, uint32_t interface, bool explicitFilename)
 Enable pcap output the indicated Ipv4 and interface pair. More...
 
virtual void EnablePcapIpv6Internal (std::string prefix, Ptr< Ipv6 > ipv6, uint32_t interface, bool explicitFilename)
 Enable pcap output the indicated Ipv6 and interface pair. More...
 
void Initialize (void)
 Initialize the helper to its default values. More...
 
bool PcapHooked (Ptr< Ipv4 > ipv4)
 checks if there is an hook to a Pcap wrapper More...
 
bool PcapHooked (Ptr< Ipv6 > ipv6)
 checks if there is an hook to a Pcap wrapper More...
 

Static Private Member Functions

static void CreateAndAggregateObjectFromTypeId (Ptr< Node > node, const std::string typeId)
 create an object from its TypeId and aggregates it to the node More...
 

Private Attributes

bool m_ipv4ArpJitterEnabled
 IPv4 ARP Jitter state (enabled/disabled) ? More...
 
bool m_ipv4Enabled
 IPv4 install state (enabled/disabled) ? More...
 
bool m_ipv6Enabled
 IPv6 install state (enabled/disabled) ? More...
 
bool m_ipv6NsRsJitterEnabled
 IPv6 IPv6 NS and RS Jitter state (enabled/disabled) ? More...
 
const Ipv4RoutingHelperm_routing
 IPv4 routing helper. More...
 
const Ipv6RoutingHelperm_routingv6
 IPv6 routing helper. More...
 
ObjectFactory m_tcpFactory
 TCP objects factory. More...
 

Detailed Description

aggregate IP/TCP/UDP functionality to existing Nodes.

This helper enables pcap and ascii tracing of events in the internet stack associated with a node. This is substantially similar to the tracing that happens in device helpers, but the important difference is that, well, there is no device. This means that the creation of output file names will change, and also the user-visible methods will not reference devices and therefore the number of trace enable methods is reduced.

Normally we avoid multiple inheritance in ns-3, however, the classes PcapUserHelperForIpv4 and AsciiTraceUserHelperForIpv4 are treated as "mixins". A mixin is a self-contained class that encapsulates a general attribute or a set of functionality that may be of interest to many other classes.

This class aggregates instances of these objects, by default, to each node:

Definition at line 86 of file internet-stack-helper.h.

Constructor & Destructor Documentation

◆ InternetStackHelper() [1/2]

ns3::InternetStackHelper::InternetStackHelper ( void  )

Create a new InternetStackHelper which uses a mix of static routing and global routing by default.

The static routing protocol (ns3::Ipv4StaticRouting) and the global routing protocol are stored in an ns3::Ipv4ListRouting protocol with priorities 0, and -10 by default. If you wish to use different priorites and different routing protocols, you need to use an adhoc ns3::Ipv4RoutingHelper, such as ns3::OlsrHelper

Definition at line 104 of file internet-stack-helper.cc.

References Initialize().

+ Here is the call graph for this function:

◆ ~InternetStackHelper()

ns3::InternetStackHelper::~InternetStackHelper ( void  )
virtual

Destroy the InternetStackHelper.

Definition at line 131 of file internet-stack-helper.cc.

References m_routing, and m_routingv6.

◆ InternetStackHelper() [2/2]

ns3::InternetStackHelper::InternetStackHelper ( const InternetStackHelper o)

Copy constructor.

Parameters
oObject to copy from.

Definition at line 137 of file internet-stack-helper.cc.

References ns3::Ipv4RoutingHelper::Copy(), ns3::Ipv6RoutingHelper::Copy(), m_ipv4ArpJitterEnabled, m_ipv4Enabled, m_ipv6Enabled, m_ipv6NsRsJitterEnabled, m_routing, m_routingv6, and m_tcpFactory.

+ Here is the call graph for this function:

Member Function Documentation

◆ AsciiHooked() [1/2]

bool ns3::InternetStackHelper::AsciiHooked ( Ptr< Ipv4 ipv4)
private

checks if there is an hook to an ascii output stream

Parameters
ipv4pointer to the IPv4 object
Returns
true if a hook is found

Definition at line 751 of file internet-stack-helper.cc.

References ns3::g_interfaceStreamMapIpv4.

Referenced by EnableAsciiIpv4Internal(), and EnableAsciiIpv6Internal().

+ Here is the caller graph for this function:

◆ AsciiHooked() [2/2]

bool ns3::InternetStackHelper::AsciiHooked ( Ptr< Ipv6 ipv6)
private

checks if there is an hook to an ascii output stream

Parameters
ipv6pointer to the IPv6 object
Returns
true if a hook is found

Definition at line 1089 of file internet-stack-helper.cc.

References ns3::g_interfaceStreamMapIpv6.

◆ AssignStreams()

int64_t ns3::InternetStackHelper::AssignStreams ( NodeContainer  c,
int64_t  stream 
)

Assign a fixed random variable stream number to the random variables used by this model.

Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.

Parameters
streamfirst stream index to use
cNodeContainer of the set of nodes for which the internet models should be modified to use a fixed stream
Returns
the number of stream indices assigned by this helper

Definition at line 210 of file internet-stack-helper.cc.

References ns3::Ipv6Extension::AssignStreams(), ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), ns3::Ipv6ExtensionFragment::EXT_NUMBER, ns3::Object::GetObject(), and NS_ASSERT.

Referenced by ChainRegressionTest::CreateDevices(), Bug772ChainTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), and FlameRegressionTest::CreateDevices().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateAndAggregateObjectFromTypeId()

void ns3::InternetStackHelper::CreateAndAggregateObjectFromTypeId ( Ptr< Node node,
const std::string  typeId 
)
staticprivate

create an object from its TypeId and aggregates it to the node

Parameters
nodethe node
typeIdthe object TypeId

Definition at line 276 of file internet-stack-helper.cc.

References ns3::Object::AggregateObject(), ns3::ObjectFactory::Create(), and ns3::ObjectFactory::SetTypeId().

Referenced by Install().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EnableAsciiIpv4Internal()

void ns3::InternetStackHelper::EnableAsciiIpv4Internal ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
Ptr< Ipv4 ipv4,
uint32_t  interface,
bool  explicitFilename 
)
privatevirtual

Enable ascii trace output on the indicated Ipv4 and interface pair.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixFilename prefix to use for ascii trace files.
ipv4Ptr to the Ipv4 interface on which you want to enable tracing.
interfaceInterface ID on the Ipv4 on which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::AsciiTraceHelperForIpv4.

Definition at line 766 of file internet-stack-helper.cc.

References AsciiHooked(), ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::AsciiTraceHelper::DefaultDropSinkWithContext(), ns3::Packet::EnablePrinting(), ns3::g_interfaceStreamMapIpv4, ns3::AsciiTraceHelper::GetFilenameFromInterfacePair(), ns3::Node::GetId(), ns3::AsciiTraceHelper::HookDefaultDropSinkWithoutContext(), ns3::Ipv4L3ProtocolDropSinkWithContext(), ns3::Ipv4L3ProtocolDropSinkWithoutContext(), ns3::Ipv4L3ProtocolRxSinkWithContext(), ns3::Ipv4L3ProtocolRxSinkWithoutContext(), ns3::Ipv4L3ProtocolTxSinkWithContext(), ns3::Ipv4L3ProtocolTxSinkWithoutContext(), m_ipv4Enabled, ns3::MakeBoundCallback(), NS_ASSERT_MSG, NS_LOG_INFO, and test-ns3::result.

+ Here is the call graph for this function:

◆ EnableAsciiIpv6Internal()

void ns3::InternetStackHelper::EnableAsciiIpv6Internal ( Ptr< OutputStreamWrapper stream,
std::string  prefix,
Ptr< Ipv6 ipv6,
uint32_t  interface,
bool  explicitFilename 
)
privatevirtual

Enable ascii trace output on the indicated Ipv6 and interface pair.

Parameters
streamAn OutputStreamWrapper representing an existing file to use when writing trace data.
prefixFilename prefix to use for ascii trace files.
ipv6Ptr to the Ipv6 interface on which you want to enable tracing.
interfaceInterface ID on the Ipv6 on which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::AsciiTraceHelperForIpv6.

Definition at line 1104 of file internet-stack-helper.cc.

References AsciiHooked(), ns3::Config::Connect(), ns3::AsciiTraceHelper::CreateFileStream(), ns3::Packet::EnablePrinting(), ns3::g_interfaceStreamMapIpv6, ns3::AsciiTraceHelper::GetFilenameFromInterfacePair(), ns3::Node::GetId(), ns3::Ipv6L3ProtocolDropSinkWithContext(), ns3::Ipv6L3ProtocolDropSinkWithoutContext(), ns3::Ipv6L3ProtocolRxSinkWithContext(), ns3::Ipv6L3ProtocolRxSinkWithoutContext(), ns3::Ipv6L3ProtocolTxSinkWithContext(), ns3::Ipv6L3ProtocolTxSinkWithoutContext(), m_ipv6Enabled, ns3::MakeBoundCallback(), NS_ASSERT_MSG, NS_LOG_INFO, and test-ns3::result.

+ Here is the call graph for this function:

◆ EnablePcapIpv4Internal()

void ns3::InternetStackHelper::EnablePcapIpv4Internal ( std::string  prefix,
Ptr< Ipv4 ipv4,
uint32_t  interface,
bool  explicitFilename 
)
privatevirtual

Enable pcap output the indicated Ipv4 and interface pair.

Parameters
prefixFilename prefix to use for pcap files.
ipv4Ptr to the Ipv4 interface on which you want to enable tracing.
interfaceInterface ID on the Ipv4 on which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::PcapHelperForIpv4.

Definition at line 409 of file internet-stack-helper.cc.

References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::DLT_RAW, create-module::file, ns3::g_interfaceFileMapIpv4, ns3::PcapHelper::GetFilenameFromInterfacePair(), ns3::Ipv4L3ProtocolRxTxSink(), m_ipv4Enabled, ns3::MakeCallback(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, PcapHooked(), and test-ns3::result.

+ Here is the call graph for this function:

◆ EnablePcapIpv6Internal()

void ns3::InternetStackHelper::EnablePcapIpv6Internal ( std::string  prefix,
Ptr< Ipv6 ipv6,
uint32_t  interface,
bool  explicitFilename 
)
privatevirtual

Enable pcap output the indicated Ipv6 and interface pair.

Parameters
prefixFilename prefix to use for pcap files.
ipv6Ptr to the Ipv6 interface on which you want to enable tracing.
interfaceInterface ID on the Ipv6 on which you want to enable tracing.
explicitFilenameTreat the prefix as an explicit filename if true

Implements ns3::PcapHelperForIpv6.

Definition at line 507 of file internet-stack-helper.cc.

References ns3::PcapHelper::CreateFile(), ns3::PcapHelper::DLT_RAW, create-module::file, ns3::g_interfaceFileMapIpv6, ns3::PcapHelper::GetFilenameFromInterfacePair(), ns3::Ipv6L3ProtocolRxTxSink(), m_ipv6Enabled, ns3::MakeCallback(), NS_ASSERT_MSG, NS_LOG_FUNCTION, NS_LOG_INFO, PcapHooked(), and test-ns3::result.

+ Here is the call graph for this function:

◆ Initialize()

void ns3::InternetStackHelper::Initialize ( void  )
private

Initialize the helper to its default values.

Definition at line 118 of file internet-stack-helper.cc.

References ns3::Ipv4ListRoutingHelper::Add(), SetRoutingHelper(), and SetTcp().

Referenced by InternetStackHelper(), and Reset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Install() [1/3]

void ns3::InternetStackHelper::Install ( NodeContainer  c) const

For each node in the input container, aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and, ns3::Tcp classes.

The program will assert if this method is called on a container with a node that already has an Ipv4 object aggregated to it.

Parameters
cNodeContainer that holds the set of nodes on which to install the new stacks.

Definition at line 261 of file internet-stack-helper.cc.

References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), and Install().

+ Here is the call graph for this function:

◆ Install() [2/3]

void ns3::InternetStackHelper::Install ( Ptr< Node node) const

Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provided node.

This method will assert if called on a node that already has an Ipv4 object aggregated to it.

Parameters
nodeThe node on which to install the stack.

Definition at line 285 of file internet-stack-helper.cc.

References ns3::Object::AggregateObject(), ns3::Ipv4RoutingHelper::Create(), ns3::Ipv6RoutingHelper::Create(), ns3::ObjectFactory::Create(), CreateAndAggregateObjectFromTypeId(), ns3::Object::GetObject(), m_ipv4ArpJitterEnabled, m_ipv4Enabled, m_ipv6Enabled, m_ipv6NsRsJitterEnabled, m_routing, m_routingv6, m_tcpFactory, NS_ASSERT, and NS_FATAL_ERROR.

+ Here is the call graph for this function:

◆ Install() [3/3]

void ns3::InternetStackHelper::Install ( std::string  nodeName) const

Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provided node.

This method will assert if called on a node that already has an Ipv4 object aggregated to it.

Parameters
nodeNameThe name of the node on which to install the stack.

Definition at line 359 of file internet-stack-helper.cc.

Referenced by ns3::NoBackhaulEpcHelper::NoBackhaulEpcHelper(), ns3::NoBackhaulEpcHelper::AddEnb(), ChainRegressionTest::CreateDevices(), Bug772ChainTest::CreateDevices(), HwmpProactiveRegressionTest::CreateDevices(), HwmpReactiveRegressionTest::CreateDevices(), HwmpSimplestRegressionTest::CreateDevices(), HwmpDoRfRegressionTest::CreateDevices(), FlameRegressionTest::CreateDevices(), ns3::olsr::Bug780Test::CreateNodes(), ns3::olsr::HelloRegressionTest::CreateNodes(), ns3::olsr::TcRegressionTest::CreateNodes(), ThreeGppHttpObjectTestCase::CreateSimpleInternetNode(), ns3::aodv::LoopbackTestCase::DoRun(), TcpEndPointBug2211Test::DoRun(), TcpSynConnectionFailedTest::DoRun(), LteCellSelectionTestCase::DoRun(), LtePrimaryCellChangeTestCase::DoRun(), LteRadioLinkFailureTestCase::DoRun(), LteSecondaryCellHandoverTestCase::DoRun(), LteSecondaryCellSelectionTestCase::DoRun(), LteUeMeasurementsHandoverTestCase::DoRun(), LteHandoverTargetTestCase::DoRun(), BulkSendBasicTestCase::DoRun(), BulkSendSeqTsSizeTestCase::DoRun(), UdpClientServerTestCase::DoRun(), UdpTraceClientServerTestCase::DoRun(), UdpEchoClientSetFillTestCase::DoRun(), DhcpTestCase::DoRun(), RadvdTestCase::DoRun(), IcmpEchoReplyTestCase::DoRun(), IcmpTimeExceedTestCase::DoRun(), IcmpV6EchoReplyTestCase::DoRun(), IcmpV6TimeExceedTestCase::DoRun(), Ipv4DeduplicationTest::DoRun(), Ipv4DeduplicationPerformanceTest::DoRun(), Ipv4ForwardingTest::DoRun(), Ipv4FragmentationTest::DoRun(), Ipv4DynamicGlobalRoutingTestCase::DoRun(), Ipv4GlobalRoutingSlash32TestCase::DoRun(), Ipv4HeaderTest::DoRun(), Ipv4PacketInfoTagTest::DoRun(), Ipv4RawSocketImplTest::DoRun(), Ipv4RipTest::DoRun(), Ipv4RipCountToInfinityTest::DoRun(), Ipv4RipSplitHorizonStrategyTest::DoRun(), Ipv4StaticRoutingSlash32TestCase::DoRun(), Ipv6DadTest::DoRun(), IpAddressHelperTestCasev6::DoRun(), Ipv6ForwardingTest::DoRun(), Ipv6FragmentationTest::DoRun(), Ipv6PacketInfoTagTest::DoRun(), Ipv6RawSocketImplTest::DoRun(), Ipv6RipngTest::DoRun(), Ipv6RipngCountToInfinityTest::DoRun(), Ipv6RipngSplitHorizonStrategyTest::DoRun(), ns3::TcpGeneralTest::DoRun(), UdpSocketLoopbackTest::DoRun(), Udp6SocketLoopbackTest::DoRun(), UdpSocketImplTest::DoRun(), Udp6SocketImplTest::DoRun(), EpcS1uDlTestCase::DoRun(), EpcS1uUlTestCase::DoRun(), LenaCqaFfMacSchedulerTestCase1::DoRun(), LenaCqaFfMacSchedulerTestCase2::DoRun(), ns3::LenaDeactivateBearerTestCase::DoRun(), LenaFdTbfqFfMacSchedulerTestCase1::DoRun(), LenaFdTbfqFfMacSchedulerTestCase2::DoRun(), LteDistributedFfrAreaTestCase::DoRun(), LteIpv6RoutingTestCase::DoRun(), LenaPssFfMacSchedulerTestCase1::DoRun(), LenaPssFfMacSchedulerTestCase2::DoRun(), LenaTdTbfqFfMacSchedulerTestCase1::DoRun(), LenaTdTbfqFfMacSchedulerTestCase2::DoRun(), LteEpcE2eDataTestCase::DoRun(), LteHandoverDelayTestCase::DoRun(), LteX2HandoverMeasuresTestCase::DoRun(), LteX2HandoverTestCase::DoRun(), SixlowpanFragmentationTest::DoRun(), SixlowpanHc1ImplTest::DoRun(), SixlowpanIphcStatefulImplTest::DoRun(), SixlowpanIphcImplTest::DoRun(), CsmaBridgeTestCase::DoRun(), CsmaBroadcastTestCase::DoRun(), CsmaMulticastTestCase::DoRun(), CsmaOneSubnetTestCase::DoRun(), CsmaPingTestCase::DoRun(), CsmaRawIpSocketTestCase::DoRun(), CsmaStarTestCase::DoRun(), LinkTest::DoSetup(), LanTest::DoSetup(), TwoLinkTest::DoSetup(), TwoLanTest::DoSetup(), BridgeTest::DoSetup(), TwoBridgeTest::DoSetup(), experiment(), LteAggregationThroughputScaleTestCase::GetThroughput(), Install(), InstallAll(), MeshTest::InstallInternetStack(), Experiment::Run(), RoutingExperiment::Run(), UanExperiment::SetupCommunications(), and RoutingHelper::SetupRoutingProtocol().

◆ InstallAll()

void ns3::InternetStackHelper::InstallAll ( void  ) const

Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation.

Definition at line 270 of file internet-stack-helper.cc.

References ns3::NodeContainer::GetGlobal(), and Install().

Referenced by Ns3TcpLossTestCase::DoRun(), Ns3TcpNoDelayTestCase::DoRun(), Ns3TcpSocketTestCaseP2P::DoRun(), Ns3TcpSocketTestCaseCsma::DoRun(), Ns3TcpStateTestCase::DoRun(), and experiment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

InternetStackHelper & ns3::InternetStackHelper::operator= ( const InternetStackHelper o)

Copy constructor.

Parameters
oObject to copy from.
Returns
A copy of the InternetStackHelper.

Definition at line 149 of file internet-stack-helper.cc.

References ns3::Ipv4RoutingHelper::Copy(), ns3::Ipv6RoutingHelper::Copy(), m_routing, and m_routingv6.

+ Here is the call graph for this function:

◆ PcapHooked() [1/2]

bool ns3::InternetStackHelper::PcapHooked ( Ptr< Ipv4 ipv4)
private

checks if there is an hook to a Pcap wrapper

Parameters
ipv4pointer to the IPv4 object
Returns
true if a hook is found

Definition at line 394 of file internet-stack-helper.cc.

References ns3::g_interfaceFileMapIpv4.

Referenced by EnablePcapIpv4Internal(), and EnablePcapIpv6Internal().

+ Here is the caller graph for this function:

◆ PcapHooked() [2/2]

bool ns3::InternetStackHelper::PcapHooked ( Ptr< Ipv6 ipv6)
private

checks if there is an hook to a Pcap wrapper

Parameters
ipv6pointer to the IPv6 object
Returns
true if a hook is found

Definition at line 492 of file internet-stack-helper.cc.

References ns3::g_interfaceFileMapIpv6.

◆ Reset()

void ns3::InternetStackHelper::Reset ( void  )

Return helper internal state to that of a newly constructed one.

Definition at line 161 of file internet-stack-helper.cc.

References Initialize(), m_ipv4ArpJitterEnabled, m_ipv4Enabled, m_ipv6Enabled, m_ipv6NsRsJitterEnabled, m_routing, and m_routingv6.

+ Here is the call graph for this function:

◆ SetIpv4ArpJitter()

void ns3::InternetStackHelper::SetIpv4ArpJitter ( bool  enable)

Enable/disable IPv4 ARP Jitter.

Parameters
enableenable state

Definition at line 199 of file internet-stack-helper.cc.

References m_ipv4ArpJitterEnabled.

Referenced by Ipv4DeduplicationTest::DoRun(), and Ipv4DeduplicationPerformanceTest::DoRun().

+ Here is the caller graph for this function:

◆ SetIpv4StackInstall()

void ns3::InternetStackHelper::SetIpv4StackInstall ( bool  enable)

Enable/disable IPv4 stack install.

Parameters
enableenable state

Definition at line 189 of file internet-stack-helper.cc.

References m_ipv4Enabled.

Referenced by IpAddressHelperTestCasev6::DoRun(), Ipv6FragmentationTest::DoRun(), Ipv6PacketInfoTagTest::DoRun(), SixlowpanFragmentationTest::DoRun(), SixlowpanHc1ImplTest::DoRun(), and SixlowpanIphcImplTest::DoRun().

+ Here is the caller graph for this function:

◆ SetIpv6NsRsJitter()

void ns3::InternetStackHelper::SetIpv6NsRsJitter ( bool  enable)

Enable/disable IPv6 NS and RS Jitter.

Parameters
enableenable state

Definition at line 204 of file internet-stack-helper.cc.

References m_ipv6NsRsJitterEnabled.

◆ SetIpv6StackInstall()

void ns3::InternetStackHelper::SetIpv6StackInstall ( bool  enable)

Enable/disable IPv6 stack install.

Parameters
enableenable state

Definition at line 194 of file internet-stack-helper.cc.

References m_ipv6Enabled.

Referenced by Ipv4DeduplicationTest::DoRun(), Ipv4DeduplicationPerformanceTest::DoRun(), Ipv4ForwardingTest::DoRun(), Ipv4HeaderTest::DoRun(), and Ipv4PacketInfoTagTest::DoRun().

+ Here is the caller graph for this function:

◆ SetRoutingHelper() [1/2]

◆ SetRoutingHelper() [2/2]

void ns3::InternetStackHelper::SetRoutingHelper ( const Ipv6RoutingHelper routing)

Set IPv6 routing helper.

Parameters
routingIPv6 routing helper

Definition at line 182 of file internet-stack-helper.cc.

References ns3::Ipv6RoutingHelper::Copy(), and m_routingv6.

+ Here is the call graph for this function:

◆ SetTcp()

void ns3::InternetStackHelper::SetTcp ( std::string  tid)

set the Tcp stack which will not need any other parameter.

This function sets up the tcp stack to the given TypeId. It should not be used for NSC stack setup because the nsc stack needs the Library attribute to be setup, please use instead the version that requires an attribute and a value. If you choose to use this function anyways to set nsc stack the default value for the linux library will be used: "liblinux2.6.26.so".

Parameters
tidthe type id, typically it is set to "ns3::TcpL4Protocol"

Definition at line 255 of file internet-stack-helper.cc.

References m_tcpFactory, and ns3::ObjectFactory::SetTypeId().

Referenced by Initialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ipv4ArpJitterEnabled

bool ns3::InternetStackHelper::m_ipv4ArpJitterEnabled
private

IPv4 ARP Jitter state (enabled/disabled) ?

Definition at line 352 of file internet-stack-helper.h.

Referenced by InternetStackHelper(), Install(), Reset(), and SetIpv4ArpJitter().

◆ m_ipv4Enabled

bool ns3::InternetStackHelper::m_ipv4Enabled
private

IPv4 install state (enabled/disabled) ?

Definition at line 342 of file internet-stack-helper.h.

Referenced by InternetStackHelper(), EnableAsciiIpv4Internal(), EnablePcapIpv4Internal(), Install(), Reset(), and SetIpv4StackInstall().

◆ m_ipv6Enabled

bool ns3::InternetStackHelper::m_ipv6Enabled
private

IPv6 install state (enabled/disabled) ?

Definition at line 347 of file internet-stack-helper.h.

Referenced by InternetStackHelper(), EnableAsciiIpv6Internal(), EnablePcapIpv6Internal(), Install(), Reset(), and SetIpv6StackInstall().

◆ m_ipv6NsRsJitterEnabled

bool ns3::InternetStackHelper::m_ipv6NsRsJitterEnabled
private

IPv6 IPv6 NS and RS Jitter state (enabled/disabled) ?

Definition at line 357 of file internet-stack-helper.h.

Referenced by InternetStackHelper(), Install(), Reset(), and SetIpv6NsRsJitter().

◆ m_routing

const Ipv4RoutingHelper* ns3::InternetStackHelper::m_routing
private

IPv4 routing helper.

Definition at line 297 of file internet-stack-helper.h.

Referenced by InternetStackHelper(), ~InternetStackHelper(), Install(), operator=(), Reset(), and SetRoutingHelper().

◆ m_routingv6

const Ipv6RoutingHelper* ns3::InternetStackHelper::m_routingv6
private

IPv6 routing helper.

Definition at line 302 of file internet-stack-helper.h.

Referenced by InternetStackHelper(), ~InternetStackHelper(), Install(), operator=(), Reset(), and SetRoutingHelper().

◆ m_tcpFactory

ObjectFactory ns3::InternetStackHelper::m_tcpFactory
private

TCP objects factory.

Definition at line 292 of file internet-stack-helper.h.

Referenced by InternetStackHelper(), Install(), and SetTcp().


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