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 | |
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. |
| 19 | For more information about the packet format and naming convention of Interest and Data packets of |
| 20 | 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 | |
| 53 | This command will print the published version to the standard output. |
| 54 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame^] | 55 | To publish Data with a specific version, you must append a version component to the end of the |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 56 | prefix. The version component must follow the aforementioned NDN naming conventions. |
| 57 | For example, the following command will publish the version `%FD%00%00%01Qc%CF%17v` of the |
| 58 | `/localhost/demo/gpl3` prefix: |
| 59 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame^] | 60 | ndnputchunks /localhost/demo/gpl3/%FD%00%00%01Qc%CF%17v < /usr/share/common-licenses/GPL-3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 61 | |
| 62 | If the version component is not valid, a new well-formed version will be generated and appended |
| 63 | to the supplied NDN name. |
| 64 | |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 65 | ### Retrieval |
| 66 | |
| 67 | To retrieve the latest version of a published file, the following command can be used: |
| 68 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame^] | 69 | ndncatchunks /localhost/demo/gpl3 |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 70 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame^] | 71 | To fetch a specific version of a published file, you can specify the version number at the end of |
| 72 | the name. For example, if the version is known to be `%FD%00%00%01Qc%CF%17v`, the following command |
| 73 | will fetch that exact version of the file (without version discovery): |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 74 | |
Chavoosh Ghasemi | bb2d280 | 2019-03-26 16:07:58 -0700 | [diff] [blame^] | 75 | ndncatchunks /localhost/demo/gpl3/%FD%00%00%01Qc%CF%17v |
Andrea Tosatto | 672b9a7 | 2016-01-05 16:18:20 +0100 | [diff] [blame] | 76 | |
| 77 | For more information, run the programs with `--help` as argument. |