blob: 1e0f02fa1b77d68810c72877a33f0c91745c87b7 [file] [log] [blame] [view]
Eric Newberry7f25a112015-05-31 11:23:25 -07001# ndnping and ndnpingserver
2
3## Introduction
4
Davide Pesaventodb9613e2023-01-20 20:52:21 -05005**ndnping** and **ndnpingserver** are reachability testing tools for NDN. They can be used
6to test the network reachability between two nodes. The client sends an Interest intended
7for a node running **ndnpingserver**. The server then sends Data in response. The client
8then calculates the roundtrip time for the Interest-Data exchange, or marks it as a timeout
9if the Data packet is not received within the timeout period.
Eric Newberry7f25a112015-05-31 11:23:25 -070010
Davide Pesaventodb9613e2023-01-20 20:52:21 -050011## Using the client
Eric Newberry7f25a112015-05-31 11:23:25 -070012
Davide Pesaventodb9613e2023-01-20 20:52:21 -050013The client can be invoked by calling `ndnping` with a name to ping. For example, to ping
14`/edu/arizona`, one would run:
Eric Newberry7f25a112015-05-31 11:23:25 -070015
Davide Pesavento0d4b1822019-07-27 19:32:05 -040016 ndnping /edu/arizona
Eric Newberry7f25a112015-05-31 11:23:25 -070017
Davide Pesaventodb9613e2023-01-20 20:52:21 -050018There are also a variety of options to control the behavior of the ping client. For example,
19to send only four pings to `/edu/arizona`, displaying a timestamp with each received Data or
Davide Pesavento0d4b1822019-07-27 19:32:05 -040020timeout, type:
Eric Newberry7f25a112015-05-31 11:23:25 -070021
Davide Pesavento0d4b1822019-07-27 19:32:05 -040022 ndnping -c 4 -t /edu/arizona
Eric Newberry7f25a112015-05-31 11:23:25 -070023
24A list of the available options can be found with `man ndnping`.
25
Davide Pesaventodb9613e2023-01-20 20:52:21 -050026## Using the server
Eric Newberry7f25a112015-05-31 11:23:25 -070027
Davide Pesaventodb9613e2023-01-20 20:52:21 -050028The server can be invoked by calling `ndnpingserver` with a name to listen for pings to. For
29example, to listen for pings to `/edu/arizona`, one would run:
Eric Newberry7f25a112015-05-31 11:23:25 -070030
Davide Pesavento0d4b1822019-07-27 19:32:05 -040031 ndnpingserver /edu/arizona
Eric Newberry7f25a112015-05-31 11:23:25 -070032
Davide Pesaventodb9613e2023-01-20 20:52:21 -050033There are also a variety of options to control the behavior of the ping server. For example,
34to satisfy only 4 ping requests before exiting, run the following:
Eric Newberry7f25a112015-05-31 11:23:25 -070035
Davide Pesavento0d4b1822019-07-27 19:32:05 -040036 ndnpingserver -p 4 /edu/arizona
Eric Newberry7f25a112015-05-31 11:23:25 -070037
Junxiao Shiae2c9f72016-02-16 09:03:24 -070038A list of the available options can be found with `man ndnpingserver`.
39
Davide Pesaventodb9613e2023-01-20 20:52:21 -050040## NDN ping protocol
Junxiao Shiae2c9f72016-02-16 09:03:24 -070041
42This section briefly describes ndnping's protocol, in order to allow alternate implementations
43to be compatible with this implementation.
Davide Pesaventodb9613e2023-01-20 20:52:21 -050044
Junxiao Shiae2c9f72016-02-16 09:03:24 -070045The current protocol version is **ndnping protocol version 1**.
Davide Pesaventodb9613e2023-01-20 20:52:21 -050046This version number will be incremented whenever there is an incompatible change.
Junxiao Shiae2c9f72016-02-16 09:03:24 -070047
48### Probe Interests
49
50The client expresses probe Interests that are intended to be forwarded to the server
51without being aggregated.
52The Interests MUST have one of the following name structures:
53
54 ndn:/<prefix>/ping/<seq>
55 ndn:/<prefix>/ping/<client-identifier>/<seq>
56
57where:
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
64If a client expresses multiple probe Interests, it is RECOMMENDED for those Interests to
65have consecutive increasing integers in `<seq>` field.
66
67If a client uses the name structure with `<client-identifier>` field, it is RECOMMENDED to use
68one or more printable characters only, to make it easier for a human operator to read the logs.
69A client implementation MAY restrict this field to be non-empty and have printable characters only.
70
Junxiao Shi20d5a0b2018-08-14 09:26:11 -060071The probe Interest SHOULD NOT carry CanBePrefix element.
72
73The probe Interest SHOULD carry MustBeFresh element.
74A client implementation MAY allow the operator to remove MustBeFresh element.
Junxiao Shiae2c9f72016-02-16 09:03:24 -070075
76### Reply Data
77
78The server SHOULD register the prefix `ndn:/<prefix>/ping`, and MUST reply to probe Interests
79under this prefix with Data.
80The Data MUST have the same name as the probe Interest.
81
82The Data MUST have BLOB as its ContentType.
83The Data MAY have arbitrary payload in its Content field.
84A server implementation MAY allow the operator to configure the length and contents of the payload.
85
86The Data SHOULD have a valid signature.
87The server SHOULD use DigestSha256 signature by default.
88A server implementation MAY allow the operator to configure a different signature algorithm.
89The client SHOULD NOT verify the signature by default.
90A client implementation MAY allow the operator to enable signature verification.