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 |
| 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 | |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 14 | ## Version discovery methods in ndncatchunks |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 15 | |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 16 | * `fixed` : sends an interest attempting to find a data packet with the |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 17 | specified prefix and version number. A version component must be present at the |
| 18 | end of the user-specified NDN name. |
| 19 | |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 20 | * `iterative`: sends a series of interests with ChildSelector set to prefer the |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 21 | rightmost child and Exclude selectors, attempting to find a data packet with the |
| 22 | specified prefix and the latest (the largest in the NDN canonical ordering) |
| 23 | version number. The version is declared "latest" after a predefined number of |
| 24 | data retrieval timeouts (default: 1). |
| 25 | |
Weiwei Liu | 13fda5b | 2016-09-28 03:29:07 +0000 | [diff] [blame] | 26 | The default discovery method is `iterative`. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 27 | |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 28 | ## Interest pipeline types in ndncatchunks |
| 29 | |
| 30 | * `fixed`: maintains a fixed-size window of Interests in flight; the window size is configurable |
| 31 | via a command line option and defaults to 1. |
| 32 | |
| 33 | * `aimd` : sends Interests using an additive-increase/multiplicative-decrease (AIMD) algorithm to |
| 34 | control the window size. By default, a Conservative Loss Adaptation algorithm is adopted |
| 35 | combining with the AIMD algorithm, that is, at most one window decrease will be |
| 36 | performed per round-trip-time. For details please refer to: |
| 37 | [A Practical Congestion Control Scheme for Named Data |
| 38 | Networking](https://www.researchgate.net/publication/306259672_A_Practical_Congestion_Control_Scheme_for_Named_Data_Networking) |
| 39 | |
Klaus Schneider | 2c3083d | 2017-12-18 14:19:04 -0700 | [diff] [blame^] | 40 | The default Interest pipeline type is `aimd`. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 41 | |
| 42 | ## Usage examples |
| 43 | |
| 44 | ### Publishing |
| 45 | |
| 46 | The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3` |
| 47 | prefix: |
| 48 | |
| 49 | ndnputchunks ndn:/localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
| 50 | |
| 51 | To find the published version you have to start ndnputchunks with the `-p` command line option, |
| 52 | for example: |
| 53 | |
| 54 | ndnputchunks -p ndn:/localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
| 55 | |
| 56 | This command will print the published version to the standard output. |
| 57 | |
| 58 | To publish data with a specific version, you must append a version component to the end of the |
| 59 | prefix. The version component must follow the aforementioned NDN naming conventions. |
| 60 | For example, the following command will publish the version `%FD%00%00%01Qc%CF%17v` of the |
| 61 | `/localhost/demo/gpl3` prefix: |
| 62 | |
| 63 | ndnputchunks ndn:/localhost/demo/gpl3/%FD%00%00%01Qc%CF%17v < /usr/share/common-licenses/GPL-3 |
| 64 | |
| 65 | If the version component is not valid, a new well-formed version will be generated and appended |
| 66 | to the supplied NDN name. |
| 67 | |
| 68 | |
| 69 | ### Retrieval |
| 70 | |
| 71 | To retrieve the latest version of a published file, the following command can be used: |
| 72 | |
| 73 | ndncatchunks -d iterative ndn:/localhost/demo/gpl3 |
| 74 | |
| 75 | This command will use the iterative method to discover the latest version of the file. |
| 76 | |
Weiwei Liu | 72c96d2 | 2016-09-27 23:06:21 -0700 | [diff] [blame] | 77 | To fetch a specific version of a published file, you can use the `fixed` version discovery method. |
| 78 | In this case the version needs to be supplied as part of the name. For example, if the version |
| 79 | is known to be `%FD%00%00%01Qc%CF%17v`, the following command will fetch that exact version of the |
| 80 | file: |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 81 | |
Weiwei Liu | 13fda5b | 2016-09-28 03:29:07 +0000 | [diff] [blame] | 82 | ndncatchunks -d fixed ndn:/localhost/demo/gpl3/%FD%00%00%01Qc%CF%17v |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 83 | |
| 84 | |
| 85 | For more information, run the programs with `--help` as argument. |