diff --git a/helper/tracers/ipv4-rate-l3-tracer.cc b/helper/tracers/ipv4-rate-l3-tracer.cc
new file mode 100644
index 0000000..e97ba18
--- /dev/null
+++ b/helper/tracers/ipv4-rate-l3-tracer.cc
@@ -0,0 +1,142 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2011 UCLA
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author:  Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "ipv4-rate-l3-tracer.h"
+#include "ns3/node.h"
+#include "ns3/packet.h"
+#include "ns3/config.h"
+#include "ns3/callback.h"
+#include "ns3/simulator.h"
+
+#include "ns3/ipv4-header.h"
+
+namespace ns3 {
+    
+Ipv4RateL3Tracer::Ipv4RateL3Tracer (std::ostream &os, Ptr<Node> node)
+  : Ipv4L3Tracer (node)
+  , m_os (os)
+{
+  SetAveragingPeriod (Seconds (1.0));
+}
+
+Ipv4RateL3Tracer::~Ipv4RateL3Tracer ()
+{
+  m_printEvent.Cancel ();
+}
+
+void
+Ipv4RateL3Tracer::SetAveragingPeriod (const Time &period)
+{
+  m_period = period;
+  m_printEvent.Cancel ();
+  m_printEvent = Simulator::Schedule (m_period, &Ipv4RateL3Tracer::PeriodicPrinter, this);
+}
+
+void
+Ipv4RateL3Tracer::PeriodicPrinter ()
+{
+  Print (m_os);
+  Reset ();
+  
+  m_printEvent = Simulator::Schedule (m_period, &Ipv4RateL3Tracer::PeriodicPrinter, this);
+}
+
+void
+Ipv4RateL3Tracer::PrintHeader (std::ostream &os) const
+{
+  os << "Time" << "\t"
+
+     << "Node" << "\t"
+     << "Interface" << "\t"
+
+     << "Type" << "\t"
+     << "Packets" << "\t"
+     << "Kilobytes";
+}
+
+void
+Ipv4RateL3Tracer::Reset ()
+{
+  for (std::map<uint32_t, boost::tuple<Stats, Stats, Stats, Stats> >::iterator stats = m_stats.begin ();
+       stats != m_stats.end ();
+       stats++)
+    {
+      stats->second.get<0> ().Reset ();
+      stats->second.get<1> ().Reset ();
+    }
+}
+
+const double alpha = 0.8;
+
+#define STATS(INDEX) stats->second.get<INDEX> ()
+#define RATE(INDEX, fieldName) STATS(INDEX).fieldName / m_period.ToDouble (Time::S)
+
+#define PRINTER(printName, fieldName) \
+STATS(2).fieldName = /*new value*/alpha * RATE(0, fieldName) + /*old value*/(1-alpha) * STATS(2).fieldName; \
+STATS(3).fieldName = /*new value*/alpha * RATE(1, fieldName) / 1024.0 + /*old value*/(1-alpha) * STATS(3).fieldName; \
+                                                                        \
+os << time.ToDouble (Time::S) << "\t"                                   \
+ << m_node << "\t"                                                      \
+ << stats->first << "\t"                                      \
+ << printName << "\t"                                                   \
+ << STATS(2).fieldName  << "\t"                                        \
+ << STATS(3).fieldName << "\n";
+
+void
+Ipv4RateL3Tracer::Print (std::ostream &os) const
+{
+  for (std::map<uint32_t, boost::tuple<Stats, Stats, Stats, Stats> >::iterator stats = m_stats.begin ();
+       stats != m_stats.end ();
+       stats++)
+    {
+      Time time = Simulator::Now ();
+
+      PRINTER ("In",   m_in);
+      PRINTER ("Out",  m_out);
+      PRINTER ("Drop", m_drop);
+    }
+}
+
+void
+Ipv4RateL3Tracer::Rx  (std::string context,
+                       Ptr<const Packet> packet, Ptr<Ipv4> ipv4,  uint32_t iface)
+{
+  m_stats[iface].get<0> ().m_in ++;
+  m_stats[iface].get<1> ().m_in += packet->GetSize ();
+}
+
+void
+Ipv4RateL3Tracer::Tx   (std::string context,
+                        Ptr<const Packet> packet, Ptr<Ipv4> ipv4,  uint32_t iface)
+{
+  m_stats[iface].get<0> ().m_out ++;
+  m_stats[iface].get<1> ().m_out += packet->GetSize ();
+}
+
+void
+Ipv4RateL3Tracer::Drop (std::string context,
+                        const Ipv4Header &header, Ptr<const Packet> packet, Ipv4L3Protocol::DropReason, Ptr<Ipv4> ipv4, uint32_t iface)
+{
+  m_stats[iface].get<0> ().m_drop ++;
+  m_stats[iface].get<1> ().m_drop += packet->GetSize ();
+}
+
+
+} // namespace ns3
