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 | |
Klaus Schneider | 9e5122b | 2019-03-19 17:03: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 | |
Klaus Schneider | 9e5122b | 2019-03-19 17:03:25 -0700 | [diff] [blame^] | 20 | * `realtime` : sends discovery Interests to fetch metadata of the solicited content from which |
Chavoosh Ghasemi | 0c6fcb5 | 2019-03-04 10:29:25 -0800 | [diff] [blame] | 21 | the data version will be resolved. |
| 22 | The version number of the solicited content is included in the name of returned |
| 23 | metadata data packet. |
| 24 | For more information about the packet format and naming convention of interest and |
| 25 | data packets for realtime version discovery, please refer to: |
| 26 | [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] | 27 | |
Chavoosh Ghasemi | 0c6fcb5 | 2019-03-04 10:29:25 -0800 | [diff] [blame] | 28 | The default discovery method is `realtime`. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 29 | |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 30 | ## Interest pipeline types in ndncatchunks |
| 31 | |
| 32 | * `fixed`: maintains a fixed-size window of Interests in flight; the window size is configurable |
| 33 | via a command line option and defaults to 1. |
| 34 | |
Klaus Schneider | 9e5122b | 2019-03-19 17:03:25 -0700 | [diff] [blame^] | 35 | * `aimd` : adjusts the window size via additive-increase/multiplicative-decrease (AIMD). |
| 36 | By default, it uses a Conservative Window Adaptation, that is, the congestion window |
| 37 | will be decreased at most once per round-trip-time. |
Weiwei Liu | 245d791 | 2016-07-28 00:04:25 -0700 | [diff] [blame] | 38 | |
Klaus Schneider | 9e5122b | 2019-03-19 17:03:25 -0700 | [diff] [blame^] | 39 | * `cubic`: adjusts the window size similar to the TCP CUBIC algorithm. |
| 40 | For details about both aimd and cubic please refer to: |
| 41 | [A Practical Congestion Control Scheme for Named Data |
| 42 | Networking](https://conferences2.sigcomm.org/acm-icn/2016/proceedings/p21-schneider.pdf) |
| 43 | |
| 44 | The default Interest pipeline type is `cubic`. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 45 | |
| 46 | ## Usage examples |
| 47 | |
| 48 | ### Publishing |
| 49 | |
| 50 | The following command will publish the text of the GPL-3 license under the `/localhost/demo/gpl3` |
| 51 | prefix: |
| 52 | |
| 53 | ndnputchunks ndn:/localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
| 54 | |
| 55 | To find the published version you have to start ndnputchunks with the `-p` command line option, |
| 56 | for example: |
| 57 | |
| 58 | ndnputchunks -p ndn:/localhost/demo/gpl3 < /usr/share/common-licenses/GPL-3 |
| 59 | |
| 60 | This command will print the published version to the standard output. |
| 61 | |
| 62 | To publish data with a specific version, you must append a version component to the end of the |
| 63 | prefix. The version component must follow the aforementioned NDN naming conventions. |
| 64 | For example, the following command will publish the version `%FD%00%00%01Qc%CF%17v` of the |
| 65 | `/localhost/demo/gpl3` prefix: |
| 66 | |
| 67 | ndnputchunks ndn:/localhost/demo/gpl3/%FD%00%00%01Qc%CF%17v < /usr/share/common-licenses/GPL-3 |
| 68 | |
| 69 | If the version component is not valid, a new well-formed version will be generated and appended |
| 70 | to the supplied NDN name. |
| 71 | |
| 72 | |
| 73 | ### Retrieval |
| 74 | |
| 75 | To retrieve the latest version of a published file, the following command can be used: |
| 76 | |
Chavoosh Ghasemi | 0c6fcb5 | 2019-03-04 10:29:25 -0800 | [diff] [blame] | 77 | ndncatchunks ndn:/localhost/demo/gpl3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 78 | |
Chavoosh Ghasemi | 0c6fcb5 | 2019-03-04 10:29:25 -0800 | [diff] [blame] | 79 | This command will use the realtime method to discover the version number of the file. |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 80 | |
Weiwei Liu | 72c96d2 | 2016-09-27 23:06:21 -0700 | [diff] [blame] | 81 | To fetch a specific version of a published file, you can use the `fixed` version discovery method. |
| 82 | In this case the version needs to be supplied as part of the name. For example, if the version |
| 83 | is known to be `%FD%00%00%01Qc%CF%17v`, the following command will fetch that exact version of the |
| 84 | file: |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 85 | |
Weiwei Liu | 13fda5b | 2016-09-28 03:29:07 +0000 | [diff] [blame] | 86 | 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] | 87 | |
| 88 | |
| 89 | For more information, run the programs with `--help` as argument. |