Skip to content

Commit 0b6e1db

Browse files
committed
Rename ndncatchunks to ndnget
Change-Id: I260e552746e900a73c2ce773bd91d9b6fa384734
1 parent 6565727 commit 0b6e1db

31 files changed

+210
-217
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ RUN --mount=rw,target=/src <<EOF
2323
mkdir -p /deps/debian
2424
touch /deps/debian/control
2525
cd /deps
26-
for binary in ndnpeek ndnpoke ndncatchunks ndnputchunks ndnping ndnpingserver ndndump ndn-dissect; do
26+
for binary in ndnget ndnputchunks ndnpeek ndnpoke ndnping ndnpingserver ndndump ndn-dissect; do
2727
dpkg-shlibdeps --ignore-missing-info "/usr/bin/${binary}" -O \
2828
| sed -n 's|^shlibs:Depends=||p' | sed 's| ([^)]*),\?||g' > "${binary}"
2929
done
@@ -32,10 +32,10 @@ EOF
3232

3333
FROM ghcr.io/named-data/ndn-cxx-runtime:${NDN_CXX_VERSION} AS ndn-tools
3434

35+
COPY --link --from=build /usr/bin/ndnget /usr/bin/
36+
COPY --link --from=build /usr/bin/ndnputchunks /usr/bin/
3537
COPY --link --from=build /usr/bin/ndnpeek /usr/bin/
3638
COPY --link --from=build /usr/bin/ndnpoke /usr/bin/
37-
COPY --link --from=build /usr/bin/ndncatchunks /usr/bin/
38-
COPY --link --from=build /usr/bin/ndnputchunks /usr/bin/
3939
COPY --link --from=build /usr/bin/ndnping /usr/bin/
4040
COPY --link --from=build /usr/bin/ndnpingserver /usr/bin/
4141
COPY --link --from=build /usr/bin/ndndump /usr/bin/
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2016-2024, Regents of the University of California,
3+
* Copyright (c) 2016-2025, Regents of the University of California,
44
* Colorado State University,
55
* University Pierre & Marie Curie, Sorbonne University.
66
*
@@ -23,9 +23,9 @@
2323
* @author Andrea Tosatto
2424
*/
2525

26-
#include "tools/chunks/catchunks/consumer.hpp"
27-
#include "tools/chunks/catchunks/discover-version.hpp"
28-
#include "tools/chunks/catchunks/pipeline-interests.hpp"
26+
#include "tools/get/consumer.hpp"
27+
#include "tools/get/discover-version.hpp"
28+
#include "tools/get/pipeline-interests.hpp"
2929

3030
#include "tests/test-common.hpp"
3131
#include "tests/io-fixture.hpp"
@@ -35,12 +35,12 @@
3535

3636
#include <boost/test/tools/output_test_stream.hpp>
3737

38-
namespace ndn::chunks::tests {
38+
namespace ndn::tests {
3939

40-
using namespace ndn::tests;
40+
using namespace ndn::get;
4141
using boost::test_tools::output_test_stream;
4242

43-
BOOST_AUTO_TEST_SUITE(Chunks)
43+
BOOST_AUTO_TEST_SUITE(Get)
4444
BOOST_AUTO_TEST_SUITE(TestConsumer)
4545

4646
BOOST_AUTO_TEST_CASE(InOrderData)
@@ -167,6 +167,6 @@ BOOST_FIXTURE_TEST_CASE(RunBasic, IoFixture)
167167
}
168168

169169
BOOST_AUTO_TEST_SUITE_END() // TestConsumer
170-
BOOST_AUTO_TEST_SUITE_END() // Chunks
170+
BOOST_AUTO_TEST_SUITE_END() // Get
171171

172-
} // namespace ndn::chunks::tests
172+
} // namespace ndn::tests
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2016-2024, Regents of the University of California,
3+
* Copyright (c) 2016-2025, Regents of the University of California,
44
* Colorado State University,
55
* University Pierre & Marie Curie, Sorbonne University.
66
*
@@ -23,7 +23,7 @@
2323
* @author Chavoosh Ghasemi
2424
*/
2525

26-
#include "tools/chunks/catchunks/discover-version.hpp"
26+
#include "tools/get/discover-version.hpp"
2727

2828
#include "tests/test-common.hpp"
2929
#include "tests/io-fixture.hpp"
@@ -32,9 +32,9 @@
3232
#include <ndn-cxx/metadata-object.hpp>
3333
#include <ndn-cxx/util/dummy-client-face.hpp>
3434

35-
namespace ndn::chunks::tests {
35+
namespace ndn::tests {
3636

37-
using namespace ndn::tests;
37+
using namespace ndn::get;
3838

3939
class DiscoverVersionFixture : public IoFixture, public KeyChainFixture
4040
{
@@ -68,7 +68,7 @@ class DiscoverVersionFixture : public IoFixture, public KeyChainFixture
6868
bool isDiscoveryFinished = false;
6969
};
7070

71-
BOOST_AUTO_TEST_SUITE(Chunks)
71+
BOOST_AUTO_TEST_SUITE(Get)
7272
BOOST_FIXTURE_TEST_SUITE(TestDiscoverVersion, DiscoverVersionFixture)
7373

7474
BOOST_AUTO_TEST_CASE(Disabled)
@@ -211,6 +211,6 @@ BOOST_AUTO_TEST_CASE(SuccessAfterNackAndTimeout)
211211
}
212212

213213
BOOST_AUTO_TEST_SUITE_END() // TestDiscoverVersion
214-
BOOST_AUTO_TEST_SUITE_END() // Chunks
214+
BOOST_AUTO_TEST_SUITE_END() // Get
215215

216-
} // namespace ndn::chunks::tests
216+
} // namespace ndn::tests

tests/chunks/pipeline-interests-aimd.t.cpp renamed to tests/get/pipeline-interests-aimd.t.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2016-2024, Regents of the University of California,
3+
* Copyright (c) 2016-2025, Regents of the University of California,
44
* Colorado State University,
55
* University Pierre & Marie Curie, Sorbonne University.
66
*
@@ -25,15 +25,13 @@
2525
* @author Klaus Schneider
2626
*/
2727

28-
#include "tools/chunks/catchunks/pipeline-interests-aimd.hpp"
28+
#include "tools/get/pipeline-interests-aimd.hpp"
2929

3030
#include "pipeline-interests-fixture.hpp"
3131

3232
#include <cmath>
3333

34-
namespace ndn::chunks::tests {
35-
36-
using namespace ndn::tests;
34+
namespace ndn::tests {
3735

3836
class PipelineInterestAimdFixture : public PipelineInterestsFixture
3937
{
@@ -74,7 +72,7 @@ class PipelineInterestAimdFixture : public PipelineInterestsFixture
7472
static constexpr double MARGIN = 0.001;
7573
};
7674

77-
BOOST_AUTO_TEST_SUITE(Chunks)
75+
BOOST_AUTO_TEST_SUITE(Get)
7876
BOOST_FIXTURE_TEST_SUITE(TestPipelineInterestsAimd, PipelineInterestAimdFixture)
7977

8078
BOOST_AUTO_TEST_CASE(SlowStart)
@@ -640,6 +638,6 @@ BOOST_AUTO_TEST_CASE(StopsWhenFileSizeLessThanChunkSize)
640638
}
641639

642640
BOOST_AUTO_TEST_SUITE_END() // TestPipelineInterestsAimd
643-
BOOST_AUTO_TEST_SUITE_END() // Chunks
641+
BOOST_AUTO_TEST_SUITE_END() // Get
644642

645-
} // namespace ndn::chunks::tests
643+
} // namespace ndn::tests

tests/chunks/pipeline-interests-cubic.t.cpp renamed to tests/get/pipeline-interests-cubic.t.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2016-2024, Regents of the University of California,
3+
* Copyright (c) 2016-2025, Regents of the University of California,
44
* Colorado State University,
55
* University Pierre & Marie Curie, Sorbonne University.
66
*
@@ -25,13 +25,11 @@
2525
* @author Klaus Schneider
2626
*/
2727

28-
#include "tools/chunks/catchunks/pipeline-interests-cubic.hpp"
28+
#include "tools/get/pipeline-interests-cubic.hpp"
2929

3030
#include "pipeline-interests-fixture.hpp"
3131

32-
namespace ndn::chunks::tests {
33-
34-
using namespace ndn::tests;
32+
namespace ndn::tests {
3533

3634
class PipelineInterestCubicFixture : public PipelineInterestsFixture
3735
{
@@ -72,7 +70,7 @@ class PipelineInterestCubicFixture : public PipelineInterestsFixture
7270
static constexpr double MARGIN = 0.001;
7371
};
7472

75-
BOOST_AUTO_TEST_SUITE(Chunks)
73+
BOOST_AUTO_TEST_SUITE(Get)
7674
BOOST_FIXTURE_TEST_SUITE(TestPipelineInterestsCubic, PipelineInterestCubicFixture)
7775

7876
BOOST_AUTO_TEST_CASE(SlowStart)
@@ -160,7 +158,6 @@ BOOST_AUTO_TEST_CASE(Timeout)
160158
BOOST_CHECK_EQUAL(pipeline->m_nRetransmitted, 3);
161159
BOOST_CHECK_EQUAL(pipeline->m_nTimeouts,
162160
pipeline->m_nRetransmitted + pipeline->m_nSkippedRetx);
163-
164161
}
165162

166163
BOOST_AUTO_TEST_CASE(CongestionMarksWithCwa)
@@ -553,8 +550,7 @@ BOOST_AUTO_TEST_CASE(StopsWhenFileSizeLessThanChunkSize)
553550
BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0);
554551
}
555552

556-
557553
BOOST_AUTO_TEST_SUITE_END() // TestPipelineInterestsCubic
558-
BOOST_AUTO_TEST_SUITE_END() // Chunks
554+
BOOST_AUTO_TEST_SUITE_END() // Get
559555

560-
} // namespace ndn::chunks::tests
556+
} // namespace ndn::tests

tests/chunks/pipeline-interests-fixed.t.cpp renamed to tests/get/pipeline-interests-fixed.t.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2016-2024, Regents of the University of California,
3+
* Copyright (c) 2016-2025, Regents of the University of California,
44
* Colorado State University,
55
* University Pierre & Marie Curie, Sorbonne University.
66
*
@@ -24,14 +24,14 @@
2424
* @author Chavoosh Ghasemi
2525
*/
2626

27-
#include "tools/chunks/catchunks/pipeline-interests-fixed.hpp"
28-
#include "tools/chunks/catchunks/data-fetcher.hpp"
27+
#include "tools/get/pipeline-interests-fixed.hpp"
28+
#include "tools/get/data-fetcher.hpp"
2929

3030
#include "pipeline-interests-fixture.hpp"
3131

3232
#include <cmath>
3333

34-
namespace ndn::chunks::tests {
34+
namespace ndn::tests {
3535

3636
class PipelineInterestFixedFixture : public PipelineInterestsFixture
3737
{
@@ -58,7 +58,7 @@ class PipelineInterestFixedFixture : public PipelineInterestsFixture
5858
PipelineInterestsFixed* pipeline;
5959
};
6060

61-
BOOST_AUTO_TEST_SUITE(Chunks)
61+
BOOST_AUTO_TEST_SUITE(Get)
6262
BOOST_FIXTURE_TEST_SUITE(TestPipelineInterestsFixed, PipelineInterestFixedFixture)
6363

6464
BOOST_AUTO_TEST_CASE(FullPipeline)
@@ -296,6 +296,6 @@ BOOST_AUTO_TEST_CASE(CongestionAllSegments)
296296
}
297297

298298
BOOST_AUTO_TEST_SUITE_END() // TestPipelineInterests
299-
BOOST_AUTO_TEST_SUITE_END() // Chunks
299+
BOOST_AUTO_TEST_SUITE_END() // Get
300300

301-
} // namespace ndn::chunks::tests
301+
} // namespace ndn::tests

tests/chunks/pipeline-interests-fixture.hpp renamed to tests/get/pipeline-interests-fixture.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
22
/*
3-
* Copyright (c) 2016-2024, Regents of the University of California,
3+
* Copyright (c) 2016-2025, Regents of the University of California,
44
* Colorado State University,
55
* University Pierre & Marie Curie, Sorbonne University.
66
*
@@ -26,19 +26,19 @@
2626
* @author Chavoosh Ghasemi
2727
*/
2828

29-
#ifndef NDN_TOOLS_TESTS_CHUNKS_PIPELINE_INTERESTS_FIXTURE_HPP
30-
#define NDN_TOOLS_TESTS_CHUNKS_PIPELINE_INTERESTS_FIXTURE_HPP
29+
#ifndef NDN_TOOLS_TESTS_GET_PIPELINE_INTERESTS_FIXTURE_HPP
30+
#define NDN_TOOLS_TESTS_GET_PIPELINE_INTERESTS_FIXTURE_HPP
3131

32-
#include "tools/chunks/catchunks/pipeline-interests.hpp"
32+
#include "tools/get/pipeline-interests.hpp"
3333

3434
#include "tests/test-common.hpp"
3535
#include "tests/io-fixture.hpp"
3636

3737
#include <ndn-cxx/util/dummy-client-face.hpp>
3838

39-
namespace ndn::chunks::tests {
39+
namespace ndn::tests {
4040

41-
using namespace ndn::tests;
41+
using namespace ndn::get;
4242

4343
class PipelineInterestsFixture : public IoFixture
4444
{
@@ -86,6 +86,6 @@ class PipelineInterestsFixture : public IoFixture
8686
std::unique_ptr<PipelineInterests> m_pipeline;
8787
};
8888

89-
} // namespace ndn::chunks::tests
89+
} // namespace ndn::tests
9090

91-
#endif // NDN_TOOLS_TESTS_CHUNKS_PIPELINE_INTERESTS_FIXTURE_HPP
91+
#endif // NDN_TOOLS_TESTS_GET_PIPELINE_INTERESTS_FIXTURE_HPP

tools/chunks/README.md

Lines changed: 6 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,14 @@
1-
# ndncatchunks and ndnputchunks
1+
# ndnputchunks
22

3-
**ndncatchunks** and **ndnputchunks** are a pair of programs to transfer a file as Data segments.
3+
**ndnputchunks** is a producer program that reads a file from the standard input, and makes
4+
it available as a set of NDN Data segments. It appends version and segment number components
5+
to the specified name as needed, according to the [NDN naming conventions](
6+
https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
47

5-
* **ndnputchunks** is a producer program that reads a file from the standard input, and makes
6-
it available as a set of NDN Data segments. It appends version and segment number components
7-
to the specified name as needed, according to the [NDN naming conventions](
8-
https://named-data.net/publications/techreports/ndn-tr-22-3-ndn-memo-naming-conventions/).
9-
10-
* **ndncatchunks** is a consumer program that fetches Data segments of a file, optionally
11-
discovering the latest version of the file, and writes the content of the retrieved file to
12-
the standard output.
13-
14-
## Version discovery in ndncatchunks
15-
16-
If a version component is present at the end of the user-specified NDN name, the provided version
17-
number will be used, without any version discovery process. Otherwise, discovery Interest(s) will
18-
be sent out to fetch metadata of the solicited content from which the Data version will be resolved.
19-
For more information about the packet format and naming conventions of Interest and Data packets
20-
used for version discovery in ndncatchunks, please refer to:
21-
[Realtime Data Retrieval (RDR) protocol](https://redmine.named-data.net/projects/ndn-tlv/wiki/RDR).
22-
23-
## Interest pipeline types in ndncatchunks
24-
25-
* `fixed`: maintains a fixed-size window of Interests in flight; the window size is configurable
26-
via a command line option and defaults to 1.
27-
28-
* `aimd` : adjusts the window size via additive-increase/multiplicative-decrease (AIMD).
29-
By default, it uses a Conservative Window Adaptation, that is, the congestion window
30-
will be decreased at most once per round-trip-time.
31-
32-
* `cubic`: adjusts the window size similar to the TCP CUBIC algorithm.
33-
For details about both aimd and cubic please refer to:
34-
[A Practical Congestion Control Scheme for Named Data
35-
Networking](https://conferences2.sigcomm.org/acm-icn/2016/proceedings/p21-schneider.pdf).
36-
37-
The default Interest pipeline type is `cubic`.
8+
Files published by ndnputchunks can be fetched with [ndnget](../get/README.md).
389

3910
## Usage examples
4011

41-
### Publishing
42-
4312
The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
4413
prefix:
4514

@@ -60,17 +29,3 @@ the following command will publish the version 1449078495094 of the `/localhost/
6029

6130
If the specified version component is not valid, ndnputchunks will exit with an error. If no version
6231
component is specified, one will be generated and appended to the name.
63-
64-
### Retrieval
65-
66-
To retrieve the latest version of a published file, the following command can be used:
67-
68-
ndncatchunks /localhost/demo/gpl3
69-
70-
To fetch a specific version of a published file, you can specify the version number at the end of
71-
the name. For example, if the version is known to be 1449078495094, the following command
72-
will fetch that exact version of the file (without version discovery):
73-
74-
ndncatchunks -Nt /localhost/demo/gpl3/v=1449078495094
75-
76-
For more information, run the programs with `--help` as argument.

0 commit comments

Comments
 (0)