NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ns3::ndn::StackHelper Class Reference

Helper class to install NDN stack and configure its parameters. More...

#include <ndn-stack-helper.hpp>

Inheritance diagram for ns3::ndn::StackHelper:
Collaboration diagram for ns3::ndn::StackHelper:

Public Types

typedef Callback< shared_ptr< Face >, Ptr< Node >, Ptr< L3Protocol >, Ptr< NetDevice > > FaceCreateCallback
 

Public Member Functions

 StackHelper ()
 Create a new NdnStackHelper with a default NDN_FLOODING forwarding stategy. More...
 
virtual ~StackHelper ()
 Destroy the NdnStackHelper. More...
 
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. More...
 
void setCsSize (size_t maxSize)
 Set maximum size for NFD's Content Store (in number of packets) More...
 
void setPolicy (const std::string &policy)
 Set the cache replacement policy for NFD's Content Store. More...
 
void AddFaceCreateCallback (TypeId netDeviceType, FaceCreateCallback callback)
 Add callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice> More...
 
void UpdateFaceCreateCallback (TypeId netDeviceType, FaceCreateCallback callback)
 Update callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice> More...
 
void RemoveFaceCreateCallback (TypeId netDeviceType, FaceCreateCallback callback)
 Remove callback to create and configure instance of the face, based on supplied Ptr<Node> and Ptr<NetDevice> More...
 
void Install (const std::string &nodeName) const
 Install Ndn stack on the node. More...
 
void Install (Ptr< Node > node) const
 Install Ndn stack on the node. More...
 
void Install (const NodeContainer &c) const
 Install Ndn stack on each node in the input container. More...
 
void InstallAll () 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. More...
 
void Update (Ptr< Node > node)
 Update Ndn stack on a given node (Add faces for new devices) More...
 
void Update (const NodeContainer &c)
 Update Ndn stack on given nodes (Add faces for new devices) More...
 
void Update (const std::string &nodeName)
 Update Ndn stack on a given node name (Add faces for new devices) More...
 
void UpdateAll ()
 Update Ndn stack on all the nodes (Add faces for new devices) More...
 
void disableStrategyChoiceManager ()
 Disable Strategy Choice Manager. More...
 
void disableForwarderStatusManager ()
 Disable Forwarder Status Manager. More...
 
void setCustomNdnCxxClocks ()
 

Static Public Member Functions

static KeyChain & getKeyChain ()
 
static void SetLinkDelayAsFaceMetric ()
 Set face metric of all faces connected through PointToPoint channel to channel latency. More...
 
static void ProcessWarmupEvents ()
 

Detailed Description

Helper class to install NDN stack and configure its parameters.

Definition at line 55 of file ndn-stack-helper.hpp.

Member Typedef Documentation

◆ FaceCreateCallback

typedef Callback<shared_ptr<Face>, Ptr<Node>, Ptr<L3Protocol>, Ptr<NetDevice> > ns3::ndn::StackHelper::FaceCreateCallback

Definition at line 89 of file ndn-stack-helper.hpp.

Constructor & Destructor Documentation

◆ StackHelper()

ns3::ndn::StackHelper::StackHelper ( )

Create a new NdnStackHelper with a default NDN_FLOODING forwarding stategy.

Definition at line 52 of file ndn-stack-helper.cpp.

References setCustomNdnCxxClocks().

◆ ~StackHelper()

ns3::ndn::StackHelper::~StackHelper ( )
virtual

Destroy the NdnStackHelper.

Definition at line 72 of file ndn-stack-helper.cpp.

References ndn::security::v2::KeyChain.

Member Function Documentation

◆ SetStackAttributes()

void ns3::ndn::StackHelper::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.

Definition at line 98 of file ndn-stack-helper.cpp.

◆ setCsSize()

void ns3::ndn::StackHelper::setCsSize ( size_t  maxSize)

Set maximum size for NFD's Content Store (in number of packets)

Definition at line 114 of file ndn-stack-helper.cpp.

◆ setPolicy()

void ns3::ndn::StackHelper::setPolicy ( const std::string &  policy)

Set the cache replacement policy for NFD's Content Store.

Definition at line 120 of file ndn-stack-helper.cpp.

References websocketpp::http::status_code::found.

◆ AddFaceCreateCallback()

void ns3::ndn::StackHelper::AddFaceCreateCallback ( TypeId  netDeviceType,
StackHelper::FaceCreateCallback  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.

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

Definition at line 194 of file ndn-stack-helper.cpp.

◆ UpdateFaceCreateCallback()

void ns3::ndn::StackHelper::UpdateFaceCreateCallback ( TypeId  netDeviceType,
FaceCreateCallback  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 201 of file ndn-stack-helper.cpp.

◆ RemoveFaceCreateCallback()

void ns3::ndn::StackHelper::RemoveFaceCreateCallback ( TypeId  netDeviceType,
FaceCreateCallback  callback 
)

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

Definition at line 213 of file ndn-stack-helper.cpp.

◆ Install() [1/3]

void 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 302 of file ndn-stack-helper.cpp.

Referenced by Install(), InstallAll(), and Update().

◆ Install() [2/3]

void 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 150 of file ndn-stack-helper.cpp.

References ns3::ndn::L3Protocol::getConfig(), and ProcessWarmupEvents().

◆ Install() [3/3]

void 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 136 of file ndn-stack-helper.cpp.

References Install().

◆ InstallAll()

void 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 144 of file ndn-stack-helper.cpp.

References Install().

Referenced by ns3::ndn::ScenarioHelper::createTopology().

◆ SetDefaultRoutes()

void ns3::ndn::StackHelper::SetDefaultRoutes ( bool  needSet)

Set flag indicating necessity to install default routes in FIB.

Definition at line 91 of file ndn-stack-helper.cpp.

◆ getKeyChain()

KeyChain & ns3::ndn::StackHelper::getKeyChain ( )
static

◆ Update() [1/3]

void ns3::ndn::StackHelper::Update ( Ptr< Node node)

Update Ndn stack on a given node (Add faces for new devices)

Parameters
nodeThe node on which to update the stack.

Definition at line 309 of file ndn-stack-helper.cpp.

References Install().

Referenced by Update(), and UpdateAll().

◆ Update() [2/3]

void ns3::ndn::StackHelper::Update ( const NodeContainer &  c)

Update Ndn stack on given nodes (Add faces for new devices)

Parameters
cThe nodes on which to update the stack.

Definition at line 329 of file ndn-stack-helper.cpp.

References Update().

◆ Update() [3/3]

void ns3::ndn::StackHelper::Update ( const std::string &  nodeName)

Update Ndn stack on a given node name (Add faces for new devices)

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

Definition at line 337 of file ndn-stack-helper.cpp.

References Update().

◆ UpdateAll()

void ns3::ndn::StackHelper::UpdateAll ( )

Update Ndn stack on all the nodes (Add faces for new devices)

Definition at line 344 of file ndn-stack-helper.cpp.

References ns3::ndn::FibHelper::AddRoute(), and Update().

◆ disableStrategyChoiceManager()

void ns3::ndn::StackHelper::disableStrategyChoiceManager ( )

Disable Strategy Choice Manager.

Definition at line 375 of file ndn-stack-helper.cpp.

Referenced by ns3::ndn::ScenarioHelper::disableStrategyChoiceManager().

◆ disableForwarderStatusManager()

void ns3::ndn::StackHelper::disableForwarderStatusManager ( )

Disable Forwarder Status Manager.

Definition at line 381 of file ndn-stack-helper.cpp.

Referenced by ns3::ndn::ScenarioHelper::disableForwarderStatusManager().

◆ SetLinkDelayAsFaceMetric()

void ns3::ndn::StackHelper::SetLinkDelayAsFaceMetric ( )
static

Set face metric of all faces connected through PointToPoint channel to channel latency.

Definition at line 387 of file ndn-stack-helper.cpp.

◆ ProcessWarmupEvents()

void ns3::ndn::StackHelper::ProcessWarmupEvents ( )
static

◆ setCustomNdnCxxClocks()

void ns3::ndn::StackHelper::setCustomNdnCxxClocks ( )

Definition at line 84 of file ndn-stack-helper.cpp.

References ndn::time::setCustomClocks().

Referenced by StackHelper().


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