diff --git a/zebra/Makefile.am b/zebra/Makefile.am
index ab09a36..abd3797 100644
--- a/zebra/Makefile.am
+++ b/zebra/Makefile.am
@@ -26,6 +26,10 @@
 protobuf_srcs = zebra_fpm_protobuf.c
 endif
 
+if DEV_BUILD
+dev_srcs = zebra_fpm_dt.c
+endif
+
 AM_CFLAGS = $(WERROR)
 
 sbin_PROGRAMS = zebra
@@ -36,7 +40,7 @@
 	zserv.c main.c interface.c connected.c zebra_rib.c zebra_routemap.c \
 	redistribute.c debug.c rtadv.c zebra_snmp.c zebra_vty.c \
 	irdp_main.c irdp_interface.c irdp_packet.c router-id.c zebra_fpm.c \
-	$(othersrc) $(protobuf_srcs)
+	$(othersrc) $(protobuf_srcs) $(dev_srcs)
 
 testzebra_SOURCES = test_main.c zebra_rib.c interface.c connected.c debug.c \
 	zebra_vty.c \
diff --git a/zebra/zebra_fpm_dt.c b/zebra/zebra_fpm_dt.c
new file mode 100644
index 0000000..bd171c8
--- /dev/null
+++ b/zebra/zebra_fpm_dt.c
@@ -0,0 +1,275 @@
+/*
+ * zebra_fpm_dt.c
+ *
+ * @copyright Copyright (C) 2016 Sproute Networks, Inc.
+ *
+ * @author Avneesh Sachdev <avneesh@sproute.com>
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * GNU Zebra 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 GNU Zebra; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+/*
+ * Developer tests for the zebra code that interfaces with the
+ * forwarding plane manager.
+ *
+ * The functions here are built into developer builds of zebra (when
+ * DEV_BUILD is defined), and can be called via the 'invoke' cli
+ * command.
+ *
+ * For example:
+ *
+ * # invoke zebra function zfpm_dt_benchmark_protobuf_encode 100000
+ *
+ */
+
+#include <zebra.h>
+#include "log.h"
+#include "vrf.h"
+
+#include "zebra/rib.h"
+
+#include "zebra_fpm_private.h"
+
+#include "qpb/qpb_allocator.h"
+#include "qpb/linear_allocator.h"
+
+#include "qpb/qpb.h"
+#include "fpm/fpm.pb-c.h"
+
+/*
+ * Externs.
+ */
+extern int zfpm_dt_benchmark_netlink_encode (int argc, const char **argv);
+extern int zfpm_dt_benchmark_protobuf_encode (int argc, const char **argv);
+extern int zfpm_dt_benchmark_protobuf_decode (int argc, const char **argv);
+
+/*
+ * zfpm_dt_find_route
+ *
+ * Selects a suitable rib destination for fpm interface tests.
+ */
+static int
+zfpm_dt_find_route (rib_dest_t **dest_p, struct rib **rib_p)
+{
+  struct route_node *rnode;
+  route_table_iter_t iter;
+  struct route_table *table;
+  rib_dest_t *dest;
+  struct rib *rib;
+  int ret;
+
+  table = zebra_vrf_table (AFI_IP, SAFI_UNICAST, VRF_DEFAULT);
+  if (!table)
+    return 0;
+
+  route_table_iter_init(&iter, table);
+  while ((rnode = route_table_iter_next(&iter)))
+    {
+      dest = rib_dest_from_rnode (rnode);
+
+      if (!dest)
+	  continue;
+
+      rib = zfpm_route_for_update(dest);
+      if (!rib)
+	continue;
+
+      if (rib->nexthop_active_num <= 0)
+	continue;
+
+      *dest_p = dest;
+      *rib_p = rib;
+      ret = 1;
+      goto done;
+    }
+
+    ret = 0;
+
+  done:
+    route_table_iter_cleanup(&iter);
+    return ret;
+}
+#ifdef HAVE_NETLINK
+
+/*
+ * zfpm_dt_benchmark_netlink_encode
+ */
+int
+zfpm_dt_benchmark_netlink_encode (int argc, const char **argv)
+{
+  int times, i, len;
+  rib_dest_t *dest;
+  struct rib *rib;
+  char buf[4096];
+
+  times = 100000;
+  if (argc > 0) {
+    times = atoi(argv[0]);
+  }
+
+  if (!zfpm_dt_find_route(&dest, &rib)) {
+    return 1;
+  }
+
+  for (i = 0; i < times; i++) {
+    len = zfpm_netlink_encode_route(RTM_NEWROUTE, dest, rib, buf, sizeof(buf));
+    if (len <= 0) {
+      return 2;
+    }
+  }
+  return 0;
+}
+
+#endif /* HAVE_NETLINK */
+
+#ifdef HAVE_PROTOBUF
+
+/*
+ * zfpm_dt_benchmark_protobuf_encode
+ */
+int
+zfpm_dt_benchmark_protobuf_encode (int argc, const char **argv)
+{
+  int times, i, len;
+  rib_dest_t *dest;
+  struct rib *rib;
+  uint8_t buf[4096];
+
+  times = 100000;
+  if (argc > 0) {
+    times = atoi(argv[0]);
+  }
+
+  if (!zfpm_dt_find_route(&dest, &rib)) {
+    return 1;
+  }
+
+  for (i = 0; i < times; i++) {
+    len = zfpm_protobuf_encode_route(dest, rib, buf, sizeof(buf));
+    if (len <= 0) {
+      return 2;
+    }
+  }
+  return 0;
+}
+
+/*
+ * zfpm_dt_log_fpm_message
+ */
+static void
+zfpm_dt_log_fpm_message (Fpm__Message *msg)
+{
+  Fpm__AddRoute *add_route;
+  Fpm__Nexthop *nexthop;
+  struct prefix prefix;
+  u_char family, nh_family;
+  uint if_index;
+  char *if_name;
+  size_t i;
+  char buf[INET6_ADDRSTRLEN];
+  union g_addr nh_addr;
+
+  if (msg->type != FPM__MESSAGE__TYPE__ADD_ROUTE)
+    return;
+
+  zfpm_debug ("Add route message");
+  add_route = msg->add_route;
+
+  if (!qpb_address_family_get (add_route->address_family, &family))
+    return;
+
+  if (!qpb_l3_prefix_get (add_route->key->prefix, family, &prefix))
+    return;
+
+  zfpm_debug ("Vrf id: %d, Prefix: %s/%d, Metric: %d", add_route->vrf_id,
+	      inet_ntop (family, &prefix.u.prefix, buf, sizeof (buf)),
+	      prefix.prefixlen, add_route->metric);
+
+  /*
+   * Go over nexthops.
+   */
+  for (i = 0; i < add_route->n_nexthops; i++)
+    {
+      nexthop = add_route->nexthops[i];
+      if (!qpb_if_identifier_get (nexthop->if_id, &if_index, &if_name))
+	continue;
+
+      if (nexthop->address)
+	qpb_l3_address_get (nexthop->address, &nh_family, &nh_addr);
+
+      zfpm_debug ("Nexthop - if_index: %d (%s), gateway: %s, ", if_index,
+		  if_name ? if_name : "name not specified",
+		  nexthop->address ? inet_ntoa (nh_addr.ipv4) : "None");
+    }
+}
+
+/*
+ * zfpm_dt_benchmark_protobuf_decode
+ */
+int
+zfpm_dt_benchmark_protobuf_decode (int argc, const char **argv)
+{
+  int times, i, len;
+  rib_dest_t *dest;
+  struct rib *rib;
+  uint8_t msg_buf[4096];
+  QPB_DECLARE_STACK_ALLOCATOR (allocator, 8192);
+  Fpm__Message *fpm_msg;
+
+  QPB_INIT_STACK_ALLOCATOR (allocator);
+
+  times = 100000;
+  if (argc > 0)
+    times = atoi(argv[0]);
+
+  if (!zfpm_dt_find_route (&dest, &rib))
+    return 1;
+
+  /*
+   * Encode the route into the message buffer once only.
+   */
+  len = zfpm_protobuf_encode_route (dest, rib, msg_buf, sizeof (msg_buf));
+  if (len <= 0)
+    return 2;
+
+  // Decode once, and display the decoded message
+  fpm_msg = fpm__message__unpack(&allocator, len, msg_buf);
+
+  if (fpm_msg)
+    {
+      zfpm_dt_log_fpm_message(fpm_msg);
+      QPB_RESET_STACK_ALLOCATOR (allocator);
+    }
+
+  /*
+   * Decode encoded message the specified number of times.
+   */
+  for (i = 0; i < times; i++)
+    {
+      fpm_msg = fpm__message__unpack (&allocator, len, msg_buf);
+
+      if (!fpm_msg)
+	return 3;
+
+      // fpm__message__free_unpacked(msg, NULL);
+      QPB_RESET_STACK_ALLOCATOR (allocator);
+  }
+  return 0;
+}
+
+#endif /* HAVE_PROTOBUF */
