Project

General

Profile

Repo Protocol Specification » History » Version 12

Shuo Chen, 02/19/2014 09:51 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 11 Shuo Chen
### Insertion command interest semantics
50 8 Shuo Chen
51 1 Shuo Chen
52
The name semantics is defined to have following components:
53
54
* ``<box of repo>`` refers to specific name of repo
55 11 Shuo Chen
* ``insert`` refers to insert data objects
56 1 Shuo Chen
* ``<data name>`` refers to specific name of data that will be inserted
57
58 8 Shuo Chen
The folloing components are components of singed interest for access control:
59
60
* ``<timestamp>``
61
* ``<random-value>``
62
* ``<SignatureInfo>``
63
* ``<SignatureValue>``
64
65
<box of repo> and <data name> can be divided by serveral continious ``/`` according to specific defination.
66 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:
67 8 Shuo Chen
68 11 Shuo Chen
    /ucla/cs/repo/insert/vedio/Forrest Gump/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
69 8 Shuo Chen
70 11 Shuo Chen
71
1. Requester sends insert command to repo.
72
73
2. Repo checks this insert command.
74
2.1 Repo validates the this command interest. If invalidated, a data object contained invalidated status code will be responded.
75
2.2 Repo checks the name of the interest. If a data with the name same with the name of the data in command interest exists in repo, this command interest is rejected.
76 1 Shuo Chen
77 12 Shuo Chen
Protocol diagram:
78 10 Alex Afanasyev
79
    Requester                     Repo                          Data producer
80
        |                           |                                 |
81
        |                           |                                 |
82
      +---+  Insert command       +---+                               |
83
      |   | --------------------> |   |                               |
84
      +---+                       |   |                               |
85
        |                         |   |                               |
86
      +---+   Confirm start       |   |                               |
87
      |   | <==================== |   |                               |
88
      +---+   Reject command      +---+                               |
89
        |     (with status code)    |                                 |
90
        |                         +---+     Interest for Data       +---+
91
        |                         |   | --------------------------> |   |
92
        |                         +---+                             |   |
93
        |                           |                               |   |
94
        |                         +---+       Data segment          |   |
95
        |                         |   | <========================== |   |
96
        |                         +---+                             +---+
97
        |                           |                                 |
98
        |                           ~                                 ~
99
        |                           ~                                 ~
100
        |                           |                                 |
101
        |                         +---+     Interest for Data       +---+
102
        |                         |   | --------------------------> |   |
103
        |                         +---+                             |   |
104
        |                           |                               |   |
105
        |                         +---+       Data segment          |   |
106
        |                         |   | <========================== |   |
107
        |                         +---+                             +---+
108
        |                           |                                 |
109
        |                           |                                 |
110
        |                           ~                                 ~
111
        |                           ~                                 ~
112
        |                           |                                 |
113
        |                           |                                 |
114
        |                           |                                 |
115
      +---+   Status interest     +---+                               |
116
      |   | --------------------> |   |                               |
117
      +---+                       |   |                               |
118
        |                         |   |                               |
119
      +---+    Status response    |   |                               |
120
      |   | <==================== |   |                               |
121
      +---+                       +---+                               |
122
        |                           |                                 |
123
        |                           |                                 |