SpreadProtocol » History » Version 17

J. Moringen, 06/27/2011 05:22 AM
added toc and implementation links

1 1 J. Wienke
h1. SpreadProtocol
2 1 J. Wienke
3 17 J. Moringen
{{>toc}}
4 17 J. Moringen
5 1 J. Wienke
This wiki page describes the protocol used by the spread-based connectors.
6 1 J. Wienke
7 1 J. Wienke
h2. Data Format
8 1 J. Wienke
9 16 J. Moringen
Data exchanged on spread is encoded using Google protocol buffers. A spread message always contains a notification (source:/trunk/protocol/RSBProtocol/Protocol.proto) as elementary communication unit. Descriptions of the Notification contents are given as comments on the descriptor file.
10 1 J. Wienke
11 16 J. Moringen
h2. Fragmentation
12 1 J. Wienke
13 16 J. Moringen
Because spread has a message size limit, a single @Notification@ may not be sufficient to transport a whole event with a huge amount of user data. Hence, events may be encoded in several @Notification@ s sent subsequently. In this case the multiple @Notification@ objects are constructed according to the following rules:
14 16 J. Moringen
* The size of individual fragments (i.e. the values of @Notification.data@) must not exceed 100,000 octets
15 16 J. Moringen
* Fragment number are in the range [0, NUMBER-OF-FRAGMENTS - 1]
16 16 J. Moringen
* Most field values are repeated in all @Notification@ s, in particular:
17 16 J. Moringen
** The id of the event (@Notification.id@ field)
18 16 J. Moringen
** The number of @Notification@ s into which the event has been split (@Notification.num_data_parts@ field)
19 16 J. Moringen
* The two fields which differ among @Notification@ s for one event are:
20 16 J. Moringen
** The index of the data chunk encoded in the Notification (@Notification.data_part@ field).
21 16 J. Moringen
** The user data (@Notification.data@ field) are split. 
22 2 J. Wienke
23 13 J. Moringen
h2. Hierarchical Bus
24 2 J. Wienke
25 8 J. Moringen
The hierarchical bus is created by sending each message to a group corresponding to its scope as well as groups corresponding to all super scopes including "/" (multigroup mulitcast).
26 8 J. Moringen
27 8 J. Moringen
_Example_
28 8 J. Moringen
<pre>
29 1 J. Wienke
super-scopes(/foo/bar/, include-self? = yes) = /, /foo/, /foo/bar/
30 8 J. Moringen
</pre>
31 2 J. Wienke
32 13 J. Moringen
h2. Group Names
33 3 J. Wienke
34 10 J. Moringen
Group names are created by applying the following steps to the fully formal scope string representation (*including trailing slash*):
35 10 J. Moringen
# Hash the scope string using "MD5":http://en.wikipedia.org/wiki/MD5.
36 10 J. Moringen
# Convert the 16 bytes of output to a 32 character string by concatenating the *zero-padded* hex (base-16) representations of the individual bytes.
37 10 J. Moringen
  Letters of the hex representation have to be lower case.
38 10 J. Moringen
# Remove the final character of the hex representation of the hash.
39 10 J. Moringen
  (Since spread group names can only be 32 bytes long _including the 0-terminator_)
40 7 J. Moringen
41 7 J. Moringen
_Example_
42 7 J. Moringen
<pre>
43 9 J. Moringen
/         -> "6666cd76f96956469e7be39d750cc7d\0"
44 1 J. Wienke
/foo/     -> "4f87be8f6e593d167f5fd1ab238cfc2\0"
45 9 J. Moringen
/foo/bar/ -> "1c184f3891344400380281315d9e738\0"
46 7 J. Moringen
</pre>
47 4 J. Wienke
48 13 J. Moringen
h2. Quality of Service
49 4 J. Wienke
50 1 J. Wienke
The following table explains how the 2D RSB QoS settings are mapped to spread message types.
51 1 J. Wienke
52 17 J. Moringen
|             |_.UNRELIABLE     |_.RELIABLE     |
53 17 J. Moringen
|_.UNORDERED  | UNRELIABLE_MESS | RELIABLE_MESS |
54 17 J. Moringen
|_.ORDERED    | FIFO_MESS       | FIFO_MESS     |
55 17 J. Moringen
56 17 J. Moringen
h2. Implementations
57 17 J. Moringen
58 17 J. Moringen
|_.Language   |_.File(s)/Directory                                   |
59 17 J. Moringen
| C++         | source:trunk/cpp/core/src/rsb/transport/spread       |
60 17 J. Moringen
| Java        | source:trunk/java/core/src/rsb/transport/spread      |
61 17 J. Moringen
| Python      | source:"trunk/python/core/rsb/rsbspread/__init__.py" |
62 17 J. Moringen
| Common Lisp | source:trunk/cl/cl-rsb/src/transport/spread          |