22 #ifndef NDN_STACK_HELPER_H
23 #define NDN_STACK_HELPER_H
25 #include "ns3/packet.h"
27 #include "ns3/object-factory.h"
28 #include "ns3/nstime.h"
80 const std::string &attr2 =
"",
const std::string &value2 =
"",
81 const std::string &attr3 =
"",
const std::string &value3 =
"",
82 const std::string &attr4 =
"",
const std::string &value4 =
"");
95 const std::string &attr1 =
"",
const std::string &value1 =
"",
96 const std::string &attr2 =
"",
const std::string &value2 =
"",
97 const std::string &attr3 =
"",
const std::string &value3 =
"",
98 const std::string &attr4 =
"",
const std::string &value4 =
"");
106 const std::string &attr1 =
"",
const std::string &value1 =
"",
107 const std::string &attr2 =
"",
const std::string &value2 =
"",
108 const std::string &attr3 =
"",
const std::string &value3 =
"",
109 const std::string &attr4 =
"",
const std::string &value4 =
"");
116 SetPit (
const std::string &pitClass,
117 const std::string &attr1 =
"",
const std::string &value1 =
"",
118 const std::string &attr2 =
"",
const std::string &value2 =
"",
119 const std::string &attr3 =
"",
const std::string &value3 =
"",
120 const std::string &attr4 =
"",
const std::string &value4 =
"");
127 SetFib (
const std::string &fibClass,
128 const std::string &attr1 =
"",
const std::string &value1 =
"",
129 const std::string &attr2 =
"",
const std::string &value2 =
"",
130 const std::string &attr3 =
"",
const std::string &value3 =
"",
131 const std::string &attr4 =
"",
const std::string &value4 =
"");
133 typedef Callback< Ptr<NetDeviceFace>, Ptr<Node>, Ptr<L3Protocol>, Ptr<NetDevice> > NetDeviceFaceCreateCallback;
173 EnableLimits (
bool enable =
true, Time avgRtt=Seconds(0.1), uint32_t avgData=1100, uint32_t avgInterest=40);
187 Install (
const std::string &nodeName)
const;
201 Install (Ptr<Node> node)
const;
216 Install (
const NodeContainer &c)
const;
236 AddRoute (
const std::string &nodeName,
const std::string &prefix, uint32_t faceId, int32_t metric);
247 AddRoute (Ptr<Node> node,
const std::string &prefix, uint32_t faceId, int32_t metric);
258 AddRoute (Ptr<Node> node,
const std::string &prefix, Ptr<Face> face, int32_t metric);
269 AddRoute (Ptr<Node> node,
const std::string &prefix, Ptr<Node> otherNode, int32_t metric);
280 AddRoute (
const std::string &nodeName,
const std::string &prefix,
const std::string &otherNodeName, int32_t metric);
290 DefaultNetDeviceCallback (Ptr<Node> node, Ptr<L3Protocol> ndn, Ptr<NetDevice> netDevice)
const;
293 PointToPointNetDeviceCallback (Ptr<Node> node, Ptr<L3Protocol> ndn, Ptr<NetDevice> netDevice)
const;
300 ObjectFactory m_ndnFactory;
301 ObjectFactory m_strategyFactory;
302 ObjectFactory m_contentStoreFactory;
303 ObjectFactory m_pitFactory;
304 ObjectFactory m_fibFactory;
306 bool m_limitsEnabled;
308 uint32_t m_avgDataSize;
309 uint32_t m_avgInterestSize;
310 bool m_needSetDefaultRoutes;
312 typedef std::list< std::pair<TypeId, NetDeviceFaceCreateCallback> > NetDeviceCallbackList;
313 NetDeviceCallbackList m_netDeviceCallbacks;
Adding Ndn functionality to existing Nodes.
void SetDefaultRoutes(bool needSet)
Set flag indicating necessity to install default routes in FIB.
StackHelper()
Create a new NdnStackHelper with a default NDN_FLOODING forwarding stategy.
void RemoveNetDeviceFaceCreateCallback(TypeId netDeviceType, NetDeviceFaceCreateCallback callback)
Remove callback to create and configure instance of the face, based on supplied Ptr
and Ptr
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.
Ptr< FaceContainer > InstallAll() const
Install Ndn stack on all nodes in the simulation.
void UpdateNetDeviceFaceCreateCallback(TypeId netDeviceType, NetDeviceFaceCreateCallback callback)
Update callback to create and configure instance of the face, based on supplied Ptr
and Ptr
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 AddNetDeviceFaceCreateCallback(TypeId netDeviceType, NetDeviceFaceCreateCallback callback)
Add callback to create and configure instance of the face, based on supplied Ptr
and Ptr
virtual ~StackHelper()
Destroy the NdnStackHelper.
static void AddRoute(const std::string &nodeName, const std::string &prefix, uint32_t faceId, int32_t metric)
Add forwarding entry to FIB.
void EnableLimits(bool enable=true, Time avgRtt=Seconds(0.1), uint32_t avgData=1100, uint32_t avgInterest=40)
Enable Interest limits (disabled by default)
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.
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.
Ptr< FaceContainer > Install(const std::string &nodeName) const
Install Ndn stack on the node.
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.