*** empty log message ***
[spider.git] / perl / proto.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3   <head>
4     <title>new protocol</title>
5   </head>
6
7   <body bgcolor="#FFFFFF">
8     <h2>new protocol</h2>
9
10     <hr>
11     <address><a href="mailto:djk@tobit.co.uk"></a>Dirk Koopman G1TLH</address><br>
12 <!-- Created: Sat Sep  4 21:11:44 BST 1999 -->
13 <!-- hhmts start -->
14 Last modified: Sat Sep  4 22:50:53 BST 1999
15 <!-- hhmts end -->
16         <hr>
17         <h4>Some thoughts</h4>
18
19     <ol>
20           <li>The protocol must be capable of being multi/broadcast.
21       <li>The format must regular.
22       <li>All packets will have a to, from and date field and a checksum of
23                 some kind.
24           <li>space is a premium, therefore I am prepared to break layering rules
25                 in specific cases to avoid duplicating fields. E.g. in AX25 using
26                 callsign fields as part of the data (which means reconstructing the
27                 packets from ax25 to be like you expect)
28           <li>the protocol will continue to be ascii for simplicity of use.
29         </ol>
30
31         <h4>packet format</h4>
32
33         The overall format of a packet shall look like this:-
34
35         <p>
36           <table border=3>
37                 <tr>
38                   <td width="20%"><b>Field</b></td>
39                   <td width="80%"><b>Description</b></td>
40                 </tr>
41                 <tr>
42                   <td width="20%"><b>OP Code</b></td>
43                   <td width="80%">
44                         This will be 'B' for now, but will be extended when multicasting
45                         comes into being
46                   </td>
47                 </tr>
48                 <tr>
49                   <td width="20%"><b>From Address</b></td>
50                   <td width="80%">
51                         This will always be the originating cluster callsign and shall 
52                         <emph>never</emph> be changed
53                   </td>
54                 </tr>
55                 <tr>
56                   <td width="20%"><b>To Address</b></td>
57                   <td width="80%">
58                         The <i>To</i> address can be anything at all that is likely
59                         to be meaningful to a cluster program, it could be a callsign, a 'group' name of
60                         some sort (eg <tt>6MUK</tt>) or it could be empty, indicating a broadcast 
61                   </td>
62                 </tr>
63                 <tr>
64                   <td width="20%"><b>Date/Time/Count</b></td>
65                   <td width="80%">
66                         This is a unix time_t, in hex (ie 8 characters) with an optional
67                         2 byte hex count on the end which can allow up to 256 protocol messages to be originated
68                         a second. Programs must allow for both 8 or 10 digit hex numbers
69                   </td>
70                 </tr>
71                 <tr>
72                   <td width="20%"><b>Data</b></td>
73                   <td width="80%">
74                         The actual cluster data. The data in this field can contain only
75                         ascii data. Any non ascii data shall be converted to <tt>%XX</tt> format, where 
76                         <tt>XX</tt> is the hex equivalent of the character represented, certain special
77                         characters in the data such as '%', '|' and '^' shall also be converted. Although
78                         it is envisaged that most data will be ascii, things like mail files can and
79                         will contain newline characters and these will be converted.
80                         <br><br>It is suggested that the raw version of the data in this packet be no
81                         more than 128 characters, if it any packets are likely to be routed over
82                         ax25 bearers. However, programs should be prepared to accept 1024 characters (after
83                         decoding) for point to point wire links and routed data.
84                   </td>
85                 </tr>
86                 <tr>
87                   <td width="20%"><b>Checksum</b></td>
88                   <td width="80%">
89                         This is calculated as the simple arithmetic checksum, modulo 256, 
90                         of the whole packet excluding
91                         this field and any preceeding field separator,  as two hex digits
92                         this checksum is designed solely to pick up errors in any connections between 
93                         this protocol and lower layers - where hopefully real CRC checking is done 
94                   </td>
95                 </tr>
96           </table>
97         </P>
98   
99         <p>
100           Each field in the above packet shall be separated by the '|' character <b>EXCEPT</b> the
101           <tt>op code</tt> which is concatenated onto the <tt>from</tt> field. The '|' character 
102           must not appear in any field in the overall packet, it is the data providers responsibility
103           make sure this happens. If it is necessary for operations there can be a locally generated
104           newline sequence added on the end of the packet for sending or delimiting purposes
105           which is stripped off before presenting the packet for decoding.  
106         </p>
107
108         <p>
109           A typical packet might look like:- <br><br>
110           <quote>
111                 BGB7DJK||8BCF65DE|DX^G1TLH^M0BAA^144123^Humungous Signal!|A8<BR>
112                 BGB7DJK|SYSOP|8BCF65FC|AN^G1TLH^What @$%7C%5E!** condxs?|5C<BR>
113                 BGB7DJK|GB7BAA|8BCF670102|TA^G1TLH^G8TIC^Baaaaaaaaaaa|FD<BR>
114       </quote>
115     <p>
116
117     <p>
118           As mentioned earlier, astute readers will see that there is a mix up of lower
119           layer data with higher. This is deliberate (as well as potentially messy), but it saves 
120           characters and promotes regularity on format. Apart from anything else, most directed
121           data actually needs to pass from cluster to cluster and it is important for the higher
122           layers to know where a packet originated. Also higher layers need to address packets to
123           other clusters or groups and there would otherwise be considerable duplication.
124         </P>
125
126         <p>
127           If a packet fails a checksum, then it is silently dropped - for now. When reliable
128           multicast comes in, other actions will occur at this level. In any event, higher level
129           functions that require some state to be maintained between packets (eg mail transfer)
130           should make their own arrangements in case reliable multicast isn't available between
131           two cluster nodes.
132     </p> 
133         <br>
134         <hr>
135         Document $Id$
136   </body>
137 </html>