<div dir="ltr">Hi everyone,<br>I'm using this ChronoSync scenario: <a href="https://github.com/named-data/ChronoSync">https://github.com/named-data/ChronoSync</a><br>I build a tree where the leaves produce data and Chronosync sync them with all the tree node. (7 nodes in my case).<br><br>The non-leaves nodes get the data and they get the average from the values.<br><br>I would like to publish them in the same ChronoSync application, e.g. with name /ndn/peer[id]/average<br>So any node, randomly, may send an Interest to the average Producers sending an Interest.<br><br>I edited Socket::publishData and Socket::fetchData to avoid sync flow in case of "my Interests".<br><br><div>Socket.cpp: <a href="http://pastebin.com/y48veyEd">http://pastebin.com/y48veyEd</a><br>publishData check the prefix, if it's DEFAULT_PREFIX, it syncs, else it only insert into m_ims.<br>fetchData doesn't append seqNo if I'm exchanging average (seqNo is NULL).<br><br>The problem now is how to set the correct face for the Application.<br>If I try with<br><i>ns3::ndn::FibHelper::AddRoute(thisNode, "/ndn/peer8/average", m_face, 1);</i><br><br>[[ Note that thisNode is get from:<br><i>ChronoSync::ChronoSync(const int minNumberMessages, const int maxNumberMessages, ns3::Ptr<ns3::Node> thisNode, bool _producer)</i><br><br>and in chronosync-app.hpp I do:<br><i>m_instance.reset(new ::ndn::ChronoSync(m_minNumberMessages, m_maxNumberMessages, GetNode(), m_periodicPublishing)); ]]<br></i><br>I get:<br><br>---------------------------------------------------------------------------------------------------------------------------<br><div>../extensions/chronosync.cpp: In constructor ‘ndn::ChronoSync::ChronoSync(int, int, ns3::Ptr<ns3::Node>, bool)’:</div><div>../extensions/chronosync.cpp:41:74: error: no matching function for call to ‘ns3::ndn::FibHelper::AddRoute(ns3::Ptr<ns3::Node>&, const char [19], ndn::Face&, int)’</div><div>   ns3::ndn::FibHelper::AddRoute(thisNode, "/ndn/peer8/average", m_face, 1);</div><div>                                                                          ^</div><div>In file included from /usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-stack-helper.hpp:31:0,</div><div>                 from /usr/local/include/ns3-dev/ns3/ndn-all.hpp:23,</div><div>                 from /usr/local/include/ns3-dev/ns3/ndnSIM-module.h:10,</div><div>                 from /home/gorgo/ndnSIM/scenario-ChronoSync/ChronoSync/src/logic.hpp:40,</div><div>                 from /home/gorgo/ndnSIM/scenario-ChronoSync/ChronoSync/src/socket.hpp:32,</div><div>                 from ../extensions/chronosync.hpp:22,</div><div>                 from ../extensions/chronosync.cpp:22:</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:56:3: note: candidate: static void ns3::ndn::FibHelper::AddRoute(ns3::Ptr<ns3::Node>, const ndn::Name&, std::shared_ptr<nfd::Face>, int32_t)</div><div>   AddRoute(Ptr<Node> node, const Name& prefix, shared_ptr<Face> face, int32_t metric);</div><div>   ^</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:56:3: note:   no known conversion for argument 3 from ‘ndn::Face’ to ‘std::shared_ptr<nfd::Face>’</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:67:3: note: candidate: static void ns3::ndn::FibHelper::AddRoute(const string&, const ndn::Name&, uint32_t, int32_t)</div><div>   AddRoute(const std::string& nodeName, const Name& prefix, uint32_t faceId, int32_t metric);</div><div>   ^</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:67:3: note:   no known conversion for argument 1 from ‘ns3::Ptr<ns3::Node>’ to ‘const string& {aka const std::__cxx11::basic_string<char>&}’</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:78:3: note: candidate: static void ns3::ndn::FibHelper::AddRoute(ns3::Ptr<ns3::Node>, const ndn::Name&, uint32_t, int32_t)</div><div>   AddRoute(Ptr<Node> node, const Name& prefix, uint32_t faceId, int32_t metric);</div><div>   ^</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:78:3: note:   no known conversion for argument 3 from ‘ndn::Face’ to ‘uint32_t {aka unsigned int}’</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:89:3: note: candidate: static void ns3::ndn::FibHelper::AddRoute(ns3::Ptr<ns3::Node>, const ndn::Name&, ns3::Ptr<ns3::Node>, int32_t)</div><div>   AddRoute(Ptr<Node> node, const Name& prefix, Ptr<Node> otherNode, int32_t metric);</div><div>   ^</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:89:3: note:   no known conversion for argument 3 from ‘ndn::Face’ to ‘ns3::Ptr<ns3::Node>’</div><div>/usr/local/include/ns3-dev/ns3/ndnSIM/helper/ndn-fib-helper.hpp:101:3: note: candidate: static void ns3::ndn::FibHelper::AddRoute(const string&, const ndn::Name&, const string&, int32_t)</div><div>   AddRoute(const std::string& nodeName, const Name& prefix, const std::string& otherNodeName,</div><div>---------------------------------------------------------------------------------------------------------------------------<br></div><div><br></div><div>To store the average I do in chronosync.cpp:</div><div><br><div><i>m_socket->publishData(reinterpret_cast<const uint8_t*>(std::to_string(avg).c_str()),</i></div><div><i>                        std::to_string(avg).size(), ndn::time::milliseconds(1000*60),                    m_routableUserPrefix.append("average"));</i></div><div><br>and I try to get it with:<br><br></div></div></div><div><div><i>m_socket->fetchData("/ndn/peer8/average", NULL,</i></div><div><i>                          bind(&ChronoSync::printData, this, _1),</i></div><div><i>                          2);</i></div></div><div><br></div><div><br></div><div>Is it possible? All this application seems very "ad-hoc solution" to me. Yes sync works but I'm not able (and I'm skilled) to do anything else here :(<br><br>Thank you,<br>Davide</div><div><br></div></div>