NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndn-l3-protocol.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20 #ifndef NDN_L3_PROTOCOL_H
21 #define NDN_L3_PROTOCOL_H
22 
23 #include "ns3/ndnSIM/model/ndn-common.hpp"
24 #include "ns3/ndnSIM/model/ndn-face.hpp"
25 
26 #include <list>
27 #include <vector>
28 
29 #include "ns3/ptr.h"
30 #include "ns3/net-device.h"
31 #include "ns3/nstime.h"
32 #include "ns3/traced-callback.h"
33 
34 #include <boost/property_tree/ptree_fwd.hpp>
35 
36 namespace nfd {
37 class Forwarder;
38 class FibManager;
40 typedef boost::property_tree::ptree ConfigSection;
41 namespace pit {
42 class Entry;
43 } // namespace pit
44 } // namespace nfd
45 
46 namespace ns3 {
47 
48 class Packet;
49 class Node;
50 class Header;
51 
52 namespace ndn {
53 
75 class L3Protocol : boost::noncopyable, public Object {
76 public:
82  static TypeId
83  GetTypeId();
84 
85  static const uint16_t ETHERNET_FRAME_TYPE;
86  static const uint16_t IP_STACK_PORT;
87  // static const uint16_t IP_PROTOCOL_TYPE; ///< \brief IP protocol type of NDN
88 
92  L3Protocol();
93  virtual ~L3Protocol();
94 
98  void
99  initialize();
100 
104  shared_ptr<nfd::Forwarder>
105  getForwarder();
106 
110  shared_ptr<nfd::FibManager>
111  getFibManager();
112 
116  shared_ptr<nfd::StrategyChoiceManager>
118 
119 
129  addFace(shared_ptr<Face> face);
130 
136  shared_ptr<Face>
137  getFaceById(nfd::FaceId face) const;
138 
139  // /**
140  // * \brief Remove face from ndn stack (remove callbacks)
141  // */
142  // virtual void
143  // removeFace(shared_ptr<Face> face);
144 
148  shared_ptr<Face>
149  getFaceByNetDevice(Ptr<NetDevice> netDevice) const;
150 
155  getConfig();
156 
157 public: // Workaround for python bindings
158  static Ptr<L3Protocol>
159  getL3Protocol(Ptr<Object> node);
160 
161 protected:
162  virtual void
163  DoDispose(void);
164 
171  virtual void
173 
174 private:
175  void
176  initializeManagement();
177 
178 private:
179  class Impl;
180  std::unique_ptr<Impl> m_impl;
181 
182  // These objects are aggregated, but for optimization, get them here
183  Ptr<Node> m_node;
184 
185  TracedCallback<const Interest&, const Face&>
186  m_inInterests;
187  TracedCallback<const Interest&, const Face&>
188  m_outInterests;
189 
190  TracedCallback<const Data&, const Face&> m_outData;
191  TracedCallback<const Data&, const Face&> m_inData;
192 
193  TracedCallback<const nfd::pit::Entry&, const Face&/*in face*/, const Data&> m_satisfiedInterests;
194  TracedCallback<const nfd::pit::Entry&> m_timedOutInterests;
195 };
196 
197 } // namespace ndn
198 } // namespace ns3
199 
200 #endif /* NDN_L3_PROTOCOL_H */
shared_ptr< Face > getFaceByNetDevice(Ptr< NetDevice > netDevice) const
Remove face from ndn stack (remove callbacks)
static const uint16_t IP_STACK_PORT
TCP/UDP port for NDN stack.
shared_ptr< nfd::Forwarder > getForwarder()
Get smart pointer to nfd::Forwarder installed on the node.
static const uint16_t ETHERNET_FRAME_TYPE
Ethernet Frame Type of Ndn.
nfd::ConfigSection & getConfig()
Get NFD config (boost::property_tree)
shared_ptr< Face > getFaceById(nfd::FaceId face) const
Get face by face ID.
shared_ptr< nfd::FibManager > getFibManager()
Get smart pointer to nfd::FibManager, used by node's NFD.
virtual void NotifyNewAggregate()
This function will notify other components connected to the node that a new stack member is now conne...
FibManager
Definition: fib-manager.cpp:38
represents a face
Definition: face.hpp:59
static TypeId GetTypeId()
Interface ID.
represents a PIT entry
Definition: pit-entry.hpp:67
nfd::FaceId addFace(shared_ptr< Face > face)
Add face to NDN stack.
boost::property_tree::ptree ConfigSection
L3Protocol()
Default constructor.
Forwarder
Definition: forwarder.cpp:36
shared_ptr< nfd::StrategyChoiceManager > getStrategyChoiceManager()
Get smart pointer to nfd::StrategyChoiceManager, used by node's NFD.
Implementation network-layer of NDN stack.
static Ptr< L3Protocol > getL3Protocol(Ptr< Object > node)
void initialize()
Initialize NFD instance.
virtual void DoDispose(void)
Do cleanup.
int FaceId
Definition: face.hpp:41