The SILC Project

source navigation ]
identifier search ]
freetext search ]
file search ]

silc/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 13 September 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                      13 September 2000
 20 Expires: 13 May 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   3.12 SILC Version Detection ................................... 24
110 4 SILC Procedures ............................................... 24
111   4.1 Creating Client Connection ................................ 24
112   4.2 Creating Server Connection ................................ 25
113   4.3 Joining to a Channel ...................................... 26
114   4.4 Channel Key Generation .................................... 27
115   4.5 Private Message Sending and Reception ..................... 27
116   4.6 Private Message Key Generation ............................ 28
117   4.7 Channel Message Sending and Reception ..................... 29
118   4.8 Session Key Regeneration .................................. 29
119   4.9 Command Sending and Reception ............................. 29
120 5 SILC Commands ................................................. 30
121   5.1 SILC Commands Syntax ...................................... 30
122   5.2 SILC Commands List ........................................ 32
123   5.3 SILC Command Status Types ................................. 53
124       5.3.1 SILC Command Status Payload ......................... 53
125       5.3.2 SILC Command Status List ............................ 54
126 6 Security Considerations ....................................... 59
127 7 References .................................................... 59
128 8 Author's Address .............................................. 60
129 
130 
131 .ti 0
132 List of Figures
133 
134 .nf
135 Figure 1:  SILC Network Topology
136 Figure 2:  Communication Inside cell
137 Figure 3:  Communication Between Cells
138 Figure 4:  SILC Public Key
139 Figure 5:  SILC Command Status Payload
140 
141 
142 .ti 0
143 1. Introduction
144 
145 This document describes a Secure Internet Live Conferencing (SILC)
146 protocol which provides secure conferencing services over insecure
147 network channel.  SILC is IRC [IRC] like protocol, however, it is 
148 not equivalent to IRC and does not support IRC.
149 
150 Strong cryptographic methods are used to protect SILC packets inside
151 SILC network.  Two other Internet Drafts relates very closely to this
152 memo; SILC Packet Protocol [SILC2] and SILC Key Exchange and
153 Authentication Protocols [SILC3].
154 
155 The protocol uses extensively packets as conferencing protocol 
156 requires message and command sending.  The SILC Packet Protocol is
157 described in [SILC2] and should be read to fully comprehend this
158 document and protocol.  [SILC2] also describes the packet encryption
159 and decryption in detail.
160 
161 The security of SILC protocol and for any security protocol for that
162 matter is based on strong and secure key exchange protocol.  The SILC
163 Key Exchange protocol is described in [SILC3] along with connection
164 authentication protocol and should be read to fully comprehend this
165 document and protocol.
166 
167 The SILC protocol has been developed to work on TCP/IP network
168 protocol, although it could be made to work on other network protocols
169 with only minor changes.  However, it is recommended that TCP/IP
170 protocol is used under SILC protocol.  Typical implementation would
171 be made in client-server model.
172 
173 
174 .ti 0
175 2. SILC Concepts
176 
177 This section describes various SILC protocol concepts that forms the 
178 actual protocol, and in the end, the actual SILC network.  The mission
179 of the protocol is to deliver messages from clients to other clients 
180 through routers and servers in secure manner.  The messages may also 
181 be delivered from one client to many clients forming a group, also 
182 known as a channel.
183 
184 This section does not focus to security issues, instead basic network 
185 concepts are introduced to make the topology of the SILC network 
186 clear.
187 
188 
189 .ti 0
190 2.1 SILC Network Topology
191 
192 SILC network is a cellular network as opposed to tree style network 
193 topology.  The rationale for this is to have servers that can perform 
194 specific kind of tasks what other servers cannot perform.  This leads 
195 to two kinds of servers; normal SILC servers and SILC routers.
196 
197 A difference between normal server and router server is that routers 
198 knows everything about everything in the network.  They also do the 
199 actual routing of the messages to the correct receiver.  Normal servers 
200 knows only about local information and nothing about global information.
201 This makes the network faster as there are less servers that needs to 
202 keep global information up to date at all time.
203 
204 This, on the other hand, leads to cellular like network, where routers 
205 are in the centrum on the cell and servers are connected to the router.
206 
207 Following diagram represents SILC network topology.
208 
209 
210 
211 
212 
213 
214 
215 
216 
217 
218 
219 
220 
221 
222 
223 
224 
225 .in 8
226 .nf
227   ---- ---- ----         ---- ---- ----
228  | S8 | S5 | S4 |       | S7 | S5 | S6 |
229  ----- ---- -----       ----- ---- -----
230 | S7 | S/R1 | S2 | --- | S8 | S/R2 | S4 |
231  ---- ------ ----       ---- ------ ----
232  | S6 | S3 | S1 |       | S1 | S3 | S2 |         ---- ----
233   ---- ---- ----         ---- ---- ----         | S3 | S1 |
234      Cell 1.   \\             Cell 2.  | \\____  ----- -----
235                 |                     |        | S4 | S/R4 |
236     ---- ---- ----         ---- ---- ----       ---- ------
237    | S7 | S4 | S2 |       | S1 | S3 | S2 |      | S2 | S5 |
238    ----- ---- -----       ----- ---- -----       ---- ----
239   | S6 | S/R3 | S1 | --- | S4 | S/R5 | S5 |       Cell 4.
240    ---- ------ ----       ---- ------ ----
241    | S8 | S5 | S3 |       | S6 | S7 | S8 |     ... etc ...
242     ---- ---- ----         ---- ---- ----
243        Cell 3.                Cell 5.
244 .in 3
245 
246 .ce
247 Figure 1:  SILC Network Topology
248 
249 
250 A cell is formed when a server or servers connect to one router.  In
251 SILC network normal server cannot directly connect to other normal
252 server.  Normal server may only connect to SILC router which then
253 routes the messages to the other servers in the cell.  Router servers
254 on the other hand may connect to other routers to form the actual SILC 
255 network, as seen in above figure.  However, router is also normal SILC 
256 server; clients may connect to it the same way as to normal SILC 
257 servers.  Normal server also cannot have active connections to more 
258 than one router.  Normal server cannot be connected to two different 
259 cells.  Router servers, on the other hand, may have as many router to 
260 router connections as needed.
261 
262 There are many issues in this network topology that needs to be careful
263 about.  Issues like the size of the cells, the number of the routers in 
264 the SILC network and the capacity requirements of the routers.  These
265 issues should be discussed in the Internet Community and additional
266 documents on the issue will be written.
267 
268 
269 .ti 0
270 2.2 Communication Inside a Cell
271 
272 It is always guaranteed that inside a cell message is delivered to the 
273 recipient with at most two server hops.  Client who is connected to
274 server in the cell and is talking on channel to other client connected 
275 to other server in the same cell, will have its messages delivered from 
276 its local server first to the router of the cell, and from the router 
277 to the other server in the cell.  Following diagram represents this 
278 scenario.
279 
280 
281 .in 25
282 .nf
283 1 --- S1     S4 --- 5
284          S/R
285  2 -- S2     S3
286      /        |
287     4         3
288 .in 3
289 
290 
291 .ce
292 Figure 2:  Communication Inside cell
293 
294 
295 Example:  Client 1. connected to Server 1. message sent to
296           Client 4. connected to Server 2. travels from Server 1.
297           first to Router which routes the message to Server 2.
298           which then sends it to the Client 4.  All the other
299           servers in the cell will not see the routed message.
300 
301 
302 If client is connected directly to the router, as router is also normal 
303 SILC server, the messages inside the cell are always delivered only with 
304 one server hop.  If clients communicating with each other are connected 
305 to the same server, no router interaction is needed.  This is the optimal
306 situation of message delivery in the SILC network.
307 
308 
309 .ti 0
310 2.3 Communication in the Network
311 
312 If the message is destined to server that does not belong to local cell 
313 the message is routed to the router server to which the destination 
314 server belongs, if the local router is connected to destination router.
315 If there is no direct connection to the destination router, the local
316 router routes the message to its primary route.  Following diagram
317 represents message sending between cells.
318 
319 
320 .in 16
321 .nf
322 1 --- S1     S4 --- 5            S2 --- 1
323          S/R - - - - - - - - S/R
324  2 -- S2     S3           S1
325      /        |             \\
326     4         3              2
327 
328    Cell 1.               Cell 2.
329 .in 3
330 
331 
332 .ce
333 Figure 3:  Communication Between Cells
334 
335 
336 Example:  Client 5. connected to Server 4. in Cell 1. message sent
337           to Client 2. connected to Server 1. in Cell 2. travels
338           from Server 4. to Router which routes the message to
339           Router in Cell 2, which then routes the message to 
340           Server 1.  All the other servers and routers in the
341           network will not see the routed message.
342 
343 
344 The optimal case of message delivery from client point of view is
345 when clients are connected directly to the routers and the messages
346 are delivered from one router to the other router.
347 
348 
349 .ti 0 
350 2.4 Channel Communication
351 
352 Messages may be sent to group of clients as well.  Sending messages to
353 many clients works the same way as sending messages point to point, from
354 message delivery point of view.  Security issues are another matter
355 which are not discussed in this section.
356 
357 Router server handles the message routing to multiple recipients.  If 
358 any recipient is not in the same cell as the sender the messages are 
359 routed further.
360 
361 Server distributes the channel message to its local clients who are 
362 joined to the channel.  Also, router distributes the message to its 
363 local clients on the channel.
364 
365 
366 .ti 0
367 3. SILC Specification
368 
369 This section describes the SILC protocol.  However, [SILC2] and
370 [SILC3] describes other important protocols that are part of this SILC
371 specification and must be read.
372 
373 
374 .ti 0
375 3.1 Client
376 
377 A client is a piece of software connecting to SILC server.  SILC client 
378 cannot be SILC server.  Purpose of clients is to provide the user 
379 interface of the SILC services for end user.  Clients are distinguished
380 from other clients by unique Client ID.  Client ID is a 128 bit ID that
381 is used in the communication in the SILC network.  The client ID is 
382 based on the nickname selected by the user.  User uses logical nicknames
383 in communication which are then mapped to the corresponding Client ID.
384 Client ID's are low level identifications and must not be seen by the
385 end user.
386 
387 Clients provide other information about the end user as well. Information
388 such as the nickname of the user, username and the hostname of the end 
389 user and user's real name.  See section 3.2 Server for information of 
390 the requirements of keeping this information.
391 
392 The nickname selected by the user is not unique in the SILC network.
393 There can be 2^8 same nicknames for one IP address. As for comparison to
394 IRC [IRC] where nicknames are unique this is a fundamental difference
395 between SILC and IRC.  This causes the server names to be used along
396 with the nicknames to identify specific users when sending messages.
397 This feature of SILC makes IRC style nickname-wars obsolete as no one
398 owns their nickname; there can always be someone else with the same
399 nickname.  Another difference is that there are no limit of the length
400 of the nickname in the SILC.
401 
402 
403 .ti 0
404 3.1.1 Client ID
405 
406 Client ID is used to identify users in the SILC network.  The Client ID
407 is unique to the extent that there can be 2^128 different Client ID's.
408 Collisions are not expected to happen.  The Client ID is defined as 
409 follows.
410 
411 .in 6
412 128 bit Client ID based on IPv4 addresses:
413 
414 32 bit  ServerID IP address (bits 1-32)
415  8 bit  Random number
416 88 bit  Truncated MD5 hash value of the nickname
417 
418 o Server ID IP address - Indicates the server where this
419   client is coming from.  The IP address hence equals the
420   server IP address where to the client has connected.
421 
422 o Random number - Random number to further randomize the
423   Client ID.  This makes it possible to have 2^8 same
424   nicknames from the same server IP address.
425 
426 o MD5 hash - MD5 hash value of the nickname is truncated
427   taking 88 bits from the start of the hash value.  This
428   hash value is used to search the user's Client ID from
429   the ID lists.
430 
431 .in 3
432 Collisions could occur when more than 2^8 clients using same nickname
433 from the same server IP address is connected to the SILC network.  
434 Server must be able to handle this situation by refusing to accept 
435 anymore of that nickname.
436 
437 Another possible collision may happen with the truncated hash value of
438 the nickname.  It could be possible to have same truncated hash value for
439 two different nicknames.  However, this is not expected to happen nor
440 cause any problems if it would occur.  Nicknames are usually logical and
441 it is unlikely to have two distinct logical nicknames produce same
442 truncated hash value.
443 
444 
445 .ti 0
446 3.2 Server
447 
448 Servers are the most important parts of the SILC network.  They form the
449 basis of the SILC, providing a point to which clients may connect to.
450 There are two kinds of servers in SILC; normal servers and router servers.
451 This section focuses on the normal server and router server is described
452 in the section 3.3 Router.
453 
454 Normal servers may not directly connect to other normal server.  Normal
455 servers may only directly connect to router server.  If the message sent
456 by the client is destined outside the local server it is always sent to
457 the router server for further routing.  Server may only have one active
458 connection to router on same port.  Normal server may not connect to other
459 cell's router except in situations where its cell's router is unavailable.
460 
461 Servers and routers in the SILC network are considered to be trusted.
462 With out a doubt, servers that are set to work on ports above 1023 are
463 not considered to be trusted.  Also, the service provider acts important
464 role in the server's trustworthy.
465 
466 
467 .ti 0
468 3.2.1 Server's Local ID List
469 
470 Normal server keeps various information about the clients and their end
471 users connected to it.  Every normal server must keep list of all locally
472 connected clients, Client ID's, nicknames, usernames and hostnames and
473 user's real name.  Normal servers only keeps local information and it
474 does not keep any global information.  Hence, normal servers knows only
475 about their locally connected clients.  This makes servers efficient as
476 they don't have to worry about global clients.  Server is also responsible
477 of creating the Client ID's for their clients.
478 
479 Normal server also keeps information about locally created channels and
480 their Channel ID's.
481 
482 
483 
484 
485 
486 
487 
488 
489 Hence, local list for normal server includes:
490 
491 .in 6
492 server list        - Router connection
493    o Server name
494    o Server IP address
495    o Server ID
496    o Sending key
497    o Receiving key
498    o Public key
499 
500 client list        - All clients in server
501    o Nickname
502    o Username@host
503    o Real name
504    o Client ID
505    o Sending key
506    o Receiving key
507 
508 channel list       - All channels in server
509    o Channel name
510    o Channel ID
511    o Client ID's on channel
512    o Client ID modes on channel
513    o Channel key
514 .in 3
515 
516 
517 
518 .ti 0
519 3.2.2 Server ID
520 
521 Servers are distinguished from other servers by unique 64 bit Server ID.
522 The Server ID is used in the SILC to route messages to correct servers.
523 Server ID's also provide information for Client ID's, see section 3.1.1
524 Client ID.  Server ID is defined as follows.
525 
526 .in 6
527 64 bit Server ID based on IPv4 addresses:
528 
529 32 bit  IP address of the server
530 16 bit  Port
531 16 bit  Random number
532 
533 o IP address of the server - This is the real IP address of
534   the server.
535 
536 o Port - This is the port the server is binded to.
537 
538 o Random number - This is used to further randomize the Server ID.
539 
540 .in 3
541 Collisions are not expected to happen in any conditions.  The Server ID
542 is always created by the server itself and server is resposible of
543 distributing it to the router.
544 
545 
546 .ti 0
547 3.2.3 SILC Server Ports
548 
549 Following ports has been assigned by IANA for the SILC protocol:
550 
551 .in 10
552 silc            706/tcp    SILC
553 silc            706/udp    SILC
554 .in 3
555 
556 If there are needs to create new SILC networks in the future the port
557 numbers must be officially assigned by the IANA.
558 
559 Server on network above privileged ports (>1023) should not be trusted
560 as they could have been set up by untrusted party.
561 
562 
563 .ti 0
564 3.3 Router
565 
566 Router server in SILC network is responsible for keeping the cell together
567 and routing messages to other servers and to other routers.  Router server
568 is also a normal server thus clients may connect to it as it would be
569 just normal SILC server.
570 
571 However, router servers has a lot of important tasks that normal servers
572 do not have.  Router server knows everything about everything in the SILC.
573 They know all clients currently on SILC, all servers and routers and all
574 channels in SILC.  Routers are the only servers in SILC that care about
575 global information and keeping them up to date at all time.  And, this
576 is what they must do.
577 
578 
579 .ti 0
580 3.3.1 Router's Local ID List
581 
582 Router server as well must keep local list of connected clients and
583 locally created channels.  However, this list is extended to include all
584 the informations of the entire cell, not just the server itself as for
585 normal servers.
586 
587 However, on router this list is a lot smaller since routers do not keep
588 information about user's nickname, username and hostname and real name
589 since these are not needed by the router.  Router keeps only information
590 that it needs.
591 
592 
593 
594 
595 
596 Hence, local list for router includes:
597 
598 .in 6
599 server list        - All servers in the cell
600    o Server name
601    o Server ID
602    o Router's Server ID
603    o Sending key
604    o Receiving key
605 
606 client list        - All clients in the cell
607    o Client ID
608 
609 channel list       - All channels in the cell
610    o Channel ID
611    o Client ID's on channel
612    o Client ID modes on channel
613    o Channel key
614 .in 3
615 
616 
617 Note that locally connected clients and other information include all the
618 same information as defined in section section 3.2.1 Server's Local ID
619 List.
620 
621 
622 .ti 0
623 3.3.2 Router's Global ID List
624 
625 Router server must also keep global list.  Normal servers do not have
626 global list as they know only about local information.  Global list
627 includes all the clients on SILC, their Client ID's, all created channels
628 and their Channel ID's and all servers and routers on SILC and their
629 Server ID's.  That is said, global list is for global information and the
630 list must not include the local information already on the router's local
631 list.
632 
633 Note that the global list does not include information like nicknames,
634 usernames and hostnames or user's real names.  Router does not keep
635 these informations as they are not needed by the router.  This 
636 information is available from the client's server which maybe queried
637 when needed.
638 
639 Hence, global list includes:
640 
641 .in 6
642 server list        - All servers in SILC
643    o Server name
644    o Server ID
645    o Router's Server ID
646 
647 
648 client list        - All clients in SILC
649    o Client ID
650 
651 channel list       - All channels in SILC
652    o Channel ID
653    o Client ID's on channel
654    o Client ID modes on channel
655 .in 3
656 
657 
658 .ti 0
659 3.3.3 Router's Server ID
660 
661 Router's Server ID's are equivalent to normal Server ID's.  As routers
662 are normal servers as well same types of ID's applies for routers as well.
663 Thus, see section 3.2.2 Server ID.  Server ID's for routers are always
664 created by the remote router where the router is connected to.
665 
666 
667 .ti 0
668 3.4 Channels
669 
670 A channel is a named group of one or more clients which will all receive
671 messages addressed to that channel.  The channel is created when first
672 client requests JOIN command to the channel, and the channel ceases to
673 exist when the last client leaves it.  When channel exists, any client
674 can reference it using the name of the channel.
675 
676 Channel names are unique although the real uniqueness comes from 64 bit
677 Channel ID that unifies each channel.  However, channel names are still
678 unique and no two global channels with same name may exist.  Channel name
679 is a string which begins with `#' character.  There is no limit on the
680 length of the channel name.  Channel names may not contain any spaces
681 (`  '), any non-printable ASCII characters, commas (`,') and wildcard
682 characters.
683 
684 Channels can have operators that can administrate the channel and
685 operate all of its modes.  Following operators on channel exist on SILC
686 network.
687 
688 .in 6
689 o Channel founder - When channel is created the joining client becomes
690   channel founder.  Channel founder is channel operator with some more
691   privileges.  Basically, channel founder can fully operate the channel
692   and all of its modes.  The privileges are limited only to the particular
693   channel.  There can be only one channel founder per channel.  Channel
694   founder supersedes channel operator's privileges.
695 
696   Channel founder privileges cannot be removed by any other operator on
697   channel.  When channel founder leaves the channel there is no channel
698   founder on the channel.  Channel founder also cannot be removed by
699   force from the channel.
700 
701 o Channel operator - When client joins to channel that has not existed
702   previously it will become automatically channel operator (and channel
703   founder discussed above).  Channel operator is able administrate the
704   channel, set some modes on channel, remove a badly behaving client from
705   the channel and promote other clients to become channel operator.
706   The privileges are limited only to the particular channel.
707 
708   Normal channel user may be promoted (opped) to channel operator
709   gaining channel operator privileges.  Channel founder or other channel
710   operator may also demote (deop) channel operator to normal channel
711   user.
712 .in 3
713 
714 
715 .ti 0
716 3.4.1 Channel ID
717 
718 Channels are distinguished from other channels by unique Channel ID.
719 The Channel ID is a 64 bit ID and collisions are not expected to happen
720 in any conditions.  Channel names are just for logical use of channels.
721 The Channel ID is created by the server where the channel is created.
722 The Channel ID is defined as follows.
723 
724 .in 6
725 64 bit Channel ID based on IPv4 addresses:
726 
727 32 bit  Router's Server ID IP address (bits 1-32)
728 16 bit  Router's Server ID port (bits 33-48)
729 16 bit  Random number
730 
731 o Router's Server ID IP address - Indicates the IP address of 
732   the router of the cell where this channel is created.  This is 
733   taken from the router's Server ID.  This way SILC router knows 
734   where this channel resides in the SILC network.
735 
736 o Router's Server ID port - Indicates the port of the channel on 
737   the server.  This is taken from the router's Server ID.
738 
739 o Random number - To further randomize the Channel ID.  This makes
740   sure that there are no collisions.  This also means that
741   in a cell there can be 2^16 channels.
742 .in 3
743 
744 
745 .ti 0
746 3.5 Operators
747 
748 Operators are normal users with extra privileges to their server or
749 router.  Usually these people are SILC server and router administrators
750 that take care of their own server and clients on them.  The purpose of
751 operators is to administrate the SILC server or router.  However, even
752 an operator with highest privileges is not able to enter invite-only
753 channel, to gain access to the contents of a encrypted and authenticated
754 packets traveling in the SILC network or to gain channel operator
755 privileges on public channels without being promoted.  They have the
756 same privileges as everyone else except they are able to administrate
757 their server or router.
758 
759 
760 .ti 0
761 3.6 SILC Commands
762 
763 Commands are very important part on SILC network especially for client
764 which uses commands to operate on the SILC network.  Commands are used
765 to set nickname, join to channel, change modes and many other things.
766 
767 Client usually sends the commands and server replies by sending a reply
768 packet to the command.  Server may also send commands usually to serve
769 the original client's request.  However, server may not send command
770 to client and there are some commands that server must not send.  Server
771 is also able to send the forwarded command packets.  For example, 
772 SILC_COMMAND_JOIN is always forwarded packet.  See [SILC2] for more
773 about packet forwarding.
774 
775 Note that the command reply is usually sent only after client has sent
776 the command request but server is allowed to send command reply packet
777 to client even if client has not requested the command.  Client may,
778 however, choose not to accept the command reply, but there are some
779 command replies that the client should accept.  Example of a such
780 command reply is reply to SILC_COMMAND_CMODE command that the server
781 uses to distribute the channel mode on all clients on the channel
782 when the mode has changed.
783 
784 It is expected that some of the commands may be miss-used by clients
785 resulting various problems on the server side.  Every implementation
786 should assure that commands may not be executed more than once, say,
787 in two (2) seconds.  This should be sufficient to prevent the miss-use
788 of commands.
789 
790 SILC commands are described in section 5 SILC Commands.
791 
792 
793 .ti 0
794 3.7 SILC Packets
795 
796 Packets are naturally the most important part of the protocol and the
797 packets are what actually makes the protocol.  Packets in SILC network
798 are always encrypted using, usually, the shared secret session key
799 or some other key, for example, channel key, when encrypting channel
800 messages.  The SILC Packet Protocol is a wide protocol and is described
801 in [SILC2].  This document does not define or describe details of
802 SILC packets.
803 
804 
805 
806 
807 .ti 0
808 3.8 Packet Encryption
809 
810 All packets passed in SILC network must be encrypted.  This section
811 defines how packets must be encrypted in the SILC network.  The detailed
812 description of the actual encryption process of the packets are
813 described in [SILC2].
814 
815 Client and its server shares secret symmetric session key which is
816 established by the SILC Key Exchange Protocol, described in [SILC3]. 
817 Every packet sent from client to server, with exception of packets for
818 channels, are encrypted with this session key.
819 
820 Channels has their own key that are shared by every client on the channel.
821 However, the channel keys are cell specific thus one cell does not know
822 the channel key of the other cell, even if that key is for same channel.
823 Channel key is also known by the routers and all servers that has clients
824 on the channel.  However, channels may have channel private keys that
825 are entirely local setting for client.  All clients on the channel must
826 know the channel private key before hand to be able to talk on the
827 channel.  In this case, no server or router knows the key for channel.
828 
829 Server shares secret symmetric session key with router which is
830 established by the SILC Key Exchange Protocol.  Every packet passed from
831 server to router, with exception of packets for channels, are encrypted
832 with the shared session key.  Same way, router server shares secret
833 symmetric key with its primary route.  However, every packet passed
834 from router to other router, including packets for channels, are
835 encrypted with the shared session key.  Every router connection has
836 their own session keys.
837 
838 
839 .ti 0
840 3.8.1 Determination of the Source and the Destination
841 
842 The source and the destination of the packet needs to be determined
843 to be able to route the packets to correct receiver.  This information
844 is available in the SILC Packet Header which is included in all packets
845 sent in SILC network.  The SILC Packet Header is described in [SILC2].
846 
847 The header is always encrypted with the session key who is next receiver
848 of the packet along the route.  The receiver of the packet, for example
849 a router along the route, is able to determine the sender and the
850 destination of the packet by decrypting the SILC Packet Header and
851 checking the ID's attached to the header.  The ID's in the header will
852 tell to where the packet needs to be sent and where it is coming from.
853 
854 The header in the packet does not change during the routing of the
855 packet.  The original sender, for example client, assembles the packet
856 and the packet header and server or router between the sender and the
857 receiver must not change the packet header.
858 
859 Note that the packet and the packet header may be encrypted with
860 different keys.  For example, packets to channels are encrypted with
861 the channel key, however, the header is encrypted with the session key
862 as described above.  However, the header and the packet may be encrypted
863 with same key.  This is case, for example, with command packets.
864 
865 
866 .ti 0
867 3.8.2 Client To Client
868 
869 Process of message delivery and encryption from client to another
870 client is as follows.
871 
872 Example:  Private message from client to another client on different
873           servers.  Clients do not share private message delivery
874           keys; normal session keys are used.
875 
876 o Client 1. sends encrypted packet to its server.  The packet is
877   encrypted with the session key shared between client and its
878   server.
879 
880 o Server determines the destination of the packet and decrypts
881   the packet.  Server encrypts the packet with session key shared
882   between the server and its router, and sends the packet to the
883   router.
884 
885 o Router determines the destination of the packet and decrypts
886   the packet.  Router encrypts the packet with session key 
887   shared between the router and the destination server, and sends
888   the packet to the server.
889 
890 o Server determines the client to which the packet is destined
891   to and decrypts the packet.  Server encrypts the packet with
892   session key shared between the server and the destination client,
893   and sends the packet to the client.
894 
895 o Client 2. decrypts the packet.
896 
897 
898 Example:  Private message from client to another client on different
899           servers.  Clients has established secret shared private
900           message delivery key with each other and that is used in 
901           the message encryption.
902 
903 o Client 1. sends encrypted packet to its server.  The packet is
904   encrypted with the private message delivery key shared between
905   clients.
906 
907 o Server determines the destination of the packet and sends the 
908   packet to the router.
909 
910 o Router determines the destination of the packet and sends the
911   packet to the server.
912 
913 o Server determines the client to which the packet is destined
914   to and sends the packet to the client.
915 
916 o Client 2. decrypts the packet with the secret shared key.
917 
918 
919 If clients share secret key with each other the private message
920 delivery is much simpler since servers and routers between the
921 clients do not need to decrypt and re-encrypt the packet.
922 
923 The process for clients on same server is much simpler as there are
924 no need to send the packet to the router.  The process for clients 
925 on different cells is same as above except that the packet is routed 
926 outside the cell.  The router of the destination cell routes the 
927 packet to the destination same way as described above.
928 
929 
930 .ti 0
931 3.8.3 Client To Channel
932 
933 Process of message delivery from client on channel to all the clients
934 on the channel.
935 
936 Example:  Channel of four users; two on same server, other two on
937           different cells.  Client sends message to the channel.
938 
939 o Client 1. encrypts the packet with channel key and sends the
940   packet to its server.
941 
942 o Server determines local clients on the channel and sends the
943   packet to the Client on the same server.  Server then sends
944   the packet to its router for further routing.
945 
946 o Router determines local clients on the channel, if found
947   sends packet to the local clients.  Router determines global
948   clients on the channel and sends the packet to its primary
949   router or fastest route.
950 
951 o (Other router(s) do the same thing and sends the packet to
952    the server(s))
953 
954 o Server determines local clients on the channel and sends the
955   packet to the client.
956 
957 o All clients receiving the packet decrypts the packet.
958 
959 
960 .ti 0
961 3.8.4 Server To Server
962 
963 Server to server packet delivery and encryption is described in above
964 examples. Router to router packet delivery is analogous to server to
965 server.  However, some packets, such as channel packets, are processed
966 differently.  These cases are described later in this document and
967 more in detail in [SILC2].
968 
969 
970 .ti 0
971 3.9 Key Exchange And Authentication
972 
973 Key exchange is done always when for example client connects to server
974 but also when server and router and router and router connects to each
975 other.  The purpose of key exchange protocol is to provide secure key
976 material to be used in the communication.  The key material is used to
977 derive various security parameters used to secure SILC packets.  The
978 SILC Key Exchange protocol is described in detail in [SILC3].
979 
980 Authentication is done after key exchange protocol has been successfully
981 completed.  The purpose of authentication is to authenticate for example
982 client connecting to the server.  However, Usually clients are accepted
983 to connect to server without explicit authentication.  Servers are
984 required use authentication protocol when connecting.  The authentication
985 may be based on passphrase (pre-shared-secret) or public key.  The
986 connection authentication protocol is described in detail in [SILC3].
987 
988 
989 .ti 0
990 3.10 Algorithms
991 
992 This section defines all the allowed algorithms that can be used in
993 the SILC protocol.  This includes mandatory cipher, mandatory public
994 key algorithm and MAC algorithms.
995 
996 
997 .ti 0
998 3.10.1 Ciphers
999 
1000 Cipher is the encryption algorithm that is used to protect the data
1001 in the SILC packets.  See [SILC2] of the actual encryption process and
1002 definition of how it must be done.  SILC has a mandatory algorithm that
1003 must be supported in order to be compliant with this protocol.
1004 
1005 
1006 
1007 
1008 
1009 
1010 Following ciphers are defined in SILC protocol:
1011 
1012 .in 6
1013 blowfish-cbc    Blowfish in CBC mode  (mandatory)
1014 twofish-cbc     Twofish in CBC mode   (optional)
1015 rc6-cbc         RC6 in CBC mode       (optional)
1016 rc5-cbc         RC5 in CBC mode       (optional)
1017 mars-cbc        Mars in CBC mode      (optional)
1018 none            No encryption         (optional)
1019 .in 3
1020 
1021 
1022 All algorithms must use minimum of 128 bit key, by default.  Several
1023 algorithms, however, supports longer keys and it is recommended to use
1024 longer keys if they are available.
1025 
1026 Algorithm none does not perform any encryption process at all and 
1027 thus is not recommended to be used.  It is recommended that no client
1028 or server implementation would accept none algorithms except in special
1029 debugging mode.
1030 
1031 Additional ciphers may be defined to be used in SILC by using the
1032 same name format as above.
1033 
1034 
1035 .ti 0
1036 3.10.2 Public Key Algorithms
1037 
1038 Public keys are used in SILC to authenticate entities in SILC network
1039 and to perform other tasks related to public key cryptography.  The 
1040 public keys are also used in the SILC Key Exchange protocol [SILC3].
1041 
1042 Following public key algorithms are defined in SILC protocol:
1043 
1044 .in 6
1045 rsa        RSA  (mandatory)
1046 dss        DSS  (optional)
1047 .in 3
1048 
1049 Both of the algorithms are described in [Scheneir] and [Menezes].
1050 
1051 Additional public key algorithms may be defined to be used in SILC.
1052 
1053 
1054 .ti 0
1055 3.10.3 MAC Algorithms
1056 
1057 Data integrity is protected by computing a message authentication code
1058 (MAC) of the packet data.  See [SILC2] for details how to compute the
1059 MAC.
1060 
1061 
1062 
1063 
1064 
1065 Following MAC algorithms are defined in SILC protocol:
1066 
1067 .in 6
1068 hmac-sha1        HMAC-SHA1, length = 20  (mandatory)
1069 hmac-md5         HMAC-MD5, length = 16   (optional)
1070 none             No MAC                  (optional)
1071 .in 3
1072 
1073 The none MAC is not recommended to be used as the packet is not
1074 authenticated when MAC is not computed.  It is recommended that no
1075 client or server would accept none MAC except in special debugging
1076 mode.
1077 
1078 The HMAC algorithm is described in [HMAC] and hash algorithms that
1079 are used as part of the HMACs are described in [Scheneir] and in
1080 [Menezes]
1081 
1082 Additional MAC algorithms may be defined to be used in SILC.
1083 
1084 
1085 .ti 0
1086 3.10.4 Compression Algorithms
1087 
1088 SILC protocol supports compression that may be applied to unencrypted
1089 data.  It is recommended to use compression on slow links as it may
1090 significantly speed up the data transmission.  By default, SILC does not
1091 use compression which is the mode that must be supported by all SILC
1092 implementations.
1093 
1094 Following compression algorithms are defined:
1095 
1096 .in 6
1097 none        No compression               (mandatory)
1098 zlib        GBU ZLIB (LZ77) compression  (optional)
1099 .in 3
1100 
1101 Additional compression algorithms may be defined to be used in SILC.
1102 
1103 
1104 .ti 0
1105 3.11 SILC Public Key
1106 
1107 This section defines the type and format of the SILC public key.  All
1108 implementations must support this public key type.  See [SILC3] for
1109 other optional public key and certificate types allowed in SILC
1110 protocol.  Public keys in SILC may be used to authenticate entities
1111 and to perform other tasks related to public key cryptography.
1112 
1113 The format of the SILC Public Key is as follows:
1114 
1115 
1116 
1117 
1118 
1119 
1120 
1121 .in 5
1122 .nf
1123                      1                   2                   3
1124  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
1125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1126 |                        Public Key Length                      |
1127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1128 |     Algorithm Name Length     |                               |
1129 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+