]> git.mxchange.org Git - hub-docs.git/blob - misc/possible_hub_states.txt
f8b29c2ce018fa66d72ebc814449b6430cf4a3d4
[hub-docs.git] / misc / possible_hub_states.txt
1 Possible States For A Hub Connection
2 ====================================
3
4 This is a brief summary of possible states a hub connection may be setted.
5 These ideas should later be implemented in a XML file with e.g. a StateXmlParser
6 class with a XmlFileReader as a data source.
7
8 -------------------------------------------------------------------------------
9  Initial state | Reason of change                             | New state
10 -------------------------------------------------------------------------------
11  New peer      | Appears as a simple connection               | Connected
12  Connected     | Has dropped the connection                   | Disconnected
13  Connected     | Does not do anything within a timeout        | Timed out
14  Connected     | Tries to send some objects with auth enabled | Message "AUTH"
15  Disconnected  | Is purged from the connection list           | Removed
16  Timed out     | Is being pinged                              | Pinged
17  Pinged        | Does not response on a ping                  | No response
18  Pinged        | Does reply slowly on a ping                  | Slowed down
19  Pinged        | Does reply fast on a ping                    | <prev. state>
20  No response   | Does still not response on X pings           | Lost connection
21  No response   | Does reply on a ping                         | Slowed down
22  Slowed down   | Does not response on a ping                  | No response
23  Slowed down   | Does still response slow on X extra pings    | Karma lose
24  Slowed down   | Does reply faster on a ping                  | <prev. state>
25  Lost connect. | Is maybe disconnected/crashed/etc.           | Disconnected
26  Karma lose    | Has lost some karma                          | <prev. state>
27  Add karma     | Has gained some karma                        | <prev. state>
28 -------------------------------------------------------------------------------
29  Observed      | Did not do any annormal activity within time | Removed from O-List
30  Observed      | Is being observed for further annormal act.  | <prev. state>
31  Removed O-L   | Is being removed from observing for ann. ac. | <prev. state>
32 -------------------------------------------------------------------------------
33  <bad state>   | Does not response within timeout             | Message "BANNED"
34  <any state>   | Sends unexpected network packets             | Message "PACKET"
35  <any state>   | Sends or replies with unknown message        | Message "UNKNOWN"
36  "PACKET"      | Still sends unexpected network packets       | Karma lose
37  "PACKET"      | Resends valid network package                | <prev. state>
38  "PACKET"+Kar. | Still sends unexpected network packets       | Message "BANNED"
39  "PACKET"+Kar. | Resends valid network package                | <prev. state>
40  "UNKNOWN"     | Still sends/replies with unknown message     | Karma lose
41  "UNKNOWN"     | Still sends/replies with unknown message     | Message "BANNED"
42  <fine state>  | Does not response within timeout             | Pinged
43 -------------------------------------------------------------------------------
44  "WELCOME"     | Tries to send objects with invalid target    | Message "TARGET"
45  "WELCOME"     | Tries to send objects with valid target      | Message "ACCEPT-OBJECT"
46  "WELCOME"     | Requests a list of hubs/clients f. inv. obj. | Message "OBJECT"
47  "WELCOME"     | Requests a list of hubs/clients f. val. obj. | Message "LIST"
48  "WELCOME"     | Sends a list of hubs/clients without offer   | Message "OFFER-LIST"
49  "WELCOME"     | Offers a list of all invalid objects         | Message "ALL-OBJECT-LIST"
50  "WELCOME"     | Offers a list with partly invalid objects    | Message "PAR-OBJECT-LIST"
51  "WELCOME"     | Offers a list of all valid objects           | Message "ACCEPT-LIST"
52  "A-L"         | Has send a different list of objects         | Message "DIV-LIST"
53  "A-L"         | Has send the same list of valid objects      | Add karma
54  "A-O-L"       | Still offers a list of all invalid objects   | Karma lose
55  "A-O-L"       | Reoffers a list of valid objects             | Message "ACCEPT-LIST"
56  "A-O-L"+Karma | Still offers a list of all invalid objects   | Message "BANNED"
57  "A-O-L"+Karma | Still offers a list of all invalid objects   | Message "ACCEPT-LIST"
58  "A-O-L"+Karma | Reoffers a list of valid objects             | Message "ACCEPT-LIST
59  "A-K"         | The target rejects the object: "OBJECT"      | Message "TARGET-OBJECT"
60  "A-K"         | The target rejects the object: "BUSY"        | Message "BUSY-OBJECT"
61  "A-O"         | Tries to send an invalid object              | Message "INVALID-OBJECT"
62  "A-O"         | Tries to send a different but valid object   | Message "DIV-OBJECT"
63  "A-O"         | Sends the same object                        | Add karma
64  "A/P-T"       | Still sends a list of all/partly invalid o.  | Karma lose
65  "A/P-T"+Karma | Still sends a list of all/partly invalid o.  | Message "BANNED"
66  "P-O-L"       | Still offers a list of part. invalid objects | Karma lose
67  "P-O-L"       | Resends a list of valid objects              | Observe->Message "ACCEPT-LIST"
68  "P-O-L"+Karma | Still offers a list of part. invalid objects | Message "BANNED"
69  "P-O-L"+Karma | Resends a list of valid objects              | Observe->Message "ACCEPT-LIST"
70  "I-O"         | Still tries to send an invalid object        | Karma lose
71  "I-O"         | Resends a different invalid object           | Message "DIV-OBJECT"
72  "I-O"         | Resends the same valid object                | Observed
73  "I-O"+Karma   | Still tries to send an invalid object        | Message "BANNED"
74  "I-O"+Karma   | Resends the same valid object                | Observed
75  "D-L"         | Still sends a different list                 | Karma lose
76  "D-L"         | Resends the same list                        | Observed   
77  "D-L"+Karma   | Still sends a different list                 | Message "BANNED"
78  "D-L"+Karma   | Resends the same list                        | Observed   
79  "D-O"         | Still tries to send a different object       | Karma lose
80  "D-O"         | Resends the same valid object                | Observed
81  "D-O"+Karma   | Still tries to send a different object       | Message "BANNED"
82  "D-O"+Karma   | Resends the same valid object                | Observed
83  "LIST"        | The peer receives a list of hubs and clients | <prev. state>
84  "TARGET"      | Still tries to send objects to invalid targ. | Karma lose
85  "TARGET"      | Sends an object to target with weak karma    | Message "ACCEPT-KARMA"
86  "TARGET"      | Sends an object to valid target              | Message "ACCEPT-OBJECT"
87  "TARGET"+Kar. | Still tries to send objects to invalid targ. | Message "TARGET-KARMA"
88  "T-K"         | Still tries to send objects to invalid targ. | Message "BANNED"
89  "T-O"         | Target does not accept the obj. but in list  | Message "OBJECT-LIST" to target
90  "OBJECT"      | Still requests a list f. invalid object      | Karma lose
91  "OBJECT"+Kar. | Still requests a list f. invalid object      | Message "OBJECT-KARMA
92  "O-K"         | Still requests a list f. invalid object      | Message "BANNED"
93  "O-L"         | Target does still say "ACCEPT" for object    | Karma lose
94  "O-L"+Karma   | Target does still say "ACCEPT" for object    | Message "BANNED" to target
95  "AUTH"        | Still tries to send objects after X "AUTH"   | Karma lose
96  "AUTH"        | Sends valid authorization data               | Observe->Message "WELCOME"
97  "AUTH"+Karma  | Still tries to send objects after X "AUTH"   | Message "BANNED"
98  "AUTH"+Karma  | Sends invalid authorization data             | Message "KICKED"
99  "AUTH"+Karma  | Sends valid authorization data               | Observe->Message "WELCOME"
100  "KICKED"      | Still authorizes itself with invalid data    | Message "BANNED"
101  "BANNED"      | Is being banned on the node                  | Disconnected
102 -------------------------------------------------------------------------------
103
104 A previous state is a non-fatal state that the peer was before the trouble
105 started. This state is stored along with a timestamp to watch the overall
106 performance of this hub reacting a troubleous peer.
107
108 Karma lose or added karma is being remembered in a lose/add-seperated summary for
109 "productive" and addionally as a full list for debugging purposes if the debug
110 mode is enabled.
111
112 A "connection" should be interpreted as a incoming socket "connection". That
113 means in this state table we threat UDP "connections" as same as TCP
114 connections to make things easier. Of, course the script will be the last one to
115 seperate between these very different protocols.
116
117 A "ping" is a small message that should be responded by a pinged peer within a
118 time period else the ping would loose some karma. When a "ping" is issued it
119 should not be resend within a time period to not ping the peer to death.
120
121 So pings are not issued while there is no trouble with the peer. This does
122 reduce network load for certain. Troubleous peers are being detected by the
123 above state changes (see Connected->Timed out for example).
124
125 Some state changes are no *real* state changes. They are sometimes remarks
126 attached to the peer connection. A good example is the state 'Karma lose' which
127 a peer does never change to.
128
129 A "list" should be interpreted as a DHT (Distributed Hash Table). All list and
130 object transferes are being validated by final hashes for high reliablity.