ns3::InternetStackHelper Class Reference

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

#include <internet-stack-helper.h>

List of all members.

Classes

struct  Trace

Public Member Functions

 InternetStackHelper (void)
void Install (Ptr< Node > node) const
void Install (NodeContainer c) const
void SetNscStack (std::string soname)
 Enable or disable use of the Network Simulation Cradle stack.

Static Public Member Functions

static void EnableAscii (std::ostream &os, NodeContainer n)
static void EnableAsciiAll (std::ostream &os)
static void EnablePcapAll (std::string filename)

Static Private Member Functions

static void Cleanup (void)
static void LogRxIp (std::string context, Ptr< const Packet > packet, uint32_t deviceId)
static void LogTxIp (std::string context, Ptr< const Packet > packet, uint32_t deviceId)
static Ptr< PcapWriterGetStream (uint32_t nodeId, uint32_t interfaceId)
static void AsciiDropEvent (std::ostream *os, std::string path, Ptr< const Packet > packet)
static uint32_t GetNodeIndex (std::string context)

Private Attributes

std::string m_nscLibrary

Static Private Attributes

static std::string m_pcapBaseFilename
static std::vector< Tracem_traces

Detailed Description

aggregate IP/TCP/UDP functionality to existing Nodes.

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


Constructor & Destructor Documentation

ns3::InternetStackHelper::InternetStackHelper ( void   ) 

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

References m_pcapBaseFilename, and m_traces.


Member Function Documentation

void ns3::InternetStackHelper::AsciiDropEvent ( std::ostream *  os,
std::string  path,
Ptr< const Packet packet 
) [static, private]

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

void ns3::InternetStackHelper::Cleanup ( void   )  [static, private]

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

void ns3::InternetStackHelper::EnableAscii ( std::ostream &  os,
NodeContainer  n 
) [static]
Parameters:
os output stream
n node container

Enable ascii output on these drop traces, for each node in the NodeContainer.. /NodeList/[i]/$ns3ArpL3Protocol/Drop /NodeList/[i]/$ns3Ipv4L3Protocol/Drop

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

Referenced by EnablePcapAll().

void ns3::InternetStackHelper::EnableAsciiAll ( std::ostream &  os  )  [static]
Parameters:
os output stream

Enable ascii output on these drop traces, for all nodes. /NodeList/[i]/$ns3ArpL3Protocol/Drop /NodeList/[i]/$ns3Ipv4L3Protocol/Drop

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

void ns3::InternetStackHelper::EnablePcapAll ( std::string  filename  )  [static]

Enable pcap output on each protocol instance which is of the ns3::Ipv4L3Protocol type. Both Tx and Rx events will be logged.

Parameters:
filename filename prefix to use for pcap files.
Warning:
If you perform multiple simulations in a single script, each iteration of the simulation will result in the trace files being overwritten. We don't attempt to anticipate what a user might actually want to do, so we leave it up to them. If you want to save any particular data, do so manually at inter-simulation time.

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

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

uint32_t ns3::InternetStackHelper::GetNodeIndex ( std::string  context  )  [static, private]

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

Referenced by GetStream(), and LogRxIp().

Ptr< PcapWriter > ns3::InternetStackHelper::GetStream ( uint32_t  nodeId,
uint32_t  interfaceId 
) [static, private]

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

References GetNodeIndex().

Referenced by LogRxIp().

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

For each node in the input container, aggregate implementations of the ns3::Ipv4, 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:
c NodeContainer that holds the set of nodes on which to install the new stacks.

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

References m_nscLibrary.

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

Aggregate implementations of the ns3::Ipv4, 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:
node The node on which to install the stack.

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

void ns3::InternetStackHelper::LogRxIp ( std::string  context,
Ptr< const Packet packet,
uint32_t  deviceId 
) [static, private]

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

References GetNodeIndex(), and GetStream().

void ns3::InternetStackHelper::LogTxIp ( std::string  context,
Ptr< const Packet packet,
uint32_t  deviceId 
) [static, private]

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

void ns3::InternetStackHelper::SetNscStack ( std::string  soname  ) 

Enable or disable use of the Network Simulation Cradle stack.

Give the NSC stack a shared library file name to use when creating the statck implementation. By providing a non-empty string as a parameter, you select the NSC version of the stack. By providing an empty string, you select the ns-3 default version.

Parameters:
soname name of the shared library with the nsc tcp stack to use, e.g. 'liblinux2.6.26.so'.

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


Member Data Documentation

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

Referenced by Install().

std::string ns3::InternetStackHelper::m_pcapBaseFilename [static, private]

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

Referenced by InternetStackHelper().

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

Referenced by InternetStackHelper().


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