diff --git a/core/scheduler.cpp b/core/scheduler.cpp
index 504a53c..725f81a 100644
--- a/core/scheduler.cpp
+++ b/core/scheduler.cpp
@@ -24,43 +24,41 @@
  */
 
 #include "scheduler.hpp"
+#include "global-io.hpp"
 
-namespace ns3 {
-
-/// @cond include_hidden
-
-template<>
-struct EventMemberImplObjTraits<std::function<void()>> {
-  typedef std::function<void()> T;
-  static T&
-  GetReference(T& p)
-  {
-    return p;
-  }
-};
-
-/// @endcond
-
-} // namespace ns3
+#include <boost/thread/tss.hpp>
 
 namespace nfd {
 namespace scheduler {
 
-EventId
-schedule(const time::nanoseconds& after, const std::function<void()>& event)
+static boost::thread_specific_ptr<Scheduler> g_scheduler;
+
+Scheduler&
+getGlobalScheduler()
 {
-  ns3::EventId id = ns3::Simulator::Schedule(ns3::NanoSeconds(after.count()),
-                                             &std::function<void()>::operator(), event);
-  return std::make_shared<ns3::EventId>(id);
+  if (g_scheduler.get() == nullptr) {
+    g_scheduler.reset(new Scheduler(*static_cast<boost::asio::io_service*>(nullptr)));
+  }
+
+  return *g_scheduler;
+}
+
+EventId
+schedule(const time::nanoseconds& after, const Scheduler::Event& event)
+{
+  return getGlobalScheduler().scheduleEvent(after, event);
 }
 
 void
 cancel(const EventId& eventId)
 {
-  if (eventId != nullptr) {
-    ns3::Simulator::Remove(*eventId);
-    const_cast<EventId&>(eventId).reset();
-  }
+  getGlobalScheduler().cancelEvent(eventId);
+}
+
+void
+resetGlobalScheduler()
+{
+  g_scheduler.reset();
 }
 
 ScopedEventId::ScopedEventId()
