Command Interest is an extension of Signed Interest.

As a signed interest, a command interest encodes the SignatureInfo and SignatureValue into the last two components of the Interest name.

|  Interest   | Interest | +------+--------+--------------------------------------------------+ +----------+ |
| Type (0x01) |  length  | | Name |  Name  | +---------+--   --+---------+---------+---------+| | Other    | |
|             |          | | Type | Length | |Component|  ...  |Component|Component|Component|| | TLVs ... | |
|             |          | |      |        | |  TLV 1  |       | TLV n-2 | TLV n-1 |  TLV n  || | in       | |
|             |          | |      |        | +---------+--   --+---------+---------+---------+| | Interest | |
|             |          | +------+--------+--------------------------------------------------+ +----------+ |

                                             \                                    /\        /
                                              ----------------  ------------------  ---  ---
                                                              \/                       \/
                                                   Signed portion of Interest       Signature

A command interest must prevent replay attack, therefore a command interest may encode additional components before the SignatureInfo component.
Depending on specific communication models, the command interest may introduce different name components.
We introduce one of the simplest solutions, stop-and-wait:


A stop-and-wait command interest introduces two additional components:

  • <timestamp>
  • <nonce>

For example, for /command/interest/name name, CommandInterest will be defined as:


                       \                         /\                               /
                        ------------  -----------  ---------------  --------------
                                    \/                            \/
                       Command Interest Extension  Components of Signed Interest

Timestamp component (n-3 th)

The value of the n-3 th component is the interest's timestamp (in terms of millisecond offset from UTC 1970-01-01 00:00:00) encoded as nonNegativeInteger.
The timestamp may be used to protect against replay attack.

Nonce component (n-2 th)

The value of the n-2 th component is random value (encoded as nonNegativeInteger) that adds additional assurances that the interest will be unique.

Command Interest Processing

Note that this verification process require signed interest to be received in order. Applications adopting this process may want to take "stop-and-wait" strategy.

On receiving an Interest, the producer, after verifying the packet signature, should treat the Interest as invalid in the following three cases:

  • one of the two components above (Timestamp and Nonce) is missing or cannot be parsed correctly;
  • the timestamp is equal or earlier than the timestamp of the received one has been received before.

Note that in order to detect this situation, the recipient needs to maintain a latest timestamp state for each trusted public key
(Since public key cryptography is used, sharing private keys is not recommended. If private key sharing is inevitable, it is the key owner's responsibility to keep clock synchronized).
For each trusted public key, the state is initialized as the timestamp of the first valid Interest signed by the key.
Since then, the state will be updated every time when the recipient receives a valid signed Interest.

Note that for the first Interest, the state is not available.
To handle this special situation, the recipient should check the Interest's timestamp against a grace interval (e.g., 120 seconds) [current_timestamp - interval/2, current_timestamp + interval/2].
The first interest is invalid if its timestamp is outside of the interval.