First simple NS-3 scenario that seems to work
diff --git a/examples/sync-example.cc b/examples/sync-example.cc
index 57bf8b4..d7212d2 100644
--- a/examples/sync-example.cc
+++ b/examples/sync-example.cc
@@ -1,23 +1,86 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 
-#include "ns3/core-module.h"
-#include "ns3/sync-helper.h"
+#include <ns3/core-module.h>
+#include <ns3/network-module.h>
+#include <ns3/NDNabstraction-module.h>
+#include <ns3/point-to-point-module.h>
+
+#include "sync-logic.h"
 
 using namespace ns3;
+using namespace Sync;
 
+NS_LOG_COMPONENT_DEFINE ("SyncExample");
+
+void OnUpdate (Ptr<Node> node, const std::string &prefix, const SeqNo &newSeq, const SeqNo &/*oldSeq*/)
+{
+  NS_LOG_LOGIC (node->GetId () << prefix << newSeq);
+}
+
+void OnRemove (Ptr<Node> node, const std::string &prefix)
+{
+  NS_LOG_LOGIC (node->GetId () << prefix);
+}
 
 int 
 main (int argc, char *argv[])
 {
-  bool verbose = true;
+  Config::SetDefault ("ns3::PointToPointNetDevice::DataRate", StringValue ("1Mbps"));
+  Config::SetDefault ("ns3::PointToPointChannel::Delay", StringValue ("10ms"));
+  Config::SetDefault ("ns3::DropTailQueue::MaxPackets", StringValue ("20"));
+  
+  Config::SetDefault ("ns3::CcnxFloodingStrategy::SmartFlooding", StringValue ("false"));
+
+  LogComponentEnable ("SyncExample", LOG_ALL);
+  
+  Time finishTime = Seconds (3.0); 
 
   CommandLine cmd;
-  cmd.AddValue ("verbose", "Tell application to log if true", verbose);
+  cmd.AddValue ("finish", "Finish time", finishTime);
+  cmd.Parse (argc, argv);
 
-  cmd.Parse (argc,argv);
+  // Creating nodes
+  NodeContainer nodes;
+  nodes.Create (3);
 
-  /* ... */
+  // Connecting nodes using two links
+  PointToPointHelper p2p;
+  p2p.Install (nodes.Get (0), nodes.Get (1));
+  p2p.Install (nodes.Get (1), nodes.Get (2));
 
+  Names::Add ("0", nodes.Get (0));
+  Names::Add ("1", nodes.Get (1));
+  Names::Add ("2", nodes.Get (2));
+  
+  // Install CCNx stack on all nodes
+  NS_LOG_INFO ("Installing CCNx stack");
+  CcnxStackHelper ccnxHelper;
+  ccnxHelper.SetForwardingStrategy ("ns3::CcnxFloodingStrategy");
+  ccnxHelper.SetDefaultRoutes (false);
+  ccnxHelper.InstallAll ();
+
+  ccnxHelper.AddRoute ("0", "/sync", 0, 0);
+  ccnxHelper.AddRoute ("1", "/sync", 0, 0);
+  ccnxHelper.AddRoute ("1", "/sync", 1, 0);
+  ccnxHelper.AddRoute ("2", "/sync", 0, 0);
+
+  ApplicationContainer apps;
+  Ptr<Application> app;
+  app = Create<SyncLogic> ("/sync",
+                           boost::bind (OnUpdate, nodes.Get (0), _1, _2, _3),
+                           boost::bind (OnRemove, nodes.Get (0), _1));
+
+  nodes.Get (0)->AddApplication (app);
+  apps.Add (app);
+
+  app = Create<SyncLogic> ("/sync",
+                           boost::bind (OnUpdate, nodes.Get (1), _1, _2, _3),
+                           boost::bind (OnRemove, nodes.Get (1), _1));
+
+  nodes.Get (1)->AddApplication (app);
+  apps.Add (app);
+  
+  Simulator::Stop (finishTime);
   Simulator::Run ();
   Simulator::Destroy ();
   return 0;
diff --git a/model/sync-logic.cc b/model/sync-logic.cc
index 17a0935..528f212 100644
--- a/model/sync-logic.cc
+++ b/model/sync-logic.cc
@@ -61,6 +61,11 @@
 #endif
 #endif
 #endif
+
+  _LOG_DEBUG ("syncPrefix");
+  
+#ifndef NS3_MODULE
+  // In NS3 module these functions are moved to StartApplication method
   
   m_ccnxHandle->setInterestFilter (m_syncPrefix,
                                    bind (&SyncLogic::respondSyncInterest, this, _1));
@@ -68,6 +73,7 @@
   m_scheduler.schedule (TIME_SECONDS (0),
                         bind (&SyncLogic::sendSyncInterest, this),
                         REEXPRESSING_INTEREST);
+#endif
 }
 
 SyncLogic::~SyncLogic ()
@@ -78,6 +84,29 @@
   m_ccnxHandle.reset ();
 }
 
+#ifdef NS3_MODULE
+void
+SyncLogic::StartApplication ()
+{
+  m_ccnxHandle->SetNode (GetNode ());
+  m_ccnxHandle->StartApplication ();
+
+  m_ccnxHandle->setInterestFilter (m_syncPrefix,
+                                   bind (&SyncLogic::respondSyncInterest, this, _1));
+
+  m_scheduler.schedule (TIME_SECONDS (0),
+                        bind (&SyncLogic::sendSyncInterest, this),
+                        REEXPRESSING_INTEREST);
+}
+
+void
+SyncLogic::StopApplication ()
+{
+  m_ccnxHandle->StopApplication ();
+}
+#endif
+
+
 void
 SyncLogic::respondSyncInterest (const string &interest)
 {
@@ -410,20 +439,4 @@
                         REEXPRESSING_INTEREST);
 }
 
-#ifdef NS3_MODULE
-void
-SyncLogic::StartApplication ()
-{
-  m_ccnxHandle->SetNode (GetNode ());
-  m_ccnxHandle->StartApplication ();
-}
-
-void
-SyncLogic::StopApplication ()
-{
-  m_ccnxHandle->StopApplication ();
-}
-#endif
-
-
 }
diff --git a/ns3/sync-ccnx-wrapper.cc b/ns3/sync-ccnx-wrapper.cc
index e66bda1..9ef8cc4 100644
--- a/ns3/sync-ccnx-wrapper.cc
+++ b/ns3/sync-ccnx-wrapper.cc
@@ -48,6 +48,7 @@
 namespace Sync {
 
 CcnxWrapper::CcnxWrapper()
+  : m_rand (0, std::numeric_limits<uint32_t>::max ())
 {
 }
 
@@ -112,6 +113,8 @@
   Ptr<Packet> packet = Create<Packet> ();
   packet->AddHeader (interestHeader);
 
+  // NS_LOG_DEBUG (interestHeader);
+  
   m_protocolHandler (packet);
 
   m_transmittedInterests (&interestHeader, this, m_face);
diff --git a/wscript b/wscript
index 21824d7..eaf1d13 100644
--- a/wscript
+++ b/wscript
@@ -35,6 +35,7 @@
         conf.check_modules(['point-to-point-layout'], mandatory = False)
 
         conf.check_boost(lib='system iostreams thread')
+        conf.define ('NS3_LOG_ENABLE', 1)
     else:
         conf.check_boost(lib='system iostreams test thread')
         conf.define ('STANDALONE', 1)
@@ -89,7 +90,14 @@
             use = 'BOOST BOOST_IOSTREAMS SSL TINYXML CCNX ' + ' '.join (['ns3_'+dep for dep in ['core', 'network', 'internet', 'NDNabstraction']]).upper (),
             includes = ['model', 'ns3', 'helper'],
             )
-        
+
+        example = bld.program (
+            target = "sync-example",
+            features=['cxx', 'cxxprogram'],
+            source = ['examples/sync-example.cc'],
+            use = 'sync-ns3',
+            includes = ['model', 'ccnx', 'helper'],
+            )
         # from waflib import Utils,Logs,Errors
         # Logs.pprint ('CYAN', program.use)