<div dir="ltr">Dear all<div>I am not understanding the cause of error as the sink function <b>Client </b> is also defined as per its signature. Please </div><div>suggest the direction to remove the error and calculate the total received Data packets at the consumer.</div><div>Regards</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 8, 2022 at 1:30 AM <<a href="mailto:ndnsim-request@lists.cs.ucla.edu">ndnsim-request@lists.cs.ucla.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send ndnSIM mailing list submissions to<br>
        <a href="mailto:ndnsim@lists.cs.ucla.edu" target="_blank">ndnsim@lists.cs.ucla.edu</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
or, via email, send a message with subject or body 'help' to<br>
        <a href="mailto:ndnsim-request@lists.cs.ucla.edu" target="_blank">ndnsim-request@lists.cs.ucla.edu</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:ndnsim-owner@lists.cs.ucla.edu" target="_blank">ndnsim-owner@lists.cs.ucla.edu</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of ndnSIM digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
   1. Counting the number of data packets through tracing<br>
      (SUBODH MISHRA)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Fri, 7 Jan 2022 18:55:17 +0530<br>
From: SUBODH MISHRA <<a href="mailto:1911602@iiitdmj.ac.in" target="_blank">1911602@iiitdmj.ac.in</a>><br>
To: <a href="mailto:ndnsim@lists.cs.ucla.edu" target="_blank">ndnsim@lists.cs.ucla.edu</a><br>
Subject: [ndnSIM] Counting the number of data packets through tracing<br>
Message-ID:<br>
        <<a href="mailto:CAApBihbi9YbaDe17jBPypqVgyhoq6w7nsNTacqGYtgvB8iAi1Q@mail.gmail.com" target="_blank">CAApBihbi9YbaDe17jBPypqVgyhoq6w7nsNTacqGYtgvB8iAi1Q@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Dear all<br>
I just want to calculate the total number of received data packet on the<br>
consumer in the ndn-simple.cpp. I used the following code in which i used<br>
the callback function named Client as well as global variable r to count<br>
the number of packets.<br>
<br>
#include "ns3/core-module.h"<br>
#include "ns3/network-module.h"<br>
#include "ns3/point-to-point-module.h"<br>
#include "ns3/ndnSIM-module.h"<br>
<br>
namespace ns3 {<br>
<br>
int r;<br>
void Client(Ptr<const ndn::Data> d, Ptr<const ndn::App> app, Ptr<const<br>
ndn::Face> f)<br>
{<br>
std::cout<<"Total data packets recieved"<<r++<<endl;<br>
}<br>
<br>
<br>
<br>
<br>
<br>
int main(int argc, char* argv[]) {<br>
<br>
<br>
     Config::SetDefault("ns3::PointToPointNetDevice::DataRate",<br>
StringValue("1Mbps"));<br>
     Config::SetDefault("ns3::PointToPointChannel::Delay",<br>
StringValue("10ms"));<br>
     Config::SetDefault("ns3::QueueBase::MaxSize", StringValue("20p"));<br>
<br>
     // Read optional command-line parameters (e.g., enable visualizer with<br>
./waf --run=<> --visualize<br>
     CommandLine cmd;<br>
     cmd.Parse(argc, argv);<br>
<br>
     // Creating nodes<br>
     NodeContainer nodes;<br>
     nodes.Create(3);<br>
<br>
     // Connecting nodes using two links<br>
     PointToPointHelper p2p;<br>
     p2p.Install(nodes.Get(0), nodes.Get(1));<br>
     p2p.Install(nodes.Get(1), nodes.Get(2));<br>
<br>
     // Install NDN stack on all nodes<br>
     ndn::StackHelper ndnHelper;<br>
     ndnHelper.SetDefaultRoutes(true);<br>
     ndnHelper.InstallAll();<br>
<br>
     // Choosing forwarding strategy<br>
     ndn::StrategyChoiceHelper::InstallAll("/prefix",<br>
"/localhost/nfd/strategy/multicast");<br>
<br>
     // Installing applications<br>
<br>
     // Consumer<br>
     ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");<br>
     // Consumer will request /prefix/0, /prefix/1, ...<br>
     consumerHelper.SetPrefix("/prefix");<br>
     consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10<br>
interests a second<br>
     auto apps = consumerHelper.Install(nodes.Get(0));<br>
   // first node<br>
     apps.Stop(Seconds(10.0)); // stop the consumer app at 10 seconds mark<br>
<br>
     // Producer<br>
     ndn::AppHelper producerHelper("ns3::ndn::Producer");<br>
     // Producer will reply to all requests starting with /prefix<br>
     producerHelper.SetPrefix("/prefix");<br>
     producerHelper.SetAttribute("PayloadSize", StringValue("1024"));<br>
     producerHelper.Install(nodes.Get(2)); // last node<br>
     Config::Connect("/NodeList/0/ApplicationList/*/ReceivedDatas",<br>
MakeCallback(&Client));<br>
     Simulator::Stop(Seconds(20.0));<br>
<br>
     Simulator::Run();<br>
     Simulator::Destroy();<br>
<br>
     return 0;<br>
   }<br>
<br>
  // setting default parameters for PointToPoint links and channels<br>
<br>
}<br>
<br>
 // namespace ns3<br>
<br>
int<br>
main(int argc, char* argv[])<br>
{<br>
<br>
<br>
return ns3::main(argc, argv);<br>
<br>
<br>
}<br>
I am receiving the following error message:-<br>
<br>
<br>
In file included from ./ns3/attribute.h:25,<br>
                 from ./ns3/attribute-accessor-helper.h:23,<br>
                 from ./ns3/core-module.h:12,<br>
                 from ../scratch/ndn-simple.cc:22:<br>
./ns3/ptr.h: In instantiation of ?ns3::Ptr<T>::~Ptr() [with T = const<br>
ndn::Data]?:<br>
./ns3/callback.h:482:31:   required from ?R ns3::FunctorCallbackImpl<T, R,<br>
T1, T2, T3, T4, T5, T6, T7, T8, T9>::operator()(T1, T2, T3) [with T = void<br>
(*)(ns3::Ptr<const ndn::Data>, ns3::Ptr<const ns3::ndn::App>,<br>
ns3::Ptr<const nfd::face::Face>); R = void; T1 = ns3::Ptr<const ndn::Data>;<br>
T2 = ns3::Ptr<const ns3::ndn::App>; T3 = ns3::Ptr<const nfd::face::Face>;<br>
T4 = ns3::empty; T5 = ns3::empty; T6 = ns3::empty; T7 = ns3::empty; T8 =<br>
ns3::empty; T9 = ns3::empty]?<br>
./ns3/callback.h:481:5:   required from here<br>
./ns3/ptr.h:758:14: error: ?const class ndn::Data? has no member named<br>
?Unref?<br>
  758 |       m_ptr->Unref ();<br>
      |       ~~~~~~~^~~~~<br>
./ns3/ptr.h: In instantiation of ?ns3::Ptr<T>::~Ptr() [with T = const<br>
ns3::ndn::App]?:<br>
./ns3/callback.h:482:31:   required from ?R ns3::FunctorCallbackImpl<T, R,<br>
T1, T2, T3, T4, T5, T6, T7, T8, T9>::operator()(T1, T2, T3) [with T = void<br>
(*)(ns3::Ptr<const ndn::Data>, ns3::Ptr<const ns3::ndn::App>,<br>
ns3::Ptr<const nfd::face::Face>); R = void; T1 = ns3::Ptr<const ndn::Data>;<br>
T2 = ns3::Ptr<const ns3::ndn::App>; T3 = ns3::Ptr<const nfd::face::Face>;<br>
T4 = ns3::empty; T5 = ns3::empty; T6 = ns3::empty; T7 = ns3::empty; T8 =<br>
ns3::empty; T9 = ns3::empty]?<br>
./ns3/callback.h:481:5:   required from here<br>
./ns3/ptr.h:758:14: error: invalid use of incomplete type ?const class<br>
ns3::ndn::App?<br>
In file included from ./ns3/ndn-all.hpp:34,<br>
                 from ./ns3/ndnSIM-module.h:10,<br>
                 from ../scratch/ndn-simple.cc:25:<br>
./ns3/ndnSIM/utils/tracers/ndn-app-delay-tracer.hpp:41:7: note: forward<br>
declaration of ?class ns3::ndn::App?<br>
   41 | class App;<br>
      |       ^~~<br>
In file included from ./ns3/attribute.h:25,<br>
                 from ./ns3/attribute-accessor-helper.h:23,<br>
                 from ./ns3/core-module.h:12,<br>
                 from ../scratch/ndn-simple.cc:22:<br>
./ns3/ptr.h: In instantiation of ?ns3::Ptr<T>::~Ptr() [with T = const<br>
nfd::face::Face]?:<br>
./ns3/callback.h:482:31:   required from ?R ns3::FunctorCallbackImpl<T, R,<br>
T1, T2, T3, T4, T5, T6, T7, T8, T9>::operator()(T1, T2, T3) [with T = void<br>
(*)(ns3::Ptr<const ndn::Data>, ns3::Ptr<const ns3::ndn::App>,<br>
ns3::Ptr<const nfd::face::Face>); R = void; T1 = ns3::Ptr<const ndn::Data>;<br>
T2 = ns3::Ptr<const ns3::ndn::App>; T3 = ns3::Ptr<const nfd::face::Face>;<br>
T4 = ns3::empty; T5 = ns3::empty; T6 = ns3::empty; T7 = ns3::empty; T8 =<br>
ns3::empty; T9 = ns3::empty]?<br>
./ns3/callback.h:481:5:   required from here<br>
./ns3/ptr.h:758:14: error: ?const class nfd::face::Face? has no member<br>
named ?Unref?<br>
  758 |       m_ptr->Unref ();<br>
      |       ~~~~~~~^~~~~<br>
./ns3/ptr.h: In instantiation of ?void ns3::Ptr<T>::Acquire() const [with T<br>
= const ndn::Data]?:<br>
./ns3/ptr.h:743:3:   required from ?ns3::Ptr<T>::Ptr(const ns3::Ptr<T>&)<br>
[with T = const ndn::Data]?<br>
./ns3/callback.h:482:31:   required from ?R ns3::FunctorCallbackImpl<T, R,<br>
T1, T2, T3, T4, T5, T6, T7, T8, T9>::operator()(T1, T2, T3) [with T = void<br>
(*)(ns3::Ptr<const ndn::Data>, ns3::Ptr<const ns3::ndn::App>,<br>
ns3::Ptr<const nfd::face::Face>); R = void; T1 = ns3::Ptr<const ndn::Data>;<br>
T2 = ns3::Ptr<const ns3::ndn::App>; T3 = ns3::Ptr<const nfd::face::Face>;<br>
T4 = ns3::empty; T5 = ns3::empty; T6 = ns3::empty; T7 = ns3::empty; T8 =<br>
ns3::empty; T9 = ns3::empty]?<br>
./ns3/callback.h:481:5:   required from here<br>
./ns3/ptr.h:712:14: error: ?const class ndn::Data? has no member named ?Ref?<br>
  712 |       m_ptr->Ref ();<br>
      |       ~~~~~~~^~~<br>
./ns3/ptr.h: In instantiation of ?void ns3::Ptr<T>::Acquire() const [with T<br>
= const ns3::ndn::App]?:<br>
./ns3/ptr.h:743:3:   required from ?ns3::Ptr<T>::Ptr(const ns3::Ptr<T>&)<br>
[with T = const ns3::ndn::App]?<br>
./ns3/callback.h:482:31:   required from ?R ns3::FunctorCallbackImpl<T, R,<br>
T1, T2, T3, T4, T5, T6, T7, T8, T9>::operator()(T1, T2, T3) [with T = void<br>
(*)(ns3::Ptr<const ndn::Data>, ns3::Ptr<const ns3::ndn::App>,<br>
ns3::Ptr<const nfd::face::Face>); R = void; T1 = ns3::Ptr<const ndn::Data>;<br>
T2 = ns3::Ptr<const ns3::ndn::App>; T3 = ns3::Ptr<const nfd::face::Face>;<br>
T4 = ns3::empty; T5 = ns3::empty; T6 = ns3::empty; T7 = ns3::empty; T8 =<br>
ns3::empty; T9 = ns3::empty]?<br>
./ns3/callback.h:481:5:   required from here<br>
./ns3/ptr.h:712:14: error: invalid use of incomplete type ?const class<br>
ns3::ndn::App?<br>
In file included from ./ns3/ndn-all.hpp:34,<br>
                 from ./ns3/ndnSIM-module.h:10,<br>
                 from ../scratch/ndn-simple.cc:25:<br>
./ns3/ndnSIM/utils/tracers/ndn-app-delay-tracer.hpp:41:7: note: forward<br>
declaration of ?class ns3::ndn::App?<br>
   41 | class App;<br>
      |       ^~~<br>
In file included from ./ns3/attribute.h:25,<br>
                 from ./ns3/attribute-accessor-helper.h:23,<br>
                 from ./ns3/core-module.h:12,<br>
                 from ../scratch/ndn-simple.cc:22:<br>
./ns3/ptr.h: In instantiation of ?void ns3::Ptr<T>::Acquire() const [with T<br>
= const nfd::face::Face]?:<br>
./ns3/ptr.h:743:3:   required from ?ns3::Ptr<T>::Ptr(const ns3::Ptr<T>&)<br>
[with T = const nfd::face::Face]?<br>
./ns3/callback.h:482:31:   required from ?R ns3::FunctorCallbackImpl<T, R,<br>
T1, T2, T3, T4, T5, T6, T7, T8, T9>::operator()(T1, T2, T3) [with T = void<br>
(*)(ns3::Ptr<const ndn::Data>, ns3::Ptr<const ns3::ndn::App>,<br>
ns3::Ptr<const nfd::face::Face>); R = void; T1 = ns3::Ptr<const ndn::Data>;<br>
T2 = ns3::Ptr<const ns3::ndn::App>; T3 = ns3::Ptr<const nfd::face::Face>;<br>
T4 = ns3::empty; T5 = ns3::empty; T6 = ns3::empty; T7 = ns3::empty; T8 =<br>
ns3::empty; T9 = ns3::empty]?<br>
./ns3/callback.h:481:5:   required from here<br>
./ns3/ptr.h:712:14: error: ?const class nfd::face::Face? has no member<br>
named ?Ref?<br>
  712 |       m_ptr->Ref ();<br>
      |       ~~~~~~~^~~<br>
<br>
Waf: Leaving directory `/home/sub/eclipse-workspace/ndnSIM/ns-3/build'<br>
Build failed<br>
 -> task in 'ndn-simple' failed with exit status 1 (run with -v to display<br>
more information)<br>
<br>
Please help me to trace the total data packets received ...<br>
Thanks in advance<br>
<br>
-- <br>
Thanks & Regards<br>
Subodh Mishra<br>
<br>
Research Scholar (Ph.D),<br>
Department of Computer Science and Engineering,<br>
PDPM-Indian Institute of Information Technology,<br>
Design and Manufacturing, Jabalpur<br>
<br>
Email: 1911602 [at] iiitdmj [dot] ac [dot] in ,<br>
           subodhkmishra [at] gmail [dot] com<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20220107/1d8c239a/attachment-0001.html" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20220107/1d8c239a/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
<br>
<br>
------------------------------<br>
<br>
End of ndnSIM Digest, Vol 110, Issue 2<br>
**************************************<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div style="color:rgb(34,34,34)">Thanks & Regards,</div><div><font color="#444444" face="comic sans ms, sans-serif" size="4">Subodh Mishra</font></div></div></div>