Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 1 | # ndnping and ndnpingserver |
| 2 | |
| 3 | ## Introduction |
| 4 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 5 | **ndnping** and **ndnpingserver** are reachability testing tools for NDN. They can be used |
| 6 | to test the network reachability between two nodes. The client sends an Interest intended |
| 7 | for a node running **ndnpingserver**. The server then sends Data in response. The client |
| 8 | then calculates the roundtrip time for the Interest-Data exchange, or marks it as a timeout |
| 9 | if the Data packet is not received within the timeout period. |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 10 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 11 | ## Using the client |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 12 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 13 | The client can be invoked by calling `ndnping` with a name to ping. For example, to ping |
| 14 | `/edu/arizona`, one would run: |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 15 | |
Davide Pesavento | 0d4b182 | 2019-07-27 19:32:05 -0400 | [diff] [blame] | 16 | ndnping /edu/arizona |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 17 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 18 | There are also a variety of options to control the behavior of the ping client. For example, |
| 19 | to send only four pings to `/edu/arizona`, displaying a timestamp with each received Data or |
Davide Pesavento | 0d4b182 | 2019-07-27 19:32:05 -0400 | [diff] [blame] | 20 | timeout, type: |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 21 | |
Davide Pesavento | 0d4b182 | 2019-07-27 19:32:05 -0400 | [diff] [blame] | 22 | ndnping -c 4 -t /edu/arizona |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 23 | |
| 24 | A list of the available options can be found with `man ndnping`. |
| 25 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 26 | ## Using the server |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 27 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 28 | The server can be invoked by calling `ndnpingserver` with a name to listen for pings to. For |
| 29 | example, to listen for pings to `/edu/arizona`, one would run: |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 30 | |
Davide Pesavento | 0d4b182 | 2019-07-27 19:32:05 -0400 | [diff] [blame] | 31 | ndnpingserver /edu/arizona |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 32 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 33 | There are also a variety of options to control the behavior of the ping server. For example, |
| 34 | to satisfy only 4 ping requests before exiting, run the following: |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 35 | |
Davide Pesavento | 0d4b182 | 2019-07-27 19:32:05 -0400 | [diff] [blame] | 36 | ndnpingserver -p 4 /edu/arizona |
Eric Newberry | 7f25a11 | 2015-05-31 11:23:25 -0700 | [diff] [blame] | 37 | |
Junxiao Shi | ae2c9f7 | 2016-02-16 09:03:24 -0700 | [diff] [blame] | 38 | A list of the available options can be found with `man ndnpingserver`. |
| 39 | |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 40 | ## NDN ping protocol |
Junxiao Shi | ae2c9f7 | 2016-02-16 09:03:24 -0700 | [diff] [blame] | 41 | |
| 42 | This section briefly describes ndnping's protocol, in order to allow alternate implementations |
| 43 | to be compatible with this implementation. |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 44 | |
Junxiao Shi | ae2c9f7 | 2016-02-16 09:03:24 -0700 | [diff] [blame] | 45 | The current protocol version is **ndnping protocol version 1**. |
Davide Pesavento | db9613e | 2023-01-20 20:52:21 -0500 | [diff] [blame] | 46 | This version number will be incremented whenever there is an incompatible change. |
Junxiao Shi | ae2c9f7 | 2016-02-16 09:03:24 -0700 | [diff] [blame] | 47 | |
| 48 | ### Probe Interests |
| 49 | |
| 50 | The client expresses probe Interests that are intended to be forwarded to the server |
| 51 | without being aggregated. |
| 52 | The Interests MUST have one of the following name structures: |
| 53 | |
| 54 | ndn:/<prefix>/ping/<seq> |
| 55 | ndn:/<prefix>/ping/<client-identifier>/<seq> |
| 56 | |
| 57 | where: |
| 58 | |
| 59 | * `<prefix>` is the server prefix that contains zero or more NameComponents. |
| 60 | * `<seq>` is one NameComponent whose value is an unsigned 64-bit integer, represented as |
| 61 | a decimal number in ASCII encoding. |
| 62 | * `<client-identifier>` is one NameComponent with arbitrary value. |
| 63 | |
| 64 | If a client expresses multiple probe Interests, it is RECOMMENDED for those Interests to |
| 65 | have consecutive increasing integers in `<seq>` field. |
| 66 | |
| 67 | If a client uses the name structure with `<client-identifier>` field, it is RECOMMENDED to use |
| 68 | one or more printable characters only, to make it easier for a human operator to read the logs. |
| 69 | A client implementation MAY restrict this field to be non-empty and have printable characters only. |
| 70 | |
Junxiao Shi | 20d5a0b | 2018-08-14 09:26:11 -0600 | [diff] [blame] | 71 | The probe Interest SHOULD NOT carry CanBePrefix element. |
| 72 | |
| 73 | The probe Interest SHOULD carry MustBeFresh element. |
| 74 | A client implementation MAY allow the operator to remove MustBeFresh element. |
Junxiao Shi | ae2c9f7 | 2016-02-16 09:03:24 -0700 | [diff] [blame] | 75 | |
| 76 | ### Reply Data |
| 77 | |
| 78 | The server SHOULD register the prefix `ndn:/<prefix>/ping`, and MUST reply to probe Interests |
| 79 | under this prefix with Data. |
| 80 | The Data MUST have the same name as the probe Interest. |
| 81 | |
| 82 | The Data MUST have BLOB as its ContentType. |
| 83 | The Data MAY have arbitrary payload in its Content field. |
| 84 | A server implementation MAY allow the operator to configure the length and contents of the payload. |
| 85 | |
| 86 | The Data SHOULD have a valid signature. |
| 87 | The server SHOULD use DigestSha256 signature by default. |
| 88 | A server implementation MAY allow the operator to configure a different signature algorithm. |
| 89 | The client SHOULD NOT verify the signature by default. |
| 90 | A client implementation MAY allow the operator to enable signature verification. |