NS-3
|
aggregate IP/TCP/UDP functionality to existing Nodes. More...
#include <internet-stack-helper.h>
Public Member Functions | |
InternetStackHelper (void) | |
virtual | ~InternetStackHelper (void) |
InternetStackHelper (const InternetStackHelper &) | |
InternetStackHelper & | operator= (const InternetStackHelper &o) |
void | Reset (void) |
void | SetRoutingHelper (const Ipv4RoutingHelper &routing) |
void | SetRoutingHelper (const Ipv6RoutingHelper &routing) |
Set IPv6 routing helper. | |
void | Install (std::string nodeName) const |
void | Install (Ptr< Node > node) const |
void | Install (NodeContainer c) const |
void | InstallAll (void) const |
void | SetTcp (std::string tid) |
set the Tcp stack which will not need any other parameter. | |
void | SetTcp (std::string tid, std::string attr, const AttributeValue &val) |
This function is used to setup the Network Simulation Cradle stack with library value. | |
void | SetIpv4StackInstall (bool enable) |
Enable/disable IPv4 stack install. | |
void | SetIpv6StackInstall (bool enable) |
Enable/disable IPv6 stack install. |
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:
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
virtual ns3::InternetStackHelper::~InternetStackHelper | ( | void | ) | [virtual] |
Destroy the InternetStackHelper
void ns3::InternetStackHelper::Install | ( | std::string | nodeName | ) | const |
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.
c | NodeContainer that holds the set of nodes on which to install the new stacks. |
void ns3::InternetStackHelper::InstallAll | ( | void | ) | const |
Aggregate IPv4, IPv6, UDP, and TCP stacks to all nodes in the simulation
void ns3::InternetStackHelper::Reset | ( | void | ) |
Return helper internal state to that of a newly constructed one
void ns3::InternetStackHelper::SetIpv4StackInstall | ( | bool | enable | ) |
Enable/disable IPv4 stack install.
enable | enable state |
void ns3::InternetStackHelper::SetIpv6StackInstall | ( | bool | enable | ) |
Enable/disable IPv6 stack install.
enable | enable state |
void ns3::InternetStackHelper::SetRoutingHelper | ( | const Ipv6RoutingHelper & | routing | ) |
Set IPv6 routing helper.
routing | IPv6 routing helper |
void ns3::InternetStackHelper::SetRoutingHelper | ( | const Ipv4RoutingHelper & | routing | ) |
routing | a new routing helper |
Set the routing helper to use during Install. The routing helper is really an object factory which is used to create an object of type ns3::Ipv4RoutingProtocol per node. This routing object is then associated to a single ns3::Ipv4 object through its ns3::Ipv4::SetRoutingProtocol.
void ns3::InternetStackHelper::SetTcp | ( | std::string | tid, |
std::string | attr, | ||
const AttributeValue & | val | ||
) |
This function is used to setup the Network Simulation Cradle stack with library value.
Give the NSC stack a shared library file name to use when creating the stack implementation. The attr string is actually the attribute name to be setup and val is its value. The attribute is the stack implementation to be used and the value is the shared library name.
tid | The type id, for the case of nsc it would be "ns3::NscTcpL4Protocol" |
attr | The attribute name that must be setup, for example "Library" |
val | The attribute value, which will be in fact the shared library name (example:"liblinux2.6.26.so") |
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".
tid | the type id, typically it is set to "ns3::TcpL4Protocol" |