Mercurial > hg > freeDiameter
annotate doc/rt_default.conf.sample @ 1562:6219359a36a9 default tip
Merge latest changes from proposed branch
author | Sebastien Decugis <sdecugis@freediameter.net> |
---|---|
date | Mon, 21 Jun 2021 19:08:18 +0800 |
parents | cec0812038bb |
children |
rev | line source |
---|---|
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
1 # This file contains the configuration for the rt_default extension of freeDiameter. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
2 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
3 # This extension provides configurable routing properties for freeDiameter. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
4 |
1336
cec0812038bb
rt_default: add reload support.
Thomas Klausner <tk@giga.or.at>
parents:
1197
diff
changeset
|
5 # This extension supports configuration reload at runtime. Send |
cec0812038bb
rt_default: add reload support.
Thomas Klausner <tk@giga.or.at>
parents:
1197
diff
changeset
|
6 # signal SIGUSR1 to the process to cause the process to reload its |
cec0812038bb
rt_default: add reload support.
Thomas Klausner <tk@giga.or.at>
parents:
1197
diff
changeset
|
7 # config. |
cec0812038bb
rt_default: add reload support.
Thomas Klausner <tk@giga.or.at>
parents:
1197
diff
changeset
|
8 |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
9 # Lines starting with a # are comments and ignored. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
10 |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
11 ############################################################################## |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
12 # The freeDiameter daemon will not allow forwarding a message to a peer that: |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
13 # - already forwarded the message (appear as Route-Record inside the message) |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
14 # - connection is not in STATE_OPEN state. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
15 # We call here "eligible peer" a peer that is not screened out by one of these criteria. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
16 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
17 # Even if a peer is specified as route for a message here, the daemon may |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
18 # choose to send a message to another peer, or return a UNABLE_TO_DELIVER error, if that peer is not eligible |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
19 # at the time where the message is to be forwarded. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
20 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
21 # Note also that defining a peer here will not result in the daemon trying to establish |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
22 # a connection to this peer. For this purpose, the peer must be defined in the main |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
23 # configuration (ConnectPeer), or connection established through other means (e.g. dynamic peer |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
24 # discovery extension). |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
25 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
26 # The default forwarding behavior of freeDiameter is: |
1197
823829bf1037
Couple of typos in the comments
Sebastien Decugis <sdecugis@freediameter.net>
parents:
724
diff
changeset
|
27 # - if the message contains a Destination-Host AVP, and the designated peer is an eligible candidate, send to this peer. |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
28 # - if a peer does not support the message application or Relay application, give it a penalty for this message |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
29 # (it means that unless overwritten by an extension, the message will not be sent to that peer) |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
30 # - if one of the eligible peer advertised a realm matching the message's Destination-Realm, send to this peer. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
31 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
32 # The mechanism is as follow: |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
33 # - the daemon builds a list of eligible peers, then attributes a score to these peers (see enum fd_rt_out_score in freeDiameter.h) |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
34 # - any number of extensions can register a callback and modify the score |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
35 # - after all callbacks have been called, the message is sent to the peer with the higher score. If an error is received, it is retried to the next peer in the list, and so on, |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
36 # until the list is empty. In such situation, an error UNABLE_TO_DELIVER is generated. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
37 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
38 # This extension allows to modify the score of some peers based on some criteria of the message. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
39 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
40 # Finally, please note that the freeDiameter daemon does not support REDIRECT indications natively. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
41 # You have to load the rt_redir extension to add this support. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
42 ############################################################################## |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
43 |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
44 # This file contains a list of RULE elements. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
45 # Each RULE is made of three components: |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
46 # - a CRITERIA, which specifies which messages the RULE apply to. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
47 # - a TARGET string, that specifies which peer(s) in the eligible list the rule is applied to |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
48 # - and a SCORE, that is added to the matching peer's current score. |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
49 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
50 # In the following definitions, "STR/REG" stands for: |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
51 # - a quoted string "some.peer" that will match exactly this string (case-insensitive), or |
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
52 # - a bracket-quoted string ["some regex"] that will be interpreted as a POSIX extended regular expression (case-sensitive), and attempt to match the string. |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
53 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
54 # The RULE is specified as: |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
55 # CRITERIA : TARGET += SCORE ; |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
56 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
57 # The CRITERIA can be: |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
58 # * -> matches any message. |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
59 # oh="STR/REG" -> selects the message if the string or regular expression matches the message's Origin-Host AVP content |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
60 # or="STR/REG" -> idem with Origin-Realm |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
61 # dh="STR/REG" -> idem with Destination-Host |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
62 # dr="STR/REG" -> idem with Destination-Realm |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
63 # un="STR/REG" -> idem with User-Name |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
64 # si="STR/REG" -> idem with Session-Id |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
65 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
66 # The TARGET is also of a similar form: |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
67 # "STR/REG" -> Will apply the score to this peer if its Diameter-Id is matched by the string or regular expression. |
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
68 # rlm="STR/REG" -> Idem with the peer's advertized Diameter-Realm. |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
69 # |
724 | 70 # The SCORE is either numeric (positive or negative), or one of the following constants (see values in libfdcore.h): |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
71 # NO_DELIVERY |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
72 # DEFAULT |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
73 # DEFAULT_REALM |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
74 # REALM |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
75 # REDIR_HOST |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
76 # REDIR_APP |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
77 # REDIR_REALM |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
78 # REDIR_REALM_APP |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
79 # REDIR_USER |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
80 # REDIR_SESSION |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
81 # FINALDEST |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
82 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
83 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
84 # Here are some examples: |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
85 # 1) Rule to add a default next-hop peer to all messages: |
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
86 # * : "proxy.testbed.aaa" += DEFAULT ; |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
87 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
88 # 2) Rule to route messages for a given realm (realmA) through another realm (realmB): |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
89 # dr="realmA" : rlm="realmB" += DEFAULT_REALM ; |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
90 # |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
91 # 3) Avoid sending messages with decorated NAI to the proxy A: |
168
6db078b955e3
Completed rt_default extension
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
167
diff
changeset
|
92 # un=[".+!.+@.+"] : "proxy.A" += NO_DELIVERY ; |
167
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
93 |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
94 |
967e579beb64
Backup work in progress on rt_default
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
diff
changeset
|
95 |