Project

General

Profile

Repo Protocol Specification » History » Version 14

Shuo Chen, 02/19/2014 10:32 AM

1 1 Shuo Chen
Repo Protocol Specification
2
===========================
3
4 2 Shuo Chen
Repo is persistent storage of data objects model in NDN. The NDN repo protocol is a specification of repo operations including reading, insertion and deletion of data objects in repo.
5
6
Repo semantics is based on [Command Interests](http://redmine.named-data.net/projects/nfd/wiki/Command_Interests) with signed commponents an the end of the name and basic common semantics of NDN. 
7
8 11 Shuo Chen
When some operation of repo including insertion and deletion of data objects is requested, a command interest is sent. The command interest is the interest as command of insertion and deletion and signed as form of command interest for access control. The repo will response the command with the data object.
9 4 Shuo Chen
10
The repo protocol can be categorized in three sections of reading, insertion and deletion of data objects.
11
12
## Repo Reading Specification
13
14 11 Shuo Chen
The repo could be viewed as the data container of the data objects. It will register some specific prefixes of data objects it holds into NFD (NDN Forwarding Deamon) and the repo will respond the data with such prefixes.
15 6 Shuo Chen
16 11 Shuo Chen
A standard interest is used to fetch content from the repo. The repo will respond when the name of the interest matches the prefix it registered in NFD. If the content in repo matches the interests, it will respond with the data object. When the interest is not matched, it will not respond.
17 6 Shuo Chen
18
The protocol is listed as bellow
19
20
If there is a matching data object:
21
22 7 Shuo Chen
    Requester                     Repo
23
        |                           |
24
        |                           |
25
        |         Interest          |
26
     t1 |-------------------------->|
27
        |                           |
28
        |        Data Object        |
29
     t2 |<==========================|
30 1 Shuo Chen
        |                           |
31 7 Shuo Chen
        |                           |
32 1 Shuo Chen
        |                           |
33 7 Shuo Chen
34
If there is no matching data object:
35 6 Shuo Chen
36
    Requester                     Repo
37
        |                           |
38 1 Shuo Chen
        |                           |
39 7 Shuo Chen
        |         Interest          |
40
     t1 |-------------------------->|
41
        |                           |
42
        |                           |
43
        |                           |
44
45 8 Shuo Chen
## Repo Insertion Specification
46
47 11 Shuo Chen
Insertion specification is for some client and application to insert data objects into certain NDN repo. A command interest as insertion command will be sent to the repo. 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 reponse with a data object containing OK status and start to send the interest to fetch the data to insert.
48 8 Shuo Chen
49 14 Shuo Chen
Segmented data insertation is also supported in the insertation protocol. Segmantation info is defined as a TLV-encoded SegmantationInfo block. If the content is segmented, the final segment id will be encoded in this block.
50
51 8 Shuo Chen
### Insertion command interest semantics
52 1 Shuo Chen
53
The name semantics is defined to have following components:
54
55
* ``<box of repo>`` refers to specific name of repo
56 11 Shuo Chen
* ``insert`` refers to insert data objects
57 1 Shuo Chen
* ``<data name>`` refers to specific name of data that will be inserted
58
59 8 Shuo Chen
The folloing components are components of singed interest for access control:
60
61
* ``<timestamp>``
62
* ``<random-value>``
63
* ``<SignatureInfo>``
64
* ``<SignatureValue>``
65
66
<box of repo> and <data name> can be divided by serveral continious ``/`` according to specific defination.
67 11 Shuo Chen
For example, for ``<box of repo>`` as ``/ucla/cs/repo`` and ``<data name>`` as ``/vedio/Forrest Gump``, the data object is defined as following:
68 8 Shuo Chen
69 11 Shuo Chen
    /ucla/cs/repo/insert/vedio/Forrest Gump/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
70 1 Shuo Chen
71 14 Shuo Chen
### SegmantationInfo
72
73
74
    SegmantationInfo      ::= SEGMENTATIONINFO-TYPE TLV-LENGTH
75
                               StartBlockId?
76
                               FinalBlockId?
77
    
78
    StartBlockId          ::= STARTBLOCKID-TYPE TLV-LENGTH
79
                                nonNegativeInteger
80
    
81
    EndBlockId            ::= FINALBLOCKID-TYPE TLV-LENGTH
82
                                nonNegativeInteger
83
84 1 Shuo Chen
Protocol process:
85
86 14 Shuo Chen
    1. start to authorize the command; if authorization does not fail immediately, go to step 3
87 1 Shuo Chen
88 14 Shuo Chen
    2. send a negative response indicating authorization failure, and abort these steps
89 1 Shuo Chen
90 14 Shuo Chen
    3. if both StartBlockId and EndBlockId are missing, go to step 6
91 1 Shuo Chen
92 14 Shuo Chen
    4. if both StartBlockId and EndBlockId are present, and StartBlockId is less than or equal to EndBlockId, go to step 6
93 1 Shuo Chen
94 14 Shuo Chen
    5. send a negative response indicating malformed command, and abort these steps
95
96
    6. wait for authorization completion
97
98
    7. if authorization fails, go to step 2
99
100
    8. send a positive response indicating insert is in progress
101
102
    9. if both StartBlockId and EndBlockId are present, go to step 15
103
104
    10. start to retrieve Name
105
106
    11. wait for retrieval completion
107
108
    12. if retrieval fails, abort these steps
109
110
    13. store retrieved Data packet
111
112
    14. abort these steps
113
114
    15. append StartBlockId to Name
115
116
    16. start to retrieve Name
117
118
    17. wait for retrieval completion
119
120
    18. if retrieval fails, abort these steps
121
122
    store retrieved Data packet
123
124
    if retrieved Data packet contains FinalBlockId, and FinalBlockId is less than EndBlockId, let EndBlockId be FinalBlockId
125
126
    if the last component of Name is greater than or equal to EndBlockId, abort these steps
127
128
    increment the last component of Name
129
130
    go to step 16
131 1 Shuo Chen
132 12 Shuo Chen
Protocol diagram:
133 10 Alex Afanasyev
134
    Requester                     Repo                          Data producer
135
        |                           |                                 |
136
        |                           |                                 |
137
      +---+  Insert command       +---+                               |
138
      |   | --------------------> |   |                               |
139
      +---+                       |   |                               |
140
        |                         |   |                               |
141
      +---+   Confirm start       |   |                               |
142
      |   | <==================== |   |                               |
143
      +---+   Reject command      +---+                               |
144
        |     (with status code)    |                                 |
145
        |                         +---+     Interest for Data       +---+
146
        |                         |   | --------------------------> |   |
147
        |                         +---+                             |   |
148
        |                           |                               |   |
149
        |                         +---+       Data segment          |   |
150
        |                         |   | <========================== |   |
151
        |                         +---+                             +---+
152
        |                           |                                 |
153
        |                           ~                                 ~
154
        |                           ~                                 ~
155
        |                           |                                 |
156
        |                         +---+     Interest for Data       +---+
157
        |                         |   | --------------------------> |   |
158
        |                         +---+                             |   |
159
        |                           |                               |   |
160
        |                         +---+       Data segment          |   |
161
        |                         |   | <========================== |   |
162
        |                         +---+                             +---+
163
        |                           |                                 |
164
        |                           |                                 |
165
        |                           ~                                 ~
166
        |                           ~                                 ~
167
        |                           |                                 |
168
        |                           |                                 |
169
        |                           |                                 |
170
      +---+   Status interest     +---+                               |
171
      |   | --------------------> |   |                               |
172
      +---+                       |   |                               |
173
        |                         |   |                               |
174
      +---+    Status response    |   |                               |
175
      |   | <==================== |   |                               |
176
      +---+                       +---+                               |
177
        |                           |                                 |
178
        |                           |                                 |