]> jfr.im git - irc/rqf/shadowircd.git/blame - doc/technical/ts6.txt
Add syntax description of MLOCK message to ts6-protocol.txt.
[irc/rqf/shadowircd.git] / doc / technical / ts6.txt
CommitLineData
212380e3 1
bee3b671 2TS6 Proposal (v8)
212380e3 3Written by Lee H <lee@leeh.co.uk>
4Ideas borrowed heavily from ircnet (Beeth, jv, Q)
5
bee3b671 6- Changes between v7 and v8 -
7-----------------------------
8
9In the v7 specification, the JOIN command included the channel modes of a
10channel, and acted on them following TS rules. In the v8 specification,
11JOIN will never send modes.
12
13Desyncs can occur both when they are sent and when they are not. If they
14are sent, then you can have a situation where a user on one side of the
15network issues "MODE #channel -l", and a user on another side of the network
16issues "JOIN #channel" whilst the +l still exists. As the JOIN string sent
17server<->server includes the full modes at the time of the user joining,
18this will propagate the +l, but there is a -l crossing in the other
19direction. Desync will occur beyond where they intersect.
20
21If the modes are not sent, then a lower TS JOIN command, or a JOIN command
22that creates a channel will cause a desync.
23
24It is judged that the desync with sending the modes is worse than the desync
25by not sending them, as such the v8 specification dictates modes are not
26sent with a JOIN command server<->server.
27
28The v8 specification also clarifies that servers may issue TMODE.
29
30- Introduction -
31----------------
212380e3 32
33This document aims to fix some of the flaws that are still present in the
34current TS system.
35
36Whilst only one person may use a nickname at any one time, they are not
37a reliable method of directing commands between servers. Clients can change
38their nicknames, which can create desyncs. A reliable method of directing
39messages between servers is required so that a message will always reach the
40intended destination, even if the client changes nicks in between.
41
42UID solves this problem by ensuring that a client has a unique ID for the
43duration of his connection.
44
45This document also aims to solve the lack of TS rules to channel 'bans' on
46a netburst. Bans from both sides of a TS war (losing/winning) are kept.
47Bursting the bans with a TS solves this problem.
48
49There is also a race condition in the current TS system, where a user can
50issue a mode during a netburst and the mode will be set on the server
51we are bursting to.
52
53
bee3b671 54- Definitions -
55---------------
212380e3 56
57Throughout this document, the following terms are used:
58
59SID - A servers unique ID. This is three characters long and must be in
60 the form [0-9][A-Z0-9][A-Z0-9]
61ID - A clients unique ID. This is six characters long and must be in
62 the form [A-Z][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9]. The
63 numbers [0-9] at the beginning of an ID are legal characters, but
64 reserved for future use.
65UID - An ID concateneted to a SID. This forms the clients UID.
66TS6 - The TS version 6.
67
68
bee3b671 69- Support -
70-----------
212380e3 71
72Support for this document is given by the TS version 6.
73
74Wherever a destination parameter or source parameter is used, it must use
75the SID or UID if the server/client has one. A TS6 capable server must
76translate any SIDs/UIDs back into the server/clients name when communicating
77with a server that does not support TS6.
78
79A TS6 server must also support the QS (quitstorm) system, and the encap
80specification found here:
81http://www.leeh.co.uk/ircd/encap.txt
82
83The TS6 protocol does not supports masked entities.
84
85
bee3b671 86- Nick TS rules -
87-----------------
212380e3 88
89A server receiving a command that requires nick TS rules must check for a
90collision between an existing user, and the nick in the received message.
91(the "new user"). The collisions must obey the rules specified in Nick TS
92collisions.
93
94If the TS received is lower than the TS of the existing user the server will
95collide the existing user if the clients user@host are different, if the
96clients user@hosts are identical it will collide the new user.
97
98If the TS received is equal to the TS of the existing user both clients are
99collided.
100
101If the TS received is higher than the TS of the existing user, the server
102will collide the existing user if the user@hosts are identical, if the
103clients user@host are different it will collide the new user and drop the
104message.
105
106
bee3b671 107- Nick TS collisions -
108----------------------
212380e3 109
110If both users are to be collided, we must issue a KILL for the existing
111user to all servers. If the new user has a UID then we must also issue a
112KILL for that UID back to the server sending us data causing the collision.
113
114If only the existing user is being collided, we must issue a KILL for the
115existing user to all servers except the server sending us data. If the
116existing user has a UID and the server sending us data supports TS6 then
117we must also issue a KILL for the existing users UID to the server sending
118us data.
119
120If only the new user is being collided, we must issue a KILL for the new user
121back to the server sending us data if the new user has a UID.
122
123
bee3b671 124- Channel TS rules -
125--------------------
212380e3 126
127A server receiving a command that requires normal channel TS rules must
128apply the following rules to the command.
129
130If the TS received is lower than our TS of the channel a TS6 server must
131remove status modes (+ov etc) and channel modes (+nt etc). If the
132originating server is TS6 capable (ie, it has a SID), the server must
133also remove any ban modes (+b etc). The new modes and statuses are then
134accepted.
135
136If any bans are removed, the server must send to non-TS6, directly connected
137servers mode changes removing the bans after the command is propagated.
138This prevents desync with banlists, and has to be sent after as clients are
139still able to send mode changes before the triggering command arrives.
140
141If the TS received is equal to our TS of the channel the server should keep
142its current modes and accept the received modes and statuses.
143
144If the TS received is higher than our TS of the channel the server should keep
145its current modes and ignore the received modes and statuses. Any statuses
146given in the received message will be removed. A server must mark clients
147losing their op (+o) status who do not have a UID as 'deopped'. A server must
148ignore any "MODE" commands from a user marked as 'deopped'.
149
150
bee3b671 151- Simple channel TS rules -
152---------------------------
212380e3 153
154A server receiving a command that requires simple channel TS rules must
155apply the following rules to the command.
156
157If the TS received is lower, or equal to our TS of the channel the modes are
158accepted. If the TS received is higher than our TS of the channel the modes
159are ignored and dropped.
160
161Simple channel TS rules do not affect current modes in the channel except
162for the modes we are accepting.
163
164
bee3b671 165- The following commands are defined here as the TS6 protocol -
166---------------------------------------------------------------
212380e3 167
bee3b671 168- PASS -
169 PASS <PASSWORD> TS <TS_CURRENT> :<SID>
212380e3 170
171This command is used for password verification with the server we are
172connecting to.
173
174Due to the burst being sent on verification of the "SERVER" command, and
175"SVINFO" being sent after "SERVER", we need to be aware of the TS version
176earlier to decide whether to send a TS6 burst or not.
177
178The <PASSWORD> field is the password we have stored for this server,
179<TS_CURRENT> is our current TS version. If this field is not present then
180the server does not support TS6. <SID> is the SID of the server.
181
bee3b671 182- UID -
183 :<SID> UID <NICK> <HOPS> <TS> +<UMODE> <USERNAME> <HOSTNAME> <IP> <UID> :<GECOS>
212380e3 184
185This command is used for introducing clients to the network.
186
187The <SID> field is the SID of the server the client is connected to.
188The <NICK> field is the nick of the client being introduced. The <HOPS>
189field is the amount of server hops between the server being burst to and
190the server the client is on. The <TS> field is the TS of the client, either
191the time they connected or the time they last changed nick. The <UMODE>
192field contains the clients usermodes that need to be transmitted between
193servers. The <USERNAME> field contains the clients username/ident. The
194<HOSTNAME> field contains the clients host.
195
196The <IP> field contains the clients IP. If the IP is not to be sent
197(due to a spoof etc), the field must be sent as "0". The <UID> field is the
198clients UID. The <GECOS> field is the clients gecos.
199
200A server receiving a UID command must apply nick TS rules to the nick.
201
bee3b671 202- SID -
203 :<SID> SID <SERVERNAME> <HOPS> <SID> :<GECOS>
212380e3 204
205This command is used for introducing servers to the network.
206
207The first <SID> field is the SID of the new servers uplink. The
208<SERVERNAME> field is the new servers name. The <HOPS> field is the hops
209between the server being introduced nd the server being burst to.
210
211The second <SID> field is the SID of the new server. The <GECOS> field i
212is the new servers gecos.
213
214Upon receiving the SID command servers must check for a SID collision.
215Two servers must not be allowed to link to the network with the same SID.
216If a server detects a SID collision it must drop the link to the directly
217connected server through which the command was received.
218
219Client and servers which do not have a UID/SID must be introduced by old
220methods.
221
bee3b671 222- SJOIN -
223 :<SID> SJOIN <TS> <CHANNAME> +<CHANMODES> :<UIDS>
212380e3 224
225This command is used for introducing users to channels.
226
227The <SID> field is the SID of the server introducing users to the channel.
228The <TS> field is the channels current TS, <CHANNAME> is the channels
229current name, <CHANMODES> are the channels current modes. <UIDS> is a
230space delimited list of clients UIDs to join to the channel. Each clients
231UID is prefixed with their status on the channel, ie "@UID" for an opped
232user. Multiple prefixes are allowed, "peons" (clients without a status) are
233not prefixed.
234
235A server receiving an SJOIN must apply normal channel TS rules to the SJOIN.
236
237A TS6 server must not use the SJOIN command outside of a netburst
238to introduce a single user to an existing channel. It must instead
239use the "JOIN" command defined in this specification. A TS6 server must
240still use SJOIN for creating channels.
241
bee3b671 242- JOIN -
243 :<UID> JOIN <TS> <CHANNAME> +
212380e3 244
245This command is used for introducing one user unopped to an existing channel.
246
247The <UID> field is the UID of the client joining the channel. The
248<TS> field is the channels current TS, <CHANNAME> is the channels
bee3b671 249current name.
212380e3 250
251A server receiving a JOIN must apply normal channel TS rules to the JOIN.
252
bee3b671 253No channel modes are sent with the JOIN command. In previous versions of
254this specification, the "+" parameter contained the channels current modes.
255A server following this version of the specification must not interpret this
256argument and must not propagate any value other than "+" for this parameter.
257
212380e3 258It should be noted that whilst JOIN would not normally create a
bee3b671 259channel or lower the timestamp, during specific conditions it can. This
260can create a desync that this specification does not rectify.
212380e3 261
bee3b671 262- BMASK -
263 :<SID> BMASK <TS> <CHANNAME> <TYPE> :<MASKS>
212380e3 264
265This command is used for bursting channel bans to a network.
266
267The <SID> field is the SID of the server bursting the bans. The
268<TS> field is the channels current TS, <CHANNAME> is the channels
269name. <TYPE> is a single character identifying the mode type (ie,
270for a ban 'b'). <MASKS> is a space delimited list of masks of the
271given mode,limited only in length to the size of the buffer as defined
272by RFC1459.
273
274A server receiving a BMASK must apply simple channel TS rules to the BMASK.
275
276A TS6 server must translate BMASKs into raw modes for non-TS6
277capable servers. This command must be used only after SJOIN has
278been sent for the given channel.
279
280It should be noted however, that a BMASK with a lower TS should
281not be possible without a desync, due to it being sent after
282SJOIN.
283
bee3b671 284- TMODE -
285 :<SID|UID> TMODE <TS> <CHANNAME> <MODESTRING>
212380e3 286
287This command is used for clients issuing modes on a channel.
288
bee3b671 289<SID|UID> is either the UID of the client setting the mode, or the SID of
290the server setting the mode. <TS> is the current TS of the channel,
291<CHANNAME> is the channels name. <MODESTRING> is the raw mode the client is
292setting.
212380e3 293
294A server receiving a TMODE must apply simple channel TS rules to the TMODE.
295
bee3b671 296A TS6 server must translate MODEs issued by a local client, or received from
297a server into TMODE to send to other TS6 capable servers.
212380e3 298