blob: d92710f0731d02bbb4274ffd3b058d46ccc3653b [file] [log] [blame] [view]
Andrea Tosatto672b9a72016-01-05 16:18:20 +01001# ndncatchunks and ndnputchunks
2
3**ndncatchunks** and **ndnputchunks** are a pair of programs to transfer a file as Data segments.
4
5* **ndnputchunks** is a producer program that reads a file from the standard input, and makes
6 it available as NDN Data segments. It appends version and segment number components
7 to the specified name, according to the
8 [NDN naming conventions](http://named-data.net/publications/techreports/ndn-tr-22-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
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070014## Version discovery in ndncatchunks
Andrea Tosatto672b9a72016-01-05 16:18:20 +010015
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070016If a version component is present at the end of the user-specified NDN name, the provided version
17number will be used, without any version discovery process. Otherwise, discovery Interest(s) will
18be sent out to fetch metadata of the solicited content from which the Data version will be resolved.
19For more information about the packet format and naming convention of Interest and Data packets of
20version discovery in ndncatchunks, please refer to:
Chavoosh Ghasemi0c6fcb52019-03-04 10:29:25 -080021[Realtime Data Retrieval (RDR) protocol wiki page](https://redmine.named-data.net/projects/ndn-tlv/wiki/RDR)
Andrea Tosatto672b9a72016-01-05 16:18:20 +010022
Weiwei Liu245d7912016-07-28 00:04:25 -070023## 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
Klaus Schneider9e5122b2019-03-19 17:03:25 -070028* `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.
Weiwei Liu245d7912016-07-28 00:04:25 -070031
Klaus Schneider9e5122b2019-03-19 17:03:25 -070032* `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
37The default Interest pipeline type is `cubic`.
Andrea Tosatto672b9a72016-01-05 16:18:20 +010038
39## Usage examples
40
41### Publishing
42
43The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3`
44prefix:
45
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070046 ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010047
48To find the published version you have to start ndnputchunks with the `-p` command line option,
49for example:
50
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070051 ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010052
53This command will print the published version to the standard output.
54
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070055To publish Data with a specific version, you must append a version component to the end of the
Andrea Tosatto672b9a72016-01-05 16:18:20 +010056prefix. The version component must follow the aforementioned NDN naming conventions.
57For example, the following command will publish the version `%FD%00%00%01Qc%CF%17v` of the
58`/localhost/demo/gpl3` prefix:
59
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070060 ndnputchunks /localhost/demo/gpl3/%FD%00%00%01Qc%CF%17v < /usr/share/common-licenses/GPL-3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010061
62If the version component is not valid, a new well-formed version will be generated and appended
63to the supplied NDN name.
64
Andrea Tosatto672b9a72016-01-05 16:18:20 +010065### Retrieval
66
67To retrieve the latest version of a published file, the following command can be used:
68
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070069 ndncatchunks /localhost/demo/gpl3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010070
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070071To fetch a specific version of a published file, you can specify the version number at the end of
72the name. For example, if the version is known to be `%FD%00%00%01Qc%CF%17v`, the following command
73will fetch that exact version of the file (without version discovery):
Andrea Tosatto672b9a72016-01-05 16:18:20 +010074
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070075 ndncatchunks /localhost/demo/gpl3/%FD%00%00%01Qc%CF%17v
Andrea Tosatto672b9a72016-01-05 16:18:20 +010076
77For more information, run the programs with `--help` as argument.