Update of tracing
In CcnxForwardingStrategy (connect using "/NodeList/*/$ns3::CcnxL3Protocol/ForwardingStrategy/<trace>":
(interests)
- OutInterests
In Ccnx (connect using "/NodeList/*/$ns3::CcnxL3Protocol/<trace>":
(interests)
- InInterests
- DropInterests
(nacks)
- OutNacks
- InNacks
- DropNacks
(data)
- OutData
- InData
- DropData
diff --git a/model/ccnx.h b/model/ccnx.h
index 38c2f74..f87da94 100644
--- a/model/ccnx.h
+++ b/model/ccnx.h
@@ -23,6 +23,7 @@
#include "ns3/object.h"
#include "ns3/callback.h"
+#include "ns3/traced-callback.h"
namespace ns3 {
@@ -79,13 +80,6 @@
class Ccnx : public Object
{
public:
- enum ForwardingStrategy
- {
- NDN_FLOODING = 1,
- NDN_BESTROUTE = 2,
- NDN_RANKING = 3
- };
-
/**
* \brief Interface ID
*
@@ -94,48 +88,6 @@
static TypeId GetTypeId ();
virtual ~Ccnx ();
- // /**
- // * \brief Send an Interest packet to a specified face
- // *
- // * \param face face where to send this packet
- // * \param header Interest header
- // * \param packet fully prepared CCNx packet to send
- // *
- // * Higher-level layers (forwarding strategy in particular) call this
- // * method to send a packet down the stack to the MAC and PHY layers.
- // */
- // virtual void
- // SendInterest (const Ptr<CcnxFace> &face,
- // const Ptr<const CcnxInterestHeader> &header,
- // const Ptr<Packet> &packet) = 0;
-
- // /**
- // * \brief Send a ContentObject packet to a specified face
- // *
- // * \param face face where to send this packet
- // * \param header ContentObject header
- // * \param packet fully prepared CCNx packet to send
- // *
- // * Higher-level layers (forwarding strategy in particular) call this
- // * method to send a packet down the stack to the MAC and PHY layers.
- // */
- // virtual void
- // SendContentObject (const Ptr<CcnxFace> &face,
- // const Ptr<const CcnxContentObjectHeader> &header,
- // const Ptr<Packet> &packet) = 0;
-
- // /**
- // * \brief Lower layers calls this method after demultiplexing
- // *
- // * Lower-layer-dependent implementation of CcnxFace will do actual work
- // * to set up demultiplexing and call this function as a callback
- // *
- // * \param face face from which packet came from
- // * \param p the packet
- // */
- // virtual void
- // Receive (const Ptr<CcnxFace> &face, const Ptr<const Packet> &p) = 0;
-
/**
* \brief Register a new forwarding strategy to be used by this Ccnx
* stack
@@ -197,6 +149,64 @@
*/
virtual Ptr<CcnxFace>
GetFaceByNetDevice (Ptr<NetDevice> netDevice) const = 0;
+
+
+ /**
+ * \enum DropReason
+ * \brief A reason why the packet has been dropped
+ */
+ enum DropReason
+ {
+ DUPLICATED, // Interests
+ SUPPRESSED, // Interests and Nacks
+ NO_FACES, // Interests
+ NON_DUPLICATED, // Nacks
+ AFTER_SATISFIED, // Nacks
+ UNSOLICITED // data
+ };
+
+protected:
+ ////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////
+
+ // transmittedInterestTrace is inside ForwardingStrategy
+
+ TracedCallback<Ptr<const CcnxInterestHeader>,
+ Ptr<const CcnxFace> > m_inInterests;
+
+ TracedCallback<Ptr<const CcnxInterestHeader>,
+ DropReason,
+ Ptr<const CcnxFace> > m_dropInterests;
+
+ ////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////
+
+ TracedCallback<Ptr<const CcnxInterestHeader>,
+ Ptr<const CcnxFace> > m_outNacks;
+
+ TracedCallback<Ptr<const CcnxInterestHeader>,
+ Ptr<const CcnxFace> > m_inNacks;
+
+ TracedCallback<Ptr<const CcnxInterestHeader>,
+ DropReason,
+ Ptr<const CcnxFace> > m_dropNacks;
+
+ ////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////
+ ////////////////////////////////////////////////////////////////////
+
+ TracedCallback<Ptr<const CcnxContentObjectHeader>,
+ bool /*from cache*/,
+ Ptr<const CcnxFace> > m_outData;
+
+ TracedCallback<Ptr<const CcnxContentObjectHeader>,
+ Ptr<const CcnxFace> > m_inData;
+
+ TracedCallback<Ptr<const CcnxContentObjectHeader>,
+ DropReason,
+ Ptr<const CcnxFace> > m_dropData;
};
} // namespace ns3