updated documentation a bit
[spider.git] / html / adminmanual-1.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
5  <TITLE>The DXSpider Administration Manual v1.48: Routing and Filtering</TITLE>
6  <LINK HREF="adminmanual-2.html" REL=next>
7
8  <LINK HREF="adminmanual.html#toc1" REL=contents>
9 <link rel=stylesheet href="style.css" type="text/css" title="default stylesheet">
10 </HEAD>
11 <BODY>
12 <A HREF="adminmanual-2.html">Next</A>
13 Previous
14 <A HREF="adminmanual.html#toc1">Contents</A>
15 <HR>
16 <H2><A NAME="s1">1. Routing and Filtering</A></H2>
17
18 <H2><A NAME="ss1.1">1.1 Introduction</A>
19 </H2>
20
21 <P>From DXSpider version 1.48, major changes were introduced to the way 
22 node connections are treated.  This is part of an ongoing process to
23 remove problems with loops and to enable talk and other functions to
24 propagate across the whole of the worldwide cluster network.  In fact,
25 in a Spider network, it would be useful, perhaps even necessary to
26 have loops.  This would give real resilience to the network, meaning
27 that if a link dropped, the information flow would simply come in and
28 go out via a different route.  Of course, we do not have a complete
29 network of Spider nodes, there are other programs out there.  Some of
30 these do not have any protection from loops.  Certainly AK1A does not 
31 handle loops well at all.  It is therefore necessary to have some form 
32 of protection for these nodes.
33 <P>
34 <P>In fact DXSpider has had a simple system for some time which is called
35 <I>isolation</I>. This is similar to what, in other systems such as 
36 <B>clx</B>, is called <I>passive mode</I>. A more detailed explanation
37 of <I>isolation</I> is given further below. This system is still available
38 and, for simple networks, is probably all that you need.
39 <P>
40 <P>The new functionality introduced in version 1.48 is filtering the node
41 and user protocol frames on a "per interface" basis. We call this
42 <I>route filtering</I>. This is used <B>instead of</B>
43 <I>isolation</I>. 
44 <P>
45 <P>What this really means is that you can control more or less completely
46 which PC protocol frames, to do with user and node management, pass to
47 each of your partner nodes. You can also limit what comes into your
48 node from your partners. You can even control the settings that your
49 partner node has for the routing information that it sends to you
50 (using the <I>rcmd</I> command).
51 <P>
52 <H2><A NAME="ss1.2">1.2 Route Filters</A>
53 </H2>
54
55 <P>Initially when route filters were being tested we generated a
56 "default" filter.  Unfortunately it quickly became apparent that this
57 might suit the UK cluster network but didn't really fit anybody else.
58 However using a default filter is an appropriate thing to do. How, is
59 explained further on.
60 <P>
61 <P>The first thing that you must do is determine whether you need to do route filtering <B>at all</B>. If you are a "normal" node with two or three partners
62 and you arranged in an "official" non-looping tree type network, then <B>you do 
63 not need to do route filtering</B> and you will feel a lot better for not 
64 getting involved. If you are successfully using <I>isolation</I> then you
65 also probably don't need to use route filtering.
66 <P>
67 <P>You will only require this functionality if you are
68 "well-connected". What that means is that you are connected to several
69 different parts of (say) the EU cluster and, at the same time, also
70 connected to two or three places in the US which, in turn are
71 connected back to the EU. This is called a "loop" and if you are
72 seriously looped then you need filtering.
73 <P>
74 <P>I should at this stage give a little bit of background on filters.  All
75 the filters in Spider work in basically the same way.  You can either
76 accept or reject various options in order to create the filter rules
77 you wish to achieve.  Some filters are user settable, others can only
78 be altered by the sysop.  Route filtering can only be done by the sysop.
79 <P>
80 <P> 
81 Anyway, without further discouragement, let me start the process
82 of explanation.
83 <P>
84 <H2><A NAME="ss1.3">1.3 The node_default filter</A>
85 </H2>
86
87 <P>All normal systems should have a default routing filter and it should
88 usually be set to send only the normal, unlooped, view of your
89 "national" network.  Here in the UK that means nodes from the UK and
90 Eire, in EU it is more complex as the networks there grew up in a more
91 intertwined way.
92 <P>
93 <P> 
94 The generic commands are:-
95 <P>
96 <BLOCKQUOTE><CODE>
97 <PRE>
98 reject/route node_default &lt;filter_option&gt;
99
100 or
101
102 accept/route node_default &lt;filter_option&gt;
103 </PRE>
104 </CODE></BLOCKQUOTE>
105 <P>where filter_option is one of the following ...
106 <P>
107 <BLOCKQUOTE><CODE>
108 <PRE>
109 call &lt;prefixes&gt;
110 call_dxcc &lt;numbers&gt;
111 call_itu &lt;numbers&gt;
112 call_zone &lt;numbers&gt;
113 channel &lt;prefixes&gt;
114 channel_dxcc &lt;numbers&gt;
115 channel_itu &lt;numbers&gt;
116 channel_zone &lt;numbers&gt;
117 </PRE>
118 </CODE></BLOCKQUOTE>
119 <P>Please be careful if you alter this setting, it will affect 
120 <B><I>ALL</I></B> your links!
121 <P>
122 <P>For the default routing filter then you have two real choices: either
123 a "national" view or the "safe" option of only your own
124 callsign. Examples of each (for my node: GB7DJK) are:-
125 <P>
126 <BLOCKQUOTE><CODE>
127 <PRE>
128 acc/route node_default call_dxcc 61,38
129 acc/route node_default call gb7djk
130 </PRE>
131 </CODE></BLOCKQUOTE>
132 <P>GB7DJK uses the first of these. The DXCC countries can be obtained from the 
133 <I>show/prefix</I> command.
134 <P>
135 <P>The example filters shown control <I>output</I> <B>TO</B> all your
136 partner nodes unless they have a specific filter applied to them (see
137 next section).
138 <P>
139 <P>It is also possible to control the <I>incoming</I> routing
140 information that you are prepared to accept <B>FROM</B> your partner
141 nodes. The reason this is necessary is to make sure that stuff like
142 mail, pings and similar commands a) go down the correct links and b)
143 don't loop around excessively. Again using GB7DJK as an example a typical
144 default input filter would be something like:
145 <P>
146 <BLOCKQUOTE><CODE>
147 <PRE>
148 rej/route node_default input call_dxcc 61,38 and not channel_dxcc 61,38
149 </PRE>
150 </CODE></BLOCKQUOTE>
151 <P>What this does is accept node and user information for our national
152 network from nodes that are in our national network, but rejects such
153 information from anyone else. Although it doesn't explicitly say so,
154 by implication, any other node information (not from the UK and Eire)
155 is accepted.
156 <P>
157 <P>As I imagine it will take a little while to get one's head around all of this you
158 can study the effect of any rules that you try by watching the debug output
159 after having done:-
160 <P>
161 <BLOCKQUOTE><CODE>
162 <PRE>
163 set/debug filter
164 </PRE>
165 </CODE></BLOCKQUOTE>
166 <P>After you have got tired of that, to put it back the way it was:-
167 <P>
168 <BLOCKQUOTE><CODE>
169 <PRE>
170 unset/debug filter
171 </PRE>
172 </CODE></BLOCKQUOTE>
173 <P>
174 <H2><A NAME="ss1.4">1.4 General route filtering</A>
175 </H2>
176
177 <P>Exactly the same rules apply for general route filtering.  You would
178 use either an accept filter or a reject filter like this ...
179 <P>
180 <BLOCKQUOTE><CODE>
181 <PRE>
182 reject/route &lt;node_call&gt; &lt;filter_option&gt;
183
184 or
185
186 accept/route &lt;node_call&gt; &lt;filter_option&gt; 
187 </PRE>
188 </CODE></BLOCKQUOTE>
189 <P>
190 <P>Here are some examples of route filters ...
191 <P>
192 <BLOCKQUOTE><CODE>
193 <PRE>
194 rej/route gb7djk call_dxcc 61,38 (everything except  UK+EIRE nodes)
195 rej/route all     (equiv to [very] restricted mode)
196 acc/route gb7djk call_dxcc 61,38 (send only UK+EIRE nodes)
197 acc/route gb7djk call gb7djk     (equiv to SET/ISOLATE)
198 </PRE>
199 </CODE></BLOCKQUOTE>
200 <P>In practice you will either be opening the default filter out for a
201 partner by defining a specific filter for that callsign:-
202 <P>
203 <BLOCKQUOTE><CODE>
204 <PRE>
205 acc/route gb7baa all
206 acc/route gb7baa input all
207 </PRE>
208 </CODE></BLOCKQUOTE>
209 <P>or restricting it quite a lot, in fact making it very nearly like an <I>isolated</I> node, like this:-
210 <P>
211 <BLOCKQUOTE><CODE>
212 <PRE>
213 acc/route pi4ehv-8 call gb7djk
214 rej/route pi4ehv-8 input call_dxcc 61,38 
215 </PRE>
216 </CODE></BLOCKQUOTE>
217 <P>This last example takes everything except UK and Eire from PI4EHV-8
218 but only sends him my local configuration (just a PC19 for GB7DJK and
219 PC16s for my local users).
220 <P>
221 <P>It is possible to do <B>much</B> more complex rules, there are up to 10
222 accept/reject pairs per callsign per filter. For more information see the 
223 next section. 
224 <P>
225 <P>
226 <H2><A NAME="ss1.5">1.5 General filter rules</A>
227 </H2>
228
229 <P>Upto v1.44 it was not possible for the user to set their own filters.  From 
230 v1.45 though that has all changed.  It is now possible to set filters for just 
231 about anything you wish.  If you have just updated from an older version of 
232 DXSpider you will need to update your new filters.  You do not need to do 
233 anything with your old filters, they will be renamed as you update.
234 <P>
235 <P>There are 3 basic commands involved in setting and manipulating filters.  These 
236 are <EM>accept</EM>, <EM>reject</EM> and <EM>clear</EM>.  First we will look
237 generally at filtering. There are a number of things you can filter in the 
238 DXSpider system. They all use the same general mechanism.
239 <P>
240 <P>In general terms you can create a "reject" or an "accept" filter which can have 
241 up to 10 lines in it. You do this using, for example ... 
242 <P>
243 <BLOCKQUOTE><CODE>
244 <PRE>
245  
246 accept/spots .....
247 reject/spots .....
248 </PRE>
249 </CODE></BLOCKQUOTE>
250 <P>where ..... are the specific commands for that type of filter. There are filters 
251 for spots, wwv, announce, wcy and (for sysops) connects. See each different 
252 accept or reject command reference for more details.
253 <P>There is also a command to clear out one or more lines in a filter. They are ...
254 <P>
255 <BLOCKQUOTE><CODE>
256 <PRE>
257 clear/spots 1
258 clear/spots all
259 </PRE>
260 </CODE></BLOCKQUOTE>
261 <P>There is clear/xxxx command for each type of filter.
262 <P>
263 <P>and you can check that your filters have worked by the command ... 
264 <P>
265 <BLOCKQUOTE><CODE>
266 <PRE>
267   
268 show/filter
269 </PRE>
270 </CODE></BLOCKQUOTE>
271 <P>
272 <P>For now we are going to use spots for the examples, but you can apply the same
273 principles to all types of filter.
274 <P>
275 <H2><A NAME="ss1.6">1.6 Types of filter</A>
276 </H2>
277
278 <P>There are two main types of filter, <EM>accept</EM> or <EM>reject</EM>.  You 
279 can use either to achieve the result you want dependent on your own preference 
280 and which is more simple to do.  It is pointless writing 8 lines of reject 
281 filters when 1 accept filter would do the same thing!  Each filter has 10 
282 lines (of any length) which are tried in order.  If a line matches then the 
283 action you have specified is taken (ie reject means ignore it and accept 
284 means take it)
285 <P>
286 <P>If you specify reject filters, then any lines that arrive that match the filter 
287 will be dumped but all else will be accepted.  If you use an accept filter, 
288 then ONLY the lines in the filter will be accepted and all else will be dumped.
289 For example if you have a single line <EM>accept</EM> filter ...
290 <P>
291 <BLOCKQUOTE><CODE>
292 <PRE>
293 accept/spots on vhf and (by_zone 14,15,16 or call_zone 14,15,16)
294 </PRE>
295 </CODE></BLOCKQUOTE>
296 <P>then you will <EM>ONLY</EM> get VHF spots <EM>from</EM> or <EM>to</EM> CQ zones 
297 14, 15 and 16.
298 <P>
299 <P>If you set a reject filter like this ...
300 <P>
301 <BLOCKQUOTE><CODE>
302 <PRE>
303 reject/spots on hf/cw
304 </PRE>
305 </CODE></BLOCKQUOTE>
306 <P>Then you will get everything <EM>EXCEPT</EM> HF CW spots.  You could make this 
307 single filter even more flexible.  For example, if you are interested in IOTA 
308 and will work it even on CW even though normally you are not interested in 
309 CW, then you could say ...
310 <P>
311 <BLOCKQUOTE><CODE>
312 <PRE>
313 reject/spots on hf/cw and not info iota
314 </PRE>
315 </CODE></BLOCKQUOTE>
316 <P>But in that case you might only be interested in iota and say:-
317 <P>
318 <BLOCKQUOTE><CODE>
319 <PRE>
320 accept/spots not on hf/cw or info iota
321 </PRE>
322 </CODE></BLOCKQUOTE>
323 <P>which achieves exactly the same thing. You should choose one or the other 
324 until you are comfortable with the way it works. You can mix them if you 
325 wish (actually you can have an accept AND a reject on the same line) but 
326 don't attempt this until you are sure you know what you are doing!
327 <P>
328 <P>You can arrange your filter lines into logical units, either for your own
329 understanding or simply convenience. Here is an example ...
330 <P>
331 <BLOCKQUOTE><CODE>
332 <PRE>
333 reject/spots 1 on hf/cw
334 reject/spots 2 on 50000/1400000 not (by_zone 14,15,16 or call_zone 14,15,16)  
335 </PRE>
336 </CODE></BLOCKQUOTE>
337 <P>What this does is to ignore all HF CW spots and also rejects any spots on VHF 
338 which don't either originate or spot someone in Europe. 
339 <P>
340 <P>This is an example where you would use a line number (1 and 2 in this case), if 
341 you leave the digit out, the system assumes '1'. Digits '0'-'9' are available.  
342 This make it easier to see just what filters you have set.  It also makes it 
343 more simple to remove individual filters, during a contest for example.
344 <P>
345 <P>You will notice in the above example that the second line has brackets.  Look 
346 at the line logically.  You can see there are 2 separate sections to it.  We 
347 are saying reject spots that are VHF or above <EM>APART</EM> from those in 
348 zones 14, 15 and 16 (either spotted there or originated there).  If you did 
349 not have the brackets to separate the 2 sections, then Spider would read it 
350 logically from the front and see a different expression entirely ...
351 <P>
352 <BLOCKQUOTE><CODE>
353 <PRE>
354 (on 50000/1400000 and by_zone 14,15,16) or call_zone 14,15,16 
355 </PRE>
356 </CODE></BLOCKQUOTE>
357 <P>The simple way to remember this is, if you use OR - use brackets. Whilst we are 
358 here CASE is not important. 'And BY_Zone' is just the same as 'and by_zone'.
359 <P>As mentioned earlier, setting several filters can be more flexible than 
360 simply setting one complex one.  Doing it in this way means that if you want 
361 to alter your filter you can just redefine or remove one or more lines of it or 
362 one line. For example ...
363 <P>
364 <BLOCKQUOTE><CODE>
365 <PRE>
366 reject/spots 1 on hf/ssb
367 </PRE>
368 </CODE></BLOCKQUOTE>
369 <P>would redefine our earlier example, or 
370 <P>
371 <BLOCKQUOTE><CODE>
372 <PRE>
373 clear/spots 1
374 </PRE>
375 </CODE></BLOCKQUOTE>
376 <P>To remove all the filter lines in the spot filter ...
377 <P>
378 <BLOCKQUOTE><CODE>
379 <PRE>
380 clear/spots all
381 </PRE>
382 </CODE></BLOCKQUOTE>
383 <P>
384 <H2><A NAME="ss1.7">1.7 Filter options</A>
385 </H2>
386
387 <P>You can filter in several different ways.  The options are listed in the
388 various helpfiles for accept, reject and filter.
389 <P>
390 <H2><A NAME="ss1.8">1.8 Default filters</A>
391 </H2>
392
393 <P>Sometimes all that is needed is a general rule for node connects.  This can
394 be done with a node_default filter.  This rule will always be followed, even
395 if the link is isolated, unless another filter is set specifically.  Default
396 rules can be set for nodes and users.  They can be set for spots, announces,
397 WWV and WCY.  They can also be used for hops.  An example might look like 
398 this ...
399 <P>
400 <BLOCKQUOTE><CODE>
401 <PRE>
402 accept/spot node_default by_zone 14,15,16,20,33
403 set/hops node_default spot 50
404 </PRE>
405 </CODE></BLOCKQUOTE>
406 <P>This filter is for spots only, you could set others for announce, WWV and WCY.
407 This filter would work for ALL nodes unless a specific filter is written to 
408 override it for a particular node.  You can also set a user_default should
409 you require.  It is important to note that default filters should be
410 considered to be "connected".  By this I mean that should you override the
411 default filter for spots, you need to add a rule for the hops for spots also.
412 <P>
413 <H2><A NAME="ss1.9">1.9 Advanced filtering</A>
414 </H2>
415
416 <P>Once you are happy with the results you get, you may like to experiment. 
417 <P>
418 <P>The previous example that filters hf/cw spots and accepts vhf/uhf spots from EU 
419 can be written with a mixed filter, for example ... 
420 <P>
421 <BLOCKQUOTE><CODE>
422 <PRE>
423 rej/spot on hf/cw
424 acc/spot on 0/30000
425 acc/spot 2 on 50000/1400000 and (by_zone 14,15,16 or call_zone 14,15,16)
426 </PRE>
427 </CODE></BLOCKQUOTE>
428 <P>Note that the first filter has not been specified with a number.  This will 
429 automatically be assumed to be number 1.  In this case, we have said <EM>reject all
430 HF spots in the CW section of the bands but accept all others at HF.  Also
431 accept anything in VHF and above spotted in or by operators in the zones
432 14, 15 and 16</EM>.  Each filter slot actually has a 'reject' slot and 
433 an 'accept' slot. The reject slot is executed BEFORE the accept slot.
434 <P>
435 <P>It was mentioned earlier that after a reject test that doesn't match, the default 
436 for following tests is 'accept', the reverse is true for 'accept'. In the example 
437 what happens is that the reject is executed first, any non hf/cw spot is passed 
438 to the accept line, which lets through everything else on HF.  The next filter line 
439 lets through just VHF/UHF spots from EU.
440 <P>
441 <H2><A NAME="ss1.10">1.10 Basic hop control</A>
442 </H2>
443
444 <P>In /spider/data you will find a file called hop_table.pl.  This is the file 
445 that controls your hop count settings.  It has a set of default hops on the 
446 various PC frames and also a set for each node you want to alter the hops for.  
447 You may be happy with the default settings of course, but this powerful tool 
448 can help to protect and improve the network.  The file will look something 
449 like this ...
450 <P>
451 <BLOCKQUOTE><CODE>
452 <PRE>
453
454 # hop table construction
455
456
457 package DXProt;
458
459 # default hopcount to use
460 $def_hopcount = 5;
461
462 # some variable hop counts based on message type
463 %hopcount = 
464 (
465  11 => 10,
466  16 => 10,
467  17 => 10,
468  19 => 10,
469  21 => 10,
470 );
471
472
473 # the per node hop control thingy
474
475
476 %nodehops = 
477
478  GB7ADX => {            11 => 8,
479                         12 => 8,
480                         16 => 8,
481                         17 => 8,
482                         19 => 8,
483                         21 => 8,
484                    },
485
486  GB7UDX => {            11 => 8,
487                         12 => 8,
488                         16 => 8,
489                         17 => 8,
490                         19 => 8,
491                         21 => 8,
492                    },
493  GB7BAA => {
494                         11 => 5,
495                         12 => 8,
496                         16 => 8,
497                         17 => 8,
498                         19 => 8,
499                         21 => 8,
500                    },
501 };
502 </PRE>
503 </CODE></BLOCKQUOTE>
504 <P>
505 <P>Each set of hops is contained within a pair of curly braces and contains a 
506 series of PC frame types.  PC11 for example is a DX spot. The figures here 
507 are not exhaustive but should give you a good idea of how the file works.
508 <P>
509 <P>You can alter this file at any time, including whilst the cluster is running.  
510 If you alter the file during runtime, the command <EM>load/hops</EM> will 
511 bring your changes into effect.
512 <P>
513 <H2><A NAME="ss1.11">1.11 Hop Control on Specific Nodes</A>
514 </H2>
515
516 <P>You can set a callsign specific hop count for any of the standard filter
517 options so:-
518 <P>
519 <BLOCKQUOTE><CODE>
520 <PRE>
521 set/hops gb7djk spot 4
522 set/hops node_default route 10
523 set/hops gb7baa wcy 5
524 </PRE>
525 </CODE></BLOCKQUOTE>
526 <P>all work on their specific area of the protocol.
527 <P>
528 <P>The <EM>set/hops</EM> command overrides any hops that you have set otherwise.
529 <P>
530 <P>You can set what hops have been set using the <EM>show/hops</EM> command.
531 <P>
532 <H2><A NAME="ss1.12">1.12 Isolating networks</A>
533 </H2>
534
535 <P>It is possible to isolate networks from each other on a "gateway" node using the
536 <EM>set/isolate &lt;node_call&gt;</EM> command.
537 <P>
538 <P>The effect of this is to partition an isolated network completely from another 
539 node connected to your node. Your node will appear on and otherwise behave 
540 normally on every network to which you are connected, but data from an isolated 
541 network will not cross onto any other network or vice versa. However all the 
542 spot, announce and WWV traffic and personal messages will still be handled 
543 locally (because you are a real node on all connected networks), that is locally
544 connected users will appear on all networks and will be able to access and 
545 receive information from all networks transparently.  All routed messages will 
546 be sent as normal, so if a user on one network knows that you are a gateway for 
547 another network, he can still still send a talk/announce etc message via your 
548 node and it will be routed across.
549 <P>
550 <P>If you use isolate on a node connection you will continue to receive
551 all information from the isolated partner, however you will not pass
552 any information back to the isolated node.  There are times when you
553 would like to forward only spots across a link (maybe during a contest
554 for example).  To do this, isolate the node in the normal way and use
555 an <EM>acc/spot &gt;call&lt; all</EM>ilter in the
556 to override the isolate. 
557 <P>
558 <HR>
559 <A HREF="adminmanual-2.html">Next</A>
560 Previous
561 <A HREF="adminmanual.html#toc1">Contents</A>
562 </BODY>
563 </HTML>