e3446e08a339a80535ca24bf37724aeebd8ef2ed
[silc.git] / doc / draft-riikonen-silc-spec-00.nroff
1 .pl 10.0i
2 .po 0
3 .ll 7.2i
4 .lt 7.2i
5 .nr LL 7.2i
6 .nr LT 7.2i
7 .ds LF Riikonen
8 .ds RF FORMFEED[Page %]
9 .ds CF
10 .ds LH Internet Draft
11 .ds RH 28 June 2000
12 .ds CH
13 .na
14 .hy 0
15 .in 0
16 .nf
17 Network Working Group                                      P. Riikonen
18 Internet-Draft
19 draft-riikonen-silc-spec-00.txt                           28 June 2000
20 Expires: 28 Jan 2001
21
22 .in 3
23
24 .ce 3
25 Secure Internet Live Conferencing (SILC),
26 Protocol Specification
27 <draft-riikonen-silc-spec-00.txt>
28
29 .ti 0
30 Status of this Memo
31
32 This document is an Internet-Draft and is in full conformance with   
33 all provisions of Section 10 of RFC 2026.  Internet-Drafts are   
34 working documents of the Internet Engineering Task Force (IETF), its   
35 areas, and its working groups.  Note that other groups may also   
36 distribute working documents as Internet-Drafts.   
37
38 Internet-Drafts are draft documents valid for a maximum of six months   
39 and may be updated, replaced, or obsoleted by other documents at any   
40 time.  It is inappropriate to use Internet-Drafts as reference   
41 material or to cite them other than as "work in progress."   
42
43 The list of current Internet-Drafts can be accessed at   
44 http://www.ietf.org/ietf/1id-abstracts.txt   
45
46 The list of Internet-Draft Shadow Directories can be accessed at   
47 http://www.ietf.org/shadow.html   
48
49 The distribution of this memo is unlimited.  
50
51
52 .ti 0
53 Abstract
54
55 This memo describes a Secure Internet Live Conferencing (SILC)
56 protocol which provides secure conferencing services over insecure
57 network channel.  SILC is IRC [IRC] like protocol, however, it is 
58 not equivalent to IRC and does not support IRC.  Strong cryptographic
59 methods are used to protect SILC packets inside SILC network.  Two
60 other Internet Drafts relates very closely to this memo;  SILC Packet
61 Protocol [SILC2] and SILC Key Exchange and Authentication Protocols
62 [SILC3].
63
64
65
66
67
68
69
70
71 .ti 0
72 Table of Contents
73
74 .nf
75 1 Introduction ..................................................  3
76 2 SILC Concepts .................................................  3
77   2.1 SILC Network Topology .....................................  4
78   2.2 Communication Inside a Cell ...............................  5
79   2.3 Communication in the Network ..............................  6
80   2.4 Channel Communication .....................................  7
81 3 SILC Specification ............................................  7
82   3.1 Client ....................................................  7
83       3.1.1 Client ID ...........................................  8
84   3.2 Server ....................................................  9
85       3.2.1 Server's Local ID List ..............................  9
86       3.2.2 Server ID ........................................... 10
87       3.2.3 SILC Server Ports ................................... 11
88   3.3 Router .................................................... 11
89       3.3.1 Router's Local ID List .............................. 11
90       3.3.2 Router's Global ID List ............................. 12
91       3.3.3 Router's Server ID .................................. 13
92   3.4 Channels .................................................. 13
93       3.4.1 Channel ID .......................................... 14
94   3.5 Operators ................................................. 14
95   3.6 SILC Commands ............................................. 15
96   3.7 SILC Packets .............................................. 15
97   3.8 Packet Encryption ......................................... 16
98       3.8.1 Determination of the Source and the Destination ..... 16
99       3.8.2 Client To Client .................................... 17
100       3.8.3 Client To Channel ................................... 18
101       3.8.4 Server To Server .................................... 19
102   3.9 Key Exchange And Authentication ........................... 19
103   3.10 Algorithms ............................................... 19
104       3.10.1 Ciphers ............................................ 19
105       3.10.2 Public Key Algorithms .............................. 20
106       3.10.3 MAC Algorithms ..................................... 20
107       3.10.4 Compression Algorithms ............................. 21
108   3.11 SILC Public Key .......................................... 21
109 4 SILC Procedures ............................................... 24
110   4.1 Creating Client Connection ................................ 24
111   4.2 Creating Server Connection ................................ 25
112   4.3 Joining to a Channel ...................................... 26
113   4.4 Channel Key Generation .................................... 27
114   4.5 Private Message Sending and Reception ..................... 27
115   4.6 Private Message Key Generation ............................ 28
116   4.7 Channel Message Sending and Reception ..................... 29
117   4.8 Session Key Regeneration .................................. 29
118   4.9 Command Sending and Reception ............................. 29
119 5 SILC Commands ................................................. 30
120   5.1 SILC Commands Syntax ...................................... 30
121   5.2 SILC Commands List ........................................ 32
122   5.3 SILC Command Status Types ................................. 53
123       5.3.1 SILC Command Status Payload ......................... 53
124       5.3.2 SILC Command Status List ............................ 54
125 6 Security Considerations ....................................... 59
126 7 References .................................................... 59
127 8 Author's Address .............................................. 60
128
129
130 .ti 0
131 List of Figures
132
133 .nf
134 Figure 1:  SILC Network Topology
135 Figure 2:  Communication Inside cell
136 Figure 3:  Communication Between Cells
137 Figure 4:  SILC Public Key
138 Figure 5:  SILC Command Status Payload
139
140
141 .ti 0
142 1. Introduction
143
144 This document describes a Secure Internet Live Conferencing (SILC)
145 protocol which provides secure conferencing services over insecure
146 network channel.  SILC is IRC [IRC] like protocol, however, it is 
147 not equivalent to IRC and does not support IRC.
148
149 Strong cryptographic methods are used to protect SILC packets inside
150 SILC network.  Two other Internet Drafts relates very closely to this
151 memo; SILC Packet Protocol [SILC2] and SILC Key Exchange and
152 Authentication Protocols [SILC3].
153
154 The protocol uses extensively packets as conferencing protocol 
155 requires message and command sending.  The SILC Packet Protocol is
156 described in [SILC2] and should be read to fully comprehend this
157 document and protocol.  [SILC2] also describes the packet encryption
158 and decryption in detail.
159
160 The security of SILC protocol and for any security protocol for that
161 matter is based on strong and secure key exchange protocol.  The SILC
162 Key Exchange protocol is described in [SILC3] along with connection
163 authentication protocol and should be read to fully comprehend this
164 document and protocol.
165
166 The SILC protocol has been developed to work on TCP/IP network
167 protocol, although it could be made to work on other network protocols
168 with only minor changes.  However, it is recommended that TCP/IP
169 protocol is used under SILC protocol.  Typical implementation would
170 be made in client-server model.
171
172
173 .ti 0
174 2. SILC Concepts
175
176 This section describes various SILC protocol concepts that forms the 
177 actual protocol, and in the end, the actual SILC network.  The mission
178 of the protocol is to deliver messages from clients to other clients 
179 through routers and servers in secure manner.  The messages may also 
180 be delivered from one client to many clients forming a group, also 
181 known as a channel.
182
183 This section does not focus to security issues, instead basic network 
184 concepts are introduced to make the topology of the SILC network 
185 clear.
186
187
188 .ti 0
189 2.1 SILC Network Topology
190
191 SILC network is a cellular network as opposed to tree style network 
192 topology.  The rationale for this is to have servers that can perform 
193 specific kind of tasks what other servers cannot perform.  This leads 
194 to two kinds of servers; normal SILC servers and SILC routers.
195
196 A difference between normal server and router server is that routers 
197 knows everything about everything in the network.  They also do the 
198 actual routing of the messages to the correct receiver.  Normal servers 
199 knows only about local information and nothing about global information.
200 This makes the network faster as there are less servers that needs to 
201 keep global information up to date at all time.
202
203 This, on the other hand, leads to cellular like network, where routers 
204 are in the centrum on the cell and servers are connected to the router.
205
206 Following diagram represents SILC network topology.
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224 .in 8
225 .nf
226   ---- ---- ----         ---- ---- ----
227  | S8 | S5 | S4 |       | S7 | S5 | S6 |
228  ----- ---- -----       ----- ---- -----
229 | S7 | S/R1 | S2 | --- | S8 | S/R2 | S4 |
230  ---- ------ ----       ---- ------ ----
231  | S6 | S3 | S1 |       | S1 | S3 | S2 |         ---- ----
232   ---- ---- ----         ---- ---- ----         | S3 | S1 |
233      Cell 1.   \\             Cell 2.  | \\____  ----- -----
234                 |                     |        | S4 | S/R4 |
235     ---- ---- ----         ---- ---- ----       ---- ------
236    | S7 | S4 | S2 |       | S1 | S3 | S2 |      | S2 | S5 |
237    ----- ---- -----       ----- ---- -----       ---- ----
238   | S6 | S/R3 | S1 | --- | S4 | S/R5 | S5 |       Cell 4.
239    ---- ------ ----       ---- ------ ----
240    | S8 | S5 | S3 |       | S6 | S7 | S8 |     ... etc ...
241     ---- ---- ----         ---- ---- ----
242        Cell 3.                Cell 5.
243 .in 3
244
245 .ce
246 Figure 1:  SILC Network Topology
247
248
249 A cell is formed when a server or servers connect to one router.  In
250 SILC network normal server cannot directly connect to other normal
251 server.  Normal server may only connect to SILC router which then
252 routes the messages to the other servers in the cell.  Router servers
253 on the other hand may connect to other routers to form the actual SILC 
254 network, as seen in above figure.  However, router is also normal SILC 
255 server; clients may connect to it the same way as to normal SILC 
256 servers.  Normal server also cannot have active connections to more 
257 than one router.  Normal server cannot be connected to two different 
258 cells.  Router servers, on the other hand, may have as many router to 
259 router connections as needed.
260
261 There are many issues in this network topology that needs to be careful
262 about.  Issues like the size of the cells, the number of the routers in 
263 the SILC network and the capacity requirements of the routers.  These
264 issues should be discussed in the Internet Community and additional
265 documents on the issue will be written.
266
267
268 .ti 0
269 2.2 Communication Inside a Cell
270
271 It is always guaranteed that inside a cell message is delivered to the 
272 recipient with at most two server hops.  Client who is connected to
273 server in the cell and is talking on channel to other client connected 
274 to other server in the same cell, will have its messages delivered from 
275 its local server first to the router of the cell, and from the router 
276 to the other server in the cell.  Following diagram represents this 
277 scenario.
278
279
280 .in 25
281 .nf
282 1 --- S1     S4 --- 5
283          S/R
284  2 -- S2     S3
285      /        |
286     4         3
287 .in 3
288
289
290 .ce
291 Figure 2:  Communication Inside cell
292
293
294 Example:  Client 1. connected to Server 1. message sent to
295           Client 4. connected to Server 2. travels from Server 1.
296           first to Router which routes the message to Server 2.
297           which then sends it to the Client 4.  All the other
298           servers in the cell will not see the routed message.
299
300
301 If client is connected directly to the router, as router is also normal 
302 SILC server, the messages inside the cell are always delivered only with 
303 one server hop.  If clients communicating with each other are connected 
304 to the same server, no router interaction is needed.  This is the optimal
305 situation of message delivery in the SILC network.
306
307
308 .ti 0
309 2.3 Communication in the Network
310
311 If the message is destined to server that does not belong to local cell 
312 the message is routed to the router server to which the destination 
313 server belongs, if the local router is connected to destination router.
314 If there is no direct connection to the destination router, the local
315 router routes the message to its primary route.  Following diagram
316 represents message sending between cells.
317
318
319 .in 16
320 .nf
321 1 --- S1     S4 --- 5            S2 --- 1
322          S/R - - - - - - - - S/R
323  2 -- S2     S3           S1
324      /        |             \\
325     4         3              2
326
327    Cell 1.               Cell 2.
328 .in 3
329
330
331 .ce
332 Figure 3:  Communication Between Cells
333
334
335 Example:  Client 5. connected to Server 4. in Cell 1. message sent
336           to Client 2. connected to Server 1. in Cell 2. travels
337           from Server 4. to Router which routes the message to
338           Router in Cell 2, which then routes the message to 
339           Server 1.  All the other servers and routers in the
340           network will not see the routed message.
341
342
343 The optimal case of message delivery from client point of view is
344 when clients are connected directly to the routers and the messages
345 are delivered from one router to the other router.
346
347
348 .ti 0 
349 2.4 Channel Communication
350
351 Messages may be sent to group of clients as well.  Sending messages to
352 many clients works the same way as sending messages point to point, from
353 message delivery point of view.  Security issues are another matter
354 which are not discussed in this section.
355
356 Router server handles the message routing to multiple recipients.  If 
357 any recipient is not in the same cell as the sender the messages are 
358 routed further.
359
360 Server distributes the channel message to its local clients who are 
361 joined to the channel.  Also, router distributes the message to its 
362 local clients on the channel.
363
364
365 .ti 0
366 3. SILC Specification
367
368 This section describes the SILC protocol.  However, [SILC2] and
369 [SILC3] describes other important protocols that are part of this SILC
370 specification and must be read.
371
372
373 .ti 0
374 3.1 Client
375
376 A client is a piece of software connecting to SILC server.  SILC client 
377 cannot be SILC server.  Purpose of clients is to provide the user 
378 interface of the SILC services for end user.  Clients are distinguished
379 from other clients by unique Client ID.  Client ID is a 128 bit ID that
380 is used in the communication in the SILC network.  The client ID is 
381 based on the nickname selected by the user.  User uses logical nicknames
382 in communication which are then mapped to the corresponding Client ID.
383 Client ID's are low level identifications and must not be seen by the
384 end user.
385
386 Clients provide other information about the end user as well. Information
387 such as the nickname of the user, username and the hostname of the end 
388 user and user's real name.  See section 3.2 Server for information of 
389 the requirements of keeping this information.
390
391 The nickname selected by the user is not unique in the SILC network.
392 There can be 2^8 same nicknames for one IP address. As for comparison to
393 IRC [IRC] where nicknames are unique this is a fundamental difference
394 between SILC and IRC.  This causes the server names to be used along
395 with the nicknames to identify specific users when sending messages.
396 This feature of SILC makes IRC style nickname-wars obsolete as no one
397 owns their nickname; there can always be someone else with the same
398 nickname.  Another difference is that there are no limit of the length
399 of the nickname in the SILC.
400
401
402 .ti 0
403 3.1.1 Client ID
404
405 Client ID is used to identify users in the SILC network.  The Client ID
406 is unique to the extent that there can be 2^128 different Client ID's.
407 Collisions are not expected to happen.  The Client ID is defined as 
408 follows.
409
410 .in 6
411 128 bit Client ID based on IPv4 addresses:
412
413 32 bit  ServerID IP address (bits 1-32)
414  8 bit  Random number
415 88 bit  Truncated MD5 hash value of the nickname
416
417 o Server ID IP address - Indicates the server where this
418   client is coming from.  The IP address hence equals the
419   server IP address where to the client has connected.
420
421 o Random number - Random number to further unify the
422   Client ID.  This makes it possible to have 2^8 same
423   nicknames from the same server IP address.
424
425 o MD5 hash - MD5 hash value of the nickname is truncated
426   taking 88 bits from the start of the hash value.  This
427   hash value is used to search the user's Client ID from
428   the ID lists.
429
430 .in 3
431 Collisions could occur when more than 2^8 clients using same nickname
432 from the same server IP address is connected to the SILC network.  
433 Server must be able to handle this situation by refusing to accept 
434 anymore of that nickname.
435
436 Another possible collision may happen with the truncated hash value of
437 the nickname.  It could be possible to have same truncated hash value for
438 two different nicknames.  However, this is not expected to happen nor
439 cause any problems if it would occur.  Nicknames are usually logical and
440 it is unlikely to have two distinct logical nicknames produce same
441 truncated hash value.
442
443
444 .ti 0
445 3.2 Server
446
447 Servers are the most important parts of the SILC network.  They form the
448 basis of the SILC, providing a point to which clients may connect to.
449 There are two kinds of servers in SILC; normal servers and router servers.
450 This section focuses on the normal server and router server is described
451 in the section 3.3 Router.
452
453 Normal servers may not directly connect to other normal server.  Normal
454 servers may only directly connect to router server.  If the message sent
455 by the client is destined outside the local server it is always sent to
456 the router server for further routing.  Server may only have one active
457 connection to router on same port.  Normal server may not connect to other
458 cell's router except in situations where its cell's router is unavailable.
459
460 Servers and routers in the SILC network are considered to be trusted.
461 With out a doubt, servers that are set to work on ports above 1023 are
462 not considered to be trusted.  Also, the service provider acts important
463 role in the server's trustworthy.
464
465
466 .ti 0
467 3.2.1 Server's Local ID List
468
469 Normal server keeps various information about the clients and their end
470 users connected to it.  Every normal server must keep list of all locally
471 connected clients, Client ID's, nicknames, usernames and hostnames and
472 user's real name.  Normal servers only keeps local information and it
473 does not keep any global information.  Hence, normal servers knows only
474 about their locally connected clients.  This makes servers efficient as
475 they don't have to worry about global clients.  Server is also responsible
476 of creating the Client ID's for their clients.
477
478 Normal server also keeps information about locally created channels and
479 their Channel ID's.
480
481
482
483
484
485
486
487
488 Hence, local list for normal server includes:
489
490 .in 6
491 server list        - Router connection
492    o Server name
493    o Server IP address
494    o Server ID
495    o Sending key
496    o Receiving key
497    o Public key
498
499 client list        - All clients in server
500    o Nickname
501    o Username@host
502    o Real name
503    o Client ID
504    o Sending key
505    o Receiving key
506
507 channel list       - All channels in server
508    o Channel name
509    o Channel ID
510    o Client ID's on channel
511    o Client ID modes on channel
512    o Channel key
513 .in 3
514
515
516
517 .ti 0
518 3.2.2 Server ID
519
520 Servers are distinguished from other servers by unique 64 bit Server ID.
521 The Server ID is used in the SILC to route messages to correct servers.
522 Server ID's also provide information for Client ID's, see section 3.1.1
523 Client ID.  Server ID is defined as follows.
524
525 .in 6
526 64 bit Server ID based on IPv4 addresses:
527
528 32 bit  IP address of the server
529 16 bit  Port
530 16 bit  Random number
531
532 o IP address of the server - This is the real IP address of
533   the server.
534
535 o Port - This is the port the server is binded to.
536
537 o Random number - This is used to further unify the Server ID.
538
539 .in 3
540 Collisions are not expected to happen in any conditions.  The Server ID
541 is always created by the server itself and server is resposible of
542 distributing it to the router.
543
544
545 .ti 0
546 3.2.3 SILC Server Ports
547
548 Following ports has been assigned by IANA for the SILC protocol:
549
550 .in 10
551 silc            706/tcp    SILC
552 silc            706/udp    SILC
553 .in 3
554
555 If there are needs to create new SILC networks in the future the port
556 numbers must be officially assigned by the IANA.
557
558 Server on network above privileged ports (>1023) should not be trusted
559 as they could have been set up by untrusted party.
560
561
562 .ti 0
563 3.3 Router
564
565 Router server in SILC network is responsible for keeping the cell together
566 and routing messages to other servers and to other routers.  Router server
567 is also a normal server thus clients may connect to it as it would be
568 just normal SILC server.
569
570 However, router servers has a lot of important tasks that normal servers
571 do not have.  Router server knows everything about everything in the SILC.
572 They know all clients currently on SILC, all servers and routers and all
573 channels in SILC.  Routers are the only servers in SILC that care about
574 global information and keeping them up to date at all time.  And, this
575 is what they must do.
576
577
578 .ti 0
579 3.3.1 Router's Local ID List
580
581 Router server as well must keep local list of connected clients and
582 locally created channels.  However, this list is extended to include all
583 the informations of the entire cell, not just the server itself as for
584 normal servers.
585
586 However, on router this list is a lot smaller since routers do not keep
587 information about user's nickname, username and hostname and real name
588 since these are not needed by the router.  Router keeps only information
589 that it needs.
590
591
592
593
594
595 Hence, local list for router includes:
596
597 .in 6
598 server list        - All servers in the cell
599    o Server name
600    o Server ID
601    o Router's Server ID
602    o Sending key
603    o Receiving key
604
605 client list        - All clients in the cell
606    o Client ID
607
608 channel list       - All channels in the cell
609    o Channel ID
610    o Client ID's on channel
611    o Client ID modes on channel
612    o Channel key
613 .in 3
614
615
616 Note that locally connected clients and other information include all the
617 same information as defined in section section 3.2.1 Server's Local ID
618 List.
619
620
621 .ti 0
622 3.3.2 Router's Global ID List
623
624 Router server must also keep global list.  Normal servers do not have
625 global list as they know only about local information.  Global list
626 includes all the clients on SILC, their Client ID's, all created channels
627 and their Channel ID's and all servers and routers on SILC and their
628 Server ID's.  That is said, global list is for global information and the
629 list must not include the local information already on the router's local
630 list.
631
632 Note that the global list does not include information like nicknames,
633 usernames and hostnames or user's real names.  Router does not keep
634 these informations as they are not needed by the router.  This 
635 information is available from the client's server which maybe queried
636 when needed.
637
638 Hence, global list includes:
639
640 .in 6
641 server list        - All servers in SILC
642    o Server name
643    o Server ID
644    o Router's Server ID
645
646
647 client list        - All clients in SILC
648    o Client ID
649
650 channel list       - All channels in SILC
651    o Channel ID
652    o Client ID's on channel
653    o Client ID modes on channel
654 .in 3
655
656
657 .ti 0
658 3.3.3 Router's Server ID
659
660 Router's Server ID's are equivalent to normal Server ID's.  As routers
661 are normal servers as well same types of ID's applies for routers as well.
662 Thus, see section 3.2.2 Server ID.  Server ID's for routers are always
663 created by the remote router where the router is connected to.
664
665
666 .ti 0
667 3.4 Channels
668
669 A channel is a named group of one or more clients which will all receive
670 messages addressed to that channel.  The channel is created when first
671 client requests JOIN command to the channel, and the channel ceases to
672 exist when the last client leaves it.  When channel exists, any client
673 can reference it using the name of the channel.
674
675 Channel names are unique although the real uniqueness comes from 64 bit
676 Channel ID that unifies each channel.  However, channel names are still
677 unique and no two global channels with same name may exist.  Channel name
678 is a string which begins with `#' character.  There is no limit on the
679 length of the channel name.  Channel names may not contain any spaces
680 (`  '), any non-printable ASCII characters, commas (`,') and wildcard
681 characters.
682
683 Channels can have operators that can administrate the channel and
684 operate all of its modes.  Following operators on channel exist on SILC
685 network.
686
687 .in 6
688 o Channel founder - When channel is created the joining client becomes
689   channel founder.  Channel founder is channel operator with some more
690   privileges.  Basically, channel founder can fully operate the channel
691   and all of its modes.  The privileges are limited only to the particular
692   channel.  There can be only one channel founder per channel.  Channel
693   founder supersedes channel operator's privileges.
694
695   Channel founder privileges cannot be removed by any other operator on
696   channel.  When channel founder leaves the channel there is no channel
697   founder on the channel.  Channel founder also cannot be removed by
698   force from the channel.
699
700 o Channel operator - When client joins to channel that has not existed
701   previously it will become automatically channel operator (and channel
702   founder discussed above).  Channel operator is able administrate the
703   channel, set some modes on channel, remove a badly behaving client from
704   the channel and promote other clients to become channel operator.
705   The privileges are limited only to the particular channel.
706
707   Normal channel user may be promoted (opped) to channel operator
708   gaining channel operator privileges.  Channel founder or other channel
709   operator may also demote (deop) channel operator to normal channel
710   user.
711 .in 3
712
713
714 .ti 0
715 3.4.1 Channel ID
716
717 Channels are distinguished from other channels by unique Channel ID.
718 The Channel ID is a 64 bit ID and collisions are not expected to happen
719 in any conditions.  Channel names are just for logical use of channels.
720 The Channel ID is created by the server where the channel is created.
721 The Channel ID is defined as follows.
722
723 .in 6
724 64 bit Channel ID based on IPv4 addresses:
725
726 32 bit  Router's Server ID IP address (bits 1-32)
727 16 bit  Router's Server ID port (bits 33-48)
728 16 bit  Random number
729
730 o Router's Server ID IP address - Indicates the IP address of 
731   the router of the cell where this channel is created.  This is 
732   taken from the router's Server ID.  This way SILC router knows 
733   where this channel resides in the SILC network.
734
735 o Router's Server ID port - Indicates the port of the channel on 
736   the server.  This is taken from the router's Server ID.
737
738 o Random number - To further unify the Channel ID.  This makes
739   sure that there are no collisions.  This also means that
740   in a cell there can be 2^16 channels.
741 .in 3
742
743
744 .ti 0
745 3.5 Operators
746
747 Operators are normal users with extra privileges to their server or
748 router.  Usually these people are SILC server and router administrators
749 that take care of their own server and clients on them.  The purpose of
750 operators is to administrate the SILC server or router.  However, even
751 an operator with highest privileges is not able to enter invite-only
752 channel, to gain access to the contents of a encrypted and authenticated
753 packets traveling in the SILC network or to gain channel operator
754 privileges on public channels without being promoted.  They have the
755 same privileges as everyone else except they are able to administrate
756 their server or router.
757
758
759 .ti 0
760 3.6 SILC Commands
761
762 Commands are very important part on SILC network especially for client
763 which uses commands to operate on the SILC network.  Commands are used
764 to set nickname, join to channel, change modes and many other things.
765
766 Client usually sends the commands and server replies by sending a reply
767 packet to the command.  Server may also send commands usually to serve
768 the original client's request.  However, server may not send command
769 to client and there are some commands that server must not send.  Server
770 is also able to send the forwarded command packets.  For example, 
771 SILC_COMMAND_JOIN is always forwarded packet.  See [SILC2] for more
772 about packet forwarding.
773
774 Note that the command reply is usually sent only after client has sent
775 the command request but server is allowed to send command reply packet
776 to client even if client has not requested the command.  Client may,
777 however, choose not to accept the command reply, but there are some
778 command replies that the client should accept.  Example of a such
779 command reply is reply to SILC_COMMAND_CMODE command that the server
780 uses to distribute the channel mode on all clients on the channel
781 when the mode has changed.
782
783 It is expected that some of the commands may be miss-used by clients
784 resulting various problems on the server side.  Every implementation
785 should assure that commands may not be executed more than once, say,
786 in two (2) seconds.  This should be sufficient to prevent the miss-use
787 of commands.
788
789 SILC commands are described in section 5 SILC Commands.
790
791
792 .ti 0
793 3.7 SILC Packets
794
795 Packets are naturally the most important part of the protocol and the
796 packets are what actually makes the protocol.  Packets in SILC network
797 are always encrypted using, usually, the shared secret session key
798 or some other key, for example, channel key, when encrypting channel
799 messages.  The SILC Packet Protocol is a wide protocol and is described
800 in [SILC2].  This document does not define or describe details of
801 SILC packets.
802
803
804
805
806 .ti 0
807 3.8 Packet Encryption
808
809 All packets passed in SILC network must be encrypted.  This section
810 defines how packets must be encrypted in the SILC network.  The detailed
811 description of the actual encryption process of the packets are
812 described in [SILC2].
813
814 Client and its server shares secret symmetric session key which is
815 established by the SILC Key Exchange Protocol, described in [SILC3]. 
816 Every packet sent from client to server, with exception of packets for
817 channels, are encrypted with this session key.
818
819 Channels has their own key that are shared by every client on the channel.
820 However, the channel keys are cell specific thus one cell does not know
821 the channel key of the other cell, even if that key is for same channel.
822 Channel key is also known by the routers and all servers that has clients
823 on the channel.  However, channels may have channel private keys that
824 are entirely local setting for client.  All clients on the channel must
825 know the channel private key before hand to be able to talk on the
826 channel.  In this case, no server or router knows the key for channel.
827
828 Server shares secret symmetric session key with router which is
829 established by the SILC Key Exchange Protocol.  Every packet passed from
830 server to router, with exception of packets for channels, are encrypted
831 with the shared session key.  Same way, router server shares secret
832 symmetric key with its primary route.  However, every packet passed
833 from router to other router, including packets for channels, are
834 encrypted with the shared session key.  Every router connection has
835 their own session keys.
836
837
838 .ti 0
839 3.8.1 Determination of the Source and the Destination
840
841 The source and the destination of the packet needs to be determined
842 to be able to route the packets to correct receiver.  This information
843 is available in the SILC Packet Header which is included in all packets
844 sent in SILC network.  The SILC Packet Header is described in [SILC2].
845
846 The header is always encrypted with the session key who is next receiver
847 of the packet along the route.  The receiver of the packet, for example
848 a router along the route, is able to determine the sender and the
849 destination of the packet by decrypting the SILC Packet Header and
850 checking the ID's attached to the header.  The ID's in the header will
851 tell to where the packet needs to be sent and where it is coming from.
852
853 The header in the packet does not change during the routing of the
854 packet.  The original sender, for example client, assembles the packet
855 and the packet header and server or router between the sender and the
856 receiver must not change the packet header.
857
858 Note that the packet and the packet header may be encrypted with
859 different keys.  For example, packets to channels are encrypted with
860 the channel key, however, the header is encrypted with the session key
861 as described above.  However, the header and the packet may be encrypted
862 with same key.  This is case, for example, with command packets.
863
864
865 .ti 0
866 3.8.2 Client To Client
867
868 Process of message delivery and encryption from client to another
869 client is as follows.
870
871 Example:  Private message from client to another client on different
872           servers.  Clients do not share private message delivery
873           keys; normal session keys are used.
874
875 o Client 1. sends encrypted packet to its server.  The packet is
876   encrypted with the session key shared between client and its
877   server.
878
879 o Server determines the destination of the packet and decrypts
880   the packet.  Server encrypts the packet with session key shared
881   between the server and its router, and sends the packet to the
882   router.
883
884 o Router determines the destination of the packet and decrypts
885   the packet.  Router encrypts the packet with session key 
886   shared between the router and the destination server, and sends
887   the packet to the server.
888
889 o Server determines the client to which the packet is destined
890   to and decrypts the packet.  Server encrypts the packet with
891   session key shared between the server and the destination client,
892   and sends the packet to the client.
893
894 o Client 2. decrypts the packet.
895
896
897 Example:  Private message from client to another client on different
898           servers.  Clients has established secret shared private
899           message delivery key with each other and that is used in 
900           the message encryption.
901
902 o Client 1. sends encrypted packet to its server.  The packet is
903   encrypted with the private message delivery key shared between
904   clients.
905
906 o Server determines the destination of the packet and sends the 
907   packet to the router.
908
909 o Router determines the destination of the packet and sends the
910   packet to the server.
911
912 o Server determines the client to which the packet is destined
913   to and sends the packet to the client.
914
915 o Client 2. decrypts the packet with the secret shared key.
916
917
918 If clients share secret key with each other the private message
919 delivery is much simpler since servers and routers between the
920 clients do not need to decrypt and re-encrypt the packet.
921
922 The process for clients on same server is much simpler as there are
923 no need to send the packet to the router.  The process for clients 
924 on different cells is same as above except that the packet is routed 
925 outside the cell.  The router of the destination cell routes the 
926 packet to the destination same way as described above.
927
928
929 .ti 0
930 3.8.3 Client To Channel
931
932 Process of message delivery from client on channel to all the clients
933 on the channel.
934
935 Example:  Channel of four users; two on same server, other two on
936           different cells.  Client sends message to the channel.
937
938 o Client 1. encrypts the packet with channel key and sends the
939   packet to its server.
940
941 o Server determines local clients on the channel and sends the
942   packet to the Client on the same server.  Server then sends
943   the packet to its router for further routing.
944
945 o Router determines local clients on the channel, if found
946   sends packet to the local clients.  Router determines global
947   clients on the channel and sends the packet to its primary
948   router or fastest route.
949
950 o (Other router(s) do the same thing and sends the packet to
951    the server(s))
952
953 o Server determines local clients on the channel and sends the
954   packet to the client.
955
956 o All clients receiving the packet decrypts the packet.
957
958
959 .ti 0
960 3.8.4 Server To Server
961
962 Server to server packet delivery and encryption is described in above
963 examples. Router to router packet delivery is analogous to server to
964 server.  However, some packets, such as channel packets, are processed
965 differently.  These cases are described later in this document and
966 more in detail in [SILC2].
967
968
969 .ti 0
970 3.9 Key Exchange And Authentication
971
972 Key exchange is done always when for example client connects to server
973 but also when server and router and router and router connects to each
974 other.  The purpose of key exchange protocol is to provide secure key
975 material to be used in the communication.  The key material is used to
976 derive various security parameters used to secure SILC packets.  The
977 SILC Key Exchange protocol is described in detail in [SILC3].
978
979 Authentication is done after key exchange protocol has been successfully
980 completed.  The purpose of authentication is to authenticate for example
981 client connecting to the server.  However, Usually clients are accepted
982 to connect to server without explicit authentication.  Servers are
983 required use authentication protocol when connecting.  The authentication
984 may be based on passphrase (pre-shared-secret) or public key.  The
985 connection authentication protocol is described in detail in [SILC3].
986
987
988 .ti 0
989 3.10 Algorithms
990
991 This section defines all the allowed algorithms that can be used in
992 the SILC protocol.  This includes mandatory cipher, mandatory public
993 key algorithm and MAC algorithms.
994
995
996 .ti 0
997 3.10.1 Ciphers
998
999 Cipher is the encryption algorithm that is used to protect the data
1000 in the SILC packets.  See [SILC2] of the actual encryption process and
1001 definition of how it must be done.  SILC has a mandatory algorithm that
1002 must be supported in order to be compliant with this protocol.
1003
1004
1005
1006
1007
1008
1009 Following ciphers are defined in SILC protocol:
1010
1011 .in 6
1012 blowfish-cbc    Blowfish in CBC mode  (mandatory)
1013 twofish-cbc     Twofish in CBC mode   (optional)
1014 rc6-cbc         RC6 in CBC mode       (optional)
1015 rc5-cbc         RC5 in CBC mode       (optional)
1016 mars-cbc        Mars in CBC mode      (optional)
1017 none            No encryption         (optional)
1018 .in 3
1019
1020
1021 All algorithms must use minimum of 128 bit key, by default.  Several
1022 algorithms, however, supports longer keys and it is recommended to use
1023 longer keys if they are available.
1024
1025 Algorithm none does not perform any encryption process at all and 
1026 thus is not recommended to be used.  It is recommended that no client
1027 or server implementation would accept none algorithms except in special
1028 debugging mode.
1029
1030 Additional ciphers may be defined to be used in SILC by using the
1031 same name format as above.
1032
1033
1034 .ti 0
1035 3.10.2 Public Key Algorithms
1036
1037 Public keys are used in SILC to authenticate entities in SILC network
1038 and to perform other tasks related to public key cryptography.  The 
1039 public keys are also used in the SILC Key Exchange protocol [SILC3].
1040
1041 Following public key algorithms are defined in SILC protocol:
1042
1043 .in 6
1044 rsa        RSA  (mandatory)
1045 dss        DSS  (optional)
1046 .in 3
1047
1048 Both of the algorithms are described in [Scheneir] and [Menezes].
1049
1050 Additional public key algorithms may be defined to be used in SILC.
1051
1052
1053 .ti 0
1054 3.10.3 MAC Algorithms
1055
1056 Data integrity is protected by computing a message authentication code
1057 (MAC) of the packet data.  See [SILC2] for details how to compute the
1058 MAC.
1059
1060
1061
1062
1063
1064 Following MAC algorithms are defined in SILC protocol:
1065
1066 .in 6
1067 hmac-sha1        HMAC-SHA1, length = 20  (mandatory)
1068 hmac-md5         HMAC-MD5, length = 16   (optional)
1069 none             No MAC                  (optional)
1070 .in 3
1071
1072 The none MAC is not recommended to be used as the packet is not
1073 authenticated when MAC is not computed.  It is recommended that no
1074 client or server would accept none MAC except in special debugging
1075 mode.
1076
1077 The HMAC algorithm is described in [HMAC] and hash algorithms that
1078 are used as part of the HMACs are described in [Scheneir] and in
1079 [Menezes]
1080
1081 Additional MAC algorithms may be defined to be used in SILC.
1082
1083
1084 .ti 0
1085 3.10.4 Compression Algorithms
1086
1087 SILC protocol supports compression that may be applied to unencrypted
1088 data.  It is recommended to use compression on slow links as it may
1089 significantly speed up the data transmission.  By default, SILC does not
1090 use compression which is the mode that must be supported by all SILC
1091 implementations.
1092
1093 Following compression algorithms are defined:
1094
1095 .in 6
1096 none        No compression               (mandatory)
1097 zlib        GBU ZLIB (LZ77) compression  (optional)
1098 .in 3
1099
1100 Additional compression algorithms may be defined to be used in SILC.
1101
1102
1103 .ti 0
1104 3.11 SILC Public Key
1105
1106 This section defines the type and format of the SILC public key.  All
1107 implementations must support this public key type.  See [SILC3] for
1108 other optional public key and certificate types allowed in SILC
1109 protocol.  Public keys in SILC may be used to authenticate entities
1110 and to perform other tasks related to public key cryptography.
1111
1112 The format of the SILC Public Key is as follows:
1113
1114
1115
1116
1117
1118
1119
1120 .in 5
1121 .nf
1122                      1                   2                   3
1123  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1124 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1125 |                        Public Key Length                      |
1126 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1127 |     Algorithm Name Length     |                               |
1128 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1129 |                                                               |
1130 ~                         Algorithm Name                        ~
1131 |                                                               |
1132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1133 |       Identifier Length       |                               |
1134 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1135 |                                                               |
1136 ~                           Identifier                          ~
1137 |                                                               |
1138 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1139 |                                                               |
1140 ~                           Public Data                         ~
1141 |                                                               |
1142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1143 .in 3
1144
1145 .ce
1146 Figure 4:  SILC Public Key
1147
1148
1149 .in 6
1150 o Public Key Length (4 bytes) - Indicates the full length
1151   of the public key, not including this field.
1152
1153 o Algorithm Name Length (2 bytes) - Indicates the length
1154   of the Algorithm Length field, not including this field.
1155
1156 o Algorithm name (variable length) - Indicates the name
1157   of the public key algorithm that the key is.  See the
1158   section 3.10.2 Public Key Algorithms for defined names.
1159
1160 o Identifier Length (2 bytes) - Indicates the length of
1161   the Identifier field, not including this field.
1162
1163 o Identifier (variable length) - Indicates the identifier
1164   of the public key.  This data can be used to identify
1165   the owner of the key.  The identifier is of following
1166   format:
1167
1168      UN   User name
1169      HN   Host name or IP address
1170      RN   Real name
1171      E    EMail address
1172      O    Organization
1173      C    Country
1174
1175
1176   Examples of an identifier:
1177
1178     `UN=priikone, HN=poseidon.pspt.fi, E=priikone@poseidon.pspt.fi'
1179
1180     `UN=sam, HN=dummy.fi, RN=Sammy Sam, O=Company XYZ, C=Finland'
1181
1182   At least user name (UN) and host name (HN) must be provided as
1183   identifier.  The fields are separated by commas (`,').  If
1184   comma is in the identifier string it must be written as `\\,',
1185   for example, `O=Company XYZ\\, Inc.'.
1186
1187 o Public Data (variable length) - Includes the actual
1188   public data of the public key.
1189
1190   The format of this field for RSA algorithm is
1191   as follows:
1192
1193      4 bytes            Length of e
1194      variable length    e
1195      4 bytes            Length of n
1196      variable length    n
1197
1198
1199   The format of this field for DSS algorithm is
1200   as follows:
1201
1202      4 bytes            Length of p
1203      variable length    p
1204      4 bytes            Length of q
1205      variable length    q
1206      4 bytes            Length of g
1207      variable length    g
1208      4 bytes            Length of y
1209      variable length    y
1210
1211   The variable length fields are multiple precession
1212   integers encoded as strings in both examples.
1213
1214   Other algorithms must define their own type of this
1215   field if they are used.
1216 .in 3
1217
1218 All fields in the public key are in MSB (most significant byte first)
1219 order.
1220
1221
1222 .ti 0
1223 4 SILC Procedures
1224
1225 This section describes various SILC procedures such as how the 
1226 connections are created and registered, how channels are created and
1227 so on.  The section describes the procedures only generally as details
1228 are described in [SILC2] and [SILC3].
1229
1230
1231 .ti 0
1232 4.1 Creating Client Connection
1233
1234 This section descibres the procedure when client connects to SILC server.
1235 When client connects to server the server must perform IP address lookup
1236 and reverse IP address lookup to assure that the origin host really is
1237 who it claims to be.  Client, host, connecting to server must have 
1238 both valid IP address and fully qualified domain name (FQDN).
1239
1240 After that client and server performs SILC Key Exchange protocol which
1241 will provide the key material used later in the communication.  The
1242 key exchange protocol must be completed successfully before the connection
1243 registration may continue.  The SILC Key Exchange protocol is described
1244 in [SILC3].
1245
1246 Typical server implementation would keep a list of connections that it
1247 allows to connect to the server.  The implementation would check, for
1248 example, the connecting client's IP address from the connection list
1249 before the SILC Key Exchange protocol has been started.  Reason for
1250 this is that if the host is not allowed to connect to the server there
1251 is no reason to perform a key exchange protocol.
1252
1253 After successful key exchange protocol the client and server performs
1254 connection authentication protocol.  The purpose of the protocol is to
1255 authenticate the client connecting to the server.  Flexible
1256 implementation could also accept the client to connect to the server
1257 without explicit authentication.  However, if authentication is
1258 desired for a specific client it may be based on passphrase or
1259 public key authentication.  If authentication fails the connection
1260 must be terminated.  The connection authentication protocol is described
1261 in [SILC3].
1262
1263 After successful key exchange and authentication protocol the client
1264 registers itself by sending SILC_PACKET_NEW_CLIENT packet to the
1265 server.  This packet includes various information about the client
1266 that the server uses to create the client.  Server creates the client
1267 and sends SILC_PACKET_NEW_ID to the client which includes the created
1268 Client ID that the client must start using after that.  After that
1269 all SILC packets from the client must have the Client ID as the
1270 Source ID in the SILC Packet Header, described in [SILC2].
1271
1272 Client must also get the server's Server ID that is to be used as
1273 Destination ID in the SILC Packet Header when communicating with
1274 the server (for example when sending commands to the server).  The
1275 ID may be resolved in two ways.  Client can take the ID from an
1276 previously received packet from server that must include the ID,
1277 or to send SILC_COMMAND_INFO command and receive the Server ID as
1278 command reply.
1279
1280 Server may choose not to use the information received in the
1281 SILC_PACKET_NEW_CLIENT packet.  For example, if public key or 
1282 certificate were used in the authentication, server may use those
1283 informations rather than what it received from client.  This is suitable
1284 way to get the true information about client if it is available.
1285
1286 The nickname of client is initially set to the username sent in the
1287 SILC_PACKET_NEW_CLIENT packet.  User should set the nickname to more
1288 suitable by sending SILC_COMMAND_NICK command.  However, this is not
1289 required as part of registration process.
1290
1291 Server must also distribute the information about newly registered
1292 client to its router (or if the server is router, to all routers in
1293 the SILC network).  More information about this in [SILC2].
1294
1295
1296 .ti 0
1297 4.2 Creating Server Connection
1298
1299 This section descibres the procedure when server connects to its
1300 router (or when router connects to other router, the cases are
1301 equivalent).  The procedure is very much alike when client connects
1302 to the server thus it is not repeated here.
1303
1304 One difference is that server must perform connection authentication
1305 protocol with proper authentication.  Proper authentication is based
1306 on passphrase or public key authentication.
1307
1308 After server and router has successfully performed the key exchange
1309 and connection authentication protocol, the server register itself
1310 to the router by sending SILC_PACKET_NEW_SERVER packet.  This packet
1311 includes the server's Server ID that it has created by itself and
1312 other relevant information about the server.
1313
1314 After router has received the SILC_PACKET_NEW_SERVER packet it
1315 distributes the information about newly registered server to all routers
1316 in the SILC network.  More information about this in [SILC2].
1317
1318 As client needed to resolve the destination ID this must be done by the
1319 server that connected to the router, as well.  The way to resolve it is
1320 to get the ID from previously received packet.  Server must also start
1321 using its own Server ID as Source ID in SILC Packet Header and the
1322 router's Server ID as Destination when communicating with the router.
1323
1324 If the server has already connected clients and locally created
1325 channels the server must distribute these informations to the router.
1326 The distribution is done by sending packet SILC_PACKET_NEW_CHANNEL.
1327 See [SILC2] for more information on this.
1328
1329
1330 .ti 0
1331 4.3 Joining to a Channel
1332
1333 This section describes the procedure when client joins to a channel.
1334 Client may join to channel by sending command SILC_COMMAND_JOIN to the
1335 server.  If the receiver receiving join command is normal server the
1336 server must check its local list whether this channel already exists
1337 locally.  This would indicate that some client connected to the server
1338 has already joined to the channel.  If this is case the client is
1339 joined to the client, new channel key is created and information about
1340 newly joined channel is sent to the router.  The new channel key is
1341 also distributed to the router and to all clients on the channel.
1342
1343 If the channel does not exist in the local list the command must be
1344 fowarded to the router which will then perform the actual joining
1345 procedure.  When server receives the reply to the command from the
1346 router it must be distributed to the client who sent the command
1347 originally.  Server will also receive the channel key from the server
1348 that it must distribute to the client who originally requested the
1349 join command.  The server must also save the channel key.
1350
1351 If the receiver of the join command is router it must first check its
1352 local list whether anyone in the cell has already joined to the channel.
1353 If this is the case the client is joined to the channel and reply is
1354 sent to the client.  If the command was sent by server the command reply
1355 is sent to the server who sent it.  Then the router must also create
1356 new channel key and distribute it to all clients on the channel and
1357 all servers that has clients on the channel.
1358
1359 If the channel does not exist on the router's local list it must
1360 check the global list whether the channel exists at all.  If it does
1361 the client is joined to the channel as described previously.  If
1362 the channel does not exist the channel is created and the client
1363 is joined to the channel.  The channel key is also created and
1364 distributed as previously described.  The client joining to the created
1365 channel is made automatically channel founder and both channel founder
1366 and channel operator privileges is set for the client.
1367
1368 When the router joins the client to the channel it must send 
1369 information about newly joined client to all routers in the SILC 
1370 network.  Also, if the channel was created in the process, information
1371 about newly created channel must also be distributed to all routers.
1372 The distribution of newly created channel is done by sending packet
1373 SILC_PACKET_NEW_CHANNEL.
1374
1375 It is important to note that new channel key is created always when
1376 new client joins to channel, whether the channel has existed previously
1377 or not.  This way the new client on the channel is not able to decrypt
1378 any of the old traffic on the channel.
1379
1380 Client who receives the reply to the join command must start using
1381 the received Channel ID in the channel message communication thereafter.
1382 However, client must not start communicating on the channel before
1383 it has received the packet SILC_PACKET_CHANNEL_KEY.
1384
1385 If client wants to know the other clients currently on the channel
1386 the client must send SILC_COMMAND_NAMES command to receive a list of
1387 channel users.  Server implementation, however, may send command reply
1388 packet to SILC_COMMAND_NAMES command after client has joined to the
1389 channel even if the client has not sent the command.
1390
1391
1392 .ti 0
1393 4.4 Channel Key Generation
1394
1395 Channel keys are created by router who creates the channel by taking
1396 enough randomness from cryptographically strong random number generator.
1397 The key is generated always when channel is created, when new client
1398 joins a channel and after the key has expired.  Key could expire for
1399 example in an hour.
1400
1401 The key must also be re-generated whenever some client leaves a channel.
1402 In this case the key is created from scratch by taking enough randomness
1403 from the random number generator.  After that the key is distributed to
1404 all clients on the channel.  However, channel keys are cell specific thus
1405 the key is created only on the cell where the client, who leaved the
1406 channel, exists.  While the server or router is creating the new channel
1407 key, no other client may join to the channel.  Messages that are sent
1408 while creating the new key are still processed with the old key.  After
1409 server has sent the SILC_PACKET_CHANNEL_KEY packet must client start
1410 using the new key.  If server creates the new key the server must also
1411 send the new key to its router.  See [SILC2] on more information about
1412 how channel messages must be encrypted and decrypted when router is
1413 processing them.
1414
1415
1416 .ti 0
1417 4.5 Private Message Sending and Reception
1418
1419 Private messages are sent point to point.  Client explicitly destines
1420 a private message to specific client that is delivered to only to that
1421 client.  No other client may receive the private message.  The receiver
1422 of the private message is destined in the SILC Packet Header as any
1423 other packet as well.
1424
1425 If the sender of a private message does not know the receiver's Client
1426 ID, it must resolve it from server.  There are two ways to resolve the
1427 client ID from server; it is recommended that client ipmlementations
1428 send SILC_COMMAND_IDENTIFY command to receive the Client ID.  Client
1429 may also send SILC_COMMAND_WHOIS command to receive the Client ID.
1430 If the sender has received earlier a private message from the receiver
1431 it should have cached the Client ID from the SILC Packet Header.
1432
1433 Receiver of a private message should not explicitly trust the nickname
1434 that it receives in the Private Message Payload, described in [SILC2].
1435 Implementations could resolve the nickname from server, as described
1436 previously, and compare the received Client ID and the SILC Packet
1437 Header's Client ID.  The nickname in the payload is merely provided
1438 to be displayed for end user.
1439
1440 See [SILC2] for describtion of private message encryption and decryption
1441 process.
1442
1443
1444 .ti 0
1445 4.6 Private Message Key Generation
1446
1447 Private message may be protected by key generated by client.  The key
1448 may be generated and sent to the other client by sending packet
1449 SILC_PACKET_PRIVATE_MESSAGE_KEY which travels through the network
1450 and is secured by session keys.  After that the private message key
1451 is used in the private message communication between those clients.
1452 See more information about how this works technically in [SILC2].
1453
1454 Other choice is to entirely use keys that are not sent through
1455 the SILC network at all.  This significantly adds security.  This key
1456 would be pre-shared-key that is known by both of the clients.  Both
1457 agree about using the key and starts sending packets that indicate
1458 that the private message is secured using private message key.  This
1459 is the technical aspect mentioned previously that is described
1460 in [SILC2].
1461
1462 If the private message keys are not set to be used, which is the
1463 case by default in SILC, the private messages are secured by using
1464 normal session keys established by SILC Key Exchange protocol.
1465
1466
1467
1468
1469 .ti 0
1470 4.7 Channel Message Sending and Reception
1471
1472 Channel messages are delivered to group of users.  The group forms a
1473 channel and all clients on the channel receives messages sent to the
1474 channel.
1475
1476 Channel messages are destined to channel by specifying the Channel ID
1477 as Destination ID in the SILC Packet Header.  The server must then
1478 distribute the message to all clients on the channel by sending the
1479 channel message destined explicitly to a client on the channel.
1480
1481 See [SILC2] for describtion of channel message encryption and decryption
1482 process.
1483
1484
1485 .ti 0
1486 4.8 Session Key Regeneration
1487
1488 Session keys should be regenerated peridiocally, say, once in an hour.
1489 The re-key process is started by sending SILC_PACKET_REKEY packet to
1490 other end, to indicate that re-key must be performed.
1491
1492 If perfect forward secrecy (PFS) flag was selected in the SILC Key
1493 Exchange protocol [SILC3] the re-key must cause new key exchange with
1494 SKE protocol.  In this case the protocol is secured with the old key
1495 and the protocol results to new key material.  See [SILC3] for more
1496 information.  After the SILC_PACKET_REKEY packet is sent the sender
1497 will perform the SKE protocol.
1498
1499 If PFS flag was not set, which is the default case, then re-key is done
1500 without executing SKE protocol.  In this case, the new key is created by
1501 hashing the old key with hash function selected earlier in the SKE
1502 protocol.  If the digest length of the hash function is too short for the
1503 key, then the key is distributed as described in section Processing the
1504 Key Material in [SILC3].  After both parties has regenerated the session
1505 key, both send SILC_PACKET_REKEY_DONE packet to each other.  These packets
1506 are still secured with the old key.  After these packets, following
1507 packets must be protected with the new key.
1508
1509
1510 .ti 0
1511 4.9 Command Sending and Reception
1512
1513 Client usually sends the commands in the SILC network.  In this case
1514 the client simply sends the command packet to server and the server
1515 processes it and replies with command reply packet.
1516
1517 However, if the server is not able to process the command, it is usually
1518 sent to the server's router.  This is case for example with commands such
1519 as, SILC_COMMAND_JOIN and SILC_COMMAND_WHOIS commands.  However, there
1520 are other commands as well.  For example, if client sends the WHOIS
1521 command requesting specific information about some client the server must
1522 send the WHOIS command to router so that all clients in SILC network
1523 are searched.  The router, on the other hand, sends the WHOIS command
1524 to further to receive the exact information about the requested client.
1525 The WHOIS command travels all the way to the server who owns the client
1526 and it replies with command reply packet.  Finally, the server who
1527 sent the command receives the command reply and it must be able to
1528 determine which client sent the original command.  The server then
1529 sends command reply to the client.  Implementations should have some
1530 kind of cache to handle, for example, WHOIS information.  Servers
1531 and routers along the route could all cache the information for faster
1532 referencing in the future.
1533
1534 The commands sent by server may be sent hop by hop until someone is able
1535 to process the command.  However, it is preferred to destine the command
1536 as precisely as it is possible.  In this case, other routers en route
1537 must route the command packet by checking the true sender and true
1538 destination of the packet.  However, servers and routers must not route
1539 command reply packets to clients coming from other server.  Client
1540 must not accept command reply packet originated from anyone else but
1541 from its own server.
1542
1543
1544 .ti 0
1545 5 SILC Commands
1546
1547 .ti 0
1548 5.1 SILC Commands Syntax
1549
1550 This section briefly describes the syntax of the command notions
1551 in this document.  Every field in command is separated from each
1552 other by whitespaces (` ') indicating that each field is independent
1553 argument and each argument must have own Command Argument Payload.
1554 The number of maximum arguments are defined with each command
1555 separately.  The Command Argument Payload is described in [SILC2].
1556
1557 Every command defines specific number for each argument.  Currently,
1558 they are defined in ascending order; first argument has number one 
1559 (1), second has number two (2) and so on.  This number is set into the
1560 Argument Type field in the Command Argument Payload.  This makes it
1561 possible to send the arguments in free order as the number must be
1562 used to identify the type of the argument.  This makes is it also
1563 possible to have multiple optional arguments in commands and in
1564 command replies.  The number of argument is marked in parentheses
1565 before the actual argument.
1566
1567
1568
1569
1570
1571 .in 6
1572 Example:  Arguments:  (1) <nickname> (2) <username@host>
1573 .in 3
1574    
1575
1576 Every command replies with Status Payload.  This payload tells the
1577 sender of the command whether the command was completed succefully or
1578 whether there was an error.  If error occured the payload includes the
1579 error type.  In the next section the Status Payload is not described 
1580 as it is common to all commands and has been described here.  Commands 
1581 may reply with other arguments as well.  These arguments are command 
1582 specific and are described in the next section.
1583
1584 Example command:
1585 .in 6
1586
1587 EXAMPLE_COMMAND
1588
1589 .in 8
1590 Max Arguments:  3
1591     Arguments:  (1) <nickname>[@<server>]  (2) <message>
1592                 (3) [<count>]
1593
1594 The command has maximum of 3 arguments.  However, only first
1595 and second arguments are mandatory.
1596
1597 First argument <nickname> is mandatory but may have optional
1598 <nickname@server> format as well.  Second argument is mandatory
1599 <message> argument.  Third argument is optional <count> argument.
1600
1601 The numbers in parentheses are the argument specific numbers
1602 that specify the type of the argument in Command Argument Payload.
1603 The receiver always knows that, say, argument number two (2) is
1604 <message> argument, regardles of the ordering of the arguments in
1605 the Command Payload.
1606
1607 Reply messages to the command:
1608
1609 Max Arguments:  4
1610     Arguments:  (1) <Status Payload>  (2) [<channel list>]
1611                 (3) <idle time>       (4) [<away message>]
1612
1613 This command may reply with maximum of 4 arguments.  However,
1614 only the first and third arguments are mandatory.  The numbers
1615 in the parentheses have the same meaning as in the upper
1616 command sending specification.
1617
1618 Every command reply with <Status Payload>, it is mandatory 
1619 argument for all command replies and for this reason it is not
1620 described in the command reply descriptions.
1621
1622
1623
1624 Status messages:
1625
1626     SILC_STATUS_OK
1627     SILC_STATUS_ERR_TOO_MANY_TARGETS
1628     SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1629     SILC_STATUS_ERR_NO_SUCH_NICK
1630
1631 Every command reply also defines set of status message that it
1632 may return inside the <Status Payload>.  All status messages
1633 are defined in the section 5.3 SILC Command Status Types.
1634 .in 3
1635
1636
1637 .ti 0
1638 5.2 SILC Commands List
1639
1640 This section lists all SILC commands, however, it is expected that a
1641 implementation and especially client implementation has many more
1642 commands that has only local affect.  These commands are official
1643 SILC commands that has both client and server sides and cannot be
1644 characterized as local commands.
1645
1646 List of all defined commands in SILC follows.
1647
1648 .in 0
1649    0    SILC_COMMAND_NONE
1650
1651         None.  This is reserved command and must not be sent.
1652
1653
1654    2    SILC_COMMAND_WHOIS
1655
1656         Max Arguments:  2
1657             Arguments:  (1) <nickname>[@<server>]  (2) [<count>]
1658
1659         Whois.  Whois command is used to query various information about
1660         specific user.  The user maybe requested by their nickname and
1661         server name.  The query may find multiple matching users as
1662         there are no unique nicknames in the SILC.  The <count> option
1663         maybe given to narrow down the number of accepted results.  If
1664         this is not defined there are no limit of accepted results.
1665         The query may also be narrowed down by defining the server name
1666         of the nickname.
1667
1668         To prevent miss-use of this service wildcards in the nickname
1669         or in the servername are not permitted.  It is not allowed
1670         to request all users on some server.  The WHOIS requests must 
1671         be based on specific nickname request.
1672
1673         The WHOIS request must be always forwarded to router by server
1674         so that all users are searched.  However, the server still must
1675         search its locally connected clients.  The server must send
1676         this command to the server who owns the requested client.  That
1677         server must reply to the command.
1678
1679         Reply messages to the command:
1680
1681         Max Arguments:  7
1682             Arguments:  (1) <Status Payload>       (2) <Client ID> 
1683                         (3) <nickname>[@<server>]  (4) <username@host> 
1684                         (5) <real name>            (6) [<channel list>] 
1685                         (7) [<idle time>]
1686
1687         This command may reply with several command reply messages to
1688         form a list of results.  In this case the status payload will
1689         include STATUS_LIST_START status in the first reply and
1690         STATUS_LIST_END in the last reply to indicate the end of the
1691         list.  If there are only one reply the status is set to normal
1692         STATUS_OK.
1693
1694         The command replies include the Client ID of the nickname,
1695         nickname and servername, username and hostnamea and users real
1696         name.  Client should process these replies only after the last
1697         reply has been received with the STATUS_LIST_END status.  If the
1698         <count> option were defined in the query there will be only
1699         <count> many replies from the server.
1700
1701         Status messages:
1702
1703             SILC_STATUS_OK
1704             SILC_STATUS_LIST_START
1705             SILC_STATUS_LIST_END
1706             SILC_STATUS_ERR_NO_SUCH_NICK
1707             SILC_STATUS_ERR_WILDCARDS
1708             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1709             SILC_STATUS_ERR_TOO_MANY_PARAMS
1710
1711
1712    3    SILC_COMMAND_WHOWAS
1713
1714         Max Arguments:  2
1715             Arguments:  (1) <nickname>[@<server>]  (2) [<count>]
1716
1717         Whowas.  This command is used to query history information about
1718         specific user.  The user maybe requested by their nickname and 
1719         server name.  The query may find multiple matching users as there
1720         are no unique nicknames in the SILC.  The <count> option maybe
1721         given to narrow down the number of accepted results.  If this
1722         is not defined there are no limit of accepted results.  The query
1723         may also be narrowed down by defining the server name of the 
1724         nickname.
1725
1726         To prevent miss-use of this service wildcards in the nickname
1727         or in the servername are not permitted.  The WHOWAS requests must 
1728         be based on specific nickname request.
1729
1730         The WHOWAS request must be always forwarded to router by server
1731         so that all users are searched.  However, the server still must
1732         search its locally connected clients.
1733
1734         Reply messages to the command:
1735
1736         Max Arguments:  3
1737             Arguments:  (1) <Status Payload>  (2) <nickname>[@<server>]
1738                         (3) <username@host>
1739
1740         This command may reply with several command reply messages to form
1741         a list of results.  In this case the status payload will include
1742         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
1743         the last reply to indicate the end of the list.  If there are only 
1744         one reply the status is set to normal STATUS_OK.
1745
1746         The command replies with nickname and username and hostname.
1747         Every server must keep history for some period of time of its
1748         locally connected clients.
1749
1750         Status messages:
1751
1752             SILC_STATUS_OK
1753             SILC_STATUS_LIST_START
1754             SILC_STATUS_LIST_END
1755             SILC_STATUS_ERR_NO_SUCH_NICK
1756             SILC_STATUS_ERR_WILDCARDS
1757             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1758             SILC_STATUS_ERR_TOO_MANY_PARAMS
1759
1760
1761    4    SILC_COMMAND_IDENTIFY
1762
1763         Max Arguments:  2
1764             Arguments:  (1) <nickname>[@<server>]  (2) [<count>]
1765
1766         Identify.  Identify command is almost analogous to WHOIS command,
1767         except that it does not return as much information.  Only relevant
1768         information such as Client ID is returned.  This is usually used
1769         to get the Client ID of a client used in the communication with
1770         the client.
1771
1772         The query may find multiple matching users as there are no unique 
1773         nicknames in the SILC.  The <count> option maybe given to narrow 
1774         down the number of accepted results.  If this is not defined there 
1775         are no limit of accepted results.  The query may also be narrowed 
1776         down by defining the server name of the nickname.
1777
1778         To prevent miss-use of this service wildcards in the nickname
1779         or in the servername are not permitted.  It is not allowed
1780         to request all users on some server.  The IDENTIFY requests must 
1781         be based on specific nickname request.
1782
1783         Implementations may not want to give interface access to this
1784         commands as it is hardly a command that would be used a end user.
1785         However, it must be implemented as it is used with private message
1786         sending.
1787
1788         The IDENTIFY must be always forwarded to router by server so that
1789         all users are searched.  However, server must still search its
1790         locally connected clients.
1791
1792         Reply messages to the command:
1793
1794         Max Arguments:  4
1795             Arguments:  (1) <Status Payload>         (2) <Client ID>
1796                         (3) [<nickname>[@<server>]]  (4) [<username@host>]
1797
1798         This command may reply with several command reply messages to form
1799         a list of results.  In this case the status payload will include
1800         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
1801         the last reply to indicate the end of the list.  If there are only 
1802         one reply the status is set to normal STATUS_OK.
1803
1804         The command replies with Client ID of the nickname and if more
1805         information is available it may reply with nickname and username
1806         and hostname.  If the <count> option were defined in the query
1807         there will be only <count> many replies from the server.
1808
1809         Status messages:
1810
1811             SILC_STATUS_OK
1812             SILC_STATUS_LIST_START
1813             SILC_STATUS_LIST_END
1814             SILC_STATUS_ERR_NO_SUCH_NICK
1815             SILC_STATUS_ERR_WILDCARDS
1816             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1817             SILC_STATUS_ERR_TOO_MANY_PARAMS
1818
1819
1820    5    SILC_COMMAND_NICK
1821
1822         Max Arguments:  1
1823             Arguments:  (1) <nickname>
1824
1825         Set/change nickname.  This command is used to set nickname for
1826         user.  There is no limit of the length of the nickname in SILC.
1827         Nickname must not include any spaces (` '), non-printable
1828         characters, commas (`,') and any wildcard characters.  Note:
1829         nicknames in SILC are case-sensitive which must be taken into
1830         account when searching clients by nickname.
1831
1832         Reply messages to the command:
1833
1834         Max Arguments:  2
1835             Arguments:  (1) <Status Payload>  (2) <New ID Payload>
1836
1837         This command is replied always with New ID Payload that is
1838         generated by the server every time user changes their nickname.
1839         Client receiving this payload must start using the received
1840         Client ID as its current valid Client ID.  The New ID Payload
1841         is described in [SILC2].
1842
1843         Status messages:
1844
1845             SILC_STATUS_OK
1846             SILC_STATUS_ERR_WILDCARDS
1847             SILC_STATUS_ERR_NICKNAME_IN_USE
1848             SILC_STATUS_ERR_BAD_NICKNAME
1849             SILC_STATUS_ERR_NOT_REGISTERED
1850             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1851             SILC_STATUS_ERR_TOO_MANY_PARAMS
1852
1853
1854    6    SILC_COMMAND_LIST
1855
1856         Max Arguments:  2
1857             Arguments:  (1) [<Channel ID>] [<server>]
1858
1859         The list command is used to list channels and their topics on
1860         current server.  If the <Channel ID> parameter is used, only the
1861         status of that channel is displayed.  Secret channels are not
1862         listed at all.  Private channels are listed with status indicating
1863         that the channel is private.
1864
1865         If the <server> argument is specified the specified server's
1866         channels are listed.  In this case the command must be sent to
1867         the server who owns the channel that was requested.
1868
1869         Reply messages to the command:
1870
1871         Max Arguments:  4
1872             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1873                         (3) <channel>         (4) <topic>
1874
1875         This command may reply with several command reply messages to form
1876         a list of results.  In this case the status payload will include
1877         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
1878         the last reply to indicate the end of the list.  If there are only 
1879         one reply the status is set to normal STATUS_OK.
1880
1881         This command replies with Channel ID, name and the topic of the
1882         channel.  If the channel is private channel the <topic> includes
1883         "*private*" string.
1884
1885         Status messages:
1886
1887             SILC_STATUS_OK
1888             SILC_STATUS_LIST_START
1889             SILC_STATUS_LIST_END
1890             SILC_STATUS_ERR_WILDCARDS
1891             SILC_STATUS_ERR_NOT_REGISTERED
1892             SILC_STATUS_ERR_TOO_MANY_PARAMS
1893             SILC_STATUS_ERR_NO_SUCH_CHANNEL
1894             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1895             SILC_STATUS_ERR_NO_SUCH_SERVER
1896
1897
1898    7    SILC_COMMAND_TOPIC
1899
1900         Max Arguments:  2
1901             Arguments:  (1) <Channel ID>  (2) [<server>]]
1902
1903         This command is used to change or view the topic of a channel.
1904         The topic for channel <Channel ID> is returned if there is no
1905         <topic> given.  If the <topic> parameter is present, the topic
1906         for that channel will be changed, if the channel modes permit
1907         this action.
1908
1909         Reply messages to the command:
1910
1911         Max Arguments:  2
1912             Arguments:  (1) <Status Payload>  (2) [<topic>]
1913
1914         The command may reply with the topic of the channel if it is
1915         set.
1916
1917         Status messages:
1918
1919             SILC_STATUS_OK
1920             SILC_STATUS_ERR_NOT_ON_CHANNEL
1921             SILC_STATUS_ERR_WILDCARDS
1922             SILC_STATUS_ERR_NOT_REGISTERED
1923             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1924             SILC_STATUS_ERR_NO_SUCH_CHANNEL
1925             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1926             SILC_STATUS_ERR_NO_CHANNEL_ID
1927             SILC_STATUS_ERR_BAD_CHANNEL_ID
1928             SILC_STATUS_ERR_TOO_MANY_PARAMS
1929             SILC_STATUS_ERR_NO_CHANNEL_PRIV
1930
1931
1932    8    SILC_COMMAND_INVITE
1933
1934         Max Arguments:  2
1935             Arguments:  (1) <Client ID>  (2) <Channel ID>
1936
1937         This command is used to invite other clients to join to the
1938         channel.  The <Client ID> argument is the target client's ID that
1939         is being invited.  The <Channel ID> is the Channel ID of the
1940         requested channel.  The sender of this command must be on the
1941         channel.  This command must fail if the requested channel does
1942         not exist, the requested client is already on the channel or if
1943         the channel is invite only channel and the caller of this command
1944         does not have at least channel operator privileges.
1945
1946         Reply messages to the command:
1947
1948         Max Arguments:  2
1949             Arguments:  (1) <Status Payload>
1950
1951         This command replies only with Status Payload.
1952
1953         Status messages:
1954
1955             SILC_STATUS_OK
1956             SILC_STATUS_ERR_NOT_REGISTERED
1957             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1958             SILC_STATUS_ERR_TOO_MANY_PARAMS
1959             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
1960             SILC_STATUS_ERR_NO_CLIENT_ID
1961             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1962             SILC_STATUS_ERR_NO_CHANNEL_ID
1963             SILC_STATUS_ERR_NOT_ON_CHANNEL
1964             SILC_STATUS_ERR_USER_ON_CHANNEL
1965
1966
1967    9    SILC_COMMAND_QUIT
1968
1969         Max Arguments:  1
1970             Arguments:  (1) [<quit message>]
1971
1972         This command is used by client to end SILC session.  The server
1973         must close the connection to a client which sends this command.
1974         if <quit message> is given it will be sent to other clients on
1975         channel if the client is on channel when quitting.
1976
1977         Reply messages to the command:
1978
1979         This command does not reply anything.
1980
1981
1982    10   SILC_COMMAND_KILL
1983
1984         Max Arguments:  2
1985             Arguments:  (1) <Client ID>  (2) [<comment>]
1986
1987         This command is used by SILC operators to remove a client from
1988         SILC network.  The removing has temporary effects and client may
1989         reconnect to SILC network.  The <Client ID> is the client to be
1990         removed from SILC.  The <comment> argument may be provided to 
1991         give to the removed client some information why it was removed
1992         from the network.
1993
1994         Reply messages to the command:
1995
1996         Max Arguments:  1
1997             Arguments:  (1) <Status Payload>
1998
1999         This command replies only with Status Payload.
2000
2001         Status messages:
2002
2003             SILC_STATUS_OK
2004             SILC_STATUS_ERR_WILDCARDS
2005             SILC_STATUS_ERR_NOT_REGISTERED
2006             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2007             SILC_STATUS_ERR_TOO_MANY_PARAMS
2008             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2009             SILC_STATUS_ERR_NO_CLIENT_ID
2010
2011
2012
2013
2014
2015    11   SILC_COMMAND_INFO
2016
2017         Max Arguments:  1
2018             Arguments:  (1) [<server>]
2019
2020         This command is used to fetch various information about a server.
2021         If <server> argument is specified the command must be sent to
2022         the requested server.
2023
2024         Reply messages to the command:
2025
2026         Max Arguments:  3
2027             Arguments:  (1) <Status Payload>  (2) <Server ID>
2028                         (3) <string>
2029
2030         This command replies with the Server ID of the server and a
2031         string which tells the information about the server.
2032
2033         Status messages:
2034
2035             SILC_STATUS_OK
2036             SILC_STATUS_ERR_WILDCARDS
2037             SILC_STATUS_ERR_NOT_REGISTERED
2038             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2039             SILC_STATUS_ERR_TOO_MANY_PARAMS
2040             SILC_STATUS_ERR_NO_SUCH_SERVER
2041
2042
2043    12   SILC_COMMAND_CONNECT
2044
2045         Max Arguments:  2
2046             Arguments:  (1) <Server ID>  
2047                         (2) [<remote server/router>[:<port>]]
2048
2049         This command is used by operators to force a server to try to
2050         establish a new connection to another router (if the connecting
2051         server is normal server) or server (if the conneceting server is
2052         router server).  Operator may specify the server/router to be
2053         connected by setting <remote server> argument.
2054
2055         Reply messages to the command:
2056
2057         Max Arguments:  1
2058             Arguments:  (1) <Status Payload>
2059
2060         This command replies only with Status Payload.
2061
2062
2063
2064         Status messages:
2065
2066             SILC_STATUS_OK
2067             SILC_STATUS_ERR_WILDCARDS
2068             SILC_STATUS_ERR_NOT_REGISTERED
2069             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2070             SILC_STATUS_ERR_TOO_MANY_PARAMS
2071             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
2072             SILC_STATUS_ERR_NO_SERVER_PRIV
2073             SILC_STATUS_ERR_NO_ROUTER_PRIV
2074
2075
2076    13   SILC_COMMAND_PING
2077
2078         Max Arguments:  1
2079             Arguments:  (1) <Server ID>
2080
2081         This command is used by client and server to test the communication
2082         channel to its server if one suspects that the communication is not
2083         working correctly.  The <Server ID> is the ID of the server the
2084         sender is connected to.
2085
2086         Reply messages to the command:
2087
2088         Max Arguments:  1
2089             Arguments:  (1) <Status Payload>
2090
2091         This command replies only with Status Payload.  Server returns
2092         SILC_STATUS_OK in Status Payload if pinging was successful.
2093
2094         Status messages:
2095
2096             SILC_STATUS_OK
2097             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2098             SILC_STATUS_ERR_TOO_MANY_PARAMS
2099             SILC_STATUS_ERR_NO_SERVER_ID
2100             SILC_STATUS_ERR_NO_SUCH_SERVER
2101             SILC_STATUS_ERR_NOT_REGISTERED
2102
2103
2104    14   SILC_COMMAND_OPER
2105
2106         Max Arguments:  2
2107             Arguments:  (1) <username>  (2) <authentication data>
2108
2109         This command is used by normal client to obtain server operator
2110         privileges on some server or router.  Note that router operator
2111         has router privileges that supersedes the server operator
2112         privileges and this does not obtain those privileges.  Client
2113         must use SILCOPER command to obtain router level privileges.
2114
2115         The <username> is the username set in the server configurations
2116         as operator.  The <authentication data> is the data that the
2117         client is authenticated against.  It may be passphrase prompted
2118         for user on client's screen or it may be public key
2119         authentication data (data signed with private key), or 
2120         certificate.
2121
2122         Reply messages to the command:
2123
2124         Max Arguments:  1
2125             Arguments:  (1) <Status Payload>
2126
2127         This command replies only with Status Payload.
2128
2129         Status messages:
2130
2131             SILC_STATUS_OK
2132             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2133             SILC_STATUS_ERR_TOO_MANY_PARAMS
2134             SILC_STATUS_ERR_NOT_REGISTERED
2135             SILC_STATUS_ERR_BAD_PASSWORD
2136             SILC_STATUS_ERR_AUTH_FAILED
2137
2138
2139    15   SILC_COMMAND_JOIN
2140
2141         Max Arguments:  3
2142             Arguments:  (1) <channel>  (2) [<passphrase>] 
2143                         (3) [<cipher>]
2144
2145         Join to channel/create new channel.  This command is used to
2146         join to a channel.  If the channel does not exist the channel is
2147         created.  If server is normal server this command must be forwarded
2148         to router who will create the channel.  The channel may be protected
2149         with passphrase.  If this is the case the passphrase must be sent
2150         along the join command.
2151
2152         The name of the <channel> must not include any spaces (` '),
2153         non-printable characters, commas (`,') or any wildcard characters.
2154
2155         Cipher to be used to secure the traffic on the channel may be
2156         requested by sending the name of the requested <cipher>.  This
2157         is used only if the channel does not exist and is created.  If
2158         the channel already exists the cipher set previously for the
2159         channel will be used to secure the traffic.
2160
2161         The server must check whether the user is allowed to join to
2162         the requested channel.  Various modes set to the channel affect
2163         the ability of the user to join the channel.  These conditions
2164         are:
2165
2166             o  The user must be invited to the channel if the channel
2167                is invite-only channel.
2168
2169             o  The Client ID/nickname/username/hostname must not match
2170                any active bans.
2171
2172             o  The correct passphrase must be provided if passphrase 
2173                is set to the channel.
2174
2175             o  The user count limit, if set, must not be reached.
2176
2177         Reply messages to the command:
2178
2179         Max Arguments:  5
2180             Arguments:  (1) <Status Payload>  (2) <channel> 
2181                         (3) <Channel ID>      (4) <channel mode mask>
2182                         (5) [<topic>]
2183
2184         This command replies with the channel name requested by the
2185         client, channel ID of the channel and topic of the channel
2186         if it exists.  It also replies with the channel mode mask
2187         which tells all the modes set on the channel.  If the
2188         channel is created the mode mask is zero (0).
2189
2190         Client must not start transmitting to the channel even after
2191         server has replied to this command.  Client is permitted to 
2192         start transmitting on channel after server has sent packet 
2193         SILC_PACKET_CHANNEL_KEY to the client.
2194
2195         Status messages:
2196
2197             SILC_STATUS_OK
2198             SILC_STATUS_ERR_WILDCARDS
2199             SILC_STATUS_ERR_NOT_REGISTERED
2200             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2201             SILC_STATUS_ERR_TOO_MANY_PARAMS
2202             SILC_STATUS_ERR_BAD_PASSWORD
2203             SILC_STATUS_ERR_CHANNEL_IS_FULL
2204             SILC_STATUS_ERR_NOT_INVITED
2205             SILC_STATUS_ERR_BANNED_FROM_CHANNEL
2206             SILC_STATUS_ERR_BAD_CHANNEL
2207             SILC_STATUS_ERR_USER_ON_CHANNEL
2208
2209
2210    16   SILC_COMMAND_MOTD
2211
2212         Max Arguments:  1
2213             Arguments:  (1) <server>
2214
2215         This command is used to query the Message of the Day of a server.
2216
2217         Reply messages to the command:
2218
2219         Max Arguments:  2
2220             Arguments:  (1) <Status Payload>  (2) [<motd>]
2221
2222         This command replies with the motd message if it exists.
2223
2224         Status messages:
2225
2226             SILC_STATUS_OK
2227             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2228             SILC_STATUS_ERR_TOO_MANY_PARAMS
2229             SILC_STATUS_ERR_NOT_REGISTERED
2230             SILC_STATUS_ERR_NO_SUCH_SERVER
2231
2232
2233    17   SILC_COMMAND_UMODE
2234
2235         Max Arguments:  2
2236             Arguments:  (1) <Client ID>  (2) <client mode mask>
2237
2238         This command is used by client to set/unset modes for itself.
2239         However, there are some modes that the client may not set itself,
2240         but they will be set by server.  However, client may unset any
2241         mode.  Modes may be masked together ORing them thus having
2242         several modes set.  Client must keep its client mode mask
2243         locally so that the mode setting/unsetting would work without
2244         problems.  Client may change only its own modes.
2245
2246         Following client modes are defined:
2247
2248            0x0000    SILC_UMODE_NONE
2249
2250               No specific mode for client.  This is the initial
2251               setting when new client is created.  The client is
2252               normal client now.
2253
2254
2255            0x0001    SILC_UMODE_SERVER_OPERATOR
2256
2257               Marks the user as server operator.  Client cannot
2258               set this mode itself.  Server sets this mode to the
2259               client when client attains the server operator
2260               privileges by SILC_COMMAND_OPER command.  Client
2261               may unset the mode itself.
2262
2263
2264            0x0002    SILC_UMODE_ROUTER_OPERATOR
2265
2266               Marks the user as router (SILC) operator.  Client
2267               cannot this mode itself.  Router sets this mode to
2268               the client when client attains the router operator
2269               privileges by SILC_COMMAND_SILCOPER command.  Client
2270               may unset the mode itself.
2271
2272         Reply messages to the command:
2273
2274         Max Arguments:  2
2275             Arguments:  (1) <Status Payload>  (2) <client mode mask>
2276
2277         This command replies with the changed client mode mask that
2278         the client is required to keep locally.
2279
2280
2281         Status messages:
2282
2283             SILC_STATUS_OK
2284             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2285             SILC_STATUS_ERR_TOO_MANY_PARAMS
2286             SILC_STATUS_ERR_NOT_REGISTERED
2287             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2288             SILC_STATUS_ERR_BAD_CLIENT_ID
2289             SILC_STATUS_ERR_NOT_YOU
2290             SILC_STATUS_ERR_UNKNOWN_MODE
2291             SILC_STATUS_ERR_NO_RECIPIENT
2292             SILC_STATUS_ERR_NO_CLIENT_ID
2293
2294
2295    18   SILC_COMMAND_CMODE
2296
2297         Max Arguments:  8
2298             Arguments:  (1) <Channel ID>    (2) <channel mode mask>
2299                         (3) [<user limit>]  (4) [<passphrase>]
2300                         (5) [<ban mask>]    (6) [<invite list>]
2301                         (7) [<Client ID>]   (8) [<cipher>[:<key len>]]
2302
2303         This command is used by client to set or change channel flags on
2304         a channel.  Channel has several modes that set various properties
2305         of a channel.  Modes may be masked together by ORing them thus
2306         having several modes set.  The <Channel ID> is the ID of the
2307         target channel.  The client changing channel mode must be on
2308         the same channel and poses sufficient privileges to be able to
2309         change the mode.
2310
2311         Following channel modes are defined:
2312
2313            0x0000    SILC_CMODE_NONE
2314
2315               No specific mode on channel.  This is the default when
2316               channel is created.  This means that channel is just plain
2317               normal channel.
2318
2319
2320            0x0001    SILC_CMODE_PRIVATE
2321
2322               Channel is private channel.  Private channels are shown
2323               in the channel list listed with SILC_COMMAND_LIST command
2324               with indicatioin that the channel is private.  Also,
2325               client on private channel will no be detected to be on
2326               the channel as the channel is not shown in the client's
2327               currently joined channel list.  Channel founder and 
2328               channel operator may set/unset this mode.
2329
2330               Typical implementation would use [+|-]p on user interface
2331               to set/unset this mode.
2332
2333
2334            0x0002    SILC_CMODE_SECRET
2335
2336               Channel is secret channel.  Secret channels are not shown
2337               in the list listed with SILC_COMMAND_LIST command.  Secret
2338               channels can be considered to be invisible channels.
2339               Channel founder and channel operator may set/unset this
2340               mode.
2341
2342               Typical implementation would use [+|-]s on user interface
2343               to set/unset this mode.
2344
2345
2346            0x0004    SILC_CMODE_PRIVKEY
2347
2348               Channel uses private channel key to protect the traffic
2349               on the channel.  When this mode is set the client will be
2350               responsible to set the key it wants to use to encrypt and
2351               decrypt the traffic on channel.  Server generated channel
2352               keys are not used at all.  This mode provides additional
2353               security as clients on channel may agree to use private
2354               channel key that even servers do not know.  Naturally,
2355               this requires that every client on the channel knows
2356               the key before hand (it is considered to be pre-shared-
2357               key).  This specification does not define how the private
2358               channel key is set as it is entirely local setting on
2359               client end.
2360
2361               As it is local setting it is possible to have several
2362               private channel keys on one channel.  In this case several
2363               clients can talk on same channel but only those clients
2364               that share the key with the message sender will be able
2365               to hear the talking.  Client should not display those
2366               message for the end user that it is not able to decrypt
2367               when this mode is set.
2368
2369               Only channel founder may set/unset this mode.  If this
2370               mode is unset the server will distribute new channel
2371               key to all clients on the channel which will be used
2372               thereafter.
2373
2374               Typical implementation would use [+|-]k on user interface
2375               to set/unset this mode.
2376
2377
2378            0x0008    SILC_CMODE_INVITE
2379
2380               Channel is invite only channel.  Client may join to this
2381               channel only if it is invited to the channel.  Channel
2382               founder and channel operator may set/unset this mode.
2383
2384               Typical implementation would use [+|-]i on user interface
2385               to set/unset this mode.
2386
2387
2388            0x0010    SILC_CMODE_TOPIC
2389
2390               The topic of the channel may only be set by client that
2391               is channel founder or channel operator.  Normal clients
2392               on channel will not be able to set topic when this mode
2393               is set.  Channel founder and channel operator may set/
2394               unset this mode.
2395
2396               Typical implementation would use [+|-]t on user interface
2397               to set/unset this mode.
2398
2399
2400            0x0020    SILC_CMODE_ULIMIT
2401
2402               User limit has been set to the channel.  New clients
2403               may not join to the channel when the limit set is
2404               reached.  Channel founder and channel operator may set/
2405               unset the limit.  The <user limit> argument is the
2406               number of limited users.
2407
2408               Typical implementation would use [+|-]l on user interface
2409               to set/unset this mode.
2410
2411
2412            0x0040    SILC_CMODE_PASSPHRASE
2413
2414               Passphrase has been set to the channel.  Client may
2415               join to the channel only if it is able to provide the
2416               correct passphrase.  Setting passphrases to channel
2417               is entirely safe as all commands are protected in the
2418               SILC network.  Only channel founder may set/unset
2419               the passphrase.  The <passphrase> argument is the
2420               set passphrase.
2421
2422               Typical implementation would use [+|-]a on user interface
2423               to set/unset this mode.
2424
2425
2426            0x0080    SILC_CMODE_BAN
2427
2428               Ban mask has been set to the channel.  The ban mask
2429               may be used to ban specific clients to join the channel.
2430               The <ban mask> argument is the set ban mask.  When
2431               unsetting a ban mask the mask must be provided as
2432               argument.  Channel founder and channel operator may
2433               set/unset this mode.  Channel founder may not be
2434               added to the ban list.
2435
2436               Typical implementation would use [+|-]b on user interface
2437               to set/unset this mode.
2438
2439
2440            0x0100    SILC_CMODE_INVITE
2441
2442               Invite list has been set to the channel.  The invite list
2443               can be used to mark the clients that is able to join
2444               channel without being invited when the channel is set to
2445               be invite-only channel.  The <invite list> argument is the
2446               set invite mask.  When unsetting entry from the invite list
2447               the entry must be provided as argument.  Channel founder and
2448               channel operator may set/unset this mode.
2449
2450               Typical implementation would use [+|-]I on user interface
2451               to set/unset this mode.
2452
2453         
2454            0x0200    SILC_CMODE_OPERATOR
2455
2456               Sets channel operator privileges on the channel for a
2457               client on the channel.  The <Client ID> argument is the
2458               target client on the channel.  Channel founder and
2459               channel operator may set/unset (promote/demote) this
2460               mode.
2461
2462               Typical implementation would use [+|-]o on user interface
2463               to set/unset this mode.
2464
2465
2466            0x0400    SILC_CMODE_CIPHER
2467
2468               Sets specific cipher to be used to protect channel
2469               traffic.  The <cipher> argument is the requested cipher.
2470               When set or unset the server must re-generate new
2471               channel key.  If <key len> argument is specified with
2472               <cipher> argument the new key is generated of <key len>
2473               length.
2474
2475               Typical implementation would use [+|-]c on user interface
2476               to set/unset this mode.
2477
2478
2479         To make the mode system work, client must keep the channel mode
2480         mask locally so that the mode setting and unsetting would work
2481         without problems.  The client receives the initial channel mode
2482         mask when it joins to the channel.  When the mode changes on
2483         channel the server distributes the changed channel mode mask to
2484         all clients on the channel by sending SILC_COMMAND_CMODE command
2485         reply packet.
2486
2487
2488         Reply messages to the command:
2489
2490         Max Arguments:  2
2491             Arguments:  (1) <Status Payload>  (2) <channel mode mask>
2492
2493         This command replies with the changed channel mode mask that
2494         client is required to keep locally.  The same mask is also
2495         sent to all clients on channel by sending additional command
2496         reply to them.
2497
2498         Status messages:
2499
2500             SILC_STATUS_OK
2501             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2502             SILC_STATUS_ERR_TOO_MANY_PARAMS
2503             SILC_STATUS_ERR_NOT_REGISTERED
2504             SILC_STATUS_ERR_NOT_ON_CHANNEL
2505             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2506             SILC_STATUS_ERR_BAD_CHANNEL_ID
2507             SILC_STATUS_ERR_NO_CHANNEL_ID
2508             SILC_STATUS_ERR_NO_CHANNEL_PRIV
2509             SILC_STATUS_ERR_UNKNOWN_MODE
2510             SILC_STATUS_ERR_NO_CLIENT_ID
2511
2512
2513
2514
2515    19   SILC_COMMAND_KICK
2516
2517         Max Arguments:  3
2518             Arguments:  (1) <channel>  (2) <Client ID>  
2519                         (3) [<comment>]
2520
2521         This command is used by channel operators to remove a client from
2522         channel.  The <channel> argument is the channel the client to be
2523         removed is on currently.  Note that the "kicker" must be on the same
2524         channel.  If <comment> is provided it will be sent to the removed
2525         client.
2526
2527         Reply messages to the command:
2528
2529         Max Arguments:  1
2530             Arguments:  (1) <Status Payload>
2531
2532         This command replies only with Status Payload.
2533
2534         Status messages:
2535
2536             SILC_STATUS_OK
2537             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2538             SILC_STATUS_ERR_TOO_MANY_PARAMS
2539             SILC_STATUS_ERR_NOT_REGISTERED
2540             SILC_STATUS_ERR_NO_SUCH_CHANNEL
2541             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2542             SILC_STATUS_ERR_NO_CHANNEL_PRIV
2543             SILC_STATUS_ERR_NO_CLIENT_ID
2544
2545
2546    20   SILC_COMMAND_RESTART
2547
2548         Max Arguments:  0
2549             Arguments:  None
2550
2551         This command may only be used by server operator to force a
2552         server to restart itself.
2553
2554         Reply messages to the command:
2555
2556         Max Arguments:  1
2557             Arguments:  (1) <Status Payload>
2558
2559         This command replies only with Status Payload.
2560
2561
2562
2563         Status messages:
2564
2565             SILC_STATUS_OK
2566             SILC_STATUS_ERR_NOT_REGISTERED
2567             SILC_STATUS_ERR_NO_SERVER_PRIV
2568
2569
2570    21   SILC_COMMAND_CLOSE
2571
2572         Max Arguments:  1
2573             Arguments:  (1) <Server ID>
2574
2575         This command is used only by operator to close connection to a
2576         remote site.  The <Server ID> argument is the ID of the remote
2577         site and must be valid.
2578
2579         Reply messages to the command:
2580
2581         Max Arguments:  1
2582             Arguments:  (1) <Status Payload>
2583
2584         This command replies only with Status Payload.
2585
2586
2587
2588         Status messages:
2589
2590             SILC_STATUS_OK
2591             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2592             SILC_STATUS_ERR_TOO_MANY_PARAMS
2593             SILC_STATUS_ERR_NOT_REGISTERED
2594             SILC_STATUS_ERR_NO_SUCH_SERVER
2595             SILC_STATUS_ERR_NO_SERVER_PRIV
2596             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
2597
2598
2599    22   SILC_COMMAND_DIE
2600
2601         Max Arguments:  0
2602             Arguments:  None
2603
2604         This command is used only by operator to shutdown the server.
2605         All connections to the server will be closed and the server is
2606         shutdown.
2607
2608         Reply messages to the command:
2609
2610
2611
2612         Max Arguments:  1
2613             Arguments:  (1) <Status Payload>
2614
2615         This command replies only with Status Payload.
2616
2617         Status messages:
2618
2619             SILC_STATUS_OK
2620             SILC_STATUS_ERR_NOT_REGISTERED
2621             SILC_STATUS_ERR_NO_SERVER_PRIV
2622
2623
2624    23   SILC_COMMAND_SILCOPER
2625
2626         Max Arguments:  2
2627             Arguments:  (1) <username>  (2) <authentication data>
2628
2629         This command is used by normal client to obtain router operator
2630         privileges (also known as SILC operator) on some router.  Note
2631         that router operator has router privileges that supersedes the
2632         server operator privileges.
2633
2634         The <username> is the username set in the server configurations
2635         as operator.  The <authentication data> is the data that the
2636         client is authenticated against.  It may be passphrase prompted
2637         for user on client's screen or it may be public key
2638         authentication data (data signed with private key), or 
2639         certificate.
2640
2641         Difference between router operator and server operator is that
2642         router operator is able to handle cell level properties while
2643         server operator (even on router server) is able to handle only
2644         local properties, such as, local connections and normal server
2645         administration.
2646
2647         Reply messages to the command:
2648
2649         Max Arguments:  1
2650             Arguments:  (1) <Status Payload>
2651
2652         This command replies only with Status Payload.
2653
2654         Status messages:
2655
2656             SILC_STATUS_OK
2657             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2658             SILC_STATUS_ERR_TOO_MANY_PARAMS
2659             SILC_STATUS_ERR_NOT_REGISTERED
2660             SILC_STATUS_ERR_BAD_PASSWORD
2661             SILC_STATUS_ERR_AUTH_FAILED
2662
2663
2664    24   SILC_COMMAND_LEAVE
2665
2666         Max Arguments:  1
2667             Arguments:  (1) <Channel ID>
2668
2669         This command is used by client to leave a channel the client is
2670         joined to.  After a client has leaved the channel the server
2671         must create new key for the channel and distribute to all clients
2672         still currently on the channel.
2673
2674         Reply messages to the command:
2675
2676         Max Arguments:  1
2677             Arguments:  (1) <Status Payload>
2678
2679         This command replies only with Status Payload.
2680
2681         Status messages:
2682
2683             SILC_STATUS_OK
2684             SILC_STATUS_ERR_NOT_REGISTERED
2685             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2686             SILC_STATUS_ERR_TOO_MANY_PARAMS
2687             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2688             SILC_STATUS_ERR_BAD_CHANNEL_ID
2689             SILC_STATUS_ERR_NO_CHANNEL_ID
2690
2691
2692    25   SILC_COMMAND_NAMES
2693
2694         Max Arguments:  1
2695             Arguments:  (1) <Channel ID>
2696
2697         This command is used to list user names currently on the requested
2698         channel; argument <Channel ID>.  The server must resolve the
2699         user names and send a comma (`,') separated list of user names
2700         on the channel.  Server or router may resolve the names by sending
2701         SILC_COMMAND_WHOIS commands.
2702
2703         If the requested channel is a private or secret channel, this
2704         command must not send the list of users, as private and secret
2705         channels cannot be seen by outside.  In this case the returned
2706         name list may include a indication that the server could not 
2707         resolve the names of the users on the channel.
2708
2709         Reply messages to the command:
2710
2711         Max Arguments:  3
2712             Arguments:  (1) <Status Payload>  (2) <Channel ID>
2713                         (3) <name list>       (4) <Client ID list>
2714
2715         This command replies with the Channel ID of the requested channel,
2716         comma separated list of users on the channel and Client ID list
2717         of the users on the list.  The Client ID list has Client ID's
2718         of all users in the list.  First Client ID in the list must be
2719         the Client ID of the first user in <name list>.  The Client ID
2720         List is formed by adding Client ID's each after each.  Note that
2721         the Client ID list is binary data.
2722
2723         Status messages:
2724
2725             SILC_STATUS_OK
2726             SILC_STATUS_ERR_NOT_REGISTERED
2727             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2728             SILC_STATUS_ERR_TOO_MANY_PARAMS
2729             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2730             SILC_STATUS_ERR_BAD_CHANNEL_ID
2731             SILC_STATUS_ERR_NO_CHANNEL_ID
2732             SILC_STATUS_ERR_NOT_ON_CHANNEL
2733
2734
2735    26 - 254
2736
2737         Currently undefined commands.
2738
2739
2740    255  SILC_COMMAND_MAX
2741
2742         Reserved command.  This must not be sent.
2743 .in 3
2744
2745
2746 .ti 0
2747 5.3 SILC Command Status Types
2748
2749 .ti 0
2750 5.3.1 SILC Command Status Payload
2751
2752 Command Status Payload is sent in command reply messages to indicate
2753 the status of the command.  The payload is one of argument in the
2754 command thus this is the data area in Command Argument Payload described
2755 in [SILC2].  The payload is only 2 bytes of length.  Following diagram
2756 represents the Command Status Payload (field is always in MSB order).
2757
2758
2759 .in 21
2760 .nf
2761                      1
2762  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
2763 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2764 |        Status Message         |
2765 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2766 .in 3
2767
2768 .ce
2769 Figure 5:  SILC Command Status Payload
2770
2771
2772 .in 6
2773 o Status Message (2 bytes) - Indicates the status message.
2774   All Status messages are described in the next section.
2775 .in 3
2776
2777
2778 .ti 0
2779 5.3.2 SILC Command Status List
2780
2781 Command Status messages are returned in the command reply messages
2782 to indicate whether the command were executed without errors.  If error
2783 has occured the status tells which error occured.  Status payload only
2784 sends numeric reply about the status.  Receiver of the payload must
2785 convert the numeric values into human readable error messages.  The
2786 list of status messages below has an example human readable error
2787 messages that client may display for the user.
2788
2789 List of all defined command status messages following.
2790
2791 .in 0
2792    Generic status messages:
2793
2794    0    SILC_STATUS_OK
2795
2796         Ok status.  Everything went Ok.  The status payload maybe
2797         safely ignored in this case.
2798
2799    1    SILC_STATUS_LIST_START
2800
2801         Start of the list.  There will be several command replies and
2802         this reply is the start of the list.
2803
2804    2    SILC_STATUS_LIST_END
2805
2806         End of the list.  There were several command replies and this
2807         reply is the last of the list.  There won't be other replies
2808         beloning to this list after this one.
2809
2810    3 - 9
2811
2812         Currently undefined and has been reserved for the future.
2813
2814
2815    Error status message:
2816
2817    10   SILC_STATUS_ERR_NO_SUCH_NICK
2818
2819         "No such nickname".  Requested nickname does not exist.
2820
2821    11   SILC_STATUS_ERR_NO_SUCH_CHANNEL
2822
2823         "No such channel".  Requested channel name does not exist.
2824
2825    12   SILC_STATUS_ERR_NO_SUCH_SERVER
2826
2827         "No such server".  Requested server name does not exist.
2828
2829    13   SILC_STATUS_ERR_TOO_MANY_TARGETS
2830
2831         "Duplicate recipients. No message delivered".  Message were
2832         tried to be sent to recipient which has several occurrences in 
2833         the recipient list.
2834
2835    14   SILC_STATUS_ERR_NO_RECIPIENT
2836
2837         "No recipient given".  Command required recipient which was
2838         not provided.
2839
2840    15   SILC_STATUS_ERR_UNKNOWN_COMMAND
2841
2842         "Unknown command".  Command sent to server is unknown by the
2843         server.
2844
2845    16   SILC_STATUS_ERR_WILDCARDS
2846
2847         "Wildcards cannot be used".  Wildcards were provided but they
2848         weren't permitted.
2849
2850    17   SILC_STATUS_ERR_NO_CLIENT_ID
2851
2852         "No Client ID given".  Client ID were expected as command
2853         parameter but were not found.
2854
2855    18   SILC_STATUS_ERR_NO_CHANNEL_ID
2856
2857         "No Channel ID given".  Channel ID were expected as command
2858         parameter but were not found.
2859
2860    19   SILC_STATUS_ERR_NO_SERVER_ID
2861
2862         "No Serve ID given".  Server ID were expected as command
2863         parameter but were not found.
2864
2865    20   SILC_STATUS_ERR_BAD_CLIENT_ID
2866
2867         "Bad Client ID".  Client ID provided were erroneous.
2868
2869    21   SILC_STATUS_ERR_BAD_CHANNEL_ID
2870
2871         "Bad Channel ID".  Channel ID provided were erroneous.
2872
2873    22   SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2874
2875         "No such Client ID".  Client ID provided does not exist.
2876
2877
2878    23   SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2879
2880         "No such Channel ID".  Channel ID provided does not exist.
2881
2882    24   SILC_STATUS_ERR_NICKNAME_IN_USE
2883
2884         "Nickname already exists".  Nickname created could not be 
2885         registered because number of same nicknames were already set to
2886         maximum.  This is not expected to happen in real life but is
2887         possible to occur.
2888
2889    25   SILC_STATUS_ERR_NOT_ON_CHANNEL
2890
2891         "You are not on that channel".  The command were specified for
2892         client user is not currently on.
2893
2894    26   SILC_STATUS_ERR_USER_ON_CHANNEL
2895
2896         "User already on channel".  User were invited on channel they
2897         already are on.
2898
2899    27   SILC_STATUS_ERR_NOT_REGISTERED
2900
2901         "You have not registered".  User executed command that requires
2902         the client to be registered on the server before it may be
2903         executed.
2904
2905    28   SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2906
2907         "Not enough parameters".  Command requires more parameters
2908         than provided.
2909
2910    29   SILC_STATUS_ERR_TOO_MANY_PARAMS
2911
2912         "Too many parameters".  Too many parameters were provided
2913         for the command.
2914
2915    30   SILC_STATUS_ERR_PERM_DENIED
2916
2917         "Your host is not among the privileged".  The client tried to
2918         register on server that does not allow this host to connect.
2919
2920    31   SILC_STATUS_ERR_BANNED_FROM_SERVER
2921
2922         "You are banned from this server".  The client tried to register
2923         on server that has explicitly denied this host to connect.
2924
2925
2926
2927    32   SILC_STATUS_ERR_BAD_PASSWORD
2928
2929         "Cannot join channel. Incorrect password".  Password provided for 
2930         channel were not accepted.
2931
2932    33   SILC_STATUS_ERR_CHANNEL_IS_FULL
2933
2934         "Cannot join channel. Channel is full".  The channel is full
2935         and client cannot be joined to it.
2936
2937    34   SILC_STATUS_ERR_NOT_INVITED
2938
2939         "Cannot join channel. You have not been invited".  The channel
2940         is invite only channel and client has not been invited.
2941
2942    35   SILC_STATUS_ERR_BANNED_FROM_CHANNEL
2943
2944         "Cannot join channel. You have been banned".  The client has
2945         been banned from the channel.
2946
2947    36   SILC_STATUS_ERR_UNKNOWN_MODE
2948
2949         "Unknown mode".  Mode provided by the client were unknown to
2950         the server.
2951
2952    37   SILC_STATUS_ERR_NOT_YOU
2953
2954         "Cannot change mode for other users".  User tried to change
2955         someone else's mode.
2956
2957    38   SILC_STATUS_ERR_NO_CHANNEL_PRIV
2958
2959         "Permission denied. You are not channel operator".  Command may 
2960         be executed only by channel operator.
2961
2962    39   SILC_STATUS_ERR_NO_SERVER_PRIV
2963
2964         "Permission denied. You are not server operator".  Command may
2965         be executed only by server operator.
2966
2967    40   SILC_STATUS_ERR_NO_ROUTER_PRIV
2968
2969         "Permission denied. You are not SILC operator".  Command may be
2970         executed only by router (SILC) operator.
2971
2972    41   SILC_STATUS_ERR_BAD_NICKNAME
2973
2974         "Bad nickname".  Nickname requested contained illegal characters
2975         or were malformed.
2976
2977    42   SILC_STATUS_ERR_BAD_CHANNEL
2978
2979         "Bad channel name".  Channel requested contained illegal characters
2980         or were malformed.
2981
2982    43   SILC_STATUS_ERR_AUTH_FAILED
2983
2984         "Authentication failed".  The authentication data sent as 
2985         argument were wrong and thus authentication failed.
2986 .in 3
2987
2988
2989 .ti 0
2990 6 Security Considerations
2991
2992 Security is central to the design of this protocol, and these security
2993 considerations permeate the specification.
2994
2995
2996
2997
2998
2999 .ti 0
3000 7 References
3001
3002 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
3003              June 2000.
3004
3005 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication 
3006              Protocols", Internet Draft, June 2000.
3007
3008 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
3009              RFC 1459, May 1993.
3010
3011 [SSH-TRANS]  Ylonen, T., et al, "SSH Transport Layer Protocol", 
3012              Internet Draft.
3013
3014 [PGP]        Callas, J., et al, "OpenPGP Message Format", RFC 2440,
3015              November 1998.
3016
3017 [SPKI]       Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
3018              September 1999.
3019
3020 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key 
3021              Infrastructure, Certificate and CRL Profile", RFC 2459,
3022              January 1999.
3023
3024 [Schneier]   Schneier, B., "Applied Cryptography Second Edition",
3025              John Wiley & Sons, New York, NY, 1996.
3026
3027 [Menezes]    Menezes, A., et al, "Handbook of Applied Cryptography",
3028              CRC Press 1997.
3029
3030 [OAKLEY]     Orman, H., "The OAKLEY Key Determination Protocol",
3031              RFC 2412, November 1998.
3032
3033 [ISAKMP]     Maughan D., et al, "Internet Security Association and
3034              Key Management Protocol (ISAKMP)", RFC 2408, November
3035              1998.
3036
3037 [IKE]        Harkins D., and Carrel D., "The Internet Key Exhange
3038              (IKE)", RFC 2409, November 1998.
3039
3040 [HMAC]       Krawczyk, H., "HMAC: Keyed-Hashing for Message
3041              Authentication", RFC 2104, February 1997.
3042
3043
3044
3045 .ti 0
3046 8 Author's Address
3047
3048 .nf
3049 Pekka Riikonen
3050 Kasarmikatu 11 A4
3051 70110 Kuopio
3052 Finland
3053
3054 EMail: priikone@poseidon.pspt.fi
3055
3056 This Internet-Draft expires 28 Jan 2001