Project

General

Profile

Repo Command » History » Version 15

Davide Pesavento, 06/28/2020 02:28 PM

1 1 Alex Afanasyev
Repo Command
2
============
3
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
                               InterestLifetime?
38 10 weijia yuan
                               ForwardingHint?
39 1 Alex Afanasyev
40 4 Weiqi Shi
41 1 Alex Afanasyev
    Name                  ::= NAME-TYPE TLV-LENGTH NameComponent*
42
    NameComponent         ::= NAME-COMPONENT-TYPE TLV-LENGTH BYTE+
43
    
44
    StartBlockId          ::= STARTBLOCKID-TYPE TLV-LENGTH
45 15 Davide Pesavento
                               NonNegativeInteger
46 1 Alex Afanasyev
    
47
    EndBlockId            ::= ENDBLOCKID-TYPE TLV-LENGTH
48 15 Davide Pesavento
                               NonNegativeInteger
49 1 Alex Afanasyev
50
    ProcessId             ::= PROCESSID-TYPE TLV-LENGTH
51 15 Davide Pesavento
                               NonNegativeInteger
52 3 Weiqi Shi
53
    InterestLifetime      ::= INTEREST-LIFETIME-TYPE TLV-LENGTH
54 15 Davide Pesavento
                               NonNegativeInteger
55 10 weijia yuan
56 12 weijia yuan
    ForwardingHint       ::= FORWARDING-HINT-TYPE TLV-LENGTH
57 11 weijia yuan
                               Delegation+
58 1 Alex Afanasyev
59
60
#### StartBlockId, EndBlockId
61
62
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.
63
64
#### Conflict of Selectors and StartBlockId, EndBlockId
65
66
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.
67
68
#### ProcessId
69
70 4 Weiqi Shi
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.
71
72
#### InterestLifetime
73 1 Alex Afanasyev
74 5 Weiqi Shi
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.
75 4 Weiqi Shi
76 13 weijia yuan
#### ForwardingHint
77
78
The ForwardingHint element contains a list of name delegations, as defined in Link Object section. Each delegation implies that the requested Data packet can be retrieved by forwarding the Interest along the delegation path. Specifics of the forwarding logic for Interests with ForwardingHint will be defined in a separated document.
79
80
81 1 Alex Afanasyev
## Repo Command Response
82
83
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.
84
85
    RepoCommandResponse   ::= INSERTSTATUS-TYPE TLV-LENGTH
86
                               ProcessId?
87
                               StatusCode
88
                               StartBlockId?
89
                               EndBlockId?
90
                               InsertNum?
91
                               DeleteNum?
92
93
    ProcessId            ::= PROCESSID-TYPE TLV-LENGTH
94 15 Davide Pesavento
                                NonNegativeInteger 
95 1 Alex Afanasyev
    
96
    StatusCode            ::= STATUSCODE-TYPE TLV-LENGTH
97 15 Davide Pesavento
                                NonNegativeInteger    
98 1 Alex Afanasyev
99
    StartBlockId          ::= STARTBLOCKID-TYPE TLV-LENGTH
100 15 Davide Pesavento
                                NonNegativeInteger
101 1 Alex Afanasyev
    
102
    EndBlockId            ::= ENDBLOCKID-TYPE TLV-LENGTH
103 15 Davide Pesavento
                                NonNegativeInteger
104 1 Alex Afanasyev
105
    InsertNum             ::= INSERTNUM-TYPE TLV-LENGTH
106 15 Davide Pesavento
                                NonNegativeInteger
107 1 Alex Afanasyev
108
    DeleteNum             ::= DELETENUM-TYPE TLV-LENGTH
109 15 Davide Pesavento
                                NonNegativeInteger
110 1 Alex Afanasyev
111
### Name
112
Name indicates the Name in repocommandparameter of repo command
113
114
115
### ProcessId
116
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.
117
118
### StatusCode
119
120
StatusCode indicates the status of repo command process. The statuscodes of insert and deletion command are described in following insertion and deletion specification.
121
122
### StartBlockId, EndBlockId
123
124
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.
125
126
### InsertNum, DeleteNum
127 6 Muktadir Chowdhury
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.
128 1 Alex Afanasyev
129
## Repo TLV Type Encoding Number
130
131
Type                  | Number
132
----------------------| -------
133
RepoCommandParameter  | 201
134
StartBlockId          | 204
135
EndBlockId            | 205
136
ProcessId             | 206
137
RepoCommandResponse   | 207
138
StatusCode            | 208
139
InsertNum             | 209
140
DeleteNum             | 210
141 5 Weiqi Shi
InterestLifetime      | 214
142 1 Alex Afanasyev
143
## Repo Trust Model
144
145
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.