8 .ds RF FORMFEED[Page %]
17 Network Working Group P. Riikonen
19 draft-riikonen-silc-pp-04.txt XXX
26 <draft-riikonen-silc-pp-04.txt>
31 This document is an Internet-Draft and is in full conformance with
32 all provisions of Section 10 of RFC 2026. Internet-Drafts are
33 working documents of the Internet Engineering Task Force (IETF), its
34 areas, and its working groups. Note that other groups may also
35 distribute working documents as Internet-Drafts.
37 Internet-Drafts are draft documents valid for a maximum of six months
38 and may be updated, replaced, or obsoleted by other documents at any
39 time. It is inappropriate to use Internet-Drafts as reference
40 material or to cite them other than as "work in progress."
42 The list of current Internet-Drafts can be accessed at
43 http://www.ietf.org/ietf/1id-abstracts.txt
45 The list of Internet-Draft Shadow Directories can be accessed at
46 http://www.ietf.org/shadow.html
48 The distribution of this memo is unlimited.
54 This memo describes a Packet Protocol used in the Secure Internet Live
55 Conferencing (SILC) protocol, specified in the Secure Internet Live
56 Conferencing, Protocol Specification Internet Draft [SILC1]. This
57 protocol describes the packet types and packet payloads which defines
58 the contents of the packets. The protocol provides secure binary packet
59 protocol that assures that the contents of the packets are secured and
74 1 Introduction .................................................. 3
75 1.1 Requirements Terminology .................................. 4
76 2 SILC Packet Protocol .......................................... 4
77 2.1 SILC Packet ............................................... 4
78 2.2 SILC Packet Header ........................................ 5
79 2.3 SILC Packet Types ......................................... 7
80 2.3.1 SILC Packet Payloads ................................ 16
81 2.3.2 Generic payloads .................................... 16
82 2.3.2.1 ID Payload .................................. 16
83 2.3.2.2 Argument Payload ............................ 17
84 2.3.2.3 Channel Payload ............................. 18
85 2.3.2.4 Public Key Payload .......................... 19
86 2.3.3 Disconnect Payload .................................. 19
87 2.3.4 Success Payload ..................................... 19
88 2.3.5 Failure Payload ..................................... 20
89 2.3.6 Reject Payload ...................................... 21
90 2.3.7 Notify Payload ...................................... 22
91 2.3.8 Error Payload ....................................... 21
92 2.3.9 Channel Message Payload ............................. 28
93 2.3.10 Channel Key Payload ................................ 31
94 2.3.11 Private Message Payload ............................ 33
95 2.3.12 Private Message Key Payload ........................ 34
96 2.3.13 Command Payload .................................... 36
97 2.3.14 Command Reply Payload .............................. 37
98 2.3.15 Connection Auth Request Payload .................... 37
99 2.3.16 New ID Payload ..................................... 38
100 2.3.17 New Client Payload ................................. 39
101 2.3.18 New Server Payload ................................. 40
102 2.3.19 New Channel Payload ................................ 41
103 2.3.20 Key Agreement Payload .............................. 42
104 2.3.21 Resume Router Payload .............................. 43
105 2.3.22 File Transfer Payload .............................. 43
106 2.4 SILC ID Types ............................................. 44
107 2.5 Packet Encryption And Decryption .......................... 44
108 2.5.1 Normal Packet Encryption And Decryption ............. 45
109 2.5.2 Channel Message Encryption And Decryption ........... 45
110 2.5.3 Private Message Encryption And Decryption ........... 46
111 2.6 Packet MAC Generation ..................................... 47
112 2.7 Packet Padding Generation ................................. 47
113 2.8 Packet Compression ........................................ 48
114 2.9 Packet Sending ............................................ 48
115 2.10 Packet Reception ......................................... 49
116 2.11 Packet Routing ........................................... 49
117 2.12 Packet Broadcasting ...................................... 50
118 3 Security Considerations ....................................... 50
119 4 References .................................................... 50
120 5 Author's Address .............................................. 52
126 Figure 1: Typical SILC Packet
127 Figure 2: SILC Packet Header
129 Figure 4: Argument Payload
130 Figure 5: Channel Payload
131 Figure 6: Public Key Payload
132 Figure 7: Disconnect Payload
133 Figure 8: Success Payload
134 Figure 9: Failure Payload
135 Figure 10: Reject Payload
136 Figure 11: Notify Payload
137 Figure 12: Error Payload
138 Figure 13: Channel Message Payload
139 Figure 14: Channel Key Payload
140 Figure 15: Private Message Payload
141 Figure 16: Private Message Key Payload
142 Figure 17: Command Payload
143 Figure 18: Connection Auth Request Payload
144 Figure 19: New Client Payload
145 Figure 20: New Server Payload
146 Figure 21: Key Agreement Payload
147 Figure 22: Resume Router Payload
148 Figure 23: File Transfer Payload
154 This document describes a Packet Protocol used in the Secure Internet
155 Live Conferencing (SILC) protocol specified in the Secure Internet Live
156 Conferencing, Protocol Specification Internet Draft [SILC1]. This
157 protocol describes the packet types and packet payloads which defines
158 the contents of the packets. The protocol provides secure binary packet
159 protocol that assures that the contents of the packets are secured and
162 The basis of SILC protocol relies in the SILC packets and it is with
163 out a doubt the most important part of the protocol. It is also probably
164 the most complicated part of the protocol. Packets are used all the
165 time in the SILC network to send messages, commands and other information.
166 All packets in SILC network are always encrypted and their integrity
167 is assured by computed MACs. The protocol defines several packet types
168 and packet payloads. Each packet type usually has a specific packet
169 payload that actually defines the contents of the packet. Each packet
170 also includes a default SILC Packet Header that provides sufficient
171 information about the origin of the packet and destination of the
176 1.1 Requirements Terminology
178 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
179 MAY, and OPTIONAL, when they appear in this document, are to be
180 interpreted as described in [RFC2119].
184 2 SILC Packet Protocol
189 SILC packets deliver messages from sender to receiver securely by
190 encrypting important fields of the packet. The packet consists of
191 default SILC Packet Header, Padding, Packet Payload data, and, packet
194 The following diagram illustrates typical SILC packet.
199 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
200 | n bytes | 1 - n bytes | n bytes | n bytes
201 | SILC Header | Padding | Data Payload | MAC
202 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
206 Figure 1: Typical SILC Packet
209 SILC Header is always the first part of the packet and its purpose
210 is to provide information about the packet. It provides for example
211 the packet type, origin of the packet and the destination of the packet.
212 The header is variable in length. See the following section for
213 description of SILC Packet header. Packets without SILC header or
214 with malformed SILC header MUST be dropped.
216 Padding follows the packet header. The purpose of the padding is to
217 make the packet multiple by eight (8) or by the block size of the
218 cipher used in the encryption, which ever is larger. The maximum
219 length of padding is currently 16 bytes. The padding is always
220 encrypted. See the section 2.7 Padding Generation for more detailed
223 Data payload area follows padding and it is the actual data of the
224 packet. The packet data is the packet payloads defined in this
225 protocol. The data payload area is always encrypted.
227 The last part of SILC packet is the packet MAC that assures the
228 integrity of the packet. The MAC is always computed from the packet
229 before the encryption is applied to the packet. If compression is used
230 in the packet the MAC is computed after the compression has been
231 applied. The compression, on the other hand, is always applied before
232 encryption. See more details in the section 2.6 Packet MAC Generation.
234 All fields in all packet payloads are always in MSB (most significant
239 2.2 SILC Packet Header
241 The SILC packet header is applied to all SILC packets and it is
242 variable in length. The purpose of SILC Packet header is to provide
243 detailed information about the packet. The receiver of the packet
244 uses the packet header to parse the packet and gain other relevant
245 parameters of the packet.
247 The following diagram represents the SILC packet header.
252 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
253 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
254 | Payload Length | Flags | Packet Type |
255 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256 | Source ID Length | Destination ID Length |
257 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
269 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
273 Figure 2: SILC Packet Header
277 o Payload Length (2 bytes) - Is the length of the packet
278 not including the padding of the packet.
280 o Flags (1 byte) - Indicates flags to be used in packet
281 processing. Several flags may be set by ORing the flags
284 The following flags are reserved for this field:
289 In this case the field is ignored.
292 Private Message Key 0x01
294 Indicates that the packet must include private
295 message that is encrypted using private key set by
296 client. Servers does not know anything about this
297 key and this causes that the private message is
298 not handled by the server at all, it is just
299 passed along. See section 2.5.3 Private Message
300 Encryption And Decryption for more information.
305 Indicates that the packet consists of list of
306 packet payloads indicated by the Packet Type field.
307 The payloads are added one after the other. Note that
308 there are packet types that must not be used as
309 list. Parsing of list packet is done by calculating
310 the length of each payload and parsing them one by
316 Marks the packet to be broadcasted. Client cannot
317 send broadcast packet and normal server cannot send
318 broadcast packet. Only router server may send broadcast
319 packet. The router receiving of packet with this flag
320 set MUST send (broadcast) the packet to its primary
321 route. If router has several router connections the
322 packet may be sent only to the primary route. See
323 section 2.12 Packet Broadcasting for description of
331 o Packet Type (1 byte) - Is the type of the packet. Receiver
332 uses this field to parse the packet. See section 2.3
333 SILC Packets for list of defined packet types.
335 o Source ID Length (2 bytes) - Indicates the length of the
336 Source ID field in the header, not including this or any
339 o Destination ID Length (2 bytes) - Indicates the length of the
340 Destination ID field in the header, not including this or
343 o Src ID Type (1 byte) - Indicates the type of ID in the
344 Source ID field. See section 2.4 SILC ID Types for
347 o Source ID (variable length) - The actual source ID that
348 indicates which is the original sender of the packet.
350 o Dst ID Type (1 byte) - Indicates the type of ID in the
351 Destination ID field. See section 2.4 SILC ID Types for
354 o Destination ID (variable length) - The actual destination
355 ID that indicates which is the end receiver of the packet.
359 2.3 SILC Packet Types
361 SILC packet types defines the contents of the packet and it is used by
362 the receiver to parse the packet. The packet type is 8 bits, as a one
363 byte, in length. The range for the packet types are from 0 - 255,
364 where 0 is never sent and 255 is currently reserved for future
365 extensions and MUST NOT be defined to any other purpose. Every SILC
366 specification compliant implementation SHOULD support all of these packet
369 The below list of the SILC Packet types includes reference to the packet
370 payload as well. Packet payloads are the actual packet, that is, the data
371 that the packet consists of. Each packet type defines packet payload
372 which usually may only be sent with the specific packet type.
374 Most of the packets are packets that must be destined directly to entity
375 that is connected to the sender. It is not allowed, for example, for
376 router to send disconnect packet to client that is not directly connected
377 to the router. However, there are some special packet types that may
378 be destined to some entity that the sender has not direct connection
379 with. These packets are for example private message packets, channel
380 message packets, command packets and some other packets that may be
381 broadcasted in the SILC network. If the packet is allowed to be sent to
382 indirectly connected entity it is mentioned separately in the packet
383 description (unless it is obvious as in private and channel message
384 packets). Other packets MUST NOT be sent or accepted, if sent, to
385 indirectly connected entities.
387 List of SILC Packet types are defined as follows.
392 This type is reserved and it is never sent.
395 1 SILC_PACKET_DISCONNECT
397 This packet is sent to disconnect the remote end. Reason of
398 the disconnection is sent inside the packet payload. Client
399 usually does not send this packet.
401 This packet MUST NOT be sent as list and the List flag MUST
404 Payload of the packet: See section 2.3.3 Disconnect Payload
407 2 SILC_PACKET_SUCCESS
409 This packet is sent upon successful execution of some protocol.
410 The status of the success is sent in the packet.
412 This packet MUST NOT be sent as list and the List flag MUST
415 Payload of the packet: See section 2.3.4 Success Payload
418 3 SILC_PACKET_FAILURE
420 This packet is sent upon failure of some protocol. The status
421 of the failure is sent in the packet.
423 This packet MUST NOT be sent as list and the List flag MUST
426 Payload of the packet: See section 2.3.5 Failure Payload
431 This packet MAY be sent upon rejection of some protocol.
432 The status of the rejection is sent in the packet.
434 This packet MUST NOT be sent as list and the List flag MUST
437 Payload of the packet: See section 2.3.6 Reject Payload
442 This packet is used to send notify message, usually from
443 server to client, although it MAY be sent from server to another
444 server as well. Client MUST NOT send this packet. Server MAY
445 send this packet to channel as well when the packet is
446 distributed to all clients on the channel.
448 Payload of the packet: See section 2.3.7 Notify Payload.
453 This packet is sent when an error occurs. Server MAY
454 send this packet. Client MUST NOT send this packet. The
455 client MAY entirely ignore the packet, however, server is
456 most likely to take action anyway. This packet MAY be sent
457 to entity that is indirectly connected to the sender.
459 This packet MUST NOT be sent as list and the List flag MUST
462 Payload of the packet: See section 2.3.8 Error Payload.
465 7 SILC_PACKET_CHANNEL_MESSAGE
467 This packet is used to send messages to channels. The packet
468 includes Channel ID of the channel and the actual message to
469 the channel. Messages sent to the channel are always protected
470 by channel specific keys. Channel Keys are distributed by
471 SILC_PACKET_CHANNEL_KEY packet.
473 This packet MUST NOT be sent as list and the List flag MUST
476 Payload of the packet: See section 2.3.9 Channel Message
480 8 SILC_PACKET_CHANNEL_KEY
482 This packet is used to distribute new key for particular
483 channel. Each channel has their own independent keys that
484 is used to protect the traffic on the channel. Only server
485 may send this packet. This packet MAY be sent to entity
486 that is indirectly connected to the sender.
488 This packet MUST NOT be sent as list and the List flag MUST
491 Payload of the packet: See section 2.3.10 Channel Key Payload
494 9 SILC_PACKET_PRIVATE_MESSAGE
496 This packet is used to send private messages from client
497 to another client. By default, private messages are protected
498 by session keys established by normal key exchange protocol.
499 However, it is possible to use specific key to protect private
500 messages. SILC_PACKET_PRIVATE_MESSAGE_KEY packet is used to
501 agree the key with the remote client. Pre-shared key MAY be
502 used as well if both of the client knows it, however, it needs
503 to be agreed outside SILC. See more of this in [SILC1].
505 This packet MUST NOT be sent as list and the List flag MUST
508 Payload of the packet: See section 2.3.11 Private Message
512 10 SILC_PACKET_PRIVATE_MESSAGE_KEY
514 This packet is used to agree about a key to be used to protect
515 the private messages between two clients. If this is not sent
516 the normal session key is used to protect the private messages
517 inside SILC network. Agreeing to use specific key to protect
518 private messages adds security, as no server between the two
519 clients will be able to decrypt the private message. However,
520 servers inside SILC network are considered to be trusted, thus
521 using normal session key to protect private messages does not
522 degrade security. Whether to agree to use specific keys by
523 default or to use normal session keys by default, is
524 implementation specific issue. See more of this in [SILC1].
526 This packet MUST NOT be sent as list and the List flag MUST
529 Payload of the packet: See section 2.3.12 Private Message
533 11 SILC_PACKET_COMMAND
535 This packet is used to send commands from client to server.
536 Server MAY send this packet to other servers as well. All
537 commands are listed in their own section SILC Command Types
538 in [SILC4]. The contents of this packet is command specific.
539 This packet MAY be sent to entity that is indirectly connected
542 This packet MUST NOT be sent as list and the List flag MUST
545 Payload of the packet: See section 2.3.13 Command Payload
548 12 SILC_PACKET_COMMAND_REPLY
550 This packet is sent as reply to the SILC_PACKET_COMMAND packet.
551 The contents of this packet is command specific. This packet
552 MAY be sent to entity that is indirectly connected to the
555 This packet MUST NOT be sent as list and the List flag MUST
558 Payload of the packet: See section 2.3.14 Command Reply
559 Payload and section 2.3.13 Command
563 13 SILC_PACKET_KEY_EXCHANGE
565 This packet is used to start SILC Key Exchange Protocol,
566 described in detail in [SILC3].
568 This packet MUST NOT be sent as list and the List flag MUST
571 Payload of the packet: Payload of this packet is described
572 in the section SILC Key Exchange
573 Protocol and its sub sections in
577 14 SILC_PACKET_KEY_EXCHANGE_1
579 This packet is used as part of the SILC Key Exchange Protocol.
581 This packet MUST NOT be sent as list and the List flag MUST
584 Payload of the packet: Payload of this packet is described
585 in the section SILC Key Exchange
586 Protocol and its sub sections in
590 15 SILC_PACKET_KEY_EXCHANGE_2
592 This packet is used as part of the SILC Key Exchange Protocol.
594 This packet MUST NOT be sent as list and the List flag MUST
597 Payload of the packet: Payload of this packet is described
598 in the section SILC Key Exchange
599 Protocol and its sub sections in
603 16 SILC_PACKET_CONNECTION_AUTH_REQUEST
605 This packet is used to request the authentication method to
606 be used in the SILC Connection Authentication Protocol. If
607 initiator of the protocol does not know the mandatory
608 authentication method this packet MAY be used to determine it.
610 The party receiving this payload MUST respond with the same
611 packet including the mandatory authentication method.
613 This packet MUST NOT be sent as list and the List flag MUST
616 Payload of the packet: See section 2.3.15 Connection Auth
622 17 SILC_PACKET_CONNECTION_AUTH
624 This packet is used to start and perform the SILC Connection
625 Authentication Protocol. This protocol is used to authenticate
626 the connecting party. The protocol is described in detail in
629 This packet MUST NOT be sent as list and the List flag MUST
632 Payload of the packet: Payload of this packet is described
633 in the section SILC Authentication
634 Protocol and it sub sections in [SILC].
637 18 SILC_PACKET_NEW_ID
639 This packet is used to distribute new ID's from server to
640 router and from router to all routers in the SILC network.
641 This is used when for example new client is registered to
642 SILC network. The newly created ID's of these operations are
643 distributed by this packet. Only server may send this packet,
644 however, client MUST be able to receive this packet. This
645 packet MAY be sent to entity that is indirectly connected
648 Payload of the packet: See section 2.3.16 New ID Payload
651 19 SILC_PACKET_NEW_CLIENT
653 This packet is used by client to register itself to the
654 SILC network. This is sent after key exchange and
655 authentication protocols has been completed. Client sends
656 various information about itself in this packet.
658 This packet MUST NOT be sent as list and the List flag MUST
661 Payload of the packet: See section 2.3.17 New Client Payload
664 20 SILC_PACKET_NEW_SERVER
666 This packet is used by server to register itself to the
667 SILC network. This is sent after key exchange and
668 authentication protocols has been completed. Server sends
669 this to the router it connected to, or, if router was
670 connecting, to the connected router. Server sends its
671 Server ID and other information in this packet. The client
672 MUST NOT send or receive this packet.
674 This packet MUST NOT be sent as list and the List flag MUST
677 Payload of the packet: See section 2.3.18 New Server Payload
680 21 SILC_PACKET_NEW_CHANNEL
682 This packet is used to notify routers about newly created
683 channel. Channels are always created by the router and it MUST
684 notify other routers about the created channel. Router sends
685 this packet to its primary route. Client MUST NOT send this
686 packet. This packet MAY be sent to entity that is indirectly
687 connected to the sender.
689 Payload of the packet: See section 2.3.19 New Channel Payload
694 This packet is used to indicate that re-key must be performed
695 for session keys. See section Session Key Regeneration in
696 [SILC1] for more information. This packet does not have
699 This packet MUST NOT be sent as list and the List flag MUST
703 23 SILC_PACKET_REKEY_DONE
705 This packet is used to indicate that re-key is performed and
706 new keys must be used hereafter.
708 This packet MUST NOT be sent as list and the List flag MUST
712 24 SILC_PACKET_HEARTBEAT
714 This packet is used by clients, servers and routers to keep the
715 connection alive. It is recommended that all servers implement
716 keepalive actions and perform it to both direction in a link.
717 This packet does not have a payload.
719 This packet MUST NOT be sent as list and the List flag MUST
723 25 SILC_PACKET_KEY_AGREEMENT
725 This packet is used by clients to request key negotiation
726 between another client in the SILC network. If the negotiation
727 is started it is performed using the SKE protocol. The result of
728 the negotiation, the secret key material, can be used for
729 example as private message key. The server and router MUST NOT
732 This packet MUST NOT be sent as list and the List flag MUST
735 Payload of the packet: See section 2.3.20 Key Agreement Payload
738 26 SILC_PACKET_RESUME_ROUTER
740 This packet is used during backup router protocol when the
741 original primary router of the cell comes back online and wishes
742 to resume the position as being the primary router of the cell.
744 Payload of the packet: See section 2.3.21 Resume Router Payload
749 This packet is used to perform an file transfer protocol in the
750 SILC session with some entity in the network. The packet is
751 multi purpose. The packet is used to tell other entity in the
752 network that the sender wishes to perform an file transfer
753 protocol. The packet is also used to actually tunnel the
754 file transfer protocol stream. The file transfer protocol
755 stream is always protected with the SILC packet.
757 This packet MUST NOT be sent as list and the List flag MUST
760 Payload of the packet: See section 2.3.22 File Transfer Payload
765 Currently undefined commands.
770 These packet types are reserved for private use and they will
771 not be defined by this document.
778 This type is reserved for future extensions and currently it
784 2.3.1 SILC Packet Payloads
786 All payloads resides in the main data area of the SILC packet. However
787 all payloads MUST be at the start of the data area after the SILC
788 packet header and padding. All fields in the packet payload are always
789 encrypted, as they reside in the data area of the packet which is
792 Payloads described in this section are common payloads that MUST be
793 accepted anytime during SILC session. Most of the payloads may only
794 be sent with specific packet type which is defined in the description
797 There are a lot of other payloads in the SILC as well. However, they
798 are not common in the sense that they could be sent at any time.
799 These payloads are not described in this section. These are payloads
800 such as SILC Key Exchange payloads and so on. These are described
801 in [SILC1], [SILC3] and [SILC4].
805 2.3.2 Generic payloads
807 This section describes generic payloads that are not associated to any
808 specific packet type. They can be used for example inside some other
815 This payload can be used to send an ID. ID's are variable in length
816 thus this payload provides a way to send variable length ID's.
829 The following diagram represents the ID Payload.
834 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
835 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
836 | ID Type | ID Length |
837 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
841 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
849 o ID Type (2 bytes) - Indicates the type of the ID. See
850 section 2.4 SILC ID Types for list of defined ID types.
852 o ID Length (2 bytes) - Length of the ID Data area not
853 including the length of any other fields in the payload.
855 o ID Data (variable length) - The actual ID data.
860 2.3.2.2 Argument Payload
862 Argument Payload is used to set arguments for any packet payload that
863 needs and supports arguments, such as commands. Number of arguments
864 associated with a packet MUST be indicated by the packet payload which
865 needs the arguments. Argument Payloads MUST always reside right after
866 the packet payload needing the arguments. Incorrect amount of argument
867 payloads MUST cause rejection of the packet.
869 The following diagram represents the Argument Payload.
874 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
875 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
876 | Payload Length | Argument Type | |
877 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
881 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
885 Figure 4: Argument Payload
889 o Payload Length (2 bytes) - Length of the argument payload data
890 area not including the length of any other fields in the
893 o Argument Type (1 byte) - Indicates the type of the argument.
894 Every argument may have a specific type that MUST be defined
895 by the packet payload needing the argument. For example
896 every command specify a number for each argument that maybe
897 associated with the command. By using this number the receiver
898 of the packet knows what type of argument this is. If there is
899 no specific argument type this field is set to zero (0).
901 o Argument Data (variable length) - Argument data.
906 2.3.2.3 Channel Payload
908 Generic Channel Payload may be used to send information about channel,
909 its name, the Channel ID and a mode.
911 The following diagram represents the Channel Payload.
917 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
918 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
919 | Channel Name Length | |
920 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
924 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
925 | Channel ID Length | |
926 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
930 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
932 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
936 Figure 5: New Channel Payload
940 o Channel Name Length (2 bytes) - Length of the channel name
943 o Channel Name (variable length) - The name of the channel.
945 o Channel ID Length (2 bytes) - Length of the Channel ID field.
947 o Channel ID (variable length) - The Channel ID.
949 o Mode Mask (4 bytes) - A mode. This can be the mode of the
950 channel but it can also be the mode of the client on the
951 channel. The contents of this field is dependent of the
952 usage of this payload. The usage is defined separately
953 when this payload is used. This is a 32 bit MSB first value.
958 2.3.2.4 Public Key Payload
960 Generic Public Key Payload may be used to send different types of
961 public keys and certificates.
963 The following diagram represents the Public Key Payload.
969 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
970 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
971 | Public Key Length | Public Key Type |
972 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
974 ~ Public Key of the party (or certificate) ~
976 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
980 Figure 6: Public Key Payload
984 o Public Key Length (2 bytes) - The length of the Public Key
985 (or certificate) field, not including any other field.
987 o Public Key Type (2 bytes) - The public key (or certificate)
988 type. This field indicates the type of the public key in
989 the packet. See the [SILC3] for defined public key types.
991 o Public Key (or certificate) (variable length) - The
992 public key or certificate.
997 2.3.3 Disconnect Payload
999 Disconnect payload is sent upon disconnection. The payload is simple;
1000 reason of disconnection is sent to the disconnected party.
1002 The payload may only be sent with SILC_PACKET_DISCONNECT packet. It
1003 MUST NOT be sent in any other packet type. The following diagram
1004 represents the Disconnect Payload.
1010 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
1011 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1013 ~ Disconnect Message ~
1015 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1019 Figure 7: Disconnect Payload
1025 o Disconnect Message (variable length) - Human readable
1026 reason of the disconnection.
1031 2.3.4 Success Payload
1033 Success payload is sent when some protocol execution is successfully
1034 completed. The payload is simple; indication of the success is sent.
1035 This may be any data, including binary or human readable data.
1040 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
1041 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1043 ~ Success Indication ~
1045 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1049 Figure 8: Success Payload
1053 o Success Indication (variable length) - Indication of
1054 the success. This may be for example some flag that
1055 indicates the protocol and the success status or human
1056 readable success message. The true length of this
1057 payload is available by calculating it from the SILC
1064 2.3.5 Failure Payload
1066 This is opposite of Success Payload. Indication of failure of
1067 some protocol is sent in the payload.
1073 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
1074 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1076 ~ Failure Indication ~
1078 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1082 Figure 9: Failure Payload
1086 o Failure Indication (variable length) - Indication of
1087 the failure. This may be for example some flag that
1088 indicates the protocol and the failure status or human
1089 readable failure message. The true length of this
1090 payload is available by calculating it from the SILC
1096 2.3.6 Reject Payload
1098 This payload is sent when some protocol is rejected to be executed.
1099 Other operations MAY send this as well that was rejected. The
1100 indication of the rejection is sent in the payload. The indication
1101 may be binary or human readable data.
1107 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
1108 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1110 ~ Reject Indication ~
1112 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1116 Figure 10: Reject Payload
1120 o Reject Indication (variable length) - Indication of
1121 the rejection. This maybe for example some flag that
1122 indicates the protocol and the rejection status or human
1123 readable rejection message. The true length of this
1124 payload is available by calculating it from the SILC
1130 2.3.7 Notify Payload
1132 Notify payload is used to send notify messages. The payload is usually
1133 sent from server to client, however, server MAY send it to another
1134 server as well. This payload MAY also be sent to a channel. Client
1135 MUST NOT send this payload. The receiver of this payload MAY ignore
1136 the contents of the payload, however, notify message SHOULD be audited.
1138 The payload may only be sent with SILC_PACKET_NOTIFY packet. It MUST
1139 not be sent in any other packet type. The following diagram represents
1145 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
1146 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1147 | Notify Type | Payload Length |
1148 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1154 Figure 11: Notify Payload
1158 o Notify Type (2 bytes) - Indicates the type of the notify
1161 o Payload Length (2 bytes) - Length of the entire Notify Payload
1162 including any associated Argument Payloads.
1164 o Argument Nums (2 bytes) - Indicates the number of Argument
1165 Payloads associated to this payload. Notify types may define
1166 arguments to be send along the notify message.
1169 The following list of currently defined notify types. The format for
1170 notify arguments is same as in SILC commands described in [SILC4].
1171 Also, all ID's sent in arguments are sent inside ID Payload.
1174 0 SILC_NOTIFY_TYPE_NONE
1176 If no specific notify type apply for the notify message this type
1180 Arguments: (1) <message>
1182 The <message> is implementation specific free text string.
1183 Receiver MAY ignore this message.
1186 1 SILC_NOTIFY_TYPE_INVITE
1188 Sent when an client is invited to a channel. This is also sent
1189 when the invite list of the channel is changed. This notify type
1190 is sent between routers and if an client was invited, to the
1191 client as well. In this case the packet is destined to the client.
1194 Arguments: (1) <Channel ID> (2) <channel name>
1195 (3) [<sender Client ID>] (4) [<adding client>]
1196 (5) [<removing client>]
1198 The <Channel ID> is the channel. The <channel name> is the name
1199 of the channel and is provided because the client which receives
1200 this notify packet may not have a way to resolve the name of the
1201 channel from the <Channel ID>. The <sender Client ID> is the
1202 Client ID which invited the client to the channel. The <adding
1203 client> and the <removing client> indicates the added or removed
1204 client from the channel's invite list. The format of the <adding
1205 client> and the <removing client> is defined in the [SILC4] with
1206 SILC_COMMAND_INVITE command.
1208 The <adding client> and <removing client> MUST NOT be sent when
1209 the packet is destined to a client.
1212 2 SILC_NOTIFY_TYPE_JOIN
1214 Sent when client has joined to a channel. The server MUST
1215 distribute this type only to the local clients on the channel
1216 and then send it to its primary router. The router or server
1217 receiving the packet distributes this type to the local clients
1218 on the channel and broadcast it to the network.
1221 Arguments: (1) [<Client ID>] (2) <Channel ID>
1223 The <Client ID> is the client that joined to the channel indicated
1224 by the <Channel ID>.
1227 3 SILC_NOTIFY_TYPE_LEAVE
1229 Sent when client has left a channel. The server must distribute
1230 this type only to the local clients on the channel and then send
1231 it to its primary router. The router or server receiving the
1232 packet distributes this type to the local clients on the channel
1233 and broadcast it to the network.
1236 Arguments: (1) <Client ID>
1238 The <Client ID> is the client which left the channel.
1241 4 SILC_NOTIFY_TYPE_SIGNOFF
1243 Sent when client signoff from SILC network. The server MUST
1244 distribute this type only to the local clients on the channel and
1245 then send it to its primary router. The router or server receiving
1246 the packet distributes this type to the local clients on the
1247 channel and broadcast it to the network.
1250 Arguments: (1) <Client ID> (2) <message>
1252 The <Client ID> is the client which left SILC network. The
1253 <message> is free text string indicating the reason of the signoff.
1256 5 SILC_NOTIFY_TYPE_TOPIC_SET
1258 Sent when topic is set/changed on a channel. This type must be
1259 sent only to the clients which is joined on the channel which
1260 topic was set or changed.
1263 Arguments: (1) <Client ID> (2) <topic>
1265 The <Client ID> is the client which set or changed the <topic>.
1268 6 SILC_NOTIFY_TYPE_NICK_CHANGE
1270 Sent when client changes nick on a channel. The server MUST
1271 distribute this type only to the local clients on the channel
1272 and then send it to its primary router. The router or server
1273 receiving the packet distributes this type to the local clients
1274 on the channel and broadcast it to the network.
1277 Arguments: (1) <Old Client ID> (2) <New Client ID>
1279 The <Old Client ID> is the old ID of the client which changed
1280 the nickname. The <New Client ID> is the new ID generated by
1281 the change of the nickname.
1284 7 SILC_NOTIFY_TYPE_CMODE_CHANGE
1286 Sent when channel mode has changed. This type MUST be sent only
1287 to the clients which is joined on the channel which mode was
1291 Arguments: (1) <ID Payload> (2) <mode mask>
1292 (3) [<cipher>] (4) <[hmac>]
1294 The <ID Payload> is the ID (usually Client ID but it can be
1295 Server ID as well when the router is enforcing channel mode
1296 change) of the entity which changed the mode. The <mode mask>
1297 is the new mode mask of the channel. The client can safely
1298 ignore the <cipher> argument since the SILC_PACKET_CHANNEL_KEY
1299 packet will force the new channel key change anyway. The <hmac>
1300 argument is important since the client is responsible of setting
1301 the new HMAC and the hmac key into use.
1304 8 SILC_NOTIFY_TYPE_CUMODE_CHANGE
1306 Sent when user mode on channel has changed. This type MUST be
1307 sent only to the clients which is joined on the channel where
1308 the target client is on.
1311 Arguments: (1) <ID Payload> (2) <mode mask>
1312 (3) <Target Client ID>
1314 The <ID Payload> is the ID (usually Client ID but it can be
1315 Server ID as well when the router is enforcing user's mode
1316 change) of the entity which changed the mode. The <mode mask>
1317 is the new mode mask of the channel. The <Target Client ID>
1318 is the client which mode was changed.
1321 9 SILC_NOTIFY_TYPE_MOTD
1323 Sent when Message of the Day (motd) is sent to a client.
1326 Arguments: (1) <motd>
1328 The <motd> is the Message of the Day.
1331 10 SILC_NOTIFY_TYPE_CHANNEL_CHANGE
1333 Sent when channel's ID has changed for a reason or another.
1334 This is sent by normal server to the client. This can also be
1335 sent by router to other server to force the Channel ID change.
1336 The Channel ID MUST be changed to use the new one. When sent
1337 to clients, this type MUST be sent only to the clients which is
1338 joined on the channel.
1341 Arguments: (1) <Old Channel ID> (2) <New Channel ID>
1343 The <Old Channel ID> is the channel's old ID and the <New
1344 Channel ID> is the new one that MUST replace the old one.
1347 11 SILC_NOTIFY_TYPE_SERVER_SIGNOFF
1349 Sent when server quits SILC network. Those clients from this
1350 server that are on channels must be removed from the channel.
1353 Arguments: (1) <Server ID> (n) [<Client ID> [...]
1355 The <Server ID> is the server's ID. The rest of the arguments
1356 are the Client ID's of the client's which are coming from this
1357 server and are thus quitting the SILC network also. If the
1358 maximum number of arguments are reached another
1359 SILC_NOTIFY_TYPE_SERVER_SIGNOFF notify packet MUST be sent.
1360 When this notify packet is sent between routers the Client ID's
1364 12 SILC_NOTIFY_TYPE_KICKED
1366 Sent when a client has been kicked from a channel. This is
1367 sent also to the client which was kicked from the channel.
1368 The client which was kicked from the channel MUST be removed
1369 from the channel. This notify type is always destined to the
1370 channel. The router or server receiving the packet distributes
1371 this type to the local clients on the channel and broadcast it
1375 Arguments: (1) <Client ID> (2) [<comment>]
1377 The <Client ID> is the client which was kicked from the channel.
1378 The kicker may have set the <comment> to indicate the reason for
1382 13 SILC_NOTIFY_TYPE_KILLED
1384 Sent when a client has been killed from the network. This is sent
1385 also to the client which was killed from the network. The client
1386 which was killed from the network MUST be removed from the network.
1387 This notify type is destined directly to the client which was
1388 killed and to channel if the client is on any channel. The router
1389 or server receiving the packet distributes this type to the local
1390 clients on the channel and broadcast it to the network.
1393 Arguments: (1) <Client ID> (2) [<comment>]
1395 The <Client ID> is the client which was killed from the network.
1396 The killer may have set the <comment> to indicate the reason for
1400 14 SILC_NOTIFY_TYPE_UMODE_CHANGE
1402 Sent when user's mode in the SILC changes. This type is sent
1403 only between routers as broadcast packet.
1406 Arguments: (1) <Client ID> (2) <mode mask>
1408 The <Client ID> is the client which mode was changed. The
1409 <mode mask> is the new mode mask.
1412 15 SILC_NOTIFY_TYPE_BAN
1414 Sent when the ban list of the channel is changed. This type is
1415 sent only between routers as broadcast packet.
1418 Arguments: (1) <Channel ID> (2) [<adding client>]
1419 (3) [<removing client>]
1421 The <Channel ID> is the channel which ban list was changed. The
1422 <adding client> is used to indicate that a ban was added and the
1423 <removing client> is used to indicate that a ban was removed from
1424 the ban list. The format of the <adding client> and the
1425 <removing client> is defined in the [SILC4] with SILC_COMMAND_BAN
1430 Notify types starting from 16384 are reserved for private notify
1437 Error payload is sent upon error. Error may occur in various
1438 conditions when server sends this packet. Client MUST NOT send this
1439 payload but MUST be able to accept it. However, client MAY
1440 totally ignore the contents of the packet as server is going to
1441 take action on the error anyway. However, it is recommended
1442 that the client takes error packet seriously.
1448 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
1449 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1453 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1457 Figure 12: Error Payload
1461 o Error Message (variable length) - Human readable error
1467 2.3.9 Channel Message Payload
1469 Channel messages are the most common messages sent in the SILC.
1470 Channel Message Payload is used to send message to channels. These
1471 messages can only be sent if client has joined to some channel.
1472 Even though this packet is the most common in SILC it is still
1473 special packet. Some special handling on sending and reception
1474 of channel message is required.
1476 Padding MUST be applied into this payload since the payload is
1477 encrypted separately from other parts of the packet with the
1478 channel specific key. Hence the requirement of the padding.
1479 The padding SHOULD be random data. The packet MUST be made
1480 multiple by eight (8) or by the block size of the cipher, which
1483 The SILC header in this packet is encrypted with the session key
1484 of the next receiver of the packet. Nothing else is encrypted
1485 with that key. Thus, the actual packet and padding to be
1486 encrypted with the session key is SILC Header plus padding to it
1487 to make it multiple by eight (8) or multiple by the block size
1488 of the cipher, which ever is larger.
1490 Receiver of the the channel message packet is able to determine
1491 the channel the message is destined to by checking the destination
1492 ID from the SILC Packet header which tells the destination channel.
1493 The original sender of the packet is also determined by checking
1494 the source ID from the header which tells the client which sent
1497 The payload may only be sent with SILC_PACKET_CHANNEL_MESSAGE packet.
1498 It MUST NOT be sent in any other packet type. The following diagram
1499 represents the Channel Message Payload.
1501 (*) indicates that the field is not encrypted.
1507 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
1508 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1509 | Flags | Message Length |
1510 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1514 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1515 | Padding Length | |
1516 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1520 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1524 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1526 ~ Initial Vector * ~
1528 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1532 Figure 13: Channel Message Payload
1536 o Flags (2 bytes) - Includes the flags of the channel
1537 messages. The flags can indicate a reason or purpose
1538 for the channel message. Note that the Private Message
1539 Payload use these same flags for the same purpose. The
1540 following flags are defined:
1542 0x0000 SILC_MESSAGE_FLAG_NONE
1544 No specific flags set.
1546 0x0001 SILC_MESSAGE_FLAG_AUTOREPLY
1548 This message is an automatic reply to an earlier
1551 0x0002 SILC_MESSAGE_FLAG_NOREPLY
1553 There should not be reply messages to this
1556 0x0004 SILC_MESSAGE_FLAG_ACTION
1558 The sender is performing an action and the message
1559 is the indication of the action.
1561 0x0008 SILC_MESSAGE_FLAG_NOTICE
1563 The message is for example an informational notice
1566 0x0010 SILC_MESSAGE_FLAG_REQUEST
1568 This is a generic request flag to send request
1569 messages. A separate document should define any
1570 payloads associated to this flag.
1572 0x0020 SILC_MESSAGE_FLAG_SIGNED
1574 This flag indicates that the message is signed
1575 with sender's private key and thus can be verified
1576 by the receiver using the sender's public key. A
1577 separate document should define the detailed procedure
1578 of the signing process and any associated payloads
1581 0x0040 - 0x0200 RESERVED
1583 Reserved for future flags
1585 0x0400 - 0x8000 PRIVATE RANGE
1587 Private range for free use.
1589 o Message Length (2 bytes) - Indicates the length of the
1590 the Message Data field in the payload, not including any
1593 o Message Data (variable length) - The actual message to
1596 o Padding Length (2 bytes) - Indicates the length of the
1597 Padding field in the payload, not including any other
1600 o Padding (variable length) - The padding that MUST be
1601 applied because this payload is encrypted separately from
1602 other parts of the packet.
1604 o MAC (variable length) - The MAC computed from the
1605 Message Length, Message Data, Padding Length and Padding
1606 fields. This protects the integrity of the plaintext
1607 channel message. The receiver can verify from the MAC
1608 whether the message decrypted correctly. Also, if more than
1609 one private key has been set for the channel, the receiver
1610 can verify which of the keys decrypted the message
1611 correctly. Note that, this field is encrypted and MUST
1612 be added to the padding calculation.
1614 o Initial Vector (variable length) - The initial vector
1615 that has been used in packet encryption. It needs to be
1616 used in the packet decryption as well. What this field
1617 includes is implementation issue. However, it is
1618 RECOMMENDED that it would be random data or, perhaps,
1619 a timestamp. It is NOT RECOMMENDED to use zero (0) as an
1620 initial vector. This field is not encrypted. This field
1621 is not included into the padding calculation. Length
1622 of this field equals the cipher's block size. This field
1623 is, however, authenticated.
1628 2.3.10 Channel Key Payload
1630 All traffic in channels are protected by channel specific keys.
1631 Channel Key Payload is used to distribute channel keys to all
1632 clients on the particular channel. Channel keys are sent when
1633 the channel is created, when new user joins to the channel and
1634 whenever a user has left a channel. Server creates the new
1635 channel key and distributes it to the clients by encrypting this
1636 payload with the session key shared between the server and
1637 the client. After that, client starts using the key received
1638 in this payload to protect the traffic on the channel.
1640 The client which is joining to the channel receives its key in the
1641 SILC_COMMAND_JOIN command reply message thus it is not necessary to
1642 send this payload to the entity which sent the SILC_COMMAND_JOIN
1645 Channel keys are cell specific thus every router in the cell have
1646 to create a channel key and distribute it if any client in the
1647 cell has joined to a channel. Channel traffic between cell's
1648 are not encrypted using channel keys, they are encrypted using
1649 normal session keys between two routers. Inside a cell, all
1650 channel traffic is encrypted with the specified channel key.
1651 Channel key should expire periodically, say, in one hour, in
1652 which case new channel key is created and distributed.
1654 The payload may only be sent with SILC_PACKET_CHANNEL_KEY packet.
1655 It MUST NOT be sent in any other packet type. The following diagram
1656 represents the Channel Key Payload.
1662 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
1663 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1664 | Channel ID Length | |
1665 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1669 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1670 | Cipher Name Length | |
1671 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1676 | Channel Key Length | |
1677 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1681 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1685 Figure 14: Channel Key Payload
1690 o Channel ID Length (2 bytes) - Indicates the length of the
1691 Channel ID field in the payload, not including any other
1694 o Channel ID (variable length) - The Channel ID of the
1695 channel this key is meant for.
1697 o Cipher Name Length (2 bytes) - Indicates the length of the
1698 Cipher name field in the payload, not including any other
1701 o Cipher Name (variable length) - Name of the cipher used
1702 in the protection of channel traffic. This name is
1703 initially decided by the creator of the channel but it
1704 MAY change during the life time of the channel as well.
1706 o Channel Key Length (2 bytes) - Indicates the length of the
1707 Channel Key field in the payload, not including any other
1710 o Channel Key (variable length) - The actual channel key
1716 2.3.11 Private Message Payload
1718 Private Message Payload is used to send private message between
1719 two clients (or users for that matter). The messages are sent only
1720 to the specified user and no other user inside SILC network is
1721 able to see the message. The message is protected by the session
1722 key established by the SILC Key Exchange Protocol. However,
1723 it is also possible to agree to use a private key to protect
1724 just the private messages. See section 2.3.11 Private Message
1725 Key Payload for detailed description of how to agree to use
1728 If normal session key is used to protect the message, every server
1729 between the sender client and the receiving client MUST decrypt the
1730 packet and always re-encrypt it with the session key of the next
1731 receiver of the packet. See section Client To Client in [SILC1].
1733 When private key is used to protect the message, servers between
1734 the sender and the receiver needs not to decrypt/re-encrypt the
1735 packet. Section Client To Client in [SILC1] gives example of this
1738 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE
1739 packet. It MUST NOT be sent in any other packet type. The following
1740 diagram represents the Private Message Payload.
1746 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
1747 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1748 | Flags | Message Data Length |
1749 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1753 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1757 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1761 Figure 15: Private Message Payload
1765 o Flags (2 bytes) - This field includes the flags of the
1766 private message. They can indicate a different reason or
1767 purpose for the private message. See the section 2.3.9
1768 Channel Message Payload for defined flags. Note that
1769 the Channel Message Payload use the same flags for the
1772 o Message Data Length (2 bytes) - Indicates the length of the
1773 Message Data field, not includes any other field.
1775 o Message Data (variable length) - The actual message to
1776 the client. Rest of the packet is reserved for the message
1779 o Padding (variable length) - This field is present only
1780 when the private message payload is encrypted with private
1781 message key. In this case the padding is applied to make
1782 the payload multiple by eight (8), or by the block size of
1783 the cipher, which ever is larger. When encrypted with
1784 normal session keys, this field MUST NOT be included.
1789 2.3.12 Private Message Key Payload
1791 This payload is used to send key from client to another client that
1792 is going to be used to protect the private messages between these
1793 two clients. If this payload is not sent normal session key
1794 established by the SILC Key Exchange Protocol is used to protect
1795 the private messages.
1797 This payload may only be sent by client to another client. Server
1798 MUST NOT send this payload at any time. After sending this payload
1799 the sender of private messages must set the Private Message Key
1800 flag into SILC Packet Header.
1802 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE_KEY
1803 packet. It MUST NOT be sent in any other packet type. The following
1804 diagram represents the Private Message Key Payload.
1810 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
1811 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1812 | Private Message Key Length | |
1813 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1815 ~ Private Message Key ~
1817 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1818 | Cipher Name Length | |
1819 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1823 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1827 Figure 16: Private Message Key Payload
1833 o Private Message Key Length (2 bytes) - Indicates the length
1834 of the Private Message Key field in the payload, not including
1837 o Private Message Key (variable length) - The actual private
1838 message key material.
1840 o Cipher Name Length (2 bytes) - Indicates the length of the
1841 Cipher Name field in the payload, not including any other
1844 o Cipher Name (variable length) - Name of the cipher to use
1845 in the private message encryption. If this field does not
1846 exist then the default cipher of the SILC protocol is used.
1847 See the [SILC1] for defined ciphers.
1853 2.3.13 Command Payload
1855 Command Payload is used to send SILC commands from client to server.
1856 Also server MAY send commands to other servers. The following diagram
1857 represents the Command Payload.
1863 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
1864 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1865 | Payload Length | SILC Command | Arguments Num |
1866 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1867 | Command Identifier |
1868 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1872 Figure 17: Command Payload
1876 o Payload Length (2 bytes) - Length of the entire command
1877 payload including any command argument payloads associated
1880 o SILC Command (1 byte) - Indicates the SILC command. This MUST
1881 be set to non-zero value. If zero (0) value is found in this
1882 field the packet MUST be discarded.
1884 o Arguments Num (1 byte) - Indicates the number of arguments
1885 associated with the command. If there are no arguments this
1886 field is set to zero (0). The arguments MUST follow the
1887 command payload. See section 2.3.2.2 for definition of the
1890 o Command Identifier (2 bytes) - Identifies this command at the
1891 sender's end. The entity which replies to this command MUST
1892 set the value found from this field into the Command Payload
1893 used to send the reply to the sender. This way the sender
1894 can identify which command reply belongs to which originally
1895 sent command. What this field includes is implementation
1896 issue but it is RECOMMENDED that wrapping counter value is
1897 used in the field. Value zero (0) in this field means that
1898 no specific value is set.
1901 See [SILC4] for detailed description of different SILC commands,
1902 their arguments and their reply messages.
1908 2.3.14 Command Reply Payload
1910 Command Reply Payload is used to send replies to the commands. The
1911 Command Reply Payload is identical to the Command Payload thus see
1912 the upper section for the Command Payload specification.
1914 The entity which sends the reply packet MUST set the Command Identifier
1915 field in the reply packet's Command Payload to the value it received
1916 in the original command packet.
1918 See SILC Commands in [SILC4] for detailed description of different
1919 SILC commands, their arguments and their reply messages.
1923 2.3.15 Connection Auth Request Payload
1925 Client MAY send this payload to server to request the authentication
1926 method that must be used in authentication protocol. If client knows
1927 this information beforehand this payload is not necessary to be sent.
1928 Server performing authentication with another server MAY also send
1929 this payload to request the authentication method. If the connecting
1930 server already knows this information this payload is not necessary
1933 Server receiving this request MUST reply with same payload sending
1934 the mandatory authentication method. Algorithms that may be required
1935 to be used by the authentication method are the ones already
1936 established by the SILC Key Exchange protocol. See section Key
1937 Exchange Start Payload in [SILC3] for detailed information.
1939 The payload may only be sent with SILC_PACKET_CONNECTION_AUTH_REQUEST
1940 packet. It MUST NOT be sent in any other packet type. The following
1941 diagram represents the Connection Auth Request Payload.
1947 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
1948 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1949 | Connection Type | Authentication Method |
1950 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1954 Figure 18: Connection Auth Request Payload
1958 o Connection Type (2 bytes) - Indicates the type of the
1959 connection. The following connection types are defined:
1966 If any other type is found in this field the packet MUST be
1967 discarded and the authentication MUST be failed.
1969 o Authentication Method (2 bytes) - Indicates the authentication
1970 method to be used in the authentication protocol. The following
1971 authentication methods are defined:
1974 1 password (mandatory)
1975 2 public key (mandatory)
1977 If any other type is found in this field the packet MUST be
1978 discarded and the authentication MUST be failed. If this
1979 payload is sent as request to receive the mandatory
1980 authentication method this field MUST be set to zero (0),
1981 indicating that receiver should send the mandatory
1982 authentication method. The receiver sending this payload
1983 to the requesting party, MAY also set this field to zero (0)
1984 to indicate that authentication is not required. In this
1985 case authentication protocol still MUST be started but
1986 server is most likely to respond with SILC_PACKET_SUCCESS
1992 2.3.16 New ID Payload
1994 New ID Payload is a multipurpose payload. It is used to send newly
1995 created ID's from clients and servers. When client connects to server
1996 and registers itself to the server by sending SILC_PACKET_NEW_CLIENT
1997 packet, server replies with this packet by sending the created ID for
1998 the client. Server always creates the ID for the client.
2000 This payload is also used when server tells its router that new client
2001 has registered to the SILC network. In this case the server sends
2002 the Client ID of the client to the router. Similarly when router
2003 distributes information to other routers about the client in the SILC
2004 network this payload is used.
2006 Also, when server connects to router, router uses this payload to inform
2007 other routers about new server in the SILC network. However, every
2008 server (or router) creates their own ID's thus the ID distributed by
2009 this payload is not created by the distributor in this case. Servers
2010 create their own ID's. Server registers itself to the network by
2011 sending SILC_PACKET_NEW_SERVER to the router it connected to. The case
2012 is same when router connects to another router.
2014 However, this payload MUST NOT be used to send information about new
2015 channels. New channels are always distributed by sending the dedicated
2016 SILC_PACKET_NEW_CHANNEL packet.
2018 Thus, this payload is very important and used every time when some
2019 new entity is registered to the SILC network. Client MUST NOT send this
2020 payload. Both client and server (and router) MAY receive this payload.
2022 The packet uses generic ID Payload as New ID Payload. See section
2023 2.3.2.1 for generic ID Payload.
2027 2.3.17 New Client Payload
2029 When client is connected to the server, keys has been exchanged and
2030 connection has been authenticated client MUST register itself to the
2031 server. Client's first packet after key exchange and authentication
2032 protocols must be SILC_PACKET_NEW_CLIENT. This payload tells server all
2033 the relevant information about the connected user. Server creates a new
2034 client ID for the client when received this payload and sends it to the
2035 client in New ID Payload.
2037 This payload sends username and real name of the user on the remote host
2038 which is connected to the SILC server with SILC client. The server
2039 creates the client ID according the information sent in this payload.
2040 The nickname of the user becomes the username sent in this payload.
2041 However, client should call NICK command after sending this payload to
2042 set the real nickname of the user which is then used to create new
2045 The payload may only be sent with SILC_PACKET_NEW_CLIENT packet. It
2046 MUST NOT be sent in any other packet type. The following diagram
2047 represents the New Client Payload.
2064 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
2065 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2066 | Username Length | |
2067 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2071 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2072 | Real Name Length | |
2073 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2077 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2081 Figure 19: New Client Payload
2085 o Username Length (2 bytes) - Length of the Username field.
2087 o Username (variable length) - The username of the user on
2088 the host where connecting to the SILC server.
2090 o Real Name Length (2 bytes) - Length of the Real Name field.
2092 o Real Name (variable length) - The real name of the user
2093 on the host where connecting to the SILC server.
2098 2.3.18 New Server Payload
2100 This payload is sent by server when it has completed successfully both
2101 key exchange and connection authentication protocols. The server
2102 MUST register itself to the SILC Network by sending this payload.
2103 The first packet after these key exchange and authentication protocols
2104 is SILC_PACKET_NEW_SERVER packet. The payload includes the Server ID
2105 of the server that it has created by itself. It also includes a
2106 name of the server that is associated to the Server ID.
2108 The payload may only be sent with SILC_PACKET_NEW_SERVER packet. It
2109 MUST NOT be sent in any other packet type. The following diagram
2110 represents the New Server Payload.
2119 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
2120 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2121 | Server ID Length | |
2122 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2126 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2127 | Server Name Length | |
2128 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2132 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2136 Figure 20: New Server Payload
2140 o Server ID Length (2 bytes) - Length of the Server ID Data
2143 o Server ID Data (variable length) - The actual Server ID
2146 o Server Name Length (2 bytes) - Length of the server name
2149 o Server Name (variable length) - The server name.
2154 2.3.19 New Channel Payload
2156 Information about newly created channel is broadcasted to all routers
2157 in the SILC network by sending this packet payload. Channels are
2158 created by router of the cell. Server never creates channels unless
2159 it is a standalone server and it does not have router connection,
2160 in this case server acts as router. Normal server send JOIN command
2161 to the router (after it has received JOIN command from client) which
2162 then processes the command and creates the channel. Client MUST NOT
2163 send this packet. Server may send this packet to a router when it is
2164 announcing its existing channels to the router after it has connected
2167 The packet uses generic Channel Payload as New Channel Payload. See
2168 section 2.3.2.3 for generic Channel Payload. The Mode Mask field in the
2169 Channel Payload is the mode of the channel.
2173 2.3.20 Key Agreement Payload
2175 This payload is used by clients to request key negotiation between
2176 another client in the SILC Network. The key agreement protocol used
2177 is the SKE protocol. The result of the protocol, the secret key
2178 material, can be used for example as private message key between the
2179 two clients. This significantly adds security as the key agreement
2180 is performed outside the SILC network. The server and router MUST NOT
2183 The sender MAY tell the receiver of this payload the hostname and the
2184 port where the SKE protocol is running in the sender's end. The
2185 receiver MAY then initiate the SKE negotiation with the sender. The
2186 sender MAY also optionally not to include the hostname and the port
2187 of its SKE protocol. In this case the receiver MAY reply to the
2188 request by sending the same payload filled with the receiver's hostname
2189 and the port where the SKE protocol is running. The sender MAY then
2190 initiate the SKE negotiation with the receiver.
2192 This payload may be sent with SILC_PACKET_KEY_AGREEMENT and
2193 SILC_PACKET_FTP packet types. It MUST NOT be sent in any other packet
2194 types. The following diagram represents the Key Agreement Payload.
2200 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
2201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2202 | Hostname Length | |
2203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2207 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2209 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2213 Figure 21: Key Agreement Payload
2217 o Hostname Length (2 bytes) - Indicates the length of the
2220 o Hostname (variable length) - The hostname or IP address where
2221 the SKE protocol is running. The sender MAY fill this field
2222 when sending the payload. If the receiver sends this payload
2223 as reply to the request it MUST fill this field.
2225 o Port (4 bytes) - The port where the SKE protocol is bound.
2226 The sender MAY fill this field when sending the payload. If
2227 the receiver sends this payload as reply to the request it
2228 MUST fill this field. This is a 32 bit MSB first order value.
2232 After the key material has been received from the SKE protocol it is
2233 processed as the [SILC3] describes. If the key material is used as
2234 channel private key then the Sending Encryption Key, as defined in
2235 [SILC3] is used as the channel private key. Other key material must
2236 be discarded. The [SILC1] defines the way to use the key material if
2237 it is intended to be used as private message keys. Any other use for
2238 the key material is undefined.
2242 2.3.21 Resume Router Payload
2244 The payload may only be sent with SILC_PACKET_RESUME_ROUTER packet. It
2245 MUST NOT be sent in any other packet type. The Following diagram
2246 represents the Resume Router Payload.
2252 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
2253 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2254 | Type | Session ID |
2255 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2259 Figure 22: Resume Router Payload
2263 o Type (1 byte) - Indicates the type of the backup resume
2264 protocol packet. The type values are defined in [SILC1].
2266 o Session ID (1 bytes) - Indicates the session ID for the
2267 backup resume protocol. The sender of the packet sets this
2268 value and the receiver MUST set the same value in subsequent
2274 2.3.22 File Transfer Payload
2276 File Transfer Payload is used to perform file transfer protocol
2277 between two entities in the network. The actual file transfer
2278 protocol is always encapsulated inside the SILC Packet. The actual
2279 data stream is also sent peer to peer outside SILC network.
2281 When an entity, usually a client wishes to perform file transfer
2282 protocol with another client in the network, they perform Key Agreement
2283 protocol as described in the section 2.3.20 Key Agreement Payload and
2284 in [SILC3], inside File Transfer Payload. After the Key Agreement
2285 protocol has been performed the subsequent packets in the data stream
2286 will be protected using the new key material. The actual file transfer
2287 protocol is also initialized in this stage. All file transfer protocol
2288 packets are always encapsulated in the File Transfer Payload and
2289 protected with the negotiated key material.
2291 The payload may only be sent with SILC_PACKET_FTP packet. It MUST NOT
2292 be sent in any other packet type. The following diagram represents the
2293 File Transfer Payload
2298 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
2299 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2305 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2309 Figure 23: File Transfer Payload
2313 o Type (1 byte) - Indicates the type of the file transfer
2314 protocol. The following file transfer protocols has been
2317 1 SSH File Transfer Protocol (SFTP) (mandatory)
2319 If zero (0) value or any unsupported file transfer protocol
2320 type is found in this field the packet must be discarded.
2321 The currently mandatory file transfer protocol is SFTP.
2322 The SFTP protocol is defined in [SFTP].
2324 o Data (variable length) - Arbitrary file transfer data. The
2325 contents and encoding of this field is dependent of the usage
2326 of this payload and the type of the file transfer protocol.
2327 When this payload is used to perform the Key Agreement
2328 protocol, this field include the Key Agreement Payload,
2329 as defined in the section 2.3.20 Key Agreement Payload.
2330 When this payload is used to send the actual file transfer
2331 protocol data, the encoding is defined in the corresponding
2332 file transfer protocol.
2339 ID's are extensively used in the SILC network to associate different
2340 entities. The following ID's has been defined to be used in the SILC
2346 When ever specific ID cannot be used this is used.
2350 Server ID to associate servers. See the format of
2355 Client ID to associate clients. See the format of
2360 Channel ID to associate channels. See the format of
2366 2.5 Packet Encryption And Decryption
2368 SILC packets are encrypted almost entirely. Only small part of SILC
2369 header is not encrypted as described in section 5.2 SILC Packet Header.
2370 The SILC Packet header is the first part of a packet to be encrypted
2371 and it is always encrypted with the key of the next receiver of the
2372 packet. The data payload area of the packet is always entirely
2373 encrypted and it is usually encrypted with the next receiver's key.
2374 However, there are some special packet types and packet payloads
2375 that require special encryption process. These special cases are
2376 described in the next sections. First is described the normal packet
2381 2.5.1 Normal Packet Encryption And Decryption
2383 Normal SILC packets are encrypted with the session key of the next
2384 receiver of the packet. The entire SILC Packet header and the packet
2385 data payload is is also encrypted with the same key. Padding of the
2386 packet is also encrypted always with the session key, also in special
2387 cases. Computed MAC of the packet must not be encrypted.
2389 Decryption process in these cases are straightforward. The receiver
2390 of the packet MUST first decrypt the SILC Packet header, or some parts
2391 of it, usually first 16 bytes of it. Then the receiver checks the
2392 packet type from the decrypted part of the header and can determine
2393 how the rest of the packet must be decrypted. If the packet type is
2394 any of the special cases described in the following sections the packet
2395 decryption is special. If the packet type is not among those special
2396 packet types rest of the packet can be decrypted with the same key.
2398 With out a doubt, this sort of decryption processing causes some
2399 overhead to packet decryption, but never the less, is required.
2403 2.5.2 Channel Message Encryption And Decryption
2405 Channel Messages (Channel Message Payload) are always encrypted with
2406 the channel specific key. However, the SILC Packet header is not
2407 encrypted with that key. As in normal case, the header is encrypted
2408 with the key of the next receiver of the packet, who ever that might
2409 be. Note that in this case the encrypted data area is not touched
2410 at all; it MUST NOT be re-encrypted with the session key.
2412 Receiver of a channel message, who ever that is, is REQUIRED to decrypt
2413 the SILC Packet header to be able to even recognize the packet to be as
2414 channel message. This is same procedure as for normal SILC packets.
2415 As the receiver founds the packet to be channel message, rest of the
2416 packet processing is special. Rest of the SILC Packet header is
2417 decrypted with the same session key along with the padding of the
2418 packet. After that the packet is protected with the channel specific
2419 key and thus can be decrypted only if the receiver is the client on
2420 the channel. See section 2.7 Packet Padding Generation for more
2421 information about padding on special packets.
2423 If the receiver of the channel message is router which is routing the
2424 message to another router then it MUST decrypt the Channel Message
2425 payload. Between routers (that is, between cells) channel messages
2426 are protected with session keys shared between the routers. This
2427 causes another special packet processing for channel messages. If
2428 the channel message is received from another router then the entire
2429 packet, including Channel Message payload, MUST be encrypted with the
2430 session key shared between the routers. In this case the packet
2431 decryption process is as with normal SILC packets. Hence, if the
2432 router is sending channel message to another router the Channel
2433 Message payload MUST have been decrypted and MUST be re-encrypted
2434 with the session key shared between the another router. In this
2435 case the packet encryption is as with any normal SILC packet.
2437 It must be noted that this is only when the channel messages are sent
2438 from router to another router. In all other cases the channel
2439 message encryption and decryption is as described above. This
2440 different processing of channel messages with router to router
2441 connection is because channel keys are cell specific. All cells have
2442 their own channel keys thus the channel message traveling from one
2443 cell to another MUST be protected as it would be any normal SILC
2446 If the SILC_CMODE_PRIVKEY channel mode has been set for the channel
2447 then the router cannot decrypt the packet as it does not know the
2448 private key. In this case the entire packet MUST be encrypted with
2449 the session key and sent to the router. The router receiving the
2450 packet MUST check the channel mode and decrypt the packet accordingly.
2454 2.5.3 Private Message Encryption And Decryption
2456 By default, private message in SILC are protected by session keys.
2457 In this case the private message encryption and decryption process is
2458 equivalent to normal packet encryption and decryption.
2460 However, private messages MAY be protected with private message key
2461 which causes the packet to be special packet. The procedure in this
2462 case is very much alike to channel packets. The actual private message
2463 is encrypted with the private message key and other parts of the
2464 packet is encrypted with the session key. See 2.7 Packet Padding
2465 Generation for more information about padding on special packets.
2467 The difference from channel message processing is that server or router
2468 en route never decrypts the actual private message, as it does not
2469 have the key to do that. Thus, when sending packets between router
2470 the processing is same as in any other case as well; the packet's header
2471 and padding is protected by the session key and the data area is not
2474 The true receiver of the private message, client, that is, is able
2475 to decrypt the private message as it shares the key with the sender
2480 2.6 Packet MAC Generation
2482 Data integrity of a packet is protected by including a message
2483 authentication code (MAC) at the end of the packet. The MAC is computed
2484 from shared secret MAC key, that is established by the SILC Key Exchange
2485 protocol, from packet sequence number, and from the original contents
2486 of the packet. The MAC is always computed before the packet is
2487 encrypted, although after it is compressed if compression is used.
2489 The MAC is computed from entire packet. Every bit of data in the packet,
2490 including SILC Packet Header is used in the MAC computing. This way
2491 the entire packet becomes authenticated.
2493 If the packet is special packet MAC is computed from the entire packet
2494 but part of the packet may be encrypted before the MAC is computed.
2495 This is case, for example, with channel messages where the message data
2496 is encrypted with key that server may not now. In this case the MAC
2497 has been computed from the encrypted data.
2499 Hence, packet's MAC generation is as follows:
2501 mac = MAC(key, sequence number | SILC packet)
2503 The MAC key is negotiated during the SKE protocol. The sequence number
2504 is a 32 bit MSB first value starting from zero for first packet and
2505 increasing for subsequent packets, finally wrapping after 2^32 packets.
2506 The value is never reset, not even after rekey has been performed. Note
2507 that the sequence number is incremented only when MAC is computed for a
2508 packet. If packet is not encrypted and MAC is not computed then the
2509 sequence number is not incremented. Hence, the sequence number is zero
2510 for first encrypted packet.
2512 See [SILC1] for defined and allowed MAC algorithms.
2516 2.7 Packet Padding Generation
2518 Padding is needed in the packet because the packet is encrypted. It
2519 MUST always be multiple by eight (8) or multiple by the block size
2520 of the cipher, which ever is larger. The padding is always encrypted.
2522 For normal packets the padding is added after the SILC Packet Header
2523 and between the Data Payload area. The padding for normal packets
2524 are calculated as follows:
2527 padding length = 16 - (packet_length mod block_size)
2530 The `block_size' is the block size of the cipher. The maximum padding
2531 length is 16 bytes, and minimum is 1 byte. The above algorithm calculates
2532 the padding to the next block size, and always returns the padding
2533 length between 1 - 16 bytes.
2535 For special packets the padding calculation is different as special
2536 packets may be encrypted differently. In these cases the encrypted
2537 data area MUST already be multiple by the block size thus in this case
2538 the padding is calculated only for SILC Packet Header, not for any
2539 other area of the packet. The same algorithm works in this case as
2540 well, except that the `packet length' is now the SILC Packet Header
2543 The padding MUST be random data, preferably, generated by
2544 cryptographically strong random number generator.
2548 2.8 Packet Compression
2550 SILC Packets MAY be compressed. In this case the data payload area
2551 is compressed and all other areas of the packet MUST remain as they
2552 are. After compression is performed for the data area, the length
2553 field of Packet Header MUST be set to the compressed length of the
2556 The compression MUST always be applied before encryption. When
2557 the packet is received and decrypted the data area MUST be decompressed.
2558 Note that the true sender of the packet MUST apply the compression and
2559 the true receiver of the packet MUST apply the decompression. Any
2560 server or router en route MUST NOT decompress the packet.
2566 The sender of the packet MUST assemble the SILC Packet Header with
2567 correct values. It MUST set the Source ID of the header as its own
2568 ID, unless it is forwarding the packet. It MUST also set the Destination
2569 ID of the header to the true destination. If the destination is client
2570 it will be Client ID, if it is server it will be Server ID and if it is
2571 channel it will be Channel ID.
2573 If the sender wants to compress the packet it MUST apply the
2574 compression now. Sender MUST also compute the padding as described
2575 in above sections. Then sender MUST compute the MAC of the packet.
2577 Then sender MUST encrypt the packet as has been described in above
2578 sections according whether the packet is normal packet or special
2579 packet. The computed MAC MUST NOT be encrypted.
2583 2.10 Packet Reception
2585 On packet reception the receiver MUST check that all fields in the
2586 SILC Packet Header are valid. It MUST check the flags of the
2587 header and act accordingly. It MUST also check the MAC of the packet
2588 and if it is to be failed the packet MUST be discarded. Also if the
2589 header of the packet includes any bad fields the packet MUST be
2592 See above sections on the decryption process of the received packet.
2594 The receiver MUST also check that the ID's in the header are valid
2595 ID's. Unsupported ID types or malformed ID's MUST cause packet
2596 rejection. The padding on the reception is always ignored.
2598 The receiver MUST also check the packet type and start parsing the
2599 packet according to the type. However, note the above sections on
2600 special packet types and their parsing.
2606 Routers are the primary entities in the SILC network that takes care
2607 of packet routing. However, normal servers routes packets as well, for
2608 example, when they are routing channel message to the local clients.
2609 Routing is quite simple as every packet tells the true origin and the
2610 true destination of the packet.
2612 It is still RECOMMENDED for routers that has several routing connections
2613 to create route cache for those destinations that has faster route than
2614 the router's primary route. This information is available for the router
2615 when other router connects to the router. The connecting party then
2616 sends all of its locally connected clients, servers and channels. These
2617 informations helps to create the route cache. Also, when new channels
2618 are created to a cell its information is broadcasted to all routers
2619 in the network. Channel ID's are based on router's ID thus it is easy
2620 to create route cache based on these informations. If faster route for
2621 destination does not exist in router's route cache the packet MUST be
2622 routed to the primary route (default route).
2624 However, there are some issues when routing channel messages to group
2625 of users. Routers are responsible of routing the channel message to
2626 other routers, local servers and local clients as well. Routers MUST
2627 send the channel message to only one router in the network, preferrably
2628 to the shortest route to reach the channel users. The message can be
2629 routed into either upstream or downstream. After the message is sent
2630 to a router in the network it MUST NOT be sent to any other router in
2631 either same route or other route. The message MUST NOT be routed to
2632 the router it came from.
2634 When routing for example private messages they should be routed to the
2635 shortest route always to reach the destination client as fast as possible.
2637 For server which receives a packet to be routed to its locally connected
2638 client the server MUST check whether the particular packet type is
2639 allowed to be routed to the client. Not all packets may be sent by
2640 some odd entity to client that is indirectly connected to the sender.
2641 See section 2.3 SILC Packet Types and paragraph about indirectly connected
2642 entities and sending packets to them. The section mentions the packets
2643 that may be sent to indirectly connected entities. It is clear that
2644 server cannot send, for example, disconnect packet to client that is not
2645 directly connected to the server.
2647 Routers form a ring in the SILC network. However, routers may have other
2648 direct connections to other routers in the network too. This can cause
2649 interesting routing problems in the network. Since the network is a ring,
2650 the packets usually should be routed into counter clock-wise direction,
2651 or if it cannot be used then always clock-wise (primary route) direction.
2652 Problems may arise when a faster direct route exists and router is routing
2653 a channel message. Currently channel messages must be routed either
2654 in upstream or downstream, they cannot be routed to other direct routes.
2655 The SILC protocol should have a shortest path discovery protocol, and some
2656 existing routing protocol, that can handle a ring network with other
2657 direct routes inside the ring (so called hybrid ring-mesh topology),
2658 MAY be defined to be used with the SILC protocol. Additional
2659 specifications MAY be written on the subject to permeate this
2664 2.12 Packet Broadcasting
2666 SILC packets MAY be broadcasted in SILC network. However, only router
2667 server may send or receive broadcast packets. Client and normal server
2668 MUST NOT send broadcast packets and they MUST ignore broadcast packets
2669 if they receive them. Broadcast packets are sent by setting Broadcast
2670 flag to the SILC packet header.
2672 Broadcasting packets means that the packet is sent to all routers in
2673 the SILC network, except to the router that sent the packet. The router
2674 receiving broadcast packet MUST send the packet to its primary route.
2675 The fact that SILC routers may have several router connections can
2676 cause problems, such as race conditions inside the SILC network, if
2677 care is not taken when broadcasting packets. Router MUST NOT send
2678 the broadcast packet to any other route except to its primary route.
2680 If the primary route of the router is the original sender of the packet
2681 the packet MUST NOT be sent to the primary route. This may happen
2682 if router has several router connections and some other router uses
2683 the router as its primary route.
2685 Routers use broadcast packets to broadcast for example information
2686 about newly registered clients, servers, channels etc. so that all the
2687 routers may keep these informations up to date.
2691 3 Security Considerations
2693 Security is central to the design of this protocol, and these security
2694 considerations permeate the specification. Common security considerations
2695 such as keeping private keys truly private and using adequate lengths for
2696 symmetric and asymmetric keys must be followed in order to maintain the
2697 security of this protocol.
2703 [SILC1] Riikonen, P., "Secure Internet Live Conferencing (SILC),
2704 Protocol Specification", Internet Draft, April 2001.
2706 [SILC3] Riikonen, P., "SILC Key Exchange and Authentication
2707 Protocols", Internet Draft, April 2001.
2709 [SILC4] Riikonen, P., "SILC Commands", Internet Draft, April 2001.
2711 [IRC] Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2714 [IRC-ARCH] Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2717 [IRC-CHAN] Kalt, C., "Internet Relay Chat: Channel Management", RFC
2720 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
2723 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
2726 [SSH-TRANS] Ylonen, T., et al, "SSH Transport Layer Protocol",
2729 [PGP] Callas, J., et al, "OpenPGP Message Format", RFC 2440,
2732 [SPKI] Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
2735 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key
2736 Infrastructure, Certificate and CRL Profile", RFC 2459,
2739 [Schneier] Schneier, B., "Applied Cryptography Second Edition",
2740 John Wiley & Sons, New York, NY, 1996.
2742 [Menezes] Menezes, A., et al, "Handbook of Applied Cryptography",
2745 [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol",
2746 RFC 2412, November 1998.
2748 [ISAKMP] Maughan D., et al, "Internet Security Association and
2749 Key Management Protocol (ISAKMP)", RFC 2408, November
2752 [IKE] Harkins D., and Carrel D., "The Internet Key Exchange
2753 (IKE)", RFC 2409, November 1998.
2755 [HMAC] Krawczyk, H., "HMAC: Keyed-Hashing for Message
2756 Authentication", RFC 2104, February 1997.
2758 [PKCS1] Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
2759 Specifications, Version 2.0", RFC 2437, October 1998.
2761 [RFC2119] Bradner, S., "Key Words for use in RFCs to Indicate
2762 Requirement Levels", BCP 14, RFC 2119, March 1997.
2770 Snellmanninkatu 34 A 15
2774 EMail: priikone@silcnet.org
2776 This Internet-Draft expires XXX