diff --git a/src/data.hpp b/src/data.hpp
index 078938a..b12061b 100644
--- a/src/data.hpp
+++ b/src/data.hpp
@@ -310,7 +310,7 @@
   bool
   operator!=(const Data& other) const;
 
-private:
+protected:
   /**
    * @brief Clear the wire encoding.
    */
diff --git a/src/encoding/tlv.hpp b/src/encoding/tlv.hpp
index 01a8679..da7b8ea 100644
--- a/src/encoding/tlv.hpp
+++ b/src/encoding/tlv.hpp
@@ -84,6 +84,9 @@
   SignatureType = 27,
   KeyLocator    = 28,
   KeyDigest     = 29,
+  LinkPreference = 30,
+  LinkDelegation = 31,
+  SelectedDelegation = 32,
 
   AppPrivateBlock1 = 128,
   AppPrivateBlock2 = 32767
diff --git a/src/link.cpp b/src/link.cpp
new file mode 100644
index 0000000..07ac0d9
--- /dev/null
+++ b/src/link.cpp
@@ -0,0 +1,199 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2015 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#include "link.hpp"
+#include "interest.hpp"
+#include "encoding/block-helpers.hpp"
+#include "util/crypto.hpp"
+#include "security/key-chain.hpp"
+#include "util/concepts.hpp"
+
+#include <algorithm>
+
+#include <boost/range/adaptors.hpp>
+
+namespace ndn {
+
+BOOST_CONCEPT_ASSERT((boost::EqualityComparable<Link>));
+BOOST_CONCEPT_ASSERT((WireEncodable<Link>));
+BOOST_CONCEPT_ASSERT((WireDecodable<Link>));
+static_assert(std::is_base_of<Data::Error, Link::Error>::value,
+              "Link::Error should inherit from Data::Error");
+
+Link::Link(const Block& block)
+{
+  wireDecode(block);
+}
+
+Link::Link(const Name& name)
+  : Data(name)
+{
+}
+
+Link::Link(const Name& name, std::initializer_list<std::pair<uint32_t, Name>> links)
+  : Data(name)
+{
+  m_delegations.insert(links);
+  encodeContent();
+}
+
+void
+Link::addDelegation(uint32_t preference, const Name& name)
+{
+  this->removeDelegationNoEncode(name);
+  m_delegations.insert({preference, name});
+  encodeContent();
+}
+
+bool
+Link::removeDelegation(const Name& name)
+{
+  bool hasRemovedDelegation = this->removeDelegationNoEncode(name);
+  if (hasRemovedDelegation) {
+    encodeContent();
+  }
+  return hasRemovedDelegation;
+}
+
+const Link::DelegationSet&
+Link::getDelegations() const
+{
+  return m_delegations;
+}
+
+template<encoding::Tag TAG>
+size_t
+Link::encodeContent(EncodingImpl<TAG>& encoder) const
+{
+  // LinkContent ::= CONTENT-TYPE TLV-LENGTH
+  //                    Delegation+
+
+  // Delegation ::= LINK-DELEGATION-TYPE TLV-LENGTH
+  //              Preference
+  //              Name
+
+  // Preference ::= LINK-PREFERENCE-TYPE TLV-LENGTH
+  //       nonNegativeInteger
+
+  size_t totalLength = 0;
+  for (const auto& delegation : m_delegations |  boost::adaptors::reversed) {
+    size_t delegationLength = 0;
+    delegationLength += std::get<1>(delegation).wireEncode(encoder);
+    delegationLength += prependNonNegativeIntegerBlock(encoder, tlv::LinkPreference,
+                                                       std::get<0>(delegation));
+    delegationLength += encoder.prependVarNumber(delegationLength);
+    delegationLength += encoder.prependVarNumber(tlv::LinkDelegation);
+    totalLength += delegationLength;
+  }
+  totalLength += encoder.prependVarNumber(totalLength);
+  totalLength += encoder.prependVarNumber(tlv::Content);
+  return totalLength;
+}
+
+template size_t
+Link::encodeContent<encoding::EncoderTag>(EncodingImpl<encoding::EncoderTag>&) const;
+
+template size_t
+Link::encodeContent<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>&) const;
+
+void
+Link::encodeContent()
+{
+  onChanged();
+
+  EncodingEstimator estimator;
+  size_t estimatedSize = encodeContent(estimator);
+
+  EncodingBuffer buffer(estimatedSize, 0);
+  encodeContent(buffer);
+
+  setContentType(tlv::ContentType_Link);
+  setContent(buffer.block());
+}
+
+void
+Link::decodeContent()
+{
+  // LinkContent ::= CONTENT-TYPE TLV-LENGTH
+  //                    Delegation+
+
+  // Delegation ::= LINK-DELEGATION-TYPE TLV-LENGTH
+  //              Preference
+  //              Name
+
+  // Preference ::= LINK-PREFERENCE-TYPE TLV-LENGTH
+  //       nonNegativeInteger
+
+  if (getContentType() != tlv::ContentType_Link)
+    {
+      throw Error("Expected Content Type Link");
+    }
+
+  const Block& content = getContent();
+  content.parse();
+
+  for (auto& delegation : content.elements()) {
+    delegation.parse();
+    Block::element_const_iterator val = delegation.elements_begin();
+    if (val == delegation.elements_end()) {
+      throw Error("Unexpected Link Encoding");
+    }
+    uint32_t preference;
+    try {
+      preference = static_cast<uint32_t>(readNonNegativeInteger(*val));
+    }
+    catch (tlv::Error&) {
+      throw Error("Missing preference field in Link Encoding");
+    }
+    ++val;
+    if (val == delegation.elements_end()) {
+      throw Error("Missing name field in Link Encoding");
+    }
+    Name name(*val);
+    m_delegations.insert({preference, name});
+  }
+}
+
+void
+Link::wireDecode(const Block& wire)
+{
+  Data::wireDecode(wire);
+  decodeContent();
+}
+
+bool
+Link::removeDelegationNoEncode(const Name& name)
+{
+  bool hasRemoved = false;
+  auto i = m_delegations.begin();
+  while (i != m_delegations.end()) {
+    if (i->second == name) {
+      hasRemoved = true;
+      i = m_delegations.erase(i);
+    }
+    else {
+      ++i;
+    }
+  }
+  return hasRemoved;
+}
+
+} // namespace ndn
diff --git a/src/link.hpp b/src/link.hpp
new file mode 100644
index 0000000..3ccb7a3
--- /dev/null
+++ b/src/link.hpp
@@ -0,0 +1,161 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2015 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library 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 Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ */
+
+#ifndef NDN_LINK_HPP
+#define NDN_LINK_HPP
+
+#include "data.hpp"
+#include <set>
+
+namespace ndn {
+
+const size_t INVALID_SELECTED_DELEGATION_INDEX = std::numeric_limits<size_t>::max();
+
+/** @brief represents a Link instance
+ */
+class Link : public Data
+{
+public:
+  class Error : public Data::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : Data::Error(what)
+    {
+    }
+  };
+
+  // The ordering is based on the preference number and needs to be preserved
+  typedef std::set<std::pair<uint32_t, Name>> DelegationSet;
+
+  /**
+   * @brief Create an empty Link object
+   *
+   * Note that in certain contexts that use Link::shared_from_this(), Link must be
+   * created using `make_shared`:
+   *
+   *     shared_ptr<Link> linkObject = make_shared<Link>();
+   *
+   * Otherwise, Link::shared_from_this() will throw std::bad_weak_ptr.
+   */
+  Link() = default;
+
+  /**
+   * @brief Create a Link object from a Block
+   *
+   * Note that in certain contexts that use Link::shared_from_this(), Link must be
+   * created using `make_shared`:
+   *
+   *     shared_ptr<Link> linkObject = make_shared<Link>(block);
+   *
+   * Otherwise, Link::shared_from_this() will throw std::bad_weak_ptr.
+   */
+  explicit
+  Link(const Block& block);
+
+  /**
+   * @brief Create a Link object with the given name
+   *
+   * @param name A reference to the name of the redirected namespace
+   *
+   * Note that in certain contexts that use Link::shared_from_this(), Link must be
+   * created using `make_shared`:
+   *
+   *     shared_ptr<Link> link = make_shared<Link>(name);
+   *
+   * Otherwise, Link::shared_from_this() will throw std::bad_weak_ptr.
+   */
+  explicit
+  Link(const Name& name);
+
+ /**
+   * @brief Create a Link object with the given name and pairs of <Preference, Name>
+   *
+   * @param name A reference to the name of the redirected namespace
+   * @param links A reference to the list of pairs of the redirected namespace
+   * along with its priority
+   *
+   * Note that in certain contexts that use Link::shared_from_this(), Link must be
+   * created using `make_shared`:
+   *
+   *     shared_ptr<Link> link = make_shared<Link>(name, links);
+   *
+   * Otherwise, Link::shared_from_this() will throw std::bad_weak_ptr.
+   */
+  Link(const Name& name, std::initializer_list<std::pair<uint32_t, Name>> links);
+
+  /**
+   * @brief Add a delegation in the format of <Name, Preference>
+   * @param preference The preference of the delegation to be added
+   * @param name The name of the delegation to be added
+   * @note If a delegation with @p name exists, its preference will be updated
+   */
+  void
+  addDelegation(uint32_t preference, const Name& name);
+
+  /**
+   * @brief Remove a delegation whose name is @p name
+   * @param name The name of the delegation to be removed
+   * @return true if delegation is removed, otherwise false
+   */
+  bool
+  removeDelegation(const Name& name);
+
+  /**
+   * @brief Get the pairs of <Name, Preference>
+   * @return a set of delegations
+   */
+  const DelegationSet&
+  getDelegations() const;
+
+  /**
+   * @brief Decode from the wire format
+   */
+  void
+  wireDecode(const Block& wire);
+
+protected:
+  /** \brief prepend Link object as a Content block to the encoder
+   *
+   *  The outermost Content element is not part of Link object structure.
+   */
+  template<encoding::Tag TAG>
+  size_t
+  encodeContent(EncodingImpl<TAG>& encoder) const;
+
+  void
+  encodeContent();
+
+  void
+  decodeContent();
+
+private:
+  bool
+  removeDelegationNoEncode(const Name& name);
+
+private:
+  DelegationSet m_delegations;
+};
+
+} // namespace ndn
+
+#endif // NDN_LINK_HPP
