Project

General

Profile

Repo Command » History » Version 9

Haitao Zhang, 02/14/2018 02:00 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 8 Haitao Zhang
33 9 Haitao Zhang
    RepoCommandParameter ::= REPOCOMMANDPARAMETER-TYPE TLV-LENGTH
34 7 Haitao Zhang
                                                    Name?
35
                                                    StartBlockId?
36
                                                    EndBlockId?
37
                                                    ProcessId?
38
                                                    MaxInterestNum?
39
                                                    WatchTimeout?
40
                                                    WatchStatus?
41 3 weijia yuan
                                                    InterestLifetime?
42
43
    Name                  ::= NAME-TYPE TLV-LENGTH NameComponent*
44
    NameComponent         ::= NAME-COMPONENT-TYPE TLV-LENGTH BYTE+
45
46
    StartBlockId          ::= STARTBLOCKID-TYPE TLV-LENGTH
47
                               nonNegativeInteger
48
    
49
    EndBlockId            ::= ENDBLOCKID-TYPE TLV-LENGTH
50
                               nonNegativeInteger
51
52
    ProcessId             ::= PROCESSID-TYPE TLV-LENGTH
53
                               nonNegativeInteger
54
55
    MaxInterestNum        ::= MAX-INTEREST-NUM-TYPE TLV-LENGTH
56
                               nonNegativeInteger
57
58
    WatchTimeout          ::= WATCH-TIMEOUT-TYPE TLV-LENGTH
59
                               nonNegativeInteger
60
61
    WatchStatus           ::= WATCH-STATUS-TYPE TLV-LENGTH
62
                               nonNegativeInteger
63
64
    InterestLifetime      ::= INTEREST-LIFETIME-TYPE TLV-LENGTH
65
                               nonNegativeInteger
66
67
#### StartBlockId, EndBlockId
68
69
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.
70
71
#### ProcessId
72
73
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.
74
75
#### InterestLifetime
76
77
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.
78
79
#### MaxInterestNum
80
81
MaxInterestNum is used by watched prefix insertion protocol to set the upper limit of the total number of interests to be sent.
82
83
#### WatchTimeout
84
85
WatchTimeout is used by watched prefix insertion protocol to set the time duration of the whole watching process.
86
87
#### WatchStatus
88
89
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.
90
91
## Repo Command Response
92
93
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.
94
95
    RepoCommandResponse   ::= INSERTSTATUS-TYPE TLV-LENGTH
96
                               ProcessId?
97
                               StatusCode
98
                               StartBlockId?
99
                               EndBlockId?
100
                               InsertNum?
101
                               DeleteNum?
102
103
    ProcessId            ::= PROCESSID-TYPE TLV-LENGTH
104
                                nonNegativeInteger 
105
    
106
    StatusCode            ::= STATUSCODE-TYPE TLV-LENGTH
107
                                nonNegativeInteger    
108
109
    StartBlockId          ::= STARTBLOCKID-TYPE TLV-LENGTH
110
                                nonNegativeInteger
111
    
112
    EndBlockId            ::= ENDBLOCKID-TYPE TLV-LENGTH
113
                                nonNegativeInteger
114
115
    InsertNum             ::= INSERTNUM-TYPE TLV-LENGTH
116
                                nonNegativeInteger
117
118
    DeleteNum             ::= DELETENUM-TYPE TLV-LENGTH
119
                                nonNegativeInteger
120
121
### Name
122
Name indicates the Name in repocommandparameter of repo command
123
124
125
### ProcessId
126
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.
127
128
### StatusCode
129
130
StatusCode indicates the status of repo command process. The statuscodes of insert and deletion command are described in following insertion and deletion specification.
131
132
### StartBlockId, EndBlockId
133
134
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.
135
136
### InsertNum, DeleteNum
137
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.
138
139
## Repo TLV Type Encoding Number
140
141
Type                  | Number
142
----------------------| -------
143
RepoCommandParameter  | 201
144
StartBlockId          | 204
145
EndBlockId            | 205
146
ProcessId             | 206
147
RepoCommandResponse   | 207
148
StatusCode            | 208
149
InsertNum             | 209
150
DeleteNum             | 210
151
MaxInterestNum        | 211
152
WatchTimeout          | 212
153
WatchStatus           | 213
154
InterestLifetime      | 214
155
156
## Repo Trust Model
157
158
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.