blob: 3c73bcfdb79c0f035af0235967b38c1dfa04b1e5 [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
Eric Newberrya209f672021-03-26 10:52:09 -07006 it available as a set of NDN Data segments. It appends version and segment number components
Davide Pesaventodb9613e2023-01-20 20:52:21 -05007 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/).
Andrea Tosatto672b9a72016-01-05 16:18:20 +01009
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.
Eric Newberrya209f672021-03-26 10:52:09 -070019For more information about the packet format and naming conventions of Interest and Data packets
20used for version discovery in ndncatchunks, please refer to:
Davide Pesaventodb9613e2023-01-20 20:52:21 -050021[Realtime Data Retrieval (RDR) protocol](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
Davide Pesaventodb9613e2023-01-20 20:52:21 -050035 Networking](https://conferences2.sigcomm.org/acm-icn/2016/proceedings/p21-schneider.pdf).
Klaus Schneider9e5122b2019-03-19 17:03:25 -070036
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
Eric Newberrya209f672021-03-26 10:52:09 -070053This command will print the published version to standard output.
Andrea Tosatto672b9a72016-01-05 16:18:20 +010054
Eric Newberrya209f672021-03-26 10:52:09 -070055To publish Data with a specific version, you need to append a version component to the end of the
56prefix. The version component must follow the aforementioned NDN naming conventions. For example,
57the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix:
Andrea Tosatto672b9a72016-01-05 16:18:20 +010058
Eric Newberrya209f672021-03-26 10:52:09 -070059 ndnputchunks -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010060
Eric Newberrya209f672021-03-26 10:52:09 -070061If the specified version component is not valid, ndnputchunks will exit with an error. If no version
62component is specified, one will be generated and appended to the name.
Andrea Tosatto672b9a72016-01-05 16:18:20 +010063
Andrea Tosatto672b9a72016-01-05 16:18:20 +010064### Retrieval
65
66To retrieve the latest version of a published file, the following command can be used:
67
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070068 ndncatchunks /localhost/demo/gpl3
Andrea Tosatto672b9a72016-01-05 16:18:20 +010069
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070070To fetch a specific version of a published file, you can specify the version number at the end of
Eric Newberrya209f672021-03-26 10:52:09 -070071the name. For example, if the version is known to be 1449078495094, the following command
Chavoosh Ghasemibb2d2802019-03-26 16:07:58 -070072will fetch that exact version of the file (without version discovery):
Andrea Tosatto672b9a72016-01-05 16:18:20 +010073
Eric Newberrya209f672021-03-26 10:52:09 -070074 ndncatchunks -Nt /localhost/demo/gpl3/v=1449078495094
Andrea Tosatto672b9a72016-01-05 16:18:20 +010075
76For more information, run the programs with `--help` as argument.