diff --git a/tests/unit-tests/test-data.cpp b/tests/unit-tests/test-data.cpp
index 2493b89..2f8329b 100644
--- a/tests/unit-tests/test-data.cpp
+++ b/tests/unit-tests/test-data.cpp
@@ -120,6 +120,19 @@
   0x0a, 0xb6
 };
 
+const uint8_t DataWithLocalControlHeader[] = {
+  0x50, 0x29, 0x53, 0x02, 0x60, 0x00,
+  0x06, 0x23, 0x07, 0x03, 0x08, 0x01, 0x41, 0x14, 0x04, 0x19, 0x02, 0x27, 0x10, 0x15,
+  0x09, 0x73, 0x6F, 0x6D, 0x65, 0x44, 0x61, 0x74, 0x61, 0x00, 0x16, 0x05, 0x1B, 0x01,
+  0x01, 0x1C, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
+};
+
+const uint8_t DataWithoutLocalControlHeader[] = {
+  0x06, 0x23, 0x07, 0x03, 0x08, 0x01, 0x41, 0x14, 0x04, 0x19, 0x02, 0x27, 0x10, 0x15,
+  0x09, 0x73, 0x6F, 0x6D, 0x65, 0x44, 0x61, 0x74, 0x61, 0x00, 0x16, 0x05, 0x1B, 0x01,
+  0x01, 0x1C, 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x00
+};
+
 BOOST_AUTO_TEST_CASE(DataEqualityChecks)
 {
   using namespace time;
@@ -200,6 +213,114 @@
   BOOST_CHECK_EQUAL(a != b, false);
 }
 
+BOOST_AUTO_TEST_CASE(EncodeWithLocalHeader)
+{
+  Data data("ndn:/A");
+  data.setFreshnessPeriod(time::seconds(10));
+  static const uint8_t someData[] = "someData";
+  data.setContent(someData, sizeof(someData));
+  data.setSignature(SignatureSha256WithRsa());
+  data.setCachingPolicy(nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
+
+  BOOST_CHECK(!data.hasWire());
+
+  Block headerBlock =
+    data.getLocalControlHeader().wireEncode(data, nfd::LocalControlHeader::ENCODE_CACHING_POLICY);
+
+  BOOST_CHECK(data.hasWire());
+  BOOST_CHECK(headerBlock.hasWire());
+
+  BOOST_CHECK_NE(headerBlock.wire(), data.wireEncode().wire());
+  BOOST_CHECK_NE(headerBlock.size(), data.wireEncode().size());
+  BOOST_CHECK_EQUAL(headerBlock.size(), 6);
+
+  BOOST_CHECK_EQUAL_COLLECTIONS(DataWithLocalControlHeader,
+                                DataWithLocalControlHeader + 6,
+                                headerBlock.begin(), headerBlock.end());
+
+  data.setFreshnessPeriod(time::seconds(1000));
+
+  Block updatedHeaderBlock = data.getLocalControlHeader()
+                                 .wireEncode(data, nfd::LocalControlHeader::ENCODE_CACHING_POLICY);
+  BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 6);
+
+  // only length should have changed
+  BOOST_CHECK_EQUAL_COLLECTIONS(updatedHeaderBlock.begin() + 2, updatedHeaderBlock.end(),
+                                headerBlock.begin() + 2,        headerBlock.end());
+
+  // adding IncomingFaceId
+  data.setIncomingFaceId(10);
+  updatedHeaderBlock =
+    data.getLocalControlHeader().wireEncode(data, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID
+                                                  | nfd::LocalControlHeader::ENCODE_CACHING_POLICY);
+  BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 9);
+
+  // masking CachingPolicy
+  updatedHeaderBlock = data.getLocalControlHeader()
+                           .wireEncode(data, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID);
+  BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 5);
+
+  // masking everything
+  BOOST_CHECK_THROW(data.getLocalControlHeader()
+                        .wireEncode(data, nfd::LocalControlHeader::ENCODE_NONE),
+                    nfd::LocalControlHeader::Error);
+}
+
+BOOST_AUTO_TEST_CASE(DecodeWithLocalHeader)
+{
+  Block wireBlock(DataWithLocalControlHeader, sizeof(DataWithLocalControlHeader));
+  const Block& payload = nfd::LocalControlHeader::getPayload(wireBlock);
+  BOOST_REQUIRE_NE(&payload, &wireBlock);
+
+  BOOST_CHECK_EQUAL(payload.type(), static_cast<uint32_t>(tlv::Data));
+  BOOST_CHECK_EQUAL(wireBlock.type(), static_cast<uint32_t>(tlv::nfd::LocalControlHeader));
+
+  Data data(payload);
+  BOOST_CHECK(!data.getLocalControlHeader().hasCachingPolicy());
+  BOOST_CHECK(!data.getLocalControlHeader().hasIncomingFaceId());
+
+  data.getLocalControlHeader().wireDecode(wireBlock);
+
+  BOOST_CHECK_EQUAL(data.getLocalControlHeader()
+                        .wireEncode(data, nfd::LocalControlHeader::ENCODE_CACHING_POLICY).size(),
+                    6);
+
+  BOOST_CHECK(data.getLocalControlHeader().hasCachingPolicy());
+  BOOST_CHECK(!data.getLocalControlHeader().hasIncomingFaceId());
+
+  BOOST_CHECK_THROW(data.getLocalControlHeader()
+                        .wireEncode(data, nfd::LocalControlHeader::ENCODE_NONE),
+                    nfd::LocalControlHeader::Error);
+
+  BOOST_CHECK_THROW(data.getLocalControlHeader()
+                        .wireEncode(data, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID),
+                    nfd::LocalControlHeader::Error);
+
+  BOOST_CHECK_NO_THROW(data.getLocalControlHeader()
+                           .wireEncode(data, nfd::LocalControlHeader::ENCODE_CACHING_POLICY));
+  BOOST_CHECK_NO_THROW(
+    data.getLocalControlHeader().wireEncode(data, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                                  nfd::LocalControlHeader::ENCODE_CACHING_POLICY));
+
+  BOOST_CHECK_NE((void*)data.getLocalControlHeader()
+                            .wireEncode(data, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                              nfd::LocalControlHeader::ENCODE_CACHING_POLICY)
+                            .wire(),
+                 (void*)wireBlock.wire());
+
+  BOOST_CHECK_EQUAL(data.getLocalControlHeader()
+                        .wireEncode(data, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                          nfd::LocalControlHeader::ENCODE_CACHING_POLICY).size(),
+                    6);
+}
+
+BOOST_AUTO_TEST_CASE(DecodeWithoutLocalHeader)
+{
+  Block wireBlock(DataWithoutLocalControlHeader, sizeof(DataWithoutLocalControlHeader));
+  const Block& payload = nfd::LocalControlHeader::getPayload(wireBlock);
+  BOOST_CHECK_EQUAL(&payload, &wireBlock);
+}
+
 class TestDataFixture
 {
 public:
diff --git a/tests/unit-tests/test-face.cpp b/tests/unit-tests/test-face.cpp
index b519d5c..e901e54 100644
--- a/tests/unit-tests/test-face.cpp
+++ b/tests/unit-tests/test-face.cpp
@@ -367,6 +367,7 @@
   Interest i("/Hello/World");
   i.setNextHopFaceId(1000);
   i.setIncomingFaceId(2000);
+  i.getLocalControlHeader().setCachingPolicy(nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
 
   face->expressInterest(i, bind([]{}), bind([]{}));
   advanceClocks(time::milliseconds(10));
@@ -375,6 +376,7 @@
   // only NextHopFaceId is allowed to go out
   BOOST_CHECK(face->sentInterests[0].getLocalControlHeader().hasNextHopFaceId());
   BOOST_CHECK(!face->sentInterests[0].getLocalControlHeader().hasIncomingFaceId());
+  BOOST_CHECK(!face->sentInterests[0].getLocalControlHeader().hasCachingPolicy());
   BOOST_CHECK_EQUAL(face->sentInterests[0].getNextHopFaceId(), 1000);
 }
 
@@ -384,8 +386,11 @@
                           [] (const InterestFilter&, const Interest& i) {
                             BOOST_CHECK(i.getLocalControlHeader().hasNextHopFaceId());
                             BOOST_CHECK(i.getLocalControlHeader().hasIncomingFaceId());
+                            BOOST_CHECK(i.getLocalControlHeader().hasCachingPolicy());
                             BOOST_CHECK_EQUAL(i.getNextHopFaceId(), 1000);
                             BOOST_CHECK_EQUAL(i.getIncomingFaceId(), 2000);
+                            BOOST_CHECK_EQUAL(i.getLocalControlHeader().getCachingPolicy(),
+                                              nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
                           },
                           bind([]{}),
                           bind([] {
@@ -396,6 +401,7 @@
   Interest i("/Hello/World/!");
   i.setNextHopFaceId(1000);
   i.setIncomingFaceId(2000);
+  i.getLocalControlHeader().setCachingPolicy(nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
 
   face->receive(i);
   advanceClocks(time::milliseconds(10));
@@ -405,8 +411,8 @@
 {
   shared_ptr<Data> d = util::makeData("/Bye/World/!");
   d->setIncomingFaceId(2000);
-  d->getLocalControlHeader().setNextHopFaceId(1000); // setNextHopFaceId is intentionally
-                                                     // not exposed directly
+  d->getLocalControlHeader().setNextHopFaceId(1000);
+  d->setCachingPolicy(nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
 
   face->put(*d);
   advanceClocks(time::milliseconds(10));
@@ -414,6 +420,9 @@
   BOOST_REQUIRE_EQUAL(face->sentDatas.size(), 1);
   BOOST_CHECK(!face->sentDatas[0].getLocalControlHeader().hasNextHopFaceId());
   BOOST_CHECK(!face->sentDatas[0].getLocalControlHeader().hasIncomingFaceId());
+  BOOST_CHECK(face->sentDatas[0].getLocalControlHeader().hasCachingPolicy());
+  BOOST_CHECK_EQUAL(face->sentDatas[0].getCachingPolicy(),
+                    nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
 }
 
 BOOST_AUTO_TEST_CASE(ReceiveDataWithLocalControlHeader)
@@ -422,6 +431,9 @@
                         [&] (const Interest& i, const Data& d) {
                           BOOST_CHECK(d.getLocalControlHeader().hasNextHopFaceId());
                           BOOST_CHECK(d.getLocalControlHeader().hasIncomingFaceId());
+                          BOOST_CHECK(d.getLocalControlHeader().hasCachingPolicy());
+                          BOOST_CHECK_EQUAL(d.getCachingPolicy(),
+                                            nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
                           BOOST_CHECK_EQUAL(d.getIncomingFaceId(), 2000);
                           BOOST_CHECK_EQUAL(d.getLocalControlHeader().getNextHopFaceId(), 1000);
                         },
@@ -433,8 +445,8 @@
 
   shared_ptr<Data> d = util::makeData("/Hello/World/!");
   d->setIncomingFaceId(2000);
-  d->getLocalControlHeader().setNextHopFaceId(1000); // setNextHopFaceId is intentionally
-                                                     // not exposed directly
+  d->getLocalControlHeader().setNextHopFaceId(1000);
+  d->setCachingPolicy(nfd::LocalControlHeader::CachingPolicy::NO_CACHE);
   face->receive(*d);
 
   advanceClocks(time::milliseconds(10), 100);
diff --git a/tests/unit-tests/test-interest.cpp b/tests/unit-tests/test-interest.cpp
index 71d6d29..7151c56 100644
--- a/tests/unit-tests/test-interest.cpp
+++ b/tests/unit-tests/test-interest.cpp
@@ -365,7 +365,10 @@
 
   BOOST_CHECK(!interest.hasWire());
 
-  Block headerBlock = interest.getLocalControlHeader().wireEncode(interest, true, true);
+  Block headerBlock =
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP);
 
   BOOST_CHECK(interest.hasWire());
   BOOST_CHECK(headerBlock.hasWire());
@@ -380,7 +383,10 @@
 
   interest.setNonce(1000);
 
-  Block updatedHeaderBlock = interest.getLocalControlHeader().wireEncode(interest, true, true);
+  Block updatedHeaderBlock =
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP);
   BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 5);
 
   // only length should have changed
@@ -389,30 +395,43 @@
 
   // updating IncomingFaceId that keeps the length
   interest.setIncomingFaceId(100);
-  updatedHeaderBlock = interest.getLocalControlHeader().wireEncode(interest, true, true);
+  updatedHeaderBlock =
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP);
   BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 5);
   BOOST_CHECK_NE(*(updatedHeaderBlock.begin() + 4), *(headerBlock.begin() + 4));
 
   // updating IncomingFaceId that increases the length by 2
   interest.setIncomingFaceId(1000);
-  updatedHeaderBlock = interest.getLocalControlHeader().wireEncode(interest, true, true);
+  updatedHeaderBlock =
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP);
   BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 6);
 
   // adding NextHopId
   interest.setNextHopFaceId(1);
-  updatedHeaderBlock = interest.getLocalControlHeader().wireEncode(interest, true, true);
+  updatedHeaderBlock =
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP);
   BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 9);
 
   // masking IncomingFaceId
-  updatedHeaderBlock = interest.getLocalControlHeader().wireEncode(interest, false, true);
+  updatedHeaderBlock = interest.getLocalControlHeader()
+                               .wireEncode(interest, nfd::LocalControlHeader::ENCODE_NEXT_HOP);
   BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 5);
 
   // masking NextHopId
-  updatedHeaderBlock = interest.getLocalControlHeader().wireEncode(interest, true, false);
+  updatedHeaderBlock =
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID);
   BOOST_CHECK_EQUAL(updatedHeaderBlock.size(), 6);
 
   // masking everything
-  BOOST_CHECK_THROW(interest.getLocalControlHeader().wireEncode(interest, false, false),
+  BOOST_CHECK_THROW(interest.getLocalControlHeader()
+                            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_NONE),
                     nfd::LocalControlHeader::Error);
 }
 
@@ -432,24 +451,42 @@
 
   BOOST_REQUIRE_NO_THROW(interest.getLocalControlHeader().wireDecode(wireBlock));
 
-  BOOST_CHECK_EQUAL(interest.getLocalControlHeader().wireEncode(interest, true, true).size(), 5);
+  BOOST_CHECK_EQUAL(
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP).size(),
+    5);
 
   BOOST_CHECK_EQUAL(interest.getIncomingFaceId(), 10);
   BOOST_CHECK(!interest.getLocalControlHeader().hasNextHopFaceId());
 
-  BOOST_CHECK_THROW(interest.getLocalControlHeader().wireEncode(interest, false, false),
+  BOOST_CHECK_THROW(interest.getLocalControlHeader()
+                            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_NONE),
                     nfd::LocalControlHeader::Error);
 
-  BOOST_CHECK_THROW(interest.getLocalControlHeader().wireEncode(interest, false, true),
+  BOOST_CHECK_THROW(interest.getLocalControlHeader()
+                            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_NEXT_HOP),
                     nfd::LocalControlHeader::Error);
 
-  BOOST_CHECK_NO_THROW(interest.getLocalControlHeader().wireEncode(interest, true, false));
-  BOOST_CHECK_NO_THROW(interest.getLocalControlHeader().wireEncode(interest, true, true));
+  BOOST_CHECK_NO_THROW(
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID));
+  BOOST_CHECK_NO_THROW(
+    interest.getLocalControlHeader()
+            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP));
 
-  BOOST_CHECK_NE((void*)interest.getLocalControlHeader().wireEncode(interest, true, true).wire(),
-                 (void*)wireBlock.wire());
+  BOOST_CHECK_NE(
+    (void*)interest.getLocalControlHeader()
+                   .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                         nfd::LocalControlHeader::ENCODE_NEXT_HOP)
+                   .wire(),
+    (void*)wireBlock.wire());
 
-  BOOST_CHECK_EQUAL(interest.getLocalControlHeader().wireEncode(interest, true, true).size(), 5);
+  BOOST_CHECK_EQUAL(interest.getLocalControlHeader()
+                            .wireEncode(interest, nfd::LocalControlHeader::ENCODE_INCOMING_FACE_ID |
+                                                  nfd::LocalControlHeader::ENCODE_NEXT_HOP).size(),
+                    5);
 }
 
 BOOST_AUTO_TEST_CASE(DecodeWithoutLocalHeader)
