diff --git a/install_helpers/tools/test-congestionmark-producer.cpp b/install_helpers/tools/test-congestionmark-producer.cpp
new file mode 100644
index 0000000..c83d15d
--- /dev/null
+++ b/install_helpers/tools/test-congestionmark-producer.cpp
@@ -0,0 +1,76 @@
+/*
+ * Producer for CongestionMark test (test_congestionmark)
+ *
+ * Receives Interests for a specified prefix and returns a Data packet with the same congestion mark
+ * as the corresponding Interest.
+ *
+ * Author: Eric Newberry <enewberry@cs.arizona.edu>
+ *
+ * Based on ndn-cxx example producer
+ */
+
+#include <ndn-cxx/face.hpp>
+#include <ndn-cxx/interest.hpp>
+#include <ndn-cxx/interest-filter.hpp>
+#include <ndn-cxx/lp/tags.hpp>
+#include <ndn-cxx/security/key-chain.hpp>
+
+using namespace ndn;
+
+class TestCongestionMarkProducer
+{
+public:
+  void
+  run(std::string prefix)
+  {
+    m_face.setInterestFilter(prefix,
+                             bind(&TestCongestionMarkProducer::onInterest, this, _1, _2),
+                             RegisterPrefixSuccessCallback(),
+                             bind(&TestCongestionMarkProducer::onRegisterFailed, this, _1, _2));
+    m_face.processEvents();
+  }
+
+private:
+  void
+  onInterest(const InterestFilter& filter, const Interest& i)
+  {
+    static const std::string content = "0123456789";
+    shared_ptr<Data> data = make_shared<Data>();
+    data->setName(i.getName());
+    data->setFreshnessPeriod(time::seconds(10));
+    data->setContent(reinterpret_cast<const uint8_t*>(content.c_str()), content.size());
+    data->setCongestionMark(i.getCongestionMark());
+    m_keyChain.sign(*data);
+    m_face.put(*data);
+  }
+
+  void
+  onRegisterFailed(const Name& prefix, const std::string& reason)
+  {
+    std::cerr << "Failed to register prefix " << prefix << " (reason: " + reason + ")" << std::endl;
+    m_face.shutdown();
+  }
+
+private:
+  Face m_face;
+  KeyChain m_keyChain;
+};
+
+int
+main(int argc, char** argv)
+{
+  if (argc != 2) {
+    return 2;
+  }
+
+  try {
+    TestCongestionMarkProducer producer;
+    producer.run(argv[1]);
+  }
+  catch (const std::exception& e) {
+    std::cerr << "ERROR: " << e.what() << std::endl;
+    return 1;
+  }
+
+  return 0;
+}
