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< FaceContainer > | Install (const std::string &nodeName) const |
Install Ndn stack on the node. More... | |
Ptr< FaceContainer > | Install (Ptr< Node > node) const |
Install Ndn stack on the node. More... | |
Ptr< FaceContainer > | Install (const NodeContainer &c) const |
Install Ndn stack on each node in the input container. More... | |
Ptr< FaceContainer > | 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. | |
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... | |
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.
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.
|
static |
Add forwarding entry to FIB.
nodeName | Node name |
prefix | Routing prefix |
faceId | Face index |
metric | Routing metric |
Definition at line 406 of file ndn-stack-helper.cc.
Referenced by AddRoute(), and Install().
|
static |
Add forwarding entry to FIB.
nodeName | Node |
prefix | Routing prefix |
faceId | Face index |
metric | Routing metric |
Definition at line 394 of file ndn-stack-helper.cc.
References AddRoute().
|
static |
Add forwarding entry to FIB.
node | Node |
prefix | Routing prefix |
face | Face |
metric | Routing metric |
Definition at line 382 of file ndn-stack-helper.cc.
References ns3::ndn::Fib::Add().
|
static |
Add forwarding entry to FIB (work only with point-to-point links)
node | Node |
prefix | Routing prefix |
otherNode | The other node, to which interests (will be used to infer face id |
metric | Routing metric |
Definition at line 421 of file ndn-stack-helper.cc.
References AddRoute().
|
static |
Add forwarding entry to FIB (work only with point-to-point links)
nodeName | Node name (refer to ns3::Names) |
prefix | Routing prefix |
otherNode | The other node name, to which interests (will be used to infer face id (refer to ns3::Names) |
metric | Routing 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)
enable | Enable or disable limits |
avgRtt | Average RTT |
avgData | Average size of contentObject packets (including all headers) |
avgInterest | Average 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
nodeName | The name of the node on which to install the stack. |
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
node | The node on which to install the stack. |
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.
c | NodeContainer that holds the set of nodes on which to install the new stacks. |
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.
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.
contentStoreClass | string, 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.
pitClass | string, 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.
forwardingStrategyClass | string 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.
pitClass | string, 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.