NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ns3::ndn::StackHelper Class Reference

Adding Ndn functionality to existing Nodes. More...

#include <ndn-stack-helper.h>

Public Types

typedef Callback< Ptr
< NetDeviceFace >, Ptr< Node >
, Ptr< L3Protocol >, Ptr
< NetDevice > > 
NetDeviceFaceCreateCallback
 

Public Member Functions

 StackHelper ()
 Create a new NdnStackHelper with a default NDN_FLOODING forwarding stategy.
 
virtual ~StackHelper ()
 Destroy the NdnStackHelper.
 
void SetStackAttributes (const std::string &attr1="", const std::string &value1="", const std::string &attr2="", const std::string &value2="", const std::string &attr3="", const std::string &value3="", const std::string &attr4="", const std::string &value4="")
 Set parameters of NdnL3Protocol.
 
void SetForwardingStrategy (const std::string &forwardingStrategyClass, const std::string &attr1="", const std::string &value1="", const std::string &attr2="", const std::string &value2="", const std::string &attr3="", const std::string &value3="", const std::string &attr4="", const std::string &value4="")
 Set forwarding strategy class and its attributes. More...
 
void SetContentStore (const std::string &contentStoreClass, const std::string &attr1="", const std::string &value1="", const std::string &attr2="", const std::string &value2="", const std::string &attr3="", const std::string &value3="", const std::string &attr4="", const std::string &value4="")
 Set content store class and its attributes. More...
 
void SetPit (const std::string &pitClass, const std::string &attr1="", const std::string &value1="", const std::string &attr2="", const std::string &value2="", const std::string &attr3="", const std::string &value3="", const std::string &attr4="", const std::string &value4="")
 Set PIT class and its attributes. More...
 
void SetFib (const std::string &fibClass, const std::string &attr1="", const std::string &value1="", const std::string &attr2="", const std::string &value2="", const std::string &attr3="", const std::string &value3="", const std::string &attr4="", const std::string &value4="")
 Set FIB class and its attributes. More...
 
void AddNetDeviceFaceCreateCallback (TypeId netDeviceType, NetDeviceFaceCreateCallback callback)
 Add callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice> More...
 
void UpdateNetDeviceFaceCreateCallback (TypeId netDeviceType, NetDeviceFaceCreateCallback callback)
 Update callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice> More...
 
void RemoveNetDeviceFaceCreateCallback (TypeId netDeviceType, NetDeviceFaceCreateCallback callback)
 Remove callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice>
 
void EnableLimits (bool enable=true, Time avgRtt=Seconds(0.1), uint32_t avgData=1100, uint32_t avgInterest=40)
 Enable Interest limits (disabled by default) More...
 
Ptr< FaceContainerInstall (const std::string &nodeName) const
 Install Ndn stack on the node. More...
 
Ptr< FaceContainerInstall (Ptr< Node > node) const
 Install Ndn stack on the node. More...
 
Ptr< FaceContainerInstall (const NodeContainer &c) const
 Install Ndn stack on each node in the input container. More...
 
Ptr< FaceContainerInstallAll () const
 Install Ndn stack on all nodes in the simulation. More...
 
void SetDefaultRoutes (bool needSet)
 Set flag indicating necessity to install default routes in FIB.
 

Static Public Member Functions

static void AddRoute (const std::string &nodeName, const std::string &prefix, uint32_t faceId, int32_t metric)
 Add forwarding entry to FIB. More...
 
static void AddRoute (Ptr< Node > node, const std::string &prefix, uint32_t faceId, int32_t metric)
 Add forwarding entry to FIB. More...
 
static void AddRoute (Ptr< Node > node, const std::string &prefix, Ptr< Face > face, int32_t metric)
 Add forwarding entry to FIB. More...
 
static void AddRoute (Ptr< Node > node, const std::string &prefix, Ptr< Node > otherNode, int32_t metric)
 Add forwarding entry to FIB (work only with point-to-point links) More...
 
static void AddRoute (const std::string &nodeName, const std::string &prefix, const std::string &otherNodeName, int32_t metric)
 Add forwarding entry to FIB (work only with point-to-point links) More...
 

Detailed Description

Adding Ndn functionality to existing Nodes.

This helper enables pcap and ascii tracing of events in the ndn 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 eschew multiple inheritance, however, the classes PcapUserHelperForNdn and AsciiTraceUserHelperForNdn 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.

Definition at line 62 of file ndn-stack-helper.h.

Member Function Documentation

void ns3::ndn::StackHelper::AddNetDeviceFaceCreateCallback ( TypeId  netDeviceType,
StackHelper::NetDeviceFaceCreateCallback  callback 
)

Add callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice>

It is possible to set up several callbacks for different NetDevice types.

Currently, there is only one specialized callback for PointToPointNetDevice, which creates face and sets limits (if enabled) based on PointToPoint link parameters

If none of the callbacks fit the TypeId of NetDevice, a default callback is used (DefaultNetDeviceCallback)

Definition at line 282 of file ndn-stack-helper.cc.

void ns3::ndn::StackHelper::AddRoute ( const std::string &  nodeName,
const std::string &  prefix,
uint32_t  faceId,
int32_t  metric 
)
static

Add forwarding entry to FIB.

Parameters
nodeNameNode name
prefixRouting prefix
faceIdFace index
metricRouting metric

Definition at line 406 of file ndn-stack-helper.cc.

Referenced by AddRoute(), and Install().

void ns3::ndn::StackHelper::AddRoute ( Ptr< Node >  node,
const std::string &  prefix,
uint32_t  faceId,
int32_t  metric 
)
static

Add forwarding entry to FIB.

Parameters
nodeNameNode
prefixRouting prefix
faceIdFace index
metricRouting metric

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

References AddRoute().

void ns3::ndn::StackHelper::AddRoute ( Ptr< Node >  node,
const std::string &  prefix,
Ptr< Face face,
int32_t  metric 
)
static

Add forwarding entry to FIB.

Parameters
nodeNode
prefixRouting prefix
faceFace
metricRouting metric

Definition at line 382 of file ndn-stack-helper.cc.

References ns3::ndn::Fib::Add().

void ns3::ndn::StackHelper::AddRoute ( Ptr< Node >  node,
const std::string &  prefix,
Ptr< Node >  otherNode,
int32_t  metric 
)
static

Add forwarding entry to FIB (work only with point-to-point links)

Parameters
nodeNode
prefixRouting prefix
otherNodeThe other node, to which interests (will be used to infer face id
metricRouting metric

Definition at line 421 of file ndn-stack-helper.cc.

References AddRoute().

void ns3::ndn::StackHelper::AddRoute ( const std::string &  nodeName,
const std::string &  prefix,
const std::string &  otherNodeName,
int32_t  metric 
)
static

Add forwarding entry to FIB (work only with point-to-point links)

Parameters
nodeNameNode name (refer to ns3::Names)
prefixRouting prefix
otherNodeThe other node name, to which interests (will be used to infer face id (refer to ns3::Names)
metricRouting metric

Definition at line 452 of file ndn-stack-helper.cc.

References AddRoute().

void ns3::ndn::StackHelper::EnableLimits ( bool  enable = true,
Time  avgRtt = Seconds(0.1),
uint32_t  avgData = 1100,
uint32_t  avgInterest = 40 
)

Enable Interest limits (disabled by default)

Parameters
enableEnable or disable limits
avgRttAverage RTT
avgDataAverage size of contentObject packets (including all headers)
avgInterestAverage size of interest packets (including all headers)

Definition at line 180 of file ndn-stack-helper.cc.

Ptr< FaceContainer > ns3::ndn::StackHelper::Install ( const std::string &  nodeName) const

Install Ndn stack on the node.

This method will assert if called on a node that already has Ndn object installed on it

Parameters
nodeNameThe name of the node on which to install the stack.
Returns
list of installed faces in the form of a smart pointer to NdnFaceContainer object

Definition at line 374 of file ndn-stack-helper.cc.

Referenced by Install(), and InstallAll().

Ptr< FaceContainer > ns3::ndn::StackHelper::Install ( Ptr< Node >  node) const

Install Ndn stack on the node.

This method will assert if called on a node that already has Ndn object installed on it

Parameters
nodeThe node on which to install the stack.
Returns
list of installed faces in the form of a smart pointer to FaceContainer object

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

References AddRoute().

Ptr< FaceContainer > ns3::ndn::StackHelper::Install ( const NodeContainer &  c) const

Install Ndn stack on each node in the input container.

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

Parameters
cNodeContainer that holds the set of nodes on which to install the new stacks.
Returns
list of installed faces in the form of a smart pointer to FaceContainer object

Definition at line 193 of file ndn-stack-helper.cc.

References Install().

Ptr< FaceContainer > ns3::ndn::StackHelper::InstallAll ( ) const

Install Ndn stack on all nodes in the simulation.

Returns
list of installed faces in the form of a smart pointer to FaceContainer object

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

References Install().

void ns3::ndn::StackHelper::SetContentStore ( const std::string &  contentStoreClass,
const std::string &  attr1 = "",
const std::string &  value1 = "",
const std::string &  attr2 = "",
const std::string &  value2 = "",
const std::string &  attr3 = "",
const std::string &  value3 = "",
const std::string &  attr4 = "",
const std::string &  value4 = "" 
)

Set content store class and its attributes.

Parameters
contentStoreClassstring, representing class of the content store

Definition at line 119 of file ndn-stack-helper.cc.

void ns3::ndn::StackHelper::SetFib ( const std::string &  fibClass,
const std::string &  attr1 = "",
const std::string &  value1 = "",
const std::string &  attr2 = "",
const std::string &  value2 = "",
const std::string &  attr3 = "",
const std::string &  value3 = "",
const std::string &  attr4 = "",
const std::string &  value4 = "" 
)

Set FIB class and its attributes.

Parameters
pitClassstring, representing class of FIB

Definition at line 155 of file ndn-stack-helper.cc.

void ns3::ndn::StackHelper::SetForwardingStrategy ( const std::string &  forwardingStrategyClass,
const std::string &  attr1 = "",
const std::string &  value1 = "",
const std::string &  attr2 = "",
const std::string &  value2 = "",
const std::string &  attr3 = "",
const std::string &  value3 = "",
const std::string &  attr4 = "",
const std::string &  value4 = "" 
)

Set forwarding strategy class and its attributes.

Parameters
forwardingStrategyClassstring containing name of the forwarding strategy class

Valid options are "ns3::NdnFloodingStrategy" (default) and "ns3::NdnBestRouteStrategy"

Other strategies can be implemented, inheriting ns3::NdnForwardingStrategy class

Definition at line 101 of file ndn-stack-helper.cc.

void ns3::ndn::StackHelper::SetPit ( const std::string &  pitClass,
const std::string &  attr1 = "",
const std::string &  value1 = "",
const std::string &  attr2 = "",
const std::string &  value2 = "",
const std::string &  attr3 = "",
const std::string &  value3 = "",
const std::string &  attr4 = "",
const std::string &  value4 = "" 
)

Set PIT class and its attributes.

Parameters
pitClassstring, representing class of PIT

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

void ns3::ndn::StackHelper::UpdateNetDeviceFaceCreateCallback ( TypeId  netDeviceType,
NetDeviceFaceCreateCallback  callback 
)

Update callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice>

It is possible to set up several callbacks for different NetDevice types.

Using this method, it is possible to override Face creation for PointToPointNetDevices

Definition at line 288 of file ndn-stack-helper.cc.


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