Command Interests » History » Version 3
Alex Afanasyev, 02/15/2014 09:01 PM
1 | 1 | Yingdi Yu | Command Interests |
---|---|---|---|
2 | ================= |
||
3 | |||
4 | **Command Interest** is a mechanism to issue an authenticated control command. |
||
5 | Command Interests are similar to Signed Interests, but in addition to basic cryptographic signature, also ensure uniqueness of each command. |
||
6 | |||
7 | The signature of a command Interest packet is embedded into the last component of the Interest name. |
||
8 | The signature covers a continuous block starting from the first name component TLV to the penultimate name component TLV: |
||
9 | |||
10 | +-------------+----------+-----------------------------------------------------------------------------------+ |
||
11 | | Interest | Interest | +------+--------+--------------------------------------------------+ +----------+ | |
||
12 | | Type (0x01) | length | | Name | Name | +---------+-- --+---------+---------+---------+| | Other | | |
||
13 | | | | | Type | Length | |Component| ... |Component|Component|Component|| | TLVs ... | | |
||
14 | | | | | | | | TLV 1 | | TLV n-2 | TLV n-1 | TLV n || | in | | |
||
15 | | | | | | | +---------+-- --+---------+---------+---------+| | Interest | | |
||
16 | | | | +------+--------+--------------------------------------------------+ +----------+ | |
||
17 | +-------------+----------+-----------------------------------------------------------------------------------+ |
||
18 | |||
19 | \ /\ / |
||
20 | ---------------- ------------------ --- --- |
||
21 | \/ \/ |
||
22 | Signed portion of Interest Signature |
||
23 | |||
24 | |||
25 | More specifically, the CommandInterest is defined to have three additional components: |
||
26 | |||
27 | * ``<timestamp>`` |
||
28 | * ``<random-value>`` |
||
29 | * ``<SignatureInfo>`` |
||
30 | * ``<SignatureValue>`` |
||
31 | |||
32 | 3 | Alex Afanasyev | /signed/interest/name/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue> |
33 | \ / |
||
34 | ------------------------- ------------------------------ |
||
35 | \/ |
||
36 | Additional components of Command Interest |
||
37 | |||
38 | |||
39 | 1 | Yingdi Yu | For example, for ``/signed/interest/name`` name, CommandInterest will be defined as: |
40 | |||
41 | /signed/interest/name/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue> |
||
42 | |||
43 | \ / |
||
44 | ---------------------------- -------------------------------- |
||
45 | \/ |
||
46 | Signed part of the name |
||
47 | |||
48 | ## Signed Interest specific Name components |
||
49 | |||
50 | ### Timestamp component (n-3 *th*) |
||
51 | |||
52 | The value of the n-3 *th* component is the control command's timestamp (in terms of millisecond offset from UTC 1970-01-01 00:00:00) encoded as [nonNegativeInteger](http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding). |
||
53 | The timestamp is used to protect against replay attack. |
||
54 | |||
55 | ### Random value (n-2 *th*) |
||
56 | |||
57 | 2 | Yingdi Yu | The value of the n-2 *th* component is random value (32bits) that adds additional assurances that the command Interest will be unique, even if multiple commands are issued at the same time. |
58 | The random value is also encoded as [nonNegativeInteger](http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding). |
||
59 | 1 | Yingdi Yu | |
60 | ### SignatureInfo component (n-1 *th*) |
||
61 | |||
62 | The value of the n-1 *th* component is actually a [SignatureInfo](http://named-data.net/doc/ndn-tlv/signature.html) TLV. |
||
63 | |||
64 | +---------+---------+-------------------+ |
||
65 | |Component|Component| +---------------+ | |
||
66 | | Type | Length | | SignatureInfo | | |
||
67 | | | | | TLV | | |
||
68 | | | | +---------------+ | |
||
69 | +---------+---------+-------------------+ |
||
70 | |||
71 | | | |
||
72 | |<---------The n-1 th Component-------->| |
||
73 | |||
74 | ### SignatureValue component (n *th*) |
||
75 | |||
76 | The value of the n *th* component is actually a [SignatureValue](http://named-data.net/doc/ndn-tlv/signature.html) TLV. |
||
77 | |||
78 | +---------+---------+--------------------+ |
||
79 | |Component|Component| +----------------+ | |
||
80 | | Type | Length | | SignatureValue | | |
||
81 | | | | | TLV | | |
||
82 | | | | +----------------+ | |
||
83 | +---------+---------+--------------------+ |
||
84 | |||
85 | | | |
||
86 | |<----------The n th Component---------->| |
||
87 | |||
88 | ## Command Interest processing |
||
89 | |||
90 | On receiving an Interest, the producer, according to the Interest name prefix, should be able to tell whether the Interest is required to be signed. |
||
91 | If the received Interest is supposed to be signed, it will be treated as invalid in the following four cases: |
||
92 | |||
93 | - one of the three components above (SignatureValue, SignatureInfo, and Timestamp) is missing or cannot be parsed correctly; |
||
94 | - the key is not trusted for signing the control command; |
||
95 | - the signature cannot be verified with the public key pointed by the [KeyLocator](http://named-data.net/doc/ndn-tlv/signature.html#keylocator) in SignatureInfo; |
||
96 | - the producer has already received a valid signed Interest whose timestamp is **equal or later** than the timestamp of the received one. |
||
97 | |||
98 | Note that in order to detect the fourth case, the producer needs to maintain a *latest timestamp* state for each trusted public key (or global *latest timestamp* for all trusted public keys). |
||
99 | For each trusted public key, the state is initialized as the timestamp of the first valid Interest signed by the key. |
||
100 | Since then, the state will be updated every time when the producer receives a valid command Interest. |
||
101 | |||
102 | Note that for the first Interest, the state is not available. |
||
103 | To handle this special situation, the producer should check the Interest's timestamp against a proper interval (e.g., 120 seconds) [current\_timestamp - interval/2, current\_timestamp + interval/2]. |
||
104 | The first interest is invalid if its timestamp is outside of the interval. |