Repo Command » History » Revision 1
Revision 1/15
| Next »
Alex Afanasyev, 07/23/2014 04:35 PM
Repo Command¶
For insertion, deletion and other operations of repo, these commands are encoded in the form of Signed Interests:
/<repo-prefix>/<command-verb>/................./.........................................
\______ _______/ \__________________ ___________________/
\/ \/
RepoCommandParameter Signed Interest additional components
The semantics of repo command interest is as follows:
The name semantics is defined to have following components:
<repo prefix>
refers to specific prefix repo is listening<command verb>
refers to the name of command<RepoCommandParameter>
refers to parameters of repo command
The following components are components of singed interest for access control:
<timestamp>
<random-value>
<SignatureInfo>
<SignatureValue>
For prefix of repo /ucla/cs/repo/, the command will be defined as this:
/ucla/cs/repo/<command verb>/<RepoCommandParameter>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
RepoCommandParameter¶
RepoCommandParameter ::= REPOCOMMANDPARAMETER-TYPE TLV-LENGTH
Name?
Selectors?
StartBlockId?
EndBlockId?
ProcessId?
Name ::= NAME-TYPE TLV-LENGTH NameComponent*
NameComponent ::= NAME-COMPONENT-TYPE TLV-LENGTH BYTE+
Selectors ::= SELECTORS-TYPE TLV-LENGTH
MinSuffixComponents?
MaxSuffixComponents?
PublisherPublicKeyLocator?
Exclude?
ChildSelector?
MinSuffixComponents ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
nonNegativeInteger
MaxSuffixComponents ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
nonNegativeInteger
PublisherPublicKeyLocator ::= KeyLocator
Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
Any ::= ANY-TYPE TLV-LENGTH(=0)
ChildSelector ::= CHILD-SELECTOR-TYPE TLV-LENGTH
nonNegativeInteger
StartBlockId ::= STARTBLOCKID-TYPE TLV-LENGTH
nonNegativeInteger
EndBlockId ::= ENDBLOCKID-TYPE TLV-LENGTH
nonNegativeInteger
ProcessId ::= PROCESSID-TYPE TLV-LENGTH
nonNegativeInteger
Repo Command Selectors¶
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. The concrete definitions of both standard NDN selectors and repo command selectors are the same.
The difference between standard NDN interest and Repo Deletion Command interest 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 exclude 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.
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.
The form of selectors is as follows:
Selectors ::= SELECTORS-TYPE TLV-LENGTH
MinSuffixComponents?
MaxSuffixComponents?
PublisherPublicKeyLocator?
Exclude?
ChildSelector?
MinSuffixComponents ::= MIN-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
nonNegativeInteger
MaxSuffixComponents ::= MAX-SUFFIX-COMPONENTS-TYPE TLV-LENGTH
nonNegativeInteger
PublisherPublicKeyLocator ::= KeyLocator
Exclude ::= EXCLUDE-TYPE TLV-LENGTH Any? (NameComponent (Any)?)+
Any ::= ANY-TYPE TLV-LENGTH(=0)
ChildSelector ::= CHILD-SELECTOR-TYPE TLV-LENGTH
nonNegativeInteger
StartBlockId, EndBlockId¶
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.
Conflict of Selectors and StartBlockId, EndBlockId¶
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.
ProcessId¶
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.
Repo Command Response¶
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.
RepoCommandResponse ::= INSERTSTATUS-TYPE TLV-LENGTH
ProcessId?
StatusCode
StartBlockId?
EndBlockId?
InsertNum?
DeleteNum?
ProcessId ::= PROCESSID-TYPE TLV-LENGTH
nonNegativeInteger
StatusCode ::= STATUSCODE-TYPE TLV-LENGTH
nonNegativeInteger
StartBlockId ::= STARTBLOCKID-TYPE TLV-LENGTH
nonNegativeInteger
EndBlockId ::= ENDBLOCKID-TYPE TLV-LENGTH
nonNegativeInteger
InsertNum ::= INSERTNUM-TYPE TLV-LENGTH
nonNegativeInteger
DeleteNum ::= DELETENUM-TYPE TLV-LENGTH
nonNegativeInteger
Name¶
Name indicates the Name in repocommandparameter of repo command
ProcessId¶
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.
StatusCode¶
StatusCode indicates the status of repo command process. The statuscodes of insert and deletion command are described in following insertion and deletion specification.
StartBlockId, EndBlockId¶
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.
InsertNum, DeleteNum¶
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 inserted from repo.
Repo TLV Type Encoding Number¶
Type | Number |
---|---|
RepoCommandParameter | 201 |
StartBlockId | 204 |
EndBlockId | 205 |
ProcessId | 206 |
RepoCommandResponse | 207 |
StatusCode | 208 |
InsertNum | 209 |
DeleteNum | 210 |
Repo Trust Model¶
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 shows how NDN trust managment works.
Repo Insertion Specification¶
Repo insertion command requests that the repo retrieve and store content. This command interest is a signed interest and will be validated with access control policy defined by the repo. When the interested is validated and name of the data is not existed in the repo. The repository will reponsd with a data object containing OK status and start to send the interest to fetch the data to insert.
Segmented data insertion is also supported in the insertion protocol. Segmentation info is defined in RepoCommandParameter. If the content is segmented, the final segment id will be encoded in this block.
Updated by Alex Afanasyev over 10 years ago · 15 revisions