blob: c951f60527aeda779d5ef68ab7fc2e37da0a734f [file] [log] [blame] [view]
Davide Pesavento5b9c85a2020-04-09 21:10:54 -04001# NDN Traffic Generator
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -08002
Davide Pesaventoef064892022-04-05 02:26:03 -04003![Language](https://img.shields.io/badge/C%2B%2B-17-blue)
Davide Pesavento9bec15a2024-04-22 23:00:03 -04004[![CI](https://github.com/named-data/ndn-traffic-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/named-data/ndn-traffic-generator/actions/workflows/ci.yml)
Davide Pesavento2a7f32b2017-09-02 13:48:13 -04005
jeraldabraham420dbf02014-04-25 22:58:31 -07006This tool is designed to generate Interest and Data traffic in an NDN network.
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -08007The client and server tool accept traffic configuration files which can be
8used to specify the pattern of NDN traffic that is required to be generated.
Alexander Afanasyevfda32a32014-03-20 10:50:00 -07009Sample configuration files are provided which include instructions on how
10to configure various parameters.
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080011
Davide Pesavento032c9802019-01-25 17:10:26 -050012## Prerequisites
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080013
Alexander Afanasyevfda32a32014-03-20 10:50:00 -070014Compiling and running ndn-traffic-generator requires the following dependencies:
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080015
Davide Pesavento665f89c2023-02-14 16:45:07 -0500161. [ndn-cxx and its dependencies](https://docs.named-data.net/ndn-cxx/current/INSTALL.html)
172. [NDN Forwarding Daemon (NFD)](https://docs.named-data.net/NFD/current/INSTALL.html)
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080018
Davide Pesavento032c9802019-01-25 17:10:26 -050019## Compilation & Installation
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080020
Davide Pesaventof5006be2022-08-19 17:36:36 -040021```shell
Davide Pesavento5b9c85a2020-04-09 21:10:54 -040022./waf configure
23./waf
24sudo ./waf install
25```
Davide Pesavento2a7f32b2017-09-02 13:48:13 -040026
Davide Pesavento032c9802019-01-25 17:10:26 -050027## Command Line Options
28
Davide Pesaventof5006be2022-08-19 17:36:36 -040029### `ndn-traffic-server`
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080030
Davide Pesavento35185332019-01-14 04:00:15 -050031 Usage: ndn-traffic-server [options] <Traffic_Configuration_File>
Alexander Lanee9fe1872023-07-25 20:00:23 -040032
Davide Pesavento35185332019-01-14 04:00:15 -050033 Respond to Interests as per provided Traffic_Configuration_File.
jeraldabraham420dbf02014-04-25 22:58:31 -070034 Multiple prefixes can be configured for handling.
Davide Pesavento35185332019-01-14 04:00:15 -050035 Set the environment variable NDN_TRAFFIC_LOGFOLDER to redirect output to a log file.
Alexander Lanee9fe1872023-07-25 20:00:23 -040036
Davide Pesavento35185332019-01-14 04:00:15 -050037 Options:
Alexander Lanee9fe1872023-07-25 20:00:23 -040038 -h [ --help ] print this help message and exit
39 -c [ --count ] arg maximum number of Interests to respond to
40 -d [ --delay ] arg (=0) wait this amount of milliseconds before responding to each Interest
41 -t [ --timestamp-format ] arg format string for timestamp output (see below)
42 -q [ --quiet ] turn off logging of Interest reception and Data generation
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080043
Davide Pesaventof5006be2022-08-19 17:36:36 -040044### `ndn-traffic-client`
Davide Pesavento032c9802019-01-25 17:10:26 -050045
46 Usage: ndn-traffic-client [options] <Traffic_Configuration_File>
Alexander Lanee9fe1872023-07-25 20:00:23 -040047
Davide Pesavento35185332019-01-14 04:00:15 -050048 Generate Interest traffic as per provided Traffic_Configuration_File.
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080049 Interests are continuously generated unless a total number is specified.
Davide Pesavento35185332019-01-14 04:00:15 -050050 Set the environment variable NDN_TRAFFIC_LOGFOLDER to redirect output to a log file.
Alexander Lanee9fe1872023-07-25 20:00:23 -040051
Davide Pesavento35185332019-01-14 04:00:15 -050052 Options:
53 -h [ --help ] print this help message and exit
54 -c [ --count ] arg total number of Interests to be generated
55 -i [ --interval ] arg (=1000) Interest generation interval in milliseconds
Alexander Lanee9fe1872023-07-25 20:00:23 -040056 -t [ --timestamp-format ] arg format string for timestamp output (see below)
57 -q [ --quiet ] turn off logging of Interest generation and Data reception
58 -v [ --verbose ] log additional per-packet information
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080059
Davide Pesavento032c9802019-01-25 17:10:26 -050060* These tools need not be used together and can be used individually as well.
61* Please refer to the sample configuration files provided for details on how to create your own.
62* Use the command line options shown above to adjust traffic configuration.
Alexander Lanee9fe1872023-07-25 20:00:23 -040063* By default, timestamps are logged in Unix epoch format with microsecond granularity.
64 For custom output, the `--timestamp-format` option expects a format string using the syntax given in the
65 [Boost.Date_Time documentation](https://www.boost.org/doc/libs/1_71_0/doc/html/date_time/date_time_io.html#date_time.format_flags).
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080066
Davide Pesavento5b9c85a2020-04-09 21:10:54 -040067## Example
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080068
Davide Pesavento5b9c85a2020-04-09 21:10:54 -040069#### ON MACHINE #1
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080070
Davide Pesavento2a7f32b2017-09-02 13:48:13 -040071(NFD must be running)
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080072
Davide Pesavento032c9802019-01-25 17:10:26 -050073Start the traffic server:
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080074
Davide Pesaventof5006be2022-08-19 17:36:36 -040075```shell
76ndn-traffic-server ndn-traffic-server.conf
77```
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080078
Davide Pesavento5b9c85a2020-04-09 21:10:54 -040079#### ON MACHINE #2
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080080
Davide Pesavento2a7f32b2017-09-02 13:48:13 -040081(NFD must be running)
Alexander Afanasyeva8f2a922014-02-26 14:21:56 -080082
Davide Pesavento2a7f32b2017-09-02 13:48:13 -040083Start the traffic client:
Alexander Afanasyevfda32a32014-03-20 10:50:00 -070084
Davide Pesaventof5006be2022-08-19 17:36:36 -040085```shell
86ndn-traffic-client ndn-traffic-client.conf
87```
Davide Pesavento665f89c2023-02-14 16:45:07 -050088
89## License
90
91ndn-traffic-generator is free software distributed under the GNU General Public License version 3.
92See [`COPYING.md`](COPYING.md) for details.