Project

General

Profile

Watched Prefix Insertion Protocol » History » Version 9

Weiqi Shi, 07/28/2014 05:53 PM

1 1 Weiqi Shi
Watched Prefix Insertion Protocol
2
=================================
3
Watched Prefix is a new protocol for repo insertion. By using this protocol, repo keep sending interests to request the data with same prefix. When a data packet is received, repo will update selectors (exclude selector in most cases) to exclude the received data and request new one. Repo will stop watching the prefix until a command interest in tell it to stop, the total amount of sent interests reaches a specific number or time out.
4
5
## Basic operations
6
7
### Keep requesting and inserting data with same prefix
8
9 9 Weiqi Shi
Command verb: **watch start**
10 1 Weiqi Shi
11
The name semantics follows the format of the repo command. The <command verb> is defined as ``watch``.
12
For example, for ``<repo prefix>`` as ``/ucla/cs/repo``, the following is an example:
13
14 9 Weiqi Shi
    /ucla/cs/repo/watch/start/<RepoCommandParameter>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
15 1 Weiqi Shi
16
### Watch status check
17
18
Command verb: **watch check**
19
20
During the watched prefix progress, requester could send watch status check command to check the status of the progress. This status check command is also signed interest. The semantics of watch status check command is shown as follows:
21
22
<command verb> equals to ``watchCheck``. For example:
23
24 9 Weiqi Shi
    /ucla/cs/repo/watch/check/<RepoCommandParameter>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
25 1 Weiqi Shi
26 9 Weiqi Shi
### Stop watched prefix insertion
27 1 Weiqi Shi
28 9 Weiqi Shi
Command verb: **watch stop**
29 1 Weiqi Shi
30 9 Weiqi Shi
During the watched prefix progress, requester could send watch stop command to stop the watched prefix insertion
31 1 Weiqi Shi
32 9 Weiqi Shi
    /ucla/cs/repo/watch/stop/<RepoCommandParameter>/<timestamp>/<random-value>/<SignatureInfo>/<SignatureValue>
33
34
## [[Repo Command|RepoCommandParameter]]
35
36
### Watch Start
37
38
The following components are used in watch start command
39
40 7 Weiqi Shi
* ``Name`` (required)
41
* ``InterestLifetime`` (optional)
42
* ``MaxInterestNum`` (optional)
43 1 Weiqi Shi
* ``WatchTimeout`` (optional)
44 6 Weiqi Shi
* ``WatchStatus`` (required)
45 1 Weiqi Shi
* ``Selectors`` (optional)
46 6 Weiqi Shi
47 1 Weiqi Shi
Name is the prefix that will be watched.
48
49
InterestLifetime is the maximum latency between interest sent and data received. If the time duration is larger than interest timeout, the same interest will be resent. If data is received within the Interest timeout, the selectors of the interest will be updated and sent to request new data. If it is not specified, a default value(4000 millisecond) will be set. 
50
51
MaxInterestNum is the maximum of total interests that can be sent. The process will stop if the total number of interests reaches this limit. If it is not specified, MaxInterestNum will be set as -1, means infinity.
52
53
WatchTimeout is the time duration of this process. Repo will keep watching the prefix until it times out. If it is not specified, WatchTimeout will be set as 0, means this process will run forever.
54
55
WatchStatus is used to show whether repo is watching a prefix or not. 
56
57
Selectors are used to exclude the received data and request new data.
58
59 9 Weiqi Shi
### Watch Check
60
61
The following component is used in watch start command
62
63
* ``ProcessId`` (required)
64
65
For watch check command interest, only ProcessId is needed. ProcessId shows the id number of this command interest, a random number generated by repo.
66
67
### Watch Stop
68
69
The following component is used in watch start command
70
71
* ``WatchStatus`` (required)
72
73
For watch stop command interest, only WatchStatus is needed.
74
75 1 Weiqi Shi
76
### RepoCommandResponse
77
78
This watch status data object could be the response data object of both watch command and watchCheck command. It will follow the format of repo command response.
79
80
Response has three part: ProcessId, indicates an ID of process;  InsertNumber, indicates how many data packets under the watched prefix has been inserted into repo; 
81 2 Weiqi Shi
StatusCode, indicates the status of the process.
82
83
StatusCode Definition:
84
85
``StatusCode`` | Description
86
-------------- | ----------------------------------------------
87
``100``        | The command is OK. Start to watch the prefix
88
``101``        | Watched Prefix Insertion is stop.
89
``300``        | This watched prefix Insertion is in progress
90
``401``        | This watch command or watchCheck command is invalidated
91
``402``        | BlockId present. BlockId is not supported in this protocol
92
``403``        | Malformed Command
93
``404``        | No such this process is in progress
94 3 Weiqi Shi
95
## Protocol Process
96
97
1. Start to validate the command. If it is validated, go to Step 3, otherwise go to Step 2.
98
99
2. Send a negative response indicating validation failure, and abort these steps, process ends (StatusCode: 401).
100
101
3. Check parameters. If it cannot be extracted from interest, send a negative response(StatusCode: 403) and stop process.
102
103
4. If it has BlockId, send a negative response(StatusCode: 402) and stop process.
104
105
5. Use parameter of the command interest to construct interest. Set the Rightmost Child Selector.
106
107
6. Send the interest and start timer. The number of sent interest plus 1(the initial value is 0).
108
109
7. If received a data, go to Step 8, if times out, go to Step 17.
110
111
8. If data is validated, go to Step 9, otherwise, go to Step 15.
112
113
9. Check whether the watched prefix insertion is still running. If it does not, process ends.
114
115
10. If the process times out(exceed watch timeout) or if total number of sent interest reaches limit, go to Step 11, otherwise go to Step 12.
116
117
11. Clear all the variables(the number of sent interest, watch timeout, interest lifetime), abort these steps, process ends.
118
119
12. Store the data into repo.
120
121
13. Update selectors, exclude from min to the received one and use the updated selectors construct new interest. 
122
123
14. Send new interest and the number of sent interest plus 1, and then go to Step 7.
124
125
15. Repeat Step 9 to 11 and skip Step 12.
126
127
16. Update selectors, only exclude the received data(since other data whose name is smaller may be satisfied), then go to Step 14.
128
129
17. Repeat Step 9 to 11 and skip Step 12.
130
131
18. Send the interest again and the number of sent interest plus 1, and then go to Step 7.
132 4 Weiqi Shi
133 8 Weiqi Shi
#### Repo watchCheck command process:
134 4 Weiqi Shi
135
1. Start to validate the check command. If it is validated, go to Step 3, otherwise, go to Step 2.
136
137
2. Send a negative response indicating validation failure, and abort these steps, process ends (StatusCode: 401).
138
139
3. Check parameter. If it cannot extracted from interest or if it does not have processId, send a negative reply(StatusCode: 403).
140
141
4. Check whether the processId is existed. If it does, go to Step 5, otherwise, send a negative reply(StatusCode: 404).
142
143
5. Use the processId to find the response and send the response back.