Project

General

Profile

Repo Command » History » Version 3

weijia yuan, 02/01/2018 04:40 PM

1 2 weijia yuan
Repo Command
2 1 weijia yuan
=============================
3 3 weijia yuan
4
For insertion, deletion and other operations of repo, these commands are encoded in the form of [[ndn-cxx:SignedInterest|Signed Interests]]:
5
6
    /<repo-prefix>/<command-verb>/................./.........................................
7
                                  \______  _______/ \__________________  ___________________/
8
                                         \/                            \/
9
                                 RepoCommandParameter   Signed Interest additional components
10
11
The semantics of repo command interest is as follows:
12
13
The name semantics is defined to have following components:
14
15
* ``<repo prefix>`` refers to specific prefix repo is listening
16
* ``<command verb>`` refers to the name of command
17
* ``<RepoCommandParameter>`` refers to parameters of repo command
18
19
The following components are components of singed interest for access control:
20
21
* ``<timestamp>``
22
* ``<random-value>``
23
* ``<SignatureInfo>``
24
* ``<SignatureValue>``
25
26
For prefix of repo /ucla/cs/repo/, the command will be defined as this:
27
28
    /ucla/cs/repo/<command verb>/<RepoCommandParameter>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
29
30
### RepoCommandParameter
31
32
    RepoCommandParameter ::= REPOCOMMANDPARAMETER-TYPE TLV-LENGTH
33
                               Name?
34
                               StartBlockId?
35
                               EndBlockId?
36
                               ProcessId?
37
                               MaxInterestNum?
38
                               WatchTimeout?
39
                               WatchStatus?
40
                               InterestLifetime?
41
42
43
44
    Name                  ::= NAME-TYPE TLV-LENGTH NameComponent*
45
    NameComponent         ::= NAME-COMPONENT-TYPE TLV-LENGTH BYTE+
46
47
48
    MinSuffixComponents   ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
49
                               nonNegativeInteger
50
51
    MaxSuffixComponents   ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
52
                               nonNegativeInteger
53
54
    PublisherPublicKeyLocator ::= KeyLocator
55
56
    Exclude               ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
57
    Any                   ::= ANY-TYPE TLV-LENGTH(=0)
58
59
   
60
    StartBlockId          ::= STARTBLOCKID-TYPE TLV-LENGTH
61
                               nonNegativeInteger
62
    
63
    EndBlockId            ::= ENDBLOCKID-TYPE TLV-LENGTH
64
                               nonNegativeInteger
65
66
    ProcessId             ::= PROCESSID-TYPE TLV-LENGTH
67
                               nonNegativeInteger
68
69
    MaxInterestNum        ::= MAX-INTEREST-NUM-TYPE TLV-LENGTH
70
                               nonNegativeInteger
71
72
    WatchTimeout          ::= WATCH-TIMEOUT-TYPE TLV-LENGTH
73
                               nonNegativeInteger
74
75
    WatchStatus           ::= WATCH-STATUS-TYPE TLV-LENGTH
76
                               nonNegativeInteger
77
78
    InterestLifetime      ::= INTEREST-LIFETIME-TYPE TLV-LENGTH
79
                               nonNegativeInteger
80
81
#### Repo Command Selectors
82
83
Repo command supports parts of interest selectors of interest to indicate which contents to process. The definition of standard NDN selectors is described in [NDN Selectors Doc](http://named-data.net/doc/ndn-tlv/interest.html#selectors). The concrete definitions of both standard NDN selectors and repo command selectors are the same.
84
85
The difference between standard NDN interest and Repo Deletion Command interest is that, the standard NDN selectors just matches **one** data packet that conforms to the selector conditions, but repo command selectors would matches **any** data packets. For example, if Interest is expressed for /ndn/edu and Exclude specifies one name component ucla, in standard NDN interest, the data producers will first include all the data packets with prefix /ndn/edu but not /ndn/edu/ucla, and then just selects one data packet. In repo deletion command interest, it will select all the data packets with prefix /ndn/edu but not /ndn/edu/ucla. However, in repo insert command, the repo will fetch one data just like standard interest selectors.
86
87
Repo command supports parts of standard NDN interests including MinSuffixComponents, MaxSuffixComponents, PublisherPublicKeyLocator, and Exclude. ChildSelector is supported in insertion command but not deletion command. If command contains other selectors, repo will ignore these not supported selectors. In addition, selectors are just supported in delete command. If other commands contains selectors, repo will ignore selectors when processing these commands.
88
89
The form of selectors is as follows:
90
91
    Selectors             ::= SELECTORS-TYPE TLV-LENGTH
92
                               MinSuffixComponents?
93
                               MaxSuffixComponents?
94
                               PublisherPublicKeyLocator?
95
                               Exclude?
96
                               ChildSelector?
97
    
98
    MinSuffixComponents   ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
99
                               nonNegativeInteger
100
101
    MaxSuffixComponents   ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
102
                               nonNegativeInteger
103
104
    PublisherPublicKeyLocator ::= KeyLocator
105
    
106
    Exclude               ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
107
    Any                   ::= ANY-TYPE TLV-LENGTH(=0)
108
109
    ChildSelector         ::= CHILD-SELECTOR-TYPE TLV-LENGTH
110
                               nonNegativeInteger
111
112
#### StartBlockId, EndBlockId
113
114
StartBlockId and EndBlockId are used to process segmented data. StartBlockId indicate the first segment number and EndBlockId indicate the last segment number. Repo will process segment data whose segment id between StartBlockId and EndBlockId. If StartBlockId is missing, the first segment id the repo process is 0; If EndBlockId is missing, this scenario is described in specific process in Repo Insertion Command section and Repo Deletion Command section.
115
116
#### Conflict of Selectors and StartBlockId, EndBlockId
117
118
Repo cannot process command with both selectors and StartBlockId, EndBlockId in RepoCommandParameter. If the RepoCommandParameter carries both, repo will ignore this command interest and return with error code of 405.
119
120
#### ProcessId
121
122
ProcessId is used by insertion and deletion check command to indicate specific insertion and deletion process. The ProcessId is fetched by repo command response of insertion and deletion command.
123
124
#### InterestLifetime
125
126
InterestLifetime is the maximum latency between interest sent and data received. If no data received after the InterestLifetime, the interest will time out. InterestLifetime is optional and a default value will be set if it is not specified.
127
128
#### MaxInterestNum
129
130
MaxInterestNum is used by watched prefix insertion protocol to set the upper limit of the total number of interests to be sent.
131
132
#### WatchTimeout
133
134
WatchTimeout is used by watched prefix insertion protocol to set the time duration of the whole watching process.
135
136
#### WatchStatus
137
138
WatchStatus is used by watched prefix insertion protocol to indicate the status of watching process. If the WatchStatus is true, then the watching prefix is running, otherwise, it is not.
139
140
## Repo Command Response
141
142
Repo command response is the response data packet of repo command interest. The response contains statuscode to indicate the status of command process and other information. A TLV-encoded block called ``RepoCommandResponse`` is encoded in content of the data packet.
143
144
    RepoCommandResponse   ::= INSERTSTATUS-TYPE TLV-LENGTH
145
                               ProcessId?
146
                               StatusCode
147
                               StartBlockId?
148
                               EndBlockId?
149
                               InsertNum?
150
                               DeleteNum?
151
152
    ProcessId            ::= PROCESSID-TYPE TLV-LENGTH
153
                                nonNegativeInteger 
154
    
155
    StatusCode            ::= STATUSCODE-TYPE TLV-LENGTH
156
                                nonNegativeInteger    
157
158
    StartBlockId          ::= STARTBLOCKID-TYPE TLV-LENGTH
159
                                nonNegativeInteger
160
    
161
    EndBlockId            ::= ENDBLOCKID-TYPE TLV-LENGTH
162
                                nonNegativeInteger
163
164
    InsertNum             ::= INSERTNUM-TYPE TLV-LENGTH
165
                                nonNegativeInteger
166
167
    DeleteNum             ::= DELETENUM-TYPE TLV-LENGTH
168
                                nonNegativeInteger
169
170
### Name
171
Name indicates the Name in repocommandparameter of repo command
172
173
174
### ProcessId
175
ProcessId is a random number generated by repo to indicate the number of the command process. Client could use this ProcessId to check the status of specific command.
176
177
### StatusCode
178
179
StatusCode indicates the status of repo command process. The statuscodes of insert and deletion command are described in following insertion and deletion specification.
180
181
### StartBlockId, EndBlockId
182
183
StartBlockId and EndBlockId are the same as those of RepoCommandParameter. If either of those in RepoCommandParameter is missing, repo will set them as the Id known for now. For example, if StartBlockId is missing in RepoCommandParameter, StartBlockId in response will be set 0. If EndBlockId is missing in RepoCommandParameter, EndBlockId will be set null untill Repo get FinalBlockId in data packet. If FinalBlockId in returned data packet is less than EndBlockId, the EndBlockId will be set FinalBlockId.
184
185
### InsertNum, DeleteNum
186
InsertNum is used in reponse of insertion status check to indicate how many data packets have been successfully inserted into the repo. DeleteNum is used in response of deletion command and deletion check command. DeleteNum indicates how many data packets have been successfully deleted from repo.
187
188
## Repo TLV Type Encoding Number
189
190
Type                  | Number
191
----------------------| -------
192
RepoCommandParameter  | 201
193
StartBlockId          | 204
194
EndBlockId            | 205
195
ProcessId             | 206
196
RepoCommandResponse   | 207
197
StatusCode            | 208
198
InsertNum             | 209
199
DeleteNum             | 210
200
MaxInterestNum        | 211
201
WatchTimeout          | 212
202
WatchStatus           | 213
203
InterestLifetime      | 214
204
205
## Repo Trust Model
206
207
The trust model of repo depends on people who deploy the repo service, such as PKI. Repo can specify their own verification policies, and data consumers can specify their own trust anchors. The NDN [FAQ](http://named-data.net/project/faq/#How_does_NDN8217s_8220trust_management8221_work) shows how NDN trust managment works.