Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 1 | # 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 Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 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 |
| 8 | [NDN naming conventions](https://named-data.net/publications/techreports/ndn-tr-22-2-ndn-memo-naming-conventions/). |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 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 Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 14 | ## Version discovery in ndncatchunks |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 15 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 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. |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 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: |
Chavoosh Ghasemi | 0c6fcb5 | 2019-03-04 10:29:25 -0800 | [diff] [blame] | 21 | [Realtime Data Retrieval (RDR) protocol wiki page](https://redmine.named-data.net/projects/ndn-tlv/wiki/RDR) |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 22 | |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 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 | |
Klaus Schneider | 9e5122b | 2019-03-19 17:03:25 -0700 | [diff] [blame] | 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. |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 31 | |
Klaus Schneider | 9e5122b | 2019-03-19 17:03:25 -0700 | [diff] [blame] | 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`. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 38 | |
| 39 | ## Usage examples |
| 40 | |
| 41 | ### Publishing |
| 42 | |
| 43 | The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3` |
| 44 | prefix: |
| 45 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 46 | ndnputchunks /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 47 | |
| 48 | To find the published version you have to start ndnputchunks with the `-p` command line option, |
| 49 | for example: |
| 50 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 51 | ndnputchunks -p /localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 52 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 53 | This command will print the published version to standard output. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 54 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 55 | To publish Data with a specific version, you need to append a version component to the end of the |
| 56 | prefix. The version component must follow the aforementioned NDN naming conventions. For example, |
| 57 | the following command will publish the version 1449078495094 of the `/localhost/demo/gpl3` prefix: |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 58 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 59 | ndnputchunks -Nt /localhost/demo/gpl3/v=1449078495094 < /usr/share/common-licenses/GPL-3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 60 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 61 | If the specified version component is not valid, ndnputchunks will exit with an error. If no version |
| 62 | component is specified, one will be generated and appended to the name. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 63 | |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 64 | ### Retrieval |
| 65 | |
| 66 | To retrieve the latest version of a published file, the following command can be used: |
| 67 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 68 | ndncatchunks /localhost/demo/gpl3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 69 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 70 | To fetch a specific version of a published file, you can specify the version number at the end of |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 71 | the name. For example, if the version is known to be 1449078495094, the following command |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame] | 72 | will fetch that exact version of the file (without version discovery): |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 73 | |
Eric Newberry | a209f67 | 2021-03-26 10:52:09 -0700 | [diff] [blame] | 74 | ndncatchunks -Nt /localhost/demo/gpl3/v=1449078495094 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 75 | |
| 76 | For more information, run the programs with `--help` as argument. |