diff --git a/tools/chunks/README.md b/tools/chunks/README.md
index 2bdd8ff..0c76fe8 100644
--- a/tools/chunks/README.md
+++ b/tools/chunks/README.md
@@ -17,13 +17,15 @@
                specified prefix and version number. A version component must be present at the
                end of the user-specified NDN name.
 
-* `iterative`: sends a series of interests with ChildSelector set to prefer the
-               rightmost child and Exclude selectors, attempting to find a data packet with the
-               specified prefix and the latest (the largest in the NDN canonical ordering)
-               version number.  The version is declared "latest" after a predefined number of
-               data retrieval timeouts (default: 1).
+* `realtime` : sends discovery interests to fetch metadata of the solicited content from which
+               the data version will be resolved.
+               The version number of the solicited content is included in the name of returned
+               metadata data packet.
+               For more information about the packet format and naming convention of interest and
+               data packets for realtime version discovery, please refer to:
+[Realtime Data Retrieval (RDR) protocol wiki page](https://redmine.named-data.net/projects/ndn-tlv/wiki/RDR)
 
-The default discovery method is `iterative`.
+The default discovery method is `realtime`.
 
 ## Interest pipeline types in ndncatchunks
 
@@ -70,9 +72,9 @@
 
 To retrieve the latest version of a published file, the following command can be used:
 
-    ndncatchunks -d iterative ndn:/localhost/demo/gpl3
+    ndncatchunks ndn:/localhost/demo/gpl3
 
-This command will use the iterative method to discover the latest version of the file.
+This command will use the realtime method to discover the version number of the file.
 
 To fetch a specific version of a published file, you can use the `fixed` version discovery method.
 In this case the version needs to be supplied as part of the name. For example, if the version
diff --git a/tools/chunks/catchunks/discover-version-iterative.cpp b/tools/chunks/catchunks/discover-version-iterative.cpp
deleted file mode 100644
index adeb48e..0000000
--- a/tools/chunks/catchunks/discover-version-iterative.cpp
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2016-2019, Regents of the University of California,
- *                          Colorado State University,
- *                          University Pierre & Marie Curie, Sorbonne University.
- *
- * This file is part of ndn-tools (Named Data Networking Essential Tools).
- * See AUTHORS.md for complete list of ndn-tools authors and contributors.
- *
- * ndn-tools 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 3 of the License, or (at your option) any later version.
- *
- * ndn-tools 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
- * ndn-tools, 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.
- *
- * @author Wentao Shang
- * @author Steve DiBenedetto
- * @author Andrea Tosatto
- * @author Klaus Schneider
- */
-
-#include "discover-version-iterative.hpp"
-
-namespace ndn {
-namespace chunks {
-
-DiscoverVersionIterative::DiscoverVersionIterative(const Name& prefix, Face& face,
-                                                   const Options& options)
-  : chunks::Options(options)
-  , DiscoverVersion(prefix, face)
-  , Options(options)
-  , m_latestVersion(0)
-  , m_foundVersion(false)
-{
-}
-
-void
-DiscoverVersionIterative::run()
-{
-  m_latestVersion = 0;
-  m_foundVersion = false;
-
-  Interest interest(m_prefix);
-  interest.setInterestLifetime(interestLifetime);
-  interest.setMustBeFresh(mustBeFresh);
-  interest.setMinSuffixComponents(3);
-  interest.setMaxSuffixComponents(3);
-  interest.setChildSelector(1);
-
-  expressInterest(interest, maxRetriesOnTimeoutOrNack, maxRetriesOnTimeoutOrNack);
-}
-
-void
-DiscoverVersionIterative::handleData(const Interest& interest, const Data& data)
-{
-  size_t versionindex = m_prefix.size();
-
-  const Name& name = data.getName();
-  Exclude exclude;
-
-  if (isVerbose)
-    std::cerr << "Data: " << data << std::endl;
-
-  BOOST_ASSERT(name.size() > m_prefix.size());
-  if (name[versionindex].isVersion()) {
-    m_latestVersion = name[versionindex].toVersion();
-    m_latestVersionData = make_shared<Data>(data);
-    m_foundVersion = true;
-
-    exclude.excludeBefore(name[versionindex]);
-
-    if (isVerbose)
-      std::cerr << "Discovered version = " << m_latestVersion << std::endl;
-  }
-  else {
-    // didn't find a version number at expected index.
-    m_strayExcludes.excludeOne(name[versionindex]);
-  }
-
-  for (const Exclude::Range& range : m_strayExcludes) {
-    BOOST_ASSERT(range.isSingular());
-    exclude.excludeOne(range.from);
-  }
-
-  Interest newInterest(interest);
-  newInterest.refreshNonce();
-  newInterest.setExclude(exclude);
-  newInterest.setInterestLifetime(discoveryTimeout);
-
-  if (m_foundVersion)
-    expressInterest(newInterest, maxRetriesOnTimeoutOrNack, maxRetriesAfterVersionFound);
-  else
-    expressInterest(interest, maxRetriesOnTimeoutOrNack, maxRetriesOnTimeoutOrNack);
-}
-
-void
-DiscoverVersionIterative::handleTimeout(const Interest& interest, const std::string& reason)
-{
-  if (m_foundVersion) {
-    // a version has been found and after a timeout error this version can be used as the latest.
-    if (isVerbose)
-      std::cerr << "Found data with the latest version: " << m_latestVersion << std::endl;
-
-    // we discovered at least one version. assume what we have is the latest.
-    this->emitSignal(onDiscoverySuccess, Name(interest.getName()).appendVersion(m_latestVersion));
-  }
-  else {
-    DiscoverVersion::handleTimeout(interest, reason);
-  }
-}
-
-void
-DiscoverVersionIterative::handleNack(const Interest& interest, const std::string& reason)
-{
-  if (m_foundVersion) {
-    // a version has been found and after a nack this version can be used as the latest.
-    if (isVerbose)
-      std::cerr << "Found data with the latest version: " << m_latestVersion << std::endl;
-
-    // we discovered at least one version. assume what we have is the latest.
-    this->emitSignal(onDiscoverySuccess, Name(interest.getName()).appendVersion(m_latestVersion));
-  }
-  else {
-    DiscoverVersion::handleNack(interest, reason);
-  }
-}
-
-} // namespace chunks
-} // namespace ndn
diff --git a/tools/chunks/catchunks/discover-version-iterative.hpp b/tools/chunks/catchunks/discover-version-iterative.hpp
deleted file mode 100644
index 8880a6d..0000000
--- a/tools/chunks/catchunks/discover-version-iterative.hpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2016-2019, Regents of the University of California,
- *                          Colorado State University,
- *                          University Pierre & Marie Curie, Sorbonne University.
- *
- * This file is part of ndn-tools (Named Data Networking Essential Tools).
- * See AUTHORS.md for complete list of ndn-tools authors and contributors.
- *
- * ndn-tools 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 3 of the License, or (at your option) any later version.
- *
- * ndn-tools 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
- * ndn-tools, 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.
- *
- * @author Wentao Shang
- * @author Steve DiBenedetto
- * @author Andrea Tosatto
- * @author Klaus Schneider
- */
-
-#ifndef NDN_TOOLS_CHUNKS_CATCHUNKS_DISCOVER_VERSION_ITERATIVE_HPP
-#define NDN_TOOLS_CHUNKS_CATCHUNKS_DISCOVER_VERSION_ITERATIVE_HPP
-
-#include "discover-version.hpp"
-
-namespace ndn {
-namespace chunks {
-
-/**
- * @brief Options for discover version iterative DiscoverVersionIterative
- *
- * The canonical name to use is DiscoverVersionIterative::Options
- */
-class DiscoverVersionIterativeOptions : public virtual Options
-{
-public:
-  explicit
-  DiscoverVersionIterativeOptions(const Options& opts = Options())
-    : Options(opts)
-  {
-  }
-
-public:
-  int maxRetriesAfterVersionFound{0};       ///< how many times to retry after a discoveryTimeout
-  time::milliseconds discoveryTimeout{300}; ///< timeout for version discovery
-};
-
-/**
- * @brief Service for discovering the latest Data version in the iterative way
- *
- * Identifies the latest retrievable version published under the specified namespace
- * (as specified by the Version marker).
- *
- * DiscoverVersionIterative declares the largest discovered version to be the latest after some
- * Interest timeouts (i.e. failed retrieval after exclusion and retransmission). The number of
- * timeouts are specified by the value of maxRetriesAfterVersionFound inside the iterative options.
- *
- * The received name component after version can be an invalid segment number, this component will
- * be excluded in the next interests. In the unlikely case that there are too many excluded
- * components such that the Interest cannot fit in ndn::MAX_NDN_PACKET_SIZE, the discovery
- * procedure will throw Face::Error.
- *
- * DiscoverVersionIterative's user is notified once after identifying the latest retrievable
- * version or on failure to find any version Data.
- */
-class DiscoverVersionIterative : public DiscoverVersion, protected DiscoverVersionIterativeOptions
-{
-public:
-  typedef DiscoverVersionIterativeOptions Options;
-
-public:
-  /**
-   * @brief create a DiscoverVersionIterative service
-   */
-  DiscoverVersionIterative(const Name& prefix, Face& face, const Options& options);
-
-  /**
-   * @brief identify the latest Data version published.
-   */
-  void
-  run() final;
-
-private:
-  void
-  handleData(const Interest& interest, const Data& data) final;
-
-  void
-  handleTimeout(const Interest& interest, const std::string& reason) final;
-
-  void
-  handleNack(const Interest& interest, const std::string& reason) final;
-
-private:
-  uint64_t m_latestVersion;
-  shared_ptr<const Data> m_latestVersionData;
-  Exclude m_strayExcludes;
-  bool m_foundVersion;
-};
-
-} // namespace chunks
-} // namespace ndn
-
-#endif // NDN_TOOLS_CHUNKS_CATCHUNKS_DISCOVER_VERSION_ITERATIVE_HPP
diff --git a/tools/chunks/catchunks/ndncatchunks.cpp b/tools/chunks/catchunks/ndncatchunks.cpp
index 2224f48..92d5401 100644
--- a/tools/chunks/catchunks/ndncatchunks.cpp
+++ b/tools/chunks/catchunks/ndncatchunks.cpp
@@ -33,7 +33,6 @@
 #include "aimd-rtt-estimator.hpp"
 #include "consumer.hpp"
 #include "discover-version-fixed.hpp"
-#include "discover-version-iterative.hpp"
 #include "discover-version-realtime.hpp"
 #include "pipeline-interests-aimd.hpp"
 #include "pipeline-interests-fixed-window.hpp"
@@ -51,11 +50,10 @@
 {
   std::string programName(argv[0]);
   Options options;
-  std::string discoverType("iterative");
+  std::string discoverType("realtime");
   std::string pipelineType("aimd");
   size_t maxPipelineSize(1);
-  int maxRetriesAfterVersionFound(0);
-  int64_t discoveryTimeoutMs(300);
+  int64_t discoveryTimeoutMs(DEFAULT_INTEREST_LIFETIME.count());
   std::string uri;
 
   // congestion control parameters, CWA refers to conservative window adaptation,
@@ -71,7 +69,7 @@
   basicDesc.add_options()
     ("help,h",      "print this help message and exit")
     ("discover-version,d", po::value<std::string>(&discoverType)->default_value(discoverType),
-                            "version discovery algorithm to use; valid values are: 'fixed', 'iterative', 'realtime'")
+                            "version discovery algorithm to use; valid values are: 'fixed', 'realtime'")
     ("pipeline-type,p", po::value<std::string>(&pipelineType)->default_value(pipelineType),
                          "type of Interest pipeline to use; valid values are: 'fixed', 'aimd'")
     ("fresh,f",     po::bool_switch(&options.mustBeFresh), "only return fresh content")
@@ -84,14 +82,10 @@
     ("version,V",   "print program version and exit")
     ;
 
-  po::options_description iterDiscoveryDesc("Iterative version discovery options");
-  iterDiscoveryDesc.add_options()
-    ("retries-iterative,i", po::value<int>(&maxRetriesAfterVersionFound)->default_value(maxRetriesAfterVersionFound),
-                            "number of timeouts that have to occur in order to confirm a discovered Data "
-                            "version as the latest one")
+  po::options_description realDiscoveryDesc("Realtime version discovery options");
+  realDiscoveryDesc.add_options()
     ("discovery-timeout,t", po::value<int64_t>(&discoveryTimeoutMs)->default_value(discoveryTimeoutMs),
-                            "discovery timeout (in milliseconds)")
-    ;
+                            "discovery timeout (in milliseconds)");
 
   po::options_description fixedPipeDesc("Fixed pipeline options");
   fixedPipeDesc.add_options()
@@ -136,7 +130,7 @@
     ;
 
   po::options_description visibleDesc;
-  visibleDesc.add(basicDesc).add(iterDiscoveryDesc).add(fixedPipeDesc).add(aimdPipeDesc);
+  visibleDesc.add(basicDesc).add(realDiscoveryDesc).add(fixedPipeDesc).add(aimdPipeDesc);
 
   po::options_description hiddenDesc;
   hiddenDesc.add_options()
@@ -196,11 +190,6 @@
     return 2;
   }
 
-  if (maxRetriesAfterVersionFound < 0 || maxRetriesAfterVersionFound > 1024) {
-    std::cerr << "ERROR: retries iterative value must be between 0 and 1024" << std::endl;
-    return 2;
-  }
-
   if (discoveryTimeoutMs < 0) {
     std::cerr << "ERROR: timeout cannot be negative" << std::endl;
     return 2;
@@ -224,14 +213,9 @@
     if (discoverType == "fixed") {
       discover = make_unique<DiscoverVersionFixed>(prefix, face, options);
     }
-    else if (discoverType == "iterative") {
-      DiscoverVersionIterative::Options optionsIterative(options);
-      optionsIterative.maxRetriesAfterVersionFound = maxRetriesAfterVersionFound;
-      optionsIterative.discoveryTimeout = time::milliseconds(discoveryTimeoutMs);
-      discover = make_unique<DiscoverVersionIterative>(prefix, face, optionsIterative);
-    }
     else if (discoverType == "realtime") {
       DiscoverVersionRealtime::Options optionsRealtime(options);
+      optionsRealtime.discoveryTimeout = time::milliseconds(discoveryTimeoutMs);
       discover = make_unique<DiscoverVersionRealtime>(prefix, face, optionsRealtime);
     }
     else {
