Bug fix, and updating README file.
[sfa.git] / sfatables / README
1 sfatables is a tool for defining access and admission control policies in an SFA network, in much the same way as iptables is for ip networks. This file gives an overview of the tool and then describes its design and implementation.
2
3 EXAMPLES
4 --------
5
6 An sfatables configuration consists of lists of rules that are applied to incoming and outgoing rspecs. Each rule consists of a 'match spec' and a 'target spec.' A match spec evaluates a request and determines if it matches a given set of criteria, and the corresponding 'target spec' specifies the action in such a case.
7
8 Let's start by defining a few policies
9
10 Examples:
11
12 Add rules:
13
14 e.g. 
15 * sfatables -A INCOMING --requester-hrn ple.emaniacs.* -j ACCEPT
16 * sfatables -A INCOMING --requester-hrn ple.* -j RESTRICT_NODES --include-only-nodegroup ple.emaniacs.pool_ple
17
18 or
19
20 Default policy:
21
22 * sfatables -P INCOMING REJECT
23
24
25 Overview:
26
27 - The OUTGOING chain is for restricting access by hiding resources. Run as a filter on the output of get_resources. Good for resources to be marked 'unavailable.'
28
29 - The INCOMING chain is for restricting access through denial. Run as a filter on the input to set_resources.  Good for restricting access to resources.
30
31 - A 'match' is a program that decides if a certain request matches a set of specified criteria (e.g. user.hrn==x or slice.site.slices > 20) 
32
33 - A 'target' is an action to perform as a result of a match (e.g. remove nodes plc.tp.* or restrict nodes to plc.some_nodegroup)
34
35 Additionally, specifying rules in this chain and making the resulting policy available to users lets them optimize their allocation within the space of possibilities they have.
36 E.g. if the policy is that your site is limited to < 1000 slivers (e.g. sfatables -A INCOMING --requester-hrn plc.* -j GLOBAL_LIMIT --site-sliver-limit 1000). 
37
38 - On startup, sfa loads the available set of matches and targets. In doing so, it remembers the input that these matches and targets need. E.g., a 'user hrn' match
39 only requires the user's HRN. A site's slice count match may require the number of slices/site. The config file consists of a set of 
40
41 - When sfa needs to invoke sfatables, it passes a 'rule context' (i.e. the parameter to the sfatables command line) along with the input from the current context to the appropriate match. If it returns True, then it goes on to invoke target specified by the rule, and uses the filtered version of the rspec that it produces.
42
43
44 Specifics:
45
46 - On startup sfa calls sfatables.load(), which loads available commands, matches and targets
47
48 - When invoking sfatables