Development/UID
From Inspire IRCd (InspIRCd)
| | This page has been marked as Development Material. Information posted here may be subject to change and/or only available in unstable versions of InspIRCd. |
Contents |
UID: Unique IDentifier
Introduction
What is UID? It is a few different things, but first and foremost it stands for Unique IDentifier.
This is a new way of sending information on state changes across server to server links. Previously, user nicknames and server names were used to identify the origin and target of traffic. This is okay for smaller networks, but the bigger the network, the bigger the chance for problems.
An example would be the following server map:
A <-----> B <-----> C <-----> D
Oper AA on server A kills user DD on server D, however, user DD quits. Another user signs on server B with nickname DD, and is then (incorrectly) killed.
The same example can be adapted for various other IRC concepts such as forced nick change, forced join, etc.
How does UID help?
Instead of the server sending something like
:AA KILL DD :spammer! get off the network
The server would send something like
:0AABBBB KILL 0DDBBBB :spammer! get off the network
Where 0AABBB is the unique ID for client with nickname AA, and 0DDBBB is the unique ID for the client with nickname DD. The client signing on to server B may recieve UID 0BBBBB, which of course does not match 0DDBBB, and therefore is not incorrectly killed.
The same occurs for places where server names may be used, such as SQUIT:
:0AABBB RSQUIT 0BB :Relinking the server
Where client with nickname AA may be remote-squitting server B from the network.
How do we implement UID?
Implementing UID can be seperated into a number of clearly defined steps:
- Introducing unique identifiers into the classes for clients and servers
- Changing the code for functions to use the unique identifiers for server to server traffic
- Changing nick collisions to force nick change to unique identifiers
Our implementation and definition of SID, ID, and UID matches TS6's. That is..
SID - A servers unique ID. This is three characters long and must be in
the form [0-9][A-Z0-9][A-Z0-9]
ID - A clients unique ID. This is six characters long and must be in
the form [A-Z][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9][A-Z0-9]. The
numbers [0-9] at the beginning of an ID are legal characters, but
reserved for future use.
UID - An ID concateneted to a SID. This forms the clients UID.
History
For posterity, the first PRIVMSGs sent with InspIRCd using UUIDs:
Mon Aug 27 04:38:20 2007: C[10] -> :w00t2 PRIVMSG #test :this is a test from hub to penguin Mon Aug 27 04:38:20 2007: S[11] -> :928AAAAAB PRIVMSG #test :this is a test from hub to penguin Mon Aug 27 04:38:25 2007: S[11] <- :497AAAAAB PRIVMSG #test :and now a test from penguin to hub
Other notes
- Server to server links will ONLY support UID. This is draconian, but it avoids having to faff about with code for backwards compatibility that will likely be buggy or introduce complex problems (TS5 -> TS6).
Reference
http://42.pl/ircd/uniqueID.txt - IRCnet UID implementation discussion

















