diff --git a/src/mgmt/nfd/face-status.cpp b/src/mgmt/nfd/face-status.cpp
index 0a284cd..0c127ae 100644
--- a/src/mgmt/nfd/face-status.cpp
+++ b/src/mgmt/nfd/face-status.cpp
@@ -32,9 +32,7 @@
 BOOST_CONCEPT_ASSERT((StatusDatasetItem<FaceStatus>));
 
 FaceStatus::FaceStatus()
-  : m_baseCongestionMarkingInterval(0)
-  , m_defaultCongestionThreshold(0)
-  , m_nInInterests(0)
+  : m_nInInterests(0)
   , m_nInData(0)
   , m_nInNacks(0)
   , m_nOutInterests(0)
@@ -65,10 +63,14 @@
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInNacks, m_nInNacks);
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInData, m_nInData);
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::NInInterests, m_nInInterests);
-  totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::DefaultCongestionThreshold,
-                                                m_defaultCongestionThreshold);
-  totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::BaseCongestionMarkingInterval,
-                                                m_baseCongestionMarkingInterval.count());
+  if (m_defaultCongestionThreshold) {
+    totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::DefaultCongestionThreshold,
+                                                  *m_defaultCongestionThreshold);
+  }
+  if (m_baseCongestionMarkingInterval) {
+    totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::BaseCongestionMarkingInterval,
+                                                  m_baseCongestionMarkingInterval->count());
+  }
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::LinkType, m_linkType);
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FacePersistency, m_facePersistency);
   totalLength += prependNonNegativeIntegerBlock(encoder, tlv::nfd::FaceScope, m_faceScope);
@@ -170,11 +172,11 @@
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::BaseCongestionMarkingInterval) {
-    m_baseCongestionMarkingInterval = time::nanoseconds(readNonNegativeInteger(*val));
+    m_baseCongestionMarkingInterval.emplace(readNonNegativeInteger(*val));
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required BaseCongestionMarkingInterval field"));
+    m_baseCongestionMarkingInterval = nullopt;
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::DefaultCongestionThreshold) {
@@ -182,7 +184,7 @@
     ++val;
   }
   else {
-    BOOST_THROW_EXCEPTION(Error("missing required DefaultCongestionThreshold field"));
+    m_defaultCongestionThreshold = nullopt;
   }
 
   if (val != m_wire.elements_end() && val->type() == tlv::nfd::NInInterests) {
@@ -283,6 +285,14 @@
 }
 
 FaceStatus&
+FaceStatus::unsetBaseCongestionMarkingInterval()
+{
+  m_wire.reset();
+  m_baseCongestionMarkingInterval = nullopt;
+  return *this;
+}
+
+FaceStatus&
 FaceStatus::setDefaultCongestionThreshold(uint64_t threshold)
 {
   m_wire.reset();
@@ -291,6 +301,14 @@
 }
 
 FaceStatus&
+FaceStatus::unsetDefaultCongestionThreshold()
+{
+  m_wire.reset();
+  m_defaultCongestionThreshold = nullopt;
+  return *this;
+}
+
+FaceStatus&
 FaceStatus::setNInInterests(uint64_t nInInterests)
 {
   m_wire.reset();
@@ -366,8 +384,12 @@
       a.getFlags() == b.getFlags() &&
       a.hasExpirationPeriod() == b.hasExpirationPeriod() &&
       (!a.hasExpirationPeriod() || a.getExpirationPeriod() == b.getExpirationPeriod()) &&
-      a.getBaseCongestionMarkingInterval() == b.getBaseCongestionMarkingInterval() &&
-      a.getDefaultCongestionThreshold() == b.getDefaultCongestionThreshold() &&
+      a.hasBaseCongestionMarkingInterval() == b.hasBaseCongestionMarkingInterval() &&
+      (!a.hasBaseCongestionMarkingInterval() ||
+       a.getBaseCongestionMarkingInterval() == b.getBaseCongestionMarkingInterval()) &&
+      a.hasDefaultCongestionThreshold() == b.hasDefaultCongestionThreshold() &&
+      (!a.hasDefaultCongestionThreshold() ||
+       a.getDefaultCongestionThreshold() == b.getDefaultCongestionThreshold()) &&
       a.getNInInterests() == b.getNInInterests() &&
       a.getNInData() == b.getNInData() &&
       a.getNInNacks() == b.getNInNacks() &&
@@ -394,10 +416,17 @@
 
   os << "     FaceScope: " << status.getFaceScope() << ",\n"
      << "     FacePersistency: " << status.getFacePersistency() << ",\n"
-     << "     LinkType: " << status.getLinkType() << ",\n"
-     << "     BaseCongestionMarkingInterval: " << status.getBaseCongestionMarkingInterval() << ",\n"
-     << "     DefaultCongestionThreshold: " << status.getDefaultCongestionThreshold() << " bytes,\n"
-     << "     Flags: " << AsHex{status.getFlags()} << ",\n"
+     << "     LinkType: " << status.getLinkType() << ",\n";
+
+  if (status.hasBaseCongestionMarkingInterval()) {
+    os << "     BaseCongestionMarkingInterval: " << status.getBaseCongestionMarkingInterval() << ",\n";
+  }
+
+  if (status.hasDefaultCongestionThreshold()) {
+    os << "     DefaultCongestionThreshold: " << status.getDefaultCongestionThreshold() << " bytes,\n";
+  }
+
+  os << "     Flags: " << AsHex{status.getFlags()} << ",\n"
      << "     Counters: {Interests: {in: " << status.getNInInterests() << ", "
      << "out: " << status.getNOutInterests() << "},\n"
      << "                Data: {in: " << status.getNInData() << ", "
