8 .ds RF FORMFEED[Page %]
11 .ds RH 25 November 2002
17 Network Working Group P. Riikonen
19 draft-riikonen-silc-spec-06.txt 25 November 2002
20 Expires: 25 April 2003
25 Secure Internet Live Conferencing (SILC),
26 Protocol Specification
27 <draft-riikonen-silc-spec-06.txt>
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.
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."
43 The list of current Internet-Drafts can be accessed at
44 http://www.ietf.org/ietf/1id-abstracts.txt
46 The list of Internet-Draft Shadow Directories can be accessed at
47 http://www.ietf.org/shadow.html
49 The distribution of this memo is unlimited.
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 the SILC network.
60 Three other Internet Drafts relates very closely to this memo;
61 SILC Packet Protocol [SILC2], SILC Key Exchange and Authentication
62 Protocols [SILC3] and SILC Commands [SILC4].
73 1 Introduction .................................................. 3
74 1.1 Requirements Terminology .................................. 4
75 2 SILC Concepts ................................................. 4
76 2.1 SILC Network Topology ..................................... 4
77 2.2 Communication Inside a Cell ............................... 6
78 2.3 Communication in the Network .............................. 6
79 2.4 Channel Communication ..................................... 7
80 2.5 Router Connections ........................................ 8
81 3 SILC Specification ............................................ 8
82 3.1 Client .................................................... 9
83 3.1.1 Client ID ........................................... 9
84 3.2 Server .................................................... 10
85 3.2.1 Server's Local ID List .............................. 10
86 3.2.2 Server ID ........................................... 11
87 3.2.3 SILC Server Ports ................................... 12
88 3.3 Router .................................................... 12
89 3.3.1 Router's Local ID List .............................. 13
90 3.3.2 Router's Global ID List ............................. 13
91 3.3.3 Router's Server ID .................................. 14
92 3.4 Channels .................................................. 14
93 3.4.1 Channel ID .......................................... 15
94 3.5 Operators ................................................. 16
95 3.6 SILC Commands ............................................. 16
96 3.7 SILC Packets .............................................. 17
97 3.8 Packet Encryption ......................................... 17
98 3.8.1 Determination of the Source and the Destination ..... 18
99 3.8.2 Client To Client .................................... 18
100 3.8.3 Client To Channel ................................... 20
101 3.8.4 Server To Server .................................... 20
102 3.9 Key Exchange And Authentication ........................... 20
103 3.9.1 Authentication Payload .............................. 21
104 3.10 Algorithms ............................................... 23
105 3.10.1 Ciphers ............................................ 23
106 3.10.1.1 CBC Mode .................................. 24
107 3.10.1.2 CTR Mode .................................. 24
108 3.10.1.3 Randomized CBC Mode ....................... 25
109 3.10.2 Public Key Algorithms .............................. 26
110 3.10.3 Hash Functions ..................................... 26
111 3.10.4 MAC Algorithms ..................................... 27
112 3.10.5 Compression Algorithms ............................. 27
113 3.11 SILC Public Key .......................................... 28
114 3.12 SILC Version Detection ................................... 30
115 3.13 Backup Routers ........................................... 31
116 3.13.1 Switching to Backup Router ......................... 32
117 3.13.2 Resuming Primary Router ............................ 33
118 3.13.3 Discussion on Backup Router Scheme ................. 36
119 4 SILC Procedures ............................................... 36
120 4.1 Creating Client Connection ................................ 36
121 4.2 Creating Server Connection ................................ 38
122 4.2.1 Announcing Clients, Channels and Servers ............ 38
123 4.3 Joining to a Channel ...................................... 39
124 4.4 Channel Key Generation .................................... 41
125 4.5 Private Message Sending and Reception ..................... 41
126 4.6 Private Message Key Generation ............................ 42
127 4.7 Channel Message Sending and Reception ..................... 43
128 4.8 Session Key Regeneration .................................. 43
129 4.9 Command Sending and Reception ............................. 44
130 4.10 Closing Connection ....................................... 45
131 4.11 Detaching and Resuming a Session ......................... 45
132 5 Security Considerations ....................................... 47
133 6 References .................................................... 48
134 7 Author's Address .............................................. 49
142 Figure 1: SILC Network Topology
143 Figure 2: Communication Inside cell
144 Figure 3: Communication Between Cells
145 Figure 4: Router Connections
146 Figure 5: SILC Public Key
147 Figure 6: Counter Block
153 This document describes a Secure Internet Live Conferencing (SILC)
154 protocol which provides secure conferencing services over insecure
155 network channel. SILC is IRC [IRC] like protocol, however, it is
156 not equivalent to IRC and does not support IRC. Some of the SILC's
157 features are not found in IRC but in traditional Instant Message (IM)
158 protocols. SILC combines features from both of these chat protocol
159 styles, and SILC can be implemented as either IRC-like system or
162 Strong cryptographic methods are used to protect SILC packets inside
163 the SILC network. Three other Internet Drafts relates very closely
164 to this memo; SILC Packet Protocol [SILC2], SILC Key Exchange and
165 Authentication Protocols [SILC3] and SILC Commands [SILC4].
167 The protocol uses extensively packets as conferencing protocol
168 requires message and command sending. The SILC Packet Protocol is
169 described in [SILC2] and should be read to fully comprehend this
170 document and protocol. [SILC2] also describes the packet encryption
171 and decryption in detail. The SILC Packet Protocol provides secured
172 and authenticated packets, and the protocol is designed to be compact.
173 This makes SILC also suitable in environment of low bandwidth
174 requirements such as mobile networks. All packet payloads in SILC
175 can be also compressed.
177 The security of SILC protocol, and for any security protocol for that
178 matter, is based on strong and secure key exchange protocol. The SILC
179 Key Exchange protocol is described in [SILC3] along with connection
180 authentication protocol and should be read to fully comprehend this
181 document and protocol.
183 The SILC protocol has been developed to work on TCP/IP network
184 protocol, although it could be made to work on other network protocols
185 with only minor changes. However, it is recommended that TCP/IP
186 protocol is used under SILC protocol. Typical implementation would
187 be made in client-server model.
191 1.1 Requirements Terminology
193 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
194 MAY, and OPTIONAL, when they appear in this document, are to be
195 interpreted as described in [RFC2119].
201 This section describes various SILC protocol concepts that forms the
202 actual protocol, and in the end, the actual SILC network. The mission
203 of the protocol is to deliver messages from clients to other clients
204 through routers and servers in secure manner. The messages may also
205 be delivered from one client to many clients forming a group, also
208 This section does not focus to security issues. Instead, basic network
209 concepts are introduced to make the topology of the SILC network
214 2.1 SILC Network Topology
216 SILC network forms a ring as opposed to tree style network topology that
217 conferencing protocols usually have. The network has a cells which are
218 constructed from router and zero or more servers. The servers are
219 connected to the router in a star like network topology. Routers in the
220 network are connected to each other forming a ring. The rationale for
221 this is to have servers that can perform specific kind of tasks what
222 other servers cannot perform. This leads to two kinds of servers; normal
223 SILC servers and SILC routers.
225 A difference between normal server and router server is that routers
226 knows everything about everything in the network. They also do the
227 actual routing of the messages to the correct receiver. Normal servers
228 knows only about local information and nothing about global information.
229 This makes the network faster as there are less servers that needs to
230 keep global information up to date at all time.
232 This, on the other hand, leads to kind of a cellular like network, where
233 routers are in the center of the cell and servers are connected to the
237 The following diagram represents SILC network topology.
241 ---- ---- ---- ---- ---- ----
242 | S8 | S5 | S4 | | S7 | S5 | S6 |
243 ----- ---- ----- ----- ---- -----
244 | S7 | S/R1 | S2 | --- | S8 | S/R2 | S4 |
245 ---- ------ ---- ---- ------ ----
246 | S6 | S3 | S1 | | S1 | S3 | S2 | ---- ----
247 ---- ---- ---- ---- ---- ---- | S3 | S1 |
248 Cell 1. \\ Cell 2. | \\____ ----- -----
250 ---- ---- ---- ---- ---- ---- ---- ------
251 | S7 | S4 | S2 | | S1 | S3 | S2 | | S2 | S5 |
252 ----- ---- ----- ----- ---- ----- ---- ----
253 | S6 | S/R3 | S1 | --- | S4 | S/R5 | S5 | ____/ Cell 4.
254 ---- ------ ---- ---- ------ ----
255 | S8 | S5 | S3 | | S6 | S7 | S8 | ... etc ...
256 ---- ---- ---- ---- ---- ----
261 Figure 1: SILC Network Topology
264 A cell is formed when a server or servers connect to one router. In
265 SILC network normal server cannot directly connect to other normal
266 server. Normal server may only connect to SILC router which then
267 routes the messages to the other servers in the cell. Router servers
268 on the other hand may connect to other routers to form the actual SILC
269 network, as seen in above figure. However, router is also normal SILC
270 server; clients may connect to it the same way as to normal SILC
271 server. Normal server also cannot have active connections to more
272 than one router. Normal server cannot be connected to two different
273 cells. Router servers, on the other hand, may have as many router to
274 router connections as needed.
276 There are many issues in this network topology that needs to be careful
277 about. Issues like the size of the cells, the number of the routers in
278 the SILC network and the capacity requirements of the routers. These
279 issues should be discussed in the Internet Community and additional
280 documents on the issue may be written.
284 2.2 Communication Inside a Cell
286 It is always guaranteed that inside a cell message is delivered to the
287 recipient with at most two server hops. A client which is connected to
288 server in the cell and is talking on channel to other client connected
289 to other server in the same cell, will have its messages delivered from
290 its local server first to the router of the cell, and from the router
291 to the other server in the cell.
293 The following diagram represents this scenario:
307 Figure 2: Communication Inside cell
310 Example: Client 1. connected to Server 1. send message to
311 Client 4. connected to Server 2. travels from Server 1.
312 first to Router which routes the message to Server 2.
313 which then sends it to the Client 4. All the other
314 servers in the cell will not see the routed message.
317 If the client is connected directly to the router, as router is also normal
318 SILC server, the messages inside the cell are always delivered only with
319 one server hop. If clients communicating with each other are connected
320 to the same server, no router interaction is needed. This is the optimal
321 situation of message delivery in the SILC network.
325 2.3 Communication in the Network
327 If the message is destined to server that does not belong to local cell
328 the message is routed to the router server to which the destination
329 server belongs, if the local router is connected to destination router.
330 If there is no direct connection to the destination router, the local
331 router routes the message to its primary route. The following diagram
332 represents message sending between cells.
340 1 --- S1 S4 --- 5 S2 --- 1
341 S/R - - - - - - - - S/R
351 Figure 3: Communication Between Cells
354 Example: Client 5. connected to Server 4. in Cell 1. sends message
355 to Client 2. connected to Server 1. in Cell 2. travels
356 from Server 4. to Router which routes the message to
357 Router in Cell 2, which then routes the message to
358 Server 1. All the other servers and routers in the
359 network will not see the routed message.
362 The optimal case of message delivery from the client point of view is
363 when clients are connected directly to the routers and the messages
364 are delivered from one router to the other.
368 2.4 Channel Communication
370 Messages may be sent to group of clients as well. Sending messages to
371 many clients works the same way as sending messages point to point, from
372 message delivery point of view. Security issues are another matter
373 which are not discussed in this section.
375 Router server handles the message routing to multiple recipients. If
376 any recipient is not in the same cell as the sender the messages are
379 Server distributes the channel message to its local clients which are
380 joined to the channel. Router also distributes the message to its
381 local clients on the channel.
386 2.5 Router Connections
388 Router connections play very important role in making the SILC like
389 network topology to work. For example, sending broadcast packets in
390 SILC network require special connections between routers; routers must
391 be connected in a specific way.
393 Every router has their primary route which is a connection to another
394 router in the network. Unless there is only two routers in the network
395 must not routers use each other as their primary routes. The router
396 connections in the network must form a ring.
398 Example with three routers in the network:
403 S/R1 - < - < - < - < - < - < - S/R2
406 \\ - > - > - S/R3 - > - > - /
411 Figure 4: Router Connections
414 Example: Network with three routers. Router 1. uses Router 2. as its
415 primary router. Router 2. uses Router 3. as its primary router,
416 and Router 3. uses Router 1. as its primary router. There may
417 be other direct connections between the routers but they must
418 not be used as primary routes.
420 The above example is applicable to any amount of routers in the network
421 except for two routers. If there are only two routers in the network both
422 routers must be able to handle situation where they use each other as their
425 The issue of router connections are very important especially with SILC
426 broadcast packets. Usually all router wide information in the network is
427 distributed by SILC broadcast packets. This sort of ring network, with
428 ability to have other direct routes in the network cause interesting
429 routing problems. The [SILC2] discusses the routing of packets in this
430 sort of network in more detail.
434 3. SILC Specification
436 This section describes the SILC protocol. However, [SILC2] and
437 [SILC3] describes other important protocols that are part of this SILC
438 specification and must be read.
444 A client is a piece of software connecting to SILC server. SILC client
445 cannot be SILC server. Purpose of clients is to provide the user
446 interface of the SILC services for end user. Clients are distinguished
447 from other clients by unique Client ID. Client ID is a 128 bit ID that
448 is used in the communication in the SILC network. The client ID is
449 based on the nickname selected by the user. User uses logical nicknames
450 in communication which are then mapped to the corresponding Client ID.
451 Client ID's are low level identifications and should not be seen by the
454 Clients provide other information about the end user as well. Information
455 such as the nickname of the user, username and the host name of the end
456 user and user's real name. See section 3.2 Server for information of
457 the requirements of keeping this information.
459 The nickname selected by the user is not unique in the SILC network.
460 There can be 2^8 same nicknames for one IP address. As for comparison to
461 IRC [IRC] where nicknames are unique this is a fundamental difference
462 between SILC and IRC. This typically causes the server names or client's
463 host names to be used along with the nicknames on user interface to
464 identify specific users when sending messages. This feature of SILC
465 makes IRC style nickname-wars obsolete as no one owns their nickname;
466 there can always be someone else with the same nickname. The maximum
467 length of nickname is 128 bytes.
473 Client ID is used to identify users in the SILC network. The Client ID
474 is unique to the extent that there can be 2^128 different Client ID's,
475 and ID's based on IPv6 addresses extends this to 2^224 different Client
476 ID's. Collisions are not expected to happen. The Client ID is defined
482 128 bit Client ID based on IPv4 addresses:
484 32 bit Server ID IP address (bits 1-32)
485 8 bit Random number or counter
486 88 bit Truncated MD5 hash value of the nickname
488 224 bit Client ID based on IPv6 addresses:
490 128 bit Server ID IP address (bits 1-128)
491 8 bit Random number or counter
492 88 bit Truncated MD5 hash value of the nickname
494 o Server ID IP address - Indicates the server where this
495 client is coming from. The IP address hence equals the
496 server IP address where to the client has connected.
498 o Random number or counter - Random number to further
499 randomize the Client ID. Another choice is to use
500 a counter starting from the zero (0). This makes it
501 possible to have 2^8 same nicknames from the same
504 o MD5 hash - MD5 hash value of the lowercase nickname is
505 truncated taking 88 bits from the start of the hash value.
506 This hash value is used to search the user's Client ID
507 from the ID lists. Note that the nickname MUST be in
511 Collisions could occur when more than 2^8 clients using same nickname
512 from the same server IP address is connected to the SILC network.
513 Server MUST be able to handle this situation by refusing to accept
514 anymore of that nickname.
516 Another possible collision may happen with the truncated hash value of
517 the nickname. It could be possible to have same truncated hash value for
518 two different nicknames. However, this is not expected to happen nor
519 cause any problems if it would occur. Nicknames are usually logical and
520 it is unlikely to have two distinct logical nicknames produce same
521 truncated hash value.
527 Servers are the most important parts of the SILC network. They form the
528 basis of the SILC, providing a point to which clients may connect to.
529 There are two kinds of servers in SILC; normal servers and router servers.
530 This section focus on the normal server and router server is described
531 in the section 3.3 Router.
533 Normal servers MUST NOT directly connect to other normal server. Normal
534 servers may only directly connect to router server. If the message sent
535 by the client is destined outside the local server it is always sent to
536 the router server for further routing. Server may only have one active
537 connection to router on same port. Normal server MUST NOT connect to other
538 cell's router except in situations where its cell's router is unavailable.
542 3.2.1 Server's Local ID List
544 Normal server keeps various information about the clients and their end
545 users connected to it. Every normal server MUST keep list of all locally
546 connected clients, Client ID's, nicknames, usernames and host names and
547 user's real name. Normal servers only keeps local information and it
548 does not keep any global information. Hence, normal servers knows only
549 about their locally connected clients. This makes servers efficient as
550 they don't have to worry about global clients. Server is also responsible
551 of creating the Client ID's for their clients.
553 Normal server also keeps information about locally created channels and
557 Hence, local list for normal server includes:
560 server list - Router connection
568 client list - All clients in server
578 channel list - All channels in server
581 o Client ID's on channel
582 o Client ID modes on channel
590 Servers are distinguished from other servers by unique 64 bit Server ID
591 (for IPv4) or 160 bit Server ID (for IPv6). The Server ID is used in
592 the SILC to route messages to correct servers. Server ID's also provide
593 information for Client ID's, see section 3.1.1 Client ID. Server ID is
597 64 bit Server ID based on IPv4 addresses:
599 32 bit IP address of the server
603 160 bit Server ID based on IPv6 addresses:
605 128 bit IP address of the server
609 o IP address of the server - This is the real IP address of
612 o Port - This is the port the server is bound to.
614 o Random number - This is used to further randomize the Server ID.
617 Collisions are not expected to happen in any conditions. The Server ID
618 is always created by the server itself and server is responsible of
619 distributing it to the router.
623 3.2.3 SILC Server Ports
625 The following ports has been assigned by IANA for the SILC protocol:
633 If there are needs to create new SILC networks in the future the port
634 numbers must be officially assigned by the IANA.
636 Server on network above privileged ports (>1023) SHOULD NOT be trusted
637 as they could have been set up by untrusted party.
643 Router server in SILC network is responsible for keeping the cell together
644 and routing messages to other servers and to other routers. Router server
645 is also a normal server thus clients may connect to it as it would be
646 just normal SILC server.
648 However, router servers has a lot of important tasks that normal servers
649 do not have. Router server knows everything about everything in the SILC.
650 They know all clients currently on SILC, all servers and routers and all
651 channels in SILC. Routers are the only servers in SILC that care about
652 global information and keeping them up to date at all time. And, this
653 is what they must do.
657 3.3.1 Router's Local ID List
659 Router server as well MUST keep local list of connected clients and
660 locally created channels. However, this list is extended to include all
661 the informations of the entire cell, not just the server itself as for
664 However, on router this list is a lot smaller since routers do not need
665 to keep information about user's nickname, username and host name and real
666 name since these are not needed by the router. The router keeps only
667 information that it needs.
670 Hence, local list for router includes:
673 server list - All servers in the cell
680 client list - All clients in the cell
684 channel list - All channels in the cell
686 o Client ID's on channel
687 o Client ID modes on channel
692 Note that locally connected clients and other information include all the
693 same information as defined in section section 3.2.1 Server's Local ID
698 3.3.2 Router's Global ID List
700 Router server MUST also keep global list. Normal servers do not have
701 global list as they know only about local information. Global list
702 includes all the clients on SILC, their Client ID's, all created channels
703 and their Channel ID's and all servers and routers on SILC and their
704 Server ID's. That is said, global list is for global information and the
705 list must not include the local information already on the router's local
708 Note that the global list does not include information like nicknames,
709 usernames and host names or user's real names. Router does not need to
710 keep these informations as they are not needed by the router. This
711 information is available from the client's server which maybe queried
714 Hence, global list includes:
717 server list - All servers in SILC
722 client list - All clients in SILC
725 channel list - All channels in SILC
727 o Client ID's on channel
728 o Client ID modes on channel
734 3.3.3 Router's Server ID
736 Router's Server ID's are equivalent to normal Server ID's. As routers
737 are normal servers as well same types of ID's applies for routers as well.
738 Thus, see section 3.2.2 Server ID.
744 A channel is a named group of one or more clients which will all receive
745 messages addressed to that channel. The channel is created when first
746 client requests JOIN command to the channel, and the channel ceases to
747 exist when the last client has left it. When channel exists, any client
748 can reference it using the name of the channel. If the channel has
749 a founder mode set and last client leaves the channel the channel does
750 not cease to exist. The founder mode can be used to make permanent
751 channels in the network. The founder of the channel can regain the
752 channel founder privileges on the channel later when he joins the
755 Channel names are unique although the real uniqueness comes from 64 bit
756 Channel ID. However, channel names are still unique and no two global
757 channels with same name may exist. The channel name is a string of
758 maximum length of 256 bytes. Channel names MUST NOT contain any
759 whitespaces (` '), any non-printable ASCII characters, commas (`,')
760 and wildcard characters.
762 Channels can have operators that can administrate the channel and
763 operate all of its modes. The following operators on channel exist on
767 o Channel founder - When channel is created the joining client becomes
768 channel founder. Channel founder is channel operator with some more
769 privileges. Basically, channel founder can fully operate the channel
770 and all of its modes. The privileges are limited only to the
771 particular channel. There can be only one channel founder per
772 channel. Channel founder supersedes channel operator's privileges.
774 Channel founder privileges cannot be removed by any other operator on
775 channel. When channel founder leaves the channel there is no channel
776 founder on the channel. However, it is possible to set a mode for
777 the channel which allows the original channel founder to regain the
778 founder privileges even after leaving the channel. Channel founder
779 also cannot be removed by force from the channel.
781 o Channel operator - When client joins to channel that has not existed
782 previously it will become automatically channel operator (and channel
783 founder discussed above). Channel operator is able administrate the
784 channel, set some modes on channel, remove a badly behaving client
785 from the channel and promote other clients to become channel
786 operator. The privileges are limited only to the particular channel.
788 Normal channel user may be promoted (opped) to channel operator
789 gaining channel operator privileges. Channel founder or other
790 channel operator may also demote (deop) channel operator to normal
798 Channels are distinguished from other channels by unique Channel ID.
799 The Channel ID is a 64 bit ID (for IPv4) or 160 bit ID (for IPv6), and
800 collisions are not expected to happen in any conditions. Channel names
801 are just for logical use of channels. The Channel ID is created by the
802 server where the channel is created. The Channel ID is defined as
806 64 bit Channel ID based on IPv4 addresses:
808 32 bit Router's Server ID IP address (bits 1-32)
809 16 bit Router's Server ID port (bits 33-48)
812 160 bit Channel ID based on IPv6 addresses:
814 128 bit Router's Server ID IP address (bits 1-128)
815 16 bit Router's Server ID port (bits 129-144)
818 o Router's Server ID IP address - Indicates the IP address of
819 the router of the cell where this channel is created. This is
820 taken from the router's Server ID. This way SILC router knows
821 where this channel resides in the SILC network.
823 o Router's Server ID port - Indicates the port of the channel on
824 the server. This is taken from the router's Server ID.
826 o Random number - To further randomize the Channel ID. This makes
827 sure that there are no collisions. This also means that
828 in a cell there can be 2^16 channels.
835 Operators are normal users with extra privileges to their server or
836 router. Usually these people are SILC server and router administrators
837 that take care of their own server and clients on them. The purpose of
838 operators is to administrate the SILC server or router. However, even
839 an operator with highest privileges is not able to enter invite-only
840 channel, to gain access to the contents of a encrypted and authenticated
841 packets traveling in the SILC network or to gain channel operator
842 privileges on public channels without being promoted. They have the
843 same privileges as everyone else except they are able to administrate
844 their server or router.
850 Commands are very important part on SILC network especially for client
851 which uses commands to operate on the SILC network. Commands are used
852 to set nickname, join to channel, change modes and many other things.
854 Client usually sends the commands and server replies by sending a reply
855 packet to the command. Server MAY also send commands usually to serve
856 the original client's request. Usually server cannot send commands to
857 clients, however there MAY be commands that allow the server to send
858 commands to client. By default servers MAY send commands only to other
861 Note that the command reply is usually sent only after client has sent
862 the command request but server is allowed to send command reply packet
863 to client even if client has not requested the command. Client MAY
864 choose to ignore the command reply.
866 It is expected that some of the commands may be miss-used by clients
867 resulting various problems on the server side. Every implementation
868 SHOULD assure that commands may not be executed more than once, say,
869 in two (2) seconds. However, to keep response rate up, allowing for
870 example five (5) commands before limiting is allowed. It is RECOMMENDED
871 that commands such as SILC_COMMAND_NICK, SILC_COMMAND_JOIN,
872 SILC_COMMAND_LEAVE and SILC_COMMAND_KILL SHOULD be limited in all cases
873 as they require heavy operations. This should be sufficient to prevent
874 the miss-use of commands.
876 SILC commands are described in [SILC4].
882 Packets are naturally the most important part of the protocol and the
883 packets are what actually makes the protocol. Packets in SILC network
884 are always encrypted using, usually the shared secret session key
885 or some other key, for example, channel key, when encrypting channel
886 messages. It is not possible to send packet in SILC network without
887 encryption. The SILC Packet Protocol is a wide protocol and is described
888 in [SILC2]. This document does not define or describe details of
893 3.8 Packet Encryption
895 All packets passed in SILC network MUST be encrypted. This section
896 defines how packets must be encrypted in the SILC network. The detailed
897 description of the actual encryption process of the packets are
898 described in [SILC2].
900 Client and its server shares secret symmetric session key which is
901 established by the SILC Key Exchange Protocol, described in [SILC3].
902 Every packet sent from client to server, with exception of packets for
903 channels, are encrypted with this session key.
905 Channels has a channel key that are shared by every client on the channel.
906 However, the channel keys are cell specific thus one cell does not know
907 the channel key of the other cell, even if that key is for same channel.
908 Channel key is also known by the routers and all servers that has clients
909 on the channel. However, channels MAY have channel private keys that
910 are entirely local setting for the client. All clients on the channel
911 MUST know the channel private key before hand to be able to talk on the
912 channel. In this case, no server or router know the key for channel.
914 Server shares secret symmetric session key with router which is
915 established by the SILC Key Exchange Protocol. Every packet passed from
916 server to router, with exception of packets for channels, are encrypted
917 with the shared session key. Same way, router server shares secret
918 symmetric key with its primary route. However, every packet passed
919 from router to other router, including packets for channels, are
920 encrypted with the shared session key. Every router connection has
921 their own session keys.
925 3.8.1 Determination of the Source and the Destination
927 The source and the destination of the packet needs to be determined
928 to be able to route the packets to correct receiver. This information
929 is available in the SILC Packet Header which is included in all packets
930 sent in SILC network. The SILC Packet Header is described in [SILC2].
932 The header MUST be encrypted with the session key who is next receiver
933 of the packet along the route. The receiver of the packet, for example
934 a router along the route, is able to determine the sender and the
935 destination of the packet by decrypting the SILC Packet Header and
936 checking the ID's attached to the header. The ID's in the header will
937 tell to where the packet needs to be sent and where it is coming from.
939 The header in the packet MUST NOT change during the routing of the
940 packet. The original sender, for example client, assembles the packet
941 and the packet header and server or router between the sender and the
942 receiver MUST NOT change the packet header. Note however, that some
943 packets such as commands may be resent by a server to serve the client's
944 original command. In this case the command packet sent by the server
945 includes the server's IDs.
947 Note that the packet and the packet header may be encrypted with
948 different keys. For example, packets to channels are encrypted with
949 the channel key, however, the header is encrypted with the session key
950 as described above. However, the header and the packet may be encrypted
951 with same key. This is the case, for example, with command packets.
955 3.8.2 Client To Client
957 The process of message delivery and encryption from client to another
958 client is as follows.
960 Example: Private message from client to another client on different
961 servers. Clients do not share private message delivery
962 keys; normal session keys are used.
964 o Client 1. sends encrypted packet to its server. The packet is
965 encrypted with the session key shared between client and its
968 o Server determines the destination of the packet and decrypts
969 the packet. Server encrypts the packet with session key shared
970 between the server and its router, and sends the packet to the
973 o Router determines the destination of the packet and decrypts
974 the packet. Router encrypts the packet with session key
975 shared between the router and the destination server, and sends
976 the packet to the server.
978 o Server determines the client to which the packet is destined
979 to and decrypts the packet. Server encrypts the packet with
980 session key shared between the server and the destination client,
981 and sends the packet to the client.
983 o Client 2. decrypts the packet.
986 Example: Private message from client to another client on different
987 servers. Clients has established secret shared private
988 message delivery key with each other and that is used in
989 the message encryption.
991 o Client 1. sends encrypted packet to its server. The packet header
992 is encrypted with the session key shared between the client and
993 server, and the private message is encrypted with the private
994 message delivery key shared between clients.
996 o Server determines the destination of the packet and sends the
997 packet to the router.
999 o Router determines the destination of the packet and sends the
1000 packet to the server.
1002 o Server determines the client to which the packet is destined
1003 to and sends the packet to the client.
1005 o Client 2. decrypts the packet with the secret shared key.
1008 If clients share secret key with each other the private message
1009 delivery is much simpler since servers and routers between the
1010 clients do not need to decrypt and re-encrypt the packet.
1012 The process for clients on same server is much simpler as there are
1013 no need to send the packet to the router. The process for clients
1014 on different cells is same as above except that the packet is routed
1015 outside the cell. The router of the destination cell routes the
1016 packet to the destination same way as described above.
1020 3.8.3 Client To Channel
1022 Process of message delivery from client on channel to all the clients
1025 Example: Channel of four users; two on same server, other two on
1026 different cells. Client sends message to the channel.
1028 o Client 1. encrypts the packet with channel key and sends the
1029 packet to its server.
1031 o Server determines local clients on the channel and sends the
1032 packet to the Client on the same server. Server then sends
1033 the packet to its router for further routing.
1035 o Router determines local clients on the channel, if found
1036 sends packet to the local clients. Router determines global
1037 clients on the channel and sends the packet to its primary
1038 router or fastest route.
1040 o (Other router(s) do the same thing and sends the packet to
1043 o Server determines local clients on the channel and sends the
1044 packet to the client.
1046 o All clients receiving the packet decrypts it.
1050 3.8.4 Server To Server
1052 Server to server packet delivery and encryption is described in above
1053 examples. Router to router packet delivery is analogous to server to
1054 server. However, some packets, such as channel packets, are processed
1055 differently. These cases are described later in this document and
1056 more in detail in [SILC2].
1060 3.9 Key Exchange And Authentication
1062 Key exchange is done always when for example client connects to server
1063 but also when server and router, and router and router connects to each
1064 other. The purpose of key exchange protocol is to provide secure key
1065 material to be used in the communication. The key material is used to
1066 derive various security parameters used to secure SILC packets. The
1067 SILC Key Exchange protocol is described in detail in [SILC3].
1069 Authentication is done after key exchange protocol has been successfully
1070 completed. The purpose of authentication is to authenticate for example
1071 client connecting to the server. However, clients may be accepted
1072 to connect to server without explicit authentication. Servers are
1073 required to use authentication protocol when connecting. The
1074 authentication may be based on passphrase (pre-shared-secret) or public
1075 key based on digital signatures. All passphrases sent in SILC protocol
1076 MUST be UTF-8 [RFC2279] encoded. The connection authentication protocol
1077 is described in detail in [SILC3].
1081 3.9.1 Authentication Payload
1083 Authentication payload is used separately from the SKE and the Connection
1084 Authentication protocol. It can be used during the session to authenticate
1085 with the remote. For example, the client can authenticate itself to the
1086 server to become server operator. In this case, Authentication Payload is
1089 The format of the Authentication Payload is as follows:
1094 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
1095 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1096 | Payload Length | Authentication Method |
1097 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1098 | Public Data Length | |
1099 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1103 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1104 | Authentication Data Length | |
1105 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1107 ~ Authentication Data ~
1109 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1113 Figure 5: Authentication Payload
1117 o Payload Length (2 bytes) - Length of the entire payload.
1119 o Authentication Method (2 bytes) - The method of the
1120 authentication. The authentication methods are defined
1121 in [SILC2] in the Connection Auth Request Payload. The NONE
1122 authentication method SHOULD NOT be used.
1124 o Public Data Length (2 bytes) - Indicates the length of
1125 the Public Data field.
1127 o Public Data (variable length) - This is defined only if
1128 the authentication method is public key. If it is any other
1129 this field MAY include a random data for padding purposes.
1130 However, in this case the field MUST be ignored by the
1133 When the authentication method is public key this includes
1134 128 to 4096 bytes of non-zero random data that is used in
1135 the signature process, described subsequently.
1137 o Authentication Data Length (2 bytes) - Indicates the
1138 length of the Authentication Data field. If zero (0)
1139 value is found in this field the payload MUST be
1142 o Authentication Data (variable length) - Authentication
1143 method dependent authentication data.
1147 If the authentication method is password based, the Authentication
1148 Data field includes the plaintext UTF-8 encoded password. It is safe
1149 to send plaintext password since the entire payload is encrypted. In
1150 this case the Public Data Length is set to zero (0), but MAY also include
1151 random data for padding purposes. It is also RECOMMENDED that maximum
1152 amount of padding is applied to SILC packet when using password based
1153 authentication. This way it is not possible to approximate the length
1154 of the password from the encrypted packet.
1156 If the authentication method is public key based (or certificate)
1157 the Authentication Data is computed as follows:
1159 HASH = hash(random bytes | ID | public key (or certificate));
1160 Authentication Data = sign(HASH);
1162 The hash() and the sign() are the hash function and the public key
1163 cryptography function selected in the SKE protocol, unless otherwise
1164 stated in the context where this payload is used. The public key
1165 is SILC style public key unless certificates are used. The ID is the
1166 entity's ID (Client or Server ID) which is authenticating itself. The
1167 ID encoding is described in [SILC2]. The random bytes are non-zero
1168 random bytes of length between 128 and 4096 bytes, and will be included
1169 into the Public Data field as is.
1171 The receiver will compute the signature using the random data received
1172 in the payload, the ID associated to the connection and the public key
1173 (or certificate) received in the SKE protocol. After computing the
1174 receiver MUST verify the signature. In case of public key authentication
1175 also this payload is encrypted.
1181 This section defines all the allowed algorithms that can be used in
1182 the SILC protocol. This includes mandatory cipher, mandatory public
1183 key algorithm and MAC algorithms.
1189 Cipher is the encryption algorithm that is used to protect the data
1190 in the SILC packets. See [SILC2] of the actual encryption process and
1191 definition of how it must be done. SILC has a mandatory algorithm that
1192 must be supported in order to be compliant with this protocol.
1194 The following ciphers are defined in SILC protocol:
1196 aes-256-cbc AES in CBC mode, 256 bit key (REQUIRED)
1197 aes-256-ctr AES in CTR mode, 256 bit key (RECOMMENDED)
1198 aes-256-rcbc AES in randomized CBC mode, 256 bit key (OPTIONAL)
1199 aes-192-<mode> AES in <mode> mode, 192 bit key (OPTIONAL)
1200 aes-128-<mode> AES in <mode> mode, 128 bit key (RECOMMENDED)
1201 twofish-256-<mode> Twofish in <mode> mode, 256 bit key (OPTIONAL)
1202 twofish-192-<mode> Twofish in <mode> mode, 192 bit key (OPTIONAL)
1203 twofish-128-<mode> Twofish in <mode> mode, 128 bit key (OPTIONAL)
1204 cast-256-<mode> CAST-256 in <mode> mode, 256 bit key (OPTIONAL)
1205 cast-192-<mode> CAST-256 in <mode> mode, 192 bit key (OPTIONAL)
1206 cast-128-<mode> CAST-256 in <mode> mode, 128 bit key (OPTIONAL)
1207 serpent-<len>-<mode> Serpent in <mode> mode, <len> bit key (OPTIONAL)
1208 rc6-<len>-<mode> RC6 in <mode> mode, <len> bit key (OPTIONAL)
1209 mars-<len>-<mode> MARS in <mode> mode, <len> bit key (OPTIONAL)
1210 none No encryption (OPTIONAL)
1212 The <mode> is either "cbc", "ctr" or "rcbc". Other encryption modes MAY
1213 be defined as to be used in SILC using the same format. The <len> is
1214 either 256, 192 or 128 bit key length. Also, additional ciphers MAY be
1215 defined to be used in SILC by using the same name format as above.
1217 Algorithm "none" does not perform any encryption process at all and
1218 thus is not recommended to be used. It is recommended that no client
1219 or server implementation would accept none algorithm except in special
1226 The "cbc" encryption mode is CBC mode with inter-packet chaining. This
1227 means that the Initial Vector (IV) for the next encryption block is
1228 the previous ciphertext block. The very first IV MUST be random and is
1229 generated as described in [SILC3].
1235 The "ctr" encryption mode is CTR mode. The CTR mode in SILC is stateful
1236 in encryption and decryption. Both sender and receiver maintain the
1237 counter for the CTR mode and thus can precompute the key stream for
1238 encryption and decryption. By default, CTR mode does not require
1239 plaintext padding, however implementations MAY apply padding to the
1240 packets. If the last key block is larger than the last plaintext block
1241 the resulted value is truncated to the size of the plaintext block and
1242 the most significant bits are used. When sending authentication data
1243 inside packets the maximum amount of padding SHOULD be applied with
1246 In CTR mode only the encryption operation of the cipher is used. The
1247 decryption operation is not needed since both encryption and decryption
1248 process is simple XOR with the plaintext block and the key stream block.
1250 The counter block is used to create the key for the CTR mode. When
1251 SILC specifications refer to Initial Vector (IV) in general cases, in
1252 case of CTR mode it refers to the counter block. The format of the
1253 128 bit counter block is as follows:
1258 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
1259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1260 | Truncated HASH from SKE |
1261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1262 | Sending/Receiving IV from SKE |
1264 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1266 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1270 Figure 6: Counter Block
1273 o Truncated HASH from SKE (4 bytes) - This value is the first 4
1274 bytes from the HASH value that was computed as a result of SKE
1275 protocol. This acts as session identifier and each rekey MUST
1276 produce a new HASH value.
1278 o Sending/Receiving IV from SKE (8 bytes) - This value is the
1279 first 8 bytes from the Sending IV or Receiving IV generated in
1280 the SKE protocol. When this mode is used to encrypt sending
1281 traffic the Sending IV is used, when used to decrypt receiving
1282 traffic the Receiving IV is used. This assures that two parties
1283 of the protocol use different IV for sending traffic. Each rekey
1284 MUST produce a new value.
1286 o Block Counter (4 bytes) - This is the counter value for the
1287 counter block and is MSB ordered number starting from one (1)
1288 value for first block and incrementing for subsequent blocks.
1289 The same value MUST NOT be used twice. The rekey MUST be
1290 performed before this counter value wraps.
1293 CTR mode MUST NOT be used with "none" MAC. Implementations also MUST
1294 assure that the same counter block is not used to encrypt more than
1295 one block. Also, the key material used with CTR mode MUST be fresh
1296 key material. Static keys (pre-shared keys) MUST NOT be used with
1297 CTR mode. For this reason using CTR mode to encrypt for example
1298 channel messages or private messages with a pre-shared key is
1299 inappropriate. For private messages, the Key Agreement could be
1300 performed to produce fresh key material.
1302 If the IV Included flag was negotiated in SKE, implementations SHOULD
1303 still use the same counter block format as defined above. However,
1304 implementations are RECOMMENDED to replace the Truncated HASH field
1305 with a 32 bit random value for each IV (counter block) per encrypted
1306 SILC packet. Also note, that in this case the decryption process is
1307 not stateful and receiver cannot precompute the key stream.
1311 3.10.1.3 Randomized CBC Mode
1313 The "rcbc" encryption mode is CBC mode with randomized IV. This means
1314 that each IV for each packet MUST be chosen randomly. When encrypting
1315 more than one block the normal inter-packet chaining is used, but for
1316 the first block new random IV is selected in each packet. In this mode
1317 the IV is appended at the end of the last ciphertext block and thus
1318 delivered to the recipient. This mode increases the ciphertext size by
1319 one ciphertext block. Note also that some data payloads in SILC are
1320 capable of delivering the IV to the recipient. When explicitly
1321 encrypting these payloads with randomized CBC the IV MUST NOT be appended
1322 at the end of the ciphertext. When encrypting these payloads with
1323 "cbc" mode they implicitly become randomized CBC since the IV is
1324 usually selected random and included in the ciphertext. In these
1325 cases using either CBC or randomized CBC is actually equivalent.
1329 3.10.2 Public Key Algorithms
1331 Public keys are used in SILC to authenticate entities in SILC network
1332 and to perform other tasks related to public key cryptography. The
1333 public keys are also used in the SILC Key Exchange protocol [SILC3].
1335 The following public key algorithms are defined in SILC protocol:
1342 DSS is described in [Menezes]. The RSA MUST be implemented according
1343 PKCS #1 [PKCS1]. The mandatory PKCS #1 implementation in SILC MUST be
1344 compliant to either PKCS #1 version 1.5 or newer with the following
1345 notes: The signature encoding is always in same format as the encryption
1346 encoding regardless of the PKCS #1 version. The signature with appendix
1347 (with hash algorithm OID in the data) MUST NOT be used in the SILC. The
1348 rationale for this is that there is no binding between the PKCS #1 OIDs
1349 and the hash algorithms used in the SILC protocol. Hence, the encoding
1350 is always in PKCS #1 version 1.5 format.
1352 Additional public key algorithms MAY be defined to be used in SILC.
1354 When signatures are computed in SILC the computing of the signature is
1355 represented as sign(). The signature computing procedure is dependent
1356 of the public key algorithm, and the public key or certificate encoding.
1357 When using SILC public key the signature is computed as described in
1358 previous paragraph for RSA and DSS keys. If the hash function is not
1359 specified separately for signing process sha1 MUST be used. When using
1360 SSH2 public keys the signature is computed as described in [SSH-TRANS].
1361 When using X.509 version 3 certificates the signature is computed as
1362 described in [PKCS7]. When using OpenPGP certificates the signature is
1363 computed as described in [PGP].
1367 3.10.3 Hash Functions
1369 Hash functions are used as part of MAC algorithms defined in the next
1370 section. They are also used in the SILC Key Exchange protocol defined
1373 The following Hash algorithm are defined in SILC protocol:
1376 sha1 SHA-1, length = 20 (REQUIRED)
1377 md5 MD5, length = 16 (RECOMMENDED)
1383 3.10.4 MAC Algorithms
1385 Data integrity is protected by computing a message authentication code
1386 (MAC) of the packet data. See [SILC2] for details how to compute the
1389 The following MAC algorithms are defined in SILC protocol:
1392 hmac-sha1-96 HMAC-SHA1, length = 12 bytes (REQUIRED)
1393 hmac-md5-96 HMAC-MD5, length = 12 bytes (OPTIONAL)
1394 hmac-sha1 HMAC-SHA1, length = 20 bytes (OPTIONAL)
1395 hmac-md5 HMAC-MD5, length = 16 bytes (OPTIONAL)
1396 none No MAC (OPTIONAL)
1399 The "none" MAC is not recommended to be used as the packet is not
1400 authenticated when MAC is not computed. It is recommended that no
1401 client or server would accept none MAC except in special debugging
1404 The HMAC algorithm is described in [HMAC] and hash algorithms that
1405 are used as part of the HMACs are described in [Scheneir] and in
1408 Additional MAC algorithms MAY be defined to be used in SILC.
1412 3.10.5 Compression Algorithms
1414 SILC protocol supports compression that may be applied to unencrypted
1415 data. It is recommended to use compression on slow links as it may
1416 significantly speed up the data transmission. By default, SILC does not
1417 use compression which is the mode that must be supported by all SILC
1420 The following compression algorithms are defined:
1423 none No compression (REQUIRED)
1424 zlib GNU ZLIB (LZ77) compression (OPTIONAL)
1427 Additional compression algorithms MAY be defined to be used in SILC.
1432 3.11 SILC Public Key
1434 This section defines the type and format of the SILC public key. All
1435 implementations MUST support this public key type. See [SILC3] for
1436 other optional public key and certificate types allowed in the SILC
1437 protocol. Public keys in SILC may be used to authenticate entities
1438 and to perform other tasks related to public key cryptography.
1440 The format of the SILC Public Key is as follows:
1446 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
1447 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1448 | Public Key Length |
1449 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1450 | Algorithm Name Length | |
1451 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1455 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1456 | Identifier Length | |
1457 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1461 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1465 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1469 Figure 5: SILC Public Key
1473 o Public Key Length (4 bytes) - Indicates the full length
1474 of the public key, not including this field.
1476 o Algorithm Name Length (2 bytes) - Indicates the length
1477 of the Algorithm Length field, not including this field.
1479 o Algorithm name (variable length) - Indicates the name
1480 of the public key algorithm that the key is. See the
1481 section 3.10.2 Public Key Algorithms for defined names.
1483 o Identifier Length (2 bytes) - Indicates the length of
1484 the Identifier field, not including this field.
1486 o Identifier (variable length) - Indicates the identifier
1487 of the public key. This data can be used to identify
1488 the owner of the key. The identifier is of the following
1492 HN Host name or IP address
1499 Examples of an identifier:
1501 `UN=priikone, HN=poseidon.pspt.fi, E=priikone@poseidon.pspt.fi'
1503 `UN=sam, HN=dummy.fi, RN=Sammy Sam, O=Company XYZ, C=Finland'
1505 At least user name (UN) and host name (HN) MUST be provided as
1506 identifier. The fields are separated by commas (`,'). If
1507 comma is in the identifier string it must be written as `\\,',
1508 for example, `O=Company XYZ\\, Inc.'.
1510 o Public Data (variable length) - Includes the actual
1511 public data of the public key.
1513 The format of this field for RSA algorithm is
1522 The format of this field for DSS algorithm is
1534 The variable length fields are multiple precession
1535 integers encoded as strings in both examples.
1537 Other algorithms must define their own type of this
1538 field if they are used.
1541 All fields in the public key are in MSB (most significant byte first)
1542 order. All strings in the public key are UTF-8 encoded.
1544 If an external protocol need to refer to SILC Public Key by name, the
1545 name "silc-rsa" and "silc-dss" for SILC Public Key based on RSA algorithm
1546 and SILC Public Key based on DSS algorithm, respectively, are to be used.
1547 However, this SILC specification does not use these names directly, and
1548 they are defined here for external protocols (protocols that may like
1549 to use SILC Public Key).
1553 3.12 SILC Version Detection
1555 The version detection of both client and server is performed at the
1556 connection phase while executing the SILC Key Exchange protocol. The
1557 version identifier is exchanged between initiator and responder. The
1558 version identifier is of the following format:
1561 SILC-<protocol version>-<software version>
1564 The version strings are of the following format:
1567 protocol version = <major>.<minor>
1568 software version = <major>[.<minor>[.<build or vendor string>]]
1571 Protocol version MUST provide both major and minor version. Currently
1572 implementations MUST set the protocol version and accept at least the
1573 protocol version as SILC-1.2-<software version>. If new protocol version
1574 causes incompatibilities with older version the <minor> version number
1575 MUST be incremented. The <major> is incremented if new protocol version
1576 is fully incompatible.
1578 Software version MAY provide major, minor and build (vendor) version.
1579 The software version MAY be freely set and accepted. The version string
1580 MUST consist of printable US-ASCII characters.
1582 Thus, the version strings could be, for example:
1587 SILC-1.2-1.0.VendorXYZ
1588 SILC-1.2-2.4.5 Vendor Limited
1595 Backup routers may exist in the cell in addition of the primary router.
1596 However, they must not be active routers and act as routers in the cell.
1597 Only one router may be acting as primary router in the cell. In the case
1598 of failure of the primary router may one of the backup routers become
1599 active. The purpose of backup routers are in case of failure of the
1600 primary router to maintain working connections inside the cell and outside
1601 the cell and to avoid netsplits.
1603 Backup routers are normal servers in the cell that are prepared to take
1604 over the tasks of the primary router if needed. They need to have at
1605 least one direct and active connection to the primary router of the cell.
1606 This communication channel is used to send the router information to
1607 the backup router. When the backup router connects to the primary router
1608 of the cell it MUST present itself as router server in the Connection
1609 Authentication protocol, even though it is normal server as long as the
1610 primary router is available. Reason for this is that the configuration
1611 needed in the responder end requires usually router connection level
1612 configuration. The responder, however must understand and treat the
1613 connection as normal server (except when feeding router level data to
1616 Backup router must know everything that the primary router knows to be
1617 able to take over the tasks of the primary router. It is the primary
1618 router's responsibility to feed the data to the backup router. If the
1619 backup router does not know all the data in the case of failure some
1620 connections may be lost. The primary router of the cell must consider
1621 the backup router being actual router server when it feeds the data to
1624 In addition of having direct connection to the primary router of the
1625 cell, the backup router must also have connection to the same router
1626 the primary router of the cell is connected. However, it must not be
1627 active router connection meaning that the backup router must not use
1628 that channel as its primary route and it must not notify the router
1629 about having connected servers, channels and clients behind it. It
1630 merely connects to the router. This sort of connection is later
1631 referred as being passive connection. Some keepalive actions may be
1632 needed by the router to keep the connection alive.
1634 It is required that other normal servers have passive connections to
1635 the backup router(s) in the cell. Some keepalive actions may be needed
1636 by the server to keep the connection alive. After they notice the
1637 failure of the primary router they must start using the connection to
1638 the first backup router as their primary route.
1640 Also, if any other router in the network is using the cell's primary
1641 router as its own primary router, it must also have passive connection
1642 to the cell's backup router. It too is prepared to switch to use the
1643 backup router as its new primary router as soon as the original primary
1644 router becomes unresponsive.
1646 All of the parties of this protocol knows which one is the backup router
1647 of the cell from their local configuration. Each of the entity must
1648 be configured accordingly and care must be taken when configuring the
1649 backup routers, servers and other routers in the network.
1651 It must be noted that some of the channel messages and private messages
1652 may be lost during the switch to the backup router. The announcements
1653 assures that the state of the network is not lost during the switch.
1655 It is RECOMMENDED that there would be at least one backup router in
1656 the cell. It is NOT RECOMMENDED to have all servers in the cell acting
1657 as backup routers as it requires establishing several connections to
1658 several servers in the cell. Large cells can easily have several
1659 backup routers in the cell.
1661 The order of the backup routers are decided at the configuration phase.
1662 All the parties of this protocol must be configured accordingly to
1663 understand the order of the backup routers. It is not required that
1664 the backup server is actually active server in the cell. Backup router
1665 may be a spare server in the cell that does not accept normal client
1666 connections at all. It may be reserved purely for the backup purposes.
1667 These, however, are cell management issues.
1669 If also the first backup router is down as well and there is another
1670 backup router in the cell then it will start acting as the primary
1671 router as described above.
1675 3.13.1 Switching to Backup Router
1677 When the primary router of the cell becomes unresponsive, for example
1678 by sending EOF to the connection, all the parties of this protocol MUST
1679 replace the old connection to the primary router with first configured
1680 backup router. The backup router usually needs to do local modifications
1681 to its database in order to update all the information needed to maintain
1682 working routes. The backup router must understand that clients that
1683 were originated from the primary router are now originated from some of
1684 the existing server connections and must update them accordingly. It
1685 must also remove those clients that were owned by the primary router
1686 since those connections were lost when the primary router became
1689 All the other parties of the protocol must also update their local
1690 database to understand that the route to the primary router will now go
1691 to the backup router.
1693 Servers connected to the backup router MUST send SILC_PACKET_RESUME_ROUTER
1694 packet with type number 21, to indicate that the server will start using
1695 the backup router as primary router. The backup router MUST NOT allow
1696 this action if it detects that primary is still up and running. If
1697 backup router knows that primary is up and running it MUST send type
1698 number 22 back to the server. The server then MUST NOT use the backup
1699 as primary router, but must try to establish connection back to the
1700 primary router. If the action is allowed type number 21 is sent back
1701 to the server from the backup router.
1703 The servers connected to the backup router must then announce their
1704 clients, channels, channel users, channel user modes and channel modes
1705 to the backup router. This is to assure that none of the important notify
1706 packets were lost during the switch to the backup router. The backup
1707 router must check which of these announced entities it already have
1708 and distribute the new ones to the primary route.
1710 The backup router too must announce its servers, clients, channels
1711 and other information to the new primary router. The primary router
1712 of the backup router too must announce its informations to the backup
1713 router. Both must process only the ones they do not know about. If
1714 any of the announced modes does not match then they are enforced in
1715 normal manner defined later in this specification.
1719 3.13.2 Resuming Primary Router
1721 Usually the primary router is unresponsive only a short period of time
1722 and it is intended that the original router of the cell will resume
1723 its position as primary router when it comes back online. The backup
1724 router that is now acting as primary router of the cell must constantly
1725 try to connect to the original primary router of the cell. It is
1726 RECOMMENDED that it would try to reconnect in 30 second intervals to
1729 When the connection is established to the primary router the backup
1730 resuming protocol is executed. The protocol is advanced as follows:
1732 1. Backup router sends SILC_PACKET_RESUME_ROUTER packet with type
1733 value 1 the primary router that came back online. The packet
1734 will indicate the primary router has been replaced by the backup
1735 router. After sending the packet the backup router will announce
1736 all of its channels, channel users, modes etc. to the primary
1739 If the primary knows that it has not been replaced (for example
1740 the backup itself disconnected from the primary router and thinks
1741 that it is now primary in the cell) the primary router send
1742 SILC_PACKET_FAILURE with the type value 1 back to the backup
1743 router. If backup receives this it MUST NOT continue with the
1744 backup resuming protocol.
1746 2. Backup router sends SILC_PACKET_RESUME_ROUTER packet with type
1747 value 2 to its current primary router to indicate that it will
1748 resign as being primary router. Then, backup router sends the
1749 SILC_PACKET_RESUME_ROUTER packet with type value 1 to all
1750 connected servers to also indicate that it will resign as being
1753 3. Backup router also send SILC_PACKET_RESUME_ROUTER packet with
1754 type value 2 to the router that is using the backup router
1755 currently as its primary router.
1757 4. Any server and router that receives the SILC_PACKET_RESUME_ROUTER
1758 with type value 1 or 2 must reconnect immediately to the
1759 primary router of the cell that came back online. After they
1760 have created the connection they MUST NOT use that connection
1761 as active primary route but still route all packets to the
1762 backup router. After the connection is created they MUST send
1763 SILC_PACKET_RESUME_ROUTER with type value 3 back to the
1764 backup router. The session ID value found in the first packet
1765 MUST be set in this packet.
1767 5. Backup router MUST wait for all packets with type value 3 before
1768 it continues with the protocol. It knows from the session ID values
1769 set in the packet when it have received all packets. The session
1770 value should be different in all packets it have sent earlier.
1771 After the packets is received the backup router sends the
1772 SILC_PACKET_RESUME_ROUTER packet with type value 4 to the
1773 primary router that came back online. This packet will indicate
1774 that the backup router is now ready to resign as being primary
1775 router. The session ID value in this packet MUST be the same as
1776 in first packet sent to the primary router. During this time
1777 the backup router must still route all packets it is receiving
1778 from server connections.
1780 6. The primary router receives the packet and send the
1781 SILC_PACKET_RESUME_ROUTER with type value 5 to all connected servers
1782 including the backup router. It also sends the packet with type
1783 value 6 to its primary router, and to the router that is using
1784 it as its primary router. The Session ID value in this packet
1787 7. Any server and router that receives the SILC_PACKET_RESUME_ROUTER
1788 with type value 5 or 6 must switch their primary route to the
1789 new primary router and remove the route for the backup router, since
1790 it is not anymore the primary router of the cell. They must also
1791 update their local database to understand that the clients are
1792 not originated from the backup router but from the locally connected
1793 servers. After that they MUST announce their channels, channel
1794 users, modes etc. to the primary router. They must not use the
1795 backup router connection after this and the connection is considered
1796 to be passive connection. The implementations SHOULD be able
1797 to disable the connection without closing the actual link.
1799 After this protocol is executed the backup router is now again normal
1800 server in the cell that has the backup link to the primary router. The
1801 primary router feeds the router specific data again to the backup router.
1802 All server connections in the backup router are considered passive
1805 When the primary router of the cell comes back online and connects
1806 to its primary router, the remote primary router must send the
1807 SILC_PACKET_RESUME_ROUTER with type value 20 indicating that the
1808 connection is not allowed since the router has been replaced by an
1809 backup router. The session ID value in this packet SHOULD be zero (0).
1810 When the router receives this packet it must not use the connection
1811 as active connection but to understand that it cannot act as primary
1812 router in the cell. It must wait that the backup router connects to
1813 it, and the backup resuming protocol is executed.
1815 The following type values has been defined for SILC_PACKET_RESUME_ROUTER
1818 1 SILC_SERVER_BACKUP_START
1819 2 SILC_SERVER_BACKUP_START_GLOBAL
1820 3 SILC_SERVER_BACKUP_START_CONNECTED
1821 4 SILC_SERVER_BACKUP_START_ENDING
1822 5 SILC_SERVER_BACKUP_START_RESUMED
1823 6 SILC_SERVER_BACKUP_START_RESUMED_GLOBAL
1824 20 SILC_SERVER_BACKUP_START_REPLACED
1825 21 SILC_SERVER_BACKUP_START_USE
1826 22 SILC_SERVER_BACKUP_START_USE_DENIED
1828 If any other value is found in the type field the packet must be
1829 discarded. The SILC_PACKET_RESUME_ROUTER packet and its payload
1830 is defined in [SILC2].
1836 3.13.3 Discussion on Backup Router Scheme
1838 It is clear that this backup router support is not able to handle all
1839 possible situations arising in unreliable network environment. This
1840 scheme for example does not handle situation when the router actually
1841 does not go offline but the network link goes down temporarily. It would
1842 require some intelligence to figure out when it is best time to switch
1843 to the backup router. To make it even more complicated it is possible
1844 that the backup router may have not lost the network link to the primary
1847 Other possible situation is when the network link is lost temporarily
1848 between two primary routers in the SILC network. Unless the routers
1849 notice the link going down they cannot perhaps find alternative routes.
1850 Worst situation is when the link goes down only for a short period of
1851 time, thus causing lag. Should the routers or servers find alternative
1852 routes if they cannot get response from the router during the lag?
1853 When alternative routes are being found it must be careful not to
1854 mess up existing primary routes between routers in the network.
1856 It is suggested that the current backup router scheme is only temporary
1857 solution and existing backup router protocols are studied further. It
1858 is also suggested that the backup router specification will be separated
1859 from this SILC specification Internet-Draft and additional specification
1860 is written on the subject.
1866 This section describes various SILC procedures such as how the
1867 connections are created and registered, how channels are created and
1868 so on. The section describes the procedures only generally as details
1869 are described in [SILC2] and [SILC3].
1873 4.1 Creating Client Connection
1875 This section describes the procedure when client connects to SILC server.
1876 When client connects to server the server MUST perform IP address lookup
1877 and reverse IP address lookup to assure that the origin host really is
1878 who it claims to be. Client, host, connecting to server SHOULD have
1879 both valid IP address and fully qualified domain name (FQDN).
1881 After that the client and server performs SILC Key Exchange protocol
1882 which will provide the key material used later in the communication.
1883 The key exchange protocol MUST be completed successfully before the
1884 connection registration may continue. The SILC Key Exchange protocol
1885 is described in [SILC3].
1887 Typical server implementation would keep a list of connections that it
1888 allows to connect to the server. The implementation would check, for
1889 example, the connecting client's IP address from the connection list
1890 before the SILC Key Exchange protocol has been started. Reason for
1891 this is that if the host is not allowed to connect to the server there
1892 is no reason to perform the key exchange protocol.
1894 After successful key exchange protocol the client and server performs
1895 connection authentication protocol. The purpose of the protocol is to
1896 authenticate the client connecting to the server. Flexible
1897 implementation could also accept the client to connect to the server
1898 without explicit authentication. However, if authentication is
1899 desired for a specific client it may be based on passphrase or
1900 public key authentication. If authentication fails the connection
1901 MUST be terminated. The connection authentication protocol is described
1904 After successful key exchange and authentication protocol the client
1905 registers itself by sending SILC_PACKET_NEW_CLIENT packet to the
1906 server. This packet includes various information about the client
1907 that the server uses to create the client. Server creates the client
1908 and sends SILC_PACKET_NEW_ID to the client which includes the created
1909 Client ID that the client MUST start using after that. After that
1910 all SILC packets from the client MUST have the Client ID as the
1911 Source ID in the SILC Packet Header, described in [SILC2].
1913 Client MUST also get the server's Server ID that is to be used as
1914 Destination ID in the SILC Packet Header when communicating with
1915 the server (for example when sending commands to the server). The
1916 ID may be resolved in two ways. Client can take the ID from an
1917 previously received packet from server that MUST include the ID,
1918 or to send SILC_COMMAND_INFO command and receive the Server ID as
1921 Server MAY choose not to use the information received in the
1922 SILC_PACKET_NEW_CLIENT packet. For example, if public key or
1923 certificate were used in the authentication, server MAY use those
1924 informations rather than what it received from client. This is suitable
1925 way to get the true information about client if it is available.
1927 The nickname of client is initially set to the username sent in the
1928 SILC_PACKET_NEW_CLIENT packet. User should set the nickname to more
1929 suitable by sending SILC_COMMAND_NICK command. However, this is not
1930 required as part of registration process.
1932 Server MUST also distribute the information about newly registered
1933 client to its router (or if the server is router, to all routers in
1934 the SILC network). More information about this in [SILC2].
1936 Router server MUST also check whether some client in the local cell
1937 is watching for the nickname this new client has, and send the
1938 SILC_NOTIFY_TYPE_WATCH to the watcher.
1942 4.2 Creating Server Connection
1944 This section describes the procedure when server connects to its
1945 router (or when router connects to other router, the cases are
1946 equivalent). The procedure is very much alike when client connects
1947 to the server thus it is not repeated here.
1949 One difference is that server MUST perform connection authentication
1950 protocol with proper authentication. A proper authentication is based
1951 on passphrase authentication or public key authentication based on
1954 After server and router has successfully performed the key exchange
1955 and connection authentication protocol, the server register itself
1956 to the router by sending SILC_PACKET_NEW_SERVER packet. This packet
1957 includes the server's Server ID that it has created by itself and
1958 other relevant information about the server.
1960 After router has received the SILC_PACKET_NEW_SERVER packet it
1961 distributes the information about newly registered server to all routers
1962 in the SILC network. More information about this in [SILC2].
1964 As client needed to resolve the destination ID this MUST be done by the
1965 server that connected to the router, as well. The way to resolve it is
1966 to get the ID from previously received packet. The server MAY also
1967 use SILC_COMMAND_INFO command to resolve the ID. Server MUST also start
1968 using its own Server ID as Source ID in SILC Packet Header and the
1969 router's Server ID as Destination when communicating with the router.
1973 4.2.1 Announcing Clients, Channels and Servers
1975 After server or router has connected to the remote router, and it already
1976 has connected clients and channels it MUST announce them to the router.
1977 If the server is router server, also all the local servers in the cell
1980 All clients are announced by compiling a list of ID Payloads into the
1981 SILC_PACKET_NEW_ID packet. All channels are announced by compiling a
1982 list of Channel Payloads into the SILC_PACKET_NEW_CHANNEL packet.
1983 Channels' mode and founder public key and other channel mode specific
1984 data is announced by sending SILC_NOTIFY_TYPE_CMODE_CHANGE notify list.
1985 Also, the channel users on the channels must be announced by compiling a
1986 list of Notify Payloads with the SILC_NOTIFY_TYPE_JOIN notify type into
1987 the SILC_PACKET_NOTIFY packet. The users' modes on the channel must
1988 also be announced by compiling list of Notify Payloads with the
1989 SILC_NOTIFY_TYPE_CUMODE_CHANGE notify type into the SILC_PACKET_NOTIFY
1992 The router MUST also announce the local servers by compiling list of
1993 ID Payloads into the SILC_PACKET_NEW_ID packet.
1995 Also, clients' modes (user modes in SILC) MUST be announced. This is
1996 done by compiling a list of Notify Payloads with SILC_NOTIFY_UMODE_CHANGE
1997 notify type into the SILC_PACKET_NOTIFY packet. Also, channel's topics
1998 MUST be announced by compiling a list of Notify Payloads with the
1999 SILC_NOTIFY_TOPIC_SET notify type into the SILC_PACKET_NOTIFY packet.
2001 The router which receives these lists MUST process them and broadcast
2002 the packets to its primary route. When processing the announced channels
2003 and channel users the router MUST check whether a channel exists already
2004 with the same name. If channel exists with the same name it MUST check
2005 whether the Channel ID is different. If the Channel ID is different the
2006 router MUST send the notify type SILC_NOTIFY_TYPE_CHANNEL_CHANGE to the
2007 server to force the channel ID change to the ID the router has. If the
2008 mode of the channel is different the router MUST send the notify type
2009 SILC_NOTIFY_TYPE_CMODE_CHANGE to the server to force the mode change
2010 to the mode that the router has.
2012 The router MUST also generate new channel key and distribute it to the
2013 channel. The key MUST NOT be generated if the SILC_CMODE_PRIVKEY mode
2016 If the channel has channel founder on the router the router MUST send
2017 the notify type SILC_NOTIFY_TYPE_CUMODE_CHANGE to the server to force
2018 the mode change for the channel founder on the server. The channel
2019 founder privileges MUST be removed.
2021 The router processing the channels MUST also compile a list of
2022 Notify Payloads with the SILC_NOTIFY_TYPE_JOIN notify type into the
2023 SILC_PACKET_NOTIFY and send the packet to the server. This way the
2024 server (or router) will receive the clients on the channel that
2029 4.3 Joining to a Channel
2031 This section describes the procedure when client joins to a channel.
2032 Client joins to channel by sending command SILC_COMMAND_JOIN to the
2033 server. If the receiver receiving join command is normal server the
2034 server MUST check its local list whether this channel already exists
2035 locally. This would indicate that some client connected to the server
2036 has already joined to the channel. If this is case the client is
2037 joined to the channel, new channel key is created and information about
2038 newly joined channel is sent to the router. The router is informed
2039 by sending SILC_NOTIFY_TYPE_JOIN notify type. The notify type MUST
2040 also be sent to the local clients on the channel. The new channel key
2041 is also sent to the router and to local clients on the channel.
2043 If the channel does not exist in the local list the client's command
2044 MUST be sent to the router which will then perform the actual joining
2045 procedure. When server receives the reply to the command from the
2046 router it MUST be sent to the client which sent the command originally.
2047 Server will also receive the channel key from the server that it MUST
2048 send to the client which originally requested the join command. The
2049 server MUST also save the channel key.
2051 If the receiver of the join command is router it MUST first check its
2052 local list whether anyone in the cell has already joined to the channel.
2053 If this is the case the client is joined to the channel and reply is
2054 sent to the client. If the command was sent by server the command reply
2055 is sent to the server which sent it. Then the router MUST also create
2056 new channel key and distribute it to all clients on the channel and
2057 all servers that has clients on the channel. Router MUST also send
2058 the SILC_NOTIFY_TYPE_JOIN notify type to local clients on the channel
2059 and to local servers that has clients on the channel.
2061 If the channel does not exist on the router's local list it MUST
2062 check the global list whether the channel exists at all. If it does
2063 the client is joined to the channel as described previously. If
2064 the channel does not exist the channel is created and the client
2065 is joined to the channel. The channel key is also created and
2066 distributed as previously described. The client joining to the created
2067 channel is made automatically channel founder and both channel founder
2068 and channel operator privileges is set for the client.
2070 If the router created the channel in the process, information about the
2071 new channel MUST be broadcasted to all routers. This is done by
2072 broadcasting SILC_PACKET_NEW_CHANNEL packet to the router's primary
2073 route. When the router joins the client to the channel it MUST also
2074 send information about newly joined client to all routers in the SILC
2075 network. This is done by broadcasting the SILC_NOTIFY_TYPE_JOIN notify
2076 type to the router's primary route.
2078 It is important to note that new channel key is created always when
2079 new client joins to channel, whether the channel has existed previously
2080 or not. This way the new client on the channel is not able to decrypt
2081 any of the old traffic on the channel. Client which receives the reply to
2082 the join command MUST start using the received Channel ID in the channel
2083 message communication thereafter. Client also receives the key for the
2084 channel in the command reply. Note that the channel key is never
2085 generated if the SILC_CMODE_PRIVKEY mode is set.
2089 4.4 Channel Key Generation
2091 Channel keys are created by router which creates the channel by taking
2092 enough randomness from cryptographically strong random number generator.
2093 The key is generated always when channel is created, when new client
2094 joins a channel and after the key has expired. Key could expire for
2097 The key MUST also be re-generated whenever some client leaves a channel.
2098 In this case the key is created from scratch by taking enough randomness
2099 from the random number generator. After that the key is distributed to
2100 all clients on the channel. However, channel keys are cell specific thus
2101 the key is created only on the cell where the client, which left the
2102 channel, exists. While the server or router is creating the new channel
2103 key, no other client may join to the channel. Messages that are sent
2104 while creating the new key are still processed with the old key. After
2105 server has sent the SILC_PACKET_CHANNEL_KEY packet MUST client start
2106 using the new key. If server creates the new key the server MUST also
2107 send the new key to its router. See [SILC2] on more information about
2108 how channel messages must be encrypted and decrypted when router is
2111 When client receives the SILC_PACKET_CHANNEL_KEY packet with the
2112 Channel Key Payload it MUST process the key data to create encryption
2113 and decryption key, and to create the HMAC key that is used to compute
2114 the MACs of the channel messages. The processing is as follows:
2116 channel_key = raw key data
2117 HMAC key = hash(raw key data)
2119 The raw key data is the key data received in the Channel Key Payload.
2120 The hash() function is the hash function used in the HMAC of the channel.
2121 Note that the server also MUST save the channel key.
2125 4.5 Private Message Sending and Reception
2127 Private messages are sent point to point. Client explicitly destine
2128 a private message to specific client that is delivered to only to that
2129 client. No other client may receive the private message. The receiver
2130 of the private message is destined in the SILC Packet Header as any
2131 other packet as well.
2133 If the sender of a private message does not know the receiver's Client
2134 ID, it MUST resolve it from server. There are two ways to resolve the
2135 client ID from server; it is RECOMMENDED that client implementations
2136 send SILC_COMMAND_IDENTIFY command to receive the Client ID. Client
2137 MAY also send SILC_COMMAND_WHOIS command to receive the Client ID.
2138 If the sender has received earlier a private message from the receiver
2139 it should have cached the Client ID from the SILC Packet Header.
2141 If server receives a private message packet which includes invalid
2142 destination Client ID the server MUST send SILC_NOTIFY_TYPE_ERROR
2143 notify to the client with error status indicating that such Client ID
2146 See [SILC2] for description of private message encryption and decryption
2151 4.6 Private Message Key Generation
2153 Private message MAY be protected with a key generated by the client.
2154 The key may be generated and sent to the other client by sending packet
2155 SILC_PACKET_PRIVATE_MESSAGE_KEY which travels through the network
2156 and is secured by session keys. After that the private message key
2157 is used in the private message communication between those clients.
2158 The key sent inside the payload SHOULD be randomly generated. This
2159 packet MUST NOT be used to send pre-shared keys.
2161 Other choice is to entirely use keys that are not sent through
2162 the SILC network at all. This significantly adds security. This key
2163 could be a pre-shared-key that is known by both of the clients. Both
2164 agree about using the key and starts sending packets that indicate
2165 that the private message is secured using private message key. In
2166 case of pre-shared keys (static keys) the IV used in encryption SHOULD
2169 It is also possible to negotiate fresh key material by performing
2170 Key Agreement. The SILC_PACKET_KEY_AGREEMENT packet MAY be used to
2171 negotiate the fresh key material. In this case the resulted key
2172 material is used to secure the private messages. Also, the IV used
2173 in encryption is used as defined in [SILC3], unless otherwise stated
2174 by the encryption mode used. By performing Key Agreement the clients
2175 may negotiate the cipher and HMAC to be used in the private message
2176 encryption and to negotiate additional security parameters.
2178 If the key is pre-shared key or other key material not generated by
2179 Key Agreement, then the key material SHOULD be processed as defined
2180 in [SILC3]. In the processing, however, the HASH, as defined in
2181 [SILC3] MUST be ignored. After processing the key material it is
2182 employed as defined in [SILC3]. In this case also, implementations
2183 SHOULD use the SILC protocol's mandatory cipher and HMAC in private
2188 4.7 Channel Message Sending and Reception
2190 Channel messages are delivered to group of users. The group forms a
2191 channel and all clients on the channel receives messages sent to the
2194 Channel messages are destined to channel by specifying the Channel ID
2195 as Destination ID in the SILC Packet Header. The server MUST then
2196 distribute the message to all clients on the channel by sending the
2197 channel message destined explicitly to a client on the channel.
2199 If server receives a channel message packet which includes invalid
2200 destination Channel ID the server MUST send SILC_NOTIFY_TYPE_ERROR
2201 notify to the sender with error status indicating that such Channel ID
2204 See the [SILC2] for description of channel message routing for router
2205 servers, and channel message encryption and decryption process.
2209 4.8 Session Key Regeneration
2211 Session keys MUST be regenerated periodically, say, once in an hour.
2212 The re-key process is started by sending SILC_PACKET_REKEY packet to
2213 other end, to indicate that re-key must be performed. The initiator
2214 of the connection SHOULD initiate the re-key.
2216 If perfect forward secrecy (PFS) flag was selected in the SILC Key
2217 Exchange protocol [SILC3] the re-key MUST cause new key exchange with
2218 SKE protocol. In this case the protocol is secured with the old key
2219 and the protocol results to new key material. See [SILC3] for more
2220 information. After the SILC_PACKET_REKEY packet is sent the sender
2221 will perform the SKE protocol.
2223 If PFS flag was set the resulted key material is processed as described
2224 in the section Processing the Key Material in [SILC3]. The difference
2225 with re-key in the processing is that the initial data for the hash
2226 function is just the resulted key material and not the HASH as it
2227 is not computed at all with re-key. Other than that, the key processing
2228 it equivalent to normal SKE negotiation.
2230 If PFS flag was not set, which is the default case, then re-key is done
2231 without executing SKE protocol. In this case, the new key is created by
2232 providing the current sending encryption key to the SKE protocol's key
2233 processing function. The process is described in the section Processing
2234 the Key Material in [SILC3]. The difference in the processing is that
2235 the initial data for the hash function is the current sending encryption
2236 key and not the SKE's KEY and HASH values. Other than that, the key
2237 processing is equivalent to normal SKE negotiation.
2239 After both parties has regenerated the session key, both MUST send
2240 SILC_PACKET_REKEY_DONE packet to each other. These packets are still
2241 secured with the old key. After these packets, the subsequent packets
2242 MUST be protected with the new key.
2246 4.9 Command Sending and Reception
2248 Client usually sends the commands in the SILC network. In this case
2249 the client simply sends the command packet to server and the server
2250 processes it and replies with command reply packet. See the [SILC3]
2251 for detailed description of all commands.
2253 However, if the server is not able to process the command, it is sent
2254 to the server's router. This is case for example with commands such
2255 as, SILC_COMMAND_JOIN and SILC_COMMAND_WHOIS commands. However, there
2256 are other commands as well. For example, if client sends the WHOIS
2257 command requesting specific information about some client the server must
2258 send the WHOIS command to router so that all clients in SILC network
2259 are searched. The router, on the other hand, sends the WHOIS command
2260 further to receive the exact information about the requested client.
2261 The WHOIS command travels all the way to the server which owns the client
2262 and it replies with command reply packet. Finally, the server which
2263 sent the command receives the command reply and it must be able to
2264 determine which client sent the original command. The server then
2265 sends command reply to the client. Implementations should have some
2266 kind of cache to handle, for example, WHOIS information. Servers
2267 and routers along the route could all cache the information for faster
2268 referencing in the future.
2270 The commands sent by server may be sent hop by hop until someone is able
2271 to process the command. However, it is preferred to destine the command
2272 as precisely as it is possible. In this case, other routers en route
2273 MUST route the command packet by checking the true sender and true
2274 destination of the packet. However, servers and routers MUST NOT route
2275 command reply packets to clients coming from other server. Client
2276 MUST NOT accept command reply packet originated from anyone else but
2277 from its own server.
2282 4.10 Closing Connection
2284 When remote client connection is closed the server MUST send the notify
2285 type SILC_NOTIFY_TYPE_SIGNOFF to its primary router and to all channels
2286 the client was joined. The server MUST also save the client's information
2287 for a period of time for history purposes.
2289 When remote server or router connection is closed the server or router
2290 MUST also remove all the clients that was behind the server or router
2291 from the SILC Network. The server or router MUST also send the notify
2292 type SILC_NOTIFY_TYPE_SERVER_SIGNOFF to its primary router and to all
2293 local clients that are joined on the same channels with the remote
2294 server's or router's clients.
2296 Router server MUST also check whether some client in the local cell
2297 is watching for the nickname this client has, and send the
2298 SILC_NOTIFY_TYPE_WATCH to the watcher, unless the client which left
2299 the network has the SILC_UMODE_REJECT_WATCHING user mode set.
2303 4.11 Detaching and Resuming a Session
2305 SILC protocol provides a possibility for a client to detach itself from
2306 the network without actually signing off from the network. The client
2307 connection to the server is closed but the client remains as valid client
2308 in the network. The client may then later resume its session back from
2309 any server in the network.
2311 When client wishes to detach from the network it MUST send the
2312 SILC_COMMAND_DETACH command to its server. The server then MUST set
2313 SILC_UMODE_DETACHED mode to the client and send SILC_NOTIFY_UMODE_CHANGE
2314 notify to its primary router, which will then MUST broadcast it further
2315 to other routers in the network. This user mode indicates that the
2316 client is detached from the network. Implementations MUST NOT use
2317 the SILC_UMODE_DETACHED flag to determine whether a packet can be sent
2318 to the client. All packets MUST still be sent to the client even if
2319 client is detached from the network. Only the server that originally
2320 had the active client connection is able to make the decision after it
2321 notices that the network connection is not active. In this case the
2322 default case is to discard the packet.
2324 The SILC_UMODE_DETACHED flag cannot be set by client itself directly
2325 with SILC_COMMAND_UMODE command, but only implicitly by sending the
2326 SILC_COMMAND_DETACH command. The flag also cannot be unset by the
2327 client, server or router with SILC_COMMAND_UMODE command, but only
2328 implicitly by sending and receiving the SILC_PACKET_RESUME_CLIENT
2331 When the client wishes to resume its session in the SILC Network it
2332 connects to a server in the network, which MAY also be a different
2333 from the original server, and performs normal procedures regarding
2334 creating a connection as described in section 4.1. After the SKE
2335 and the Connection Authentication protocols has been successfully
2336 completed the client MUST NOT send SILC_PACKET_NEW_CLIENT packet, but
2337 MUST send SILC_PACKET_RESUME_CLIENT packet. This packet is used to
2338 perform the resuming procedure. The packet MUST include the detached
2339 client's Client ID, which the client must know. It also includes
2340 Authentication Payload which includes signature made with the client's
2341 private key. The signature is computed as defined in the section
2342 3.9.1. Thus, the authentication method MUST be based in public key
2345 When server receives the SILC_PACKET_RESUME_CLIENT packet it MUST
2346 do the following: Server checks that the Client ID is valid client
2347 and that it has the SILC_UMODE_DETACHED mode set. Then it verifies
2348 the Authentication Payload with the detached client's public key.
2349 If it does not have the public key it retrieves it by sending
2350 SILC_COMMAND_GETKEY command to the server that has the public key from
2351 the original client connection. The server MUST NOT use the public
2352 key received in the SKE protocol for this connection. If the
2353 signature is valid the server unsets the SILC_UMODE_DETACHED flag,
2354 and sends the SILC_PACKET_RESUME_CLIENT packet to its primary router.
2355 The routers MUST broadcast the packet and unset the SILC_UMODE_DETACHED
2356 flag when the packet is received. If the server is router server it
2357 also MUST send the SILC_PACKET_RESUME_CLIENT packet to the original
2358 server whom owned the detached client.
2360 The servers and routers that receives the SILC_PACKET_RESUME_CLIENT
2361 packet MUST know whether the packet already has been received for
2362 the client. It is protocol error to attempt to resume the client
2363 session from more than one server. The implementations could set
2364 internal flag that indicates that the client is resumed. If router
2365 receive SILC_PACKET_RESUME_CLIENT packet for client that is already
2366 resumed the client MUST be killed from the network. This would
2367 indicate that the client is attempting to resume the session more
2368 than once which is protocol error. In this case the router sends
2369 SILC_NOTIFY_TYPE_KILLED to the client. All routers that detect
2370 the same situation MUST also send the notify for the client.
2372 The servers and routers that receive the SILC_PACKET_RESUME_CLIENT
2373 must also understand that the client may not be found behind the
2374 same server that it originally came from. They must update their
2375 caches according this. The server that now owns the client session
2376 MUST check whether the Client ID of the resumed client is based
2377 on the server's Server ID. If it is not it creates a new Client
2378 ID and send SILC_NOTIFY_TYPE_NICK_CHANGE to the network. It MUST
2379 also send the channel keys of all channels that the client is
2380 joined to the client since it does not have them. Whether the
2381 Client ID was changed or not the server MUST send SILC_PACKET_NEW_ID
2382 packet to the client. Only after this the client is resumed back
2383 to the network and may start sending packets and messages.
2385 It is also possible that the server does not know about the channels
2386 that the client has joined. In this case it join the client internally
2387 to the channels, generate new channel keys and distribute the keys
2388 to the channels as described in section 4.4.
2390 It is implementation issue for how long servers keep detached client
2391 sessions. It is RECOMMENDED that the detached sessions would be
2392 persistent as long as the server is running.
2396 5 Security Considerations
2398 Security is central to the design of this protocol, and these security
2399 considerations permeate the specification. Common security considerations
2400 such as keeping private keys truly private and using adequate lengths for
2401 symmetric and asymmetric keys must be followed in order to maintain the
2402 security of this protocol.
2404 Special attention must also be paid on the servers and routers that are
2405 running the SILC service. The SILC protocol's security depends greatly
2406 on the security and the integrity of the servers and administrators that
2407 are running the service. It is recommended that some form of registration
2408 is required by the server and router administrator prior acceptance to
2409 the SILC Network. Even though, the SILC protocol is secure in a network
2410 of mutual distrust between clients, servers, routers and administrators
2411 of the servers, the client should be able to trust the servers they are
2412 using if they wish to do so.
2414 It however must be noted that if the client requires absolute security
2415 by not trusting any of the servers or routers in the SILC Network, it can
2416 be accomplished by negotiating private keys outside the SILC Network,
2417 either using SKE or some other key exchange protocol, or to use some
2418 other external means for distributing the keys. This applies for all
2419 messages, private messages and channel messages.
2421 It is important to note that SILC, like any other security protocol is
2422 not full proof system; the SILC servers and routers could very well be
2423 compromised. However, to provide acceptable level of security and
2424 usability for end user the protocol use many times session keys or other
2425 keys generated by the servers to secure the messages. This is
2426 intentional design feature to allow ease of use for end user. This way
2427 the network is still usable, and remains encrypted even if the external
2428 means of distributing the keys is not working. The implementation,
2429 however, may like to not follow this design feature, and always negotiate
2430 the keys outside SILC network. This is acceptable solution and many times
2431 recommended. The implementation still must be able to work with the
2432 server generated keys.
2434 If this is unacceptable for the client or end user, the private keys
2435 negotiated outside the SILC Network should always be used. In the end
2436 it is always implementor's choice whether to negotiate private keys by
2437 default or whether to use the keys generated by the servers.
2439 It is also recommended that router operators in the SILC Network would
2440 form a joint forum to discuss the router and SILC Network management
2441 issues. Also, router operators along with the cell's server operators
2442 should have a forum to discuss the cell management issues.
2448 [SILC2] Riikonen, P., "SILC Packet Protocol", Internet Draft,
2451 [SILC3] Riikonen, P., "SILC Key Exchange and Authentication
2452 Protocols", Internet Draft, May 2002.
2454 [SILC4] Riikonen, P., "SILC Commands", Internet Draft, May 2002.
2456 [IRC] Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2459 [IRC-ARCH] Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2462 [IRC-CHAN] Kalt, C., "Internet Relay Chat: Channel Management", RFC
2465 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
2468 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
2471 [SSH-TRANS] Ylonen, T., et al, "SSH Transport Layer Protocol",
2474 [PGP] Callas, J., et al, "OpenPGP Message Format", RFC 2440,
2477 [SPKI] Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
2480 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key
2481 Infrastructure, Certificate and CRL Profile", RFC 2459,
2484 [Schneier] Schneier, B., "Applied Cryptography Second Edition",
2485 John Wiley & Sons, New York, NY, 1996.
2487 [Menezes] Menezes, A., et al, "Handbook of Applied Cryptography",
2490 [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol",
2491 RFC 2412, November 1998.
2493 [ISAKMP] Maughan D., et al, "Internet Security Association and
2494 Key Management Protocol (ISAKMP)", RFC 2408, November
2497 [IKE] Harkins D., and Carrel D., "The Internet Key Exchange
2498 (IKE)", RFC 2409, November 1998.
2500 [HMAC] Krawczyk, H., "HMAC: Keyed-Hashing for Message
2501 Authentication", RFC 2104, February 1997.
2503 [PKCS1] Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
2504 Specifications, Version 2.0", RFC 2437, October 1998.
2506 [RFC2119] Bradner, S., "Key Words for use in RFCs to Indicate
2507 Requirement Levels", BCP 14, RFC 2119, March 1997.
2509 [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
2510 10646", RFC 2279, January 1998.
2512 [PKCS7] Kalinski, B., "PKCS #7: Cryptographic Message Syntax,
2513 Version 1.5", RFC 2315, March 1998.
2521 Snellmaninkatu 34 A 15
2525 EMail: priikone@iki.fi
2527 This Internet-Draft expires 25 April 2003