8 .ds RF FORMFEED[Page %]
11 .ds RH 25 November 2002
17 Network Working Group P. Riikonen
19 draft-riikonen-silc-pp-06.txt 25 November 2002
20 Expires: 25 April 2003
26 <draft-riikonen-silc-pp-06.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
73 1 Introduction .................................................. 3
74 1.1 Requirements Terminology .................................. 4
75 2 SILC Packet Protocol .......................................... 4
76 2.1 SILC Packet ............................................... 4
77 2.2 SILC Packet Header ........................................ 5
78 2.3 SILC Packet Types ......................................... 8
79 2.3.1 SILC Packet Payloads ................................ 15
80 2.3.2 Generic payloads .................................... 16
81 2.3.2.1 ID Payload .................................. 16
82 2.3.2.2 Argument Payload ............................ 16
83 2.3.2.3 Channel Payload ............................. 17
84 2.3.2.4 Public Key Payload .......................... 18
85 2.3.2.5 Message Payload ............................. 19
86 2.3.3 Disconnect Payload .................................. 22
87 2.3.4 Success Payload ..................................... 23
88 2.3.5 Failure Payload ..................................... 23
89 2.3.6 Reject Payload ...................................... 24
90 2.3.7 Notify Payload ...................................... 25
91 2.3.8 Error Payload ....................................... 32
92 2.3.9 Channel Message Payload ............................. 33
93 2.3.10 Channel Key Payload ................................ 34
94 2.3.11 Private Message Payload ............................ 35
95 2.3.12 Private Message Key Payload ........................ 36
96 2.3.13 Command Payload .................................... 38
97 2.3.14 Command Reply Payload .............................. 39
98 2.3.15 Connection Auth Request Payload .................... 39
99 2.3.16 New ID Payload ..................................... 40
100 2.3.17 New Client Payload ................................. 41
101 2.3.18 New Server Payload ................................. 42
102 2.3.19 New Channel Payload ................................ 43
103 2.3.20 Key Agreement Payload .............................. 43
104 2.3.21 Resume Router Payload .............................. 44
105 2.3.22 File Transfer Payload .............................. 45
106 2.3.23 Resume Client Payload .............................. 46
107 2.4 SILC ID Types ............................................. 47
108 2.5 Packet Encryption And Decryption .......................... 48
109 2.5.1 Normal Packet Encryption And Decryption ............. 48
110 2.5.2 Channel Message Encryption And Decryption ........... 49
111 2.5.3 Private Message Encryption And Decryption ........... 50
112 2.6 Packet MAC Generation ..................................... 50
113 2.7 Packet Padding Generation ................................. 51
114 2.8 Packet Compression ........................................ 52
115 2.9 Packet Sending ............................................ 52
116 2.10 Packet Reception ......................................... 52
117 2.11 Packet Routing ........................................... 53
118 2.12 Packet Broadcasting ...................................... 54
119 3 Security Considerations ....................................... 55
120 4 References .................................................... 55
121 5 Author's Address .............................................. 56
127 Figure 1: Typical SILC Packet
128 Figure 2: SILC Packet Header
130 Figure 4: Argument Payload
131 Figure 5: Channel Payload
132 Figure 6: Public Key Payload
133 Figure 7: Message Payload
134 Figure 8: Disconnect Payload
135 Figure 9: Success Payload
136 Figure 10: Failure Payload
137 Figure 11: Reject Payload
138 Figure 12: Notify Payload
139 Figure 13: Error Payload
140 Figure 14: Channel Key Payload
141 Figure 15: Private Message Key Payload
142 Figure 16: Command Payload
143 Figure 17: Connection Auth Request Payload
144 Figure 18: New Client Payload
145 Figure 19: New Server Payload
146 Figure 20: Key Agreement Payload
147 Figure 21: Resume Router Payload
148 Figure 22: File Transfer Payload
149 Figure 23: Resume Client Payload
155 This document describes a Packet Protocol used in the Secure Internet
156 Live Conferencing (SILC) protocol specified in the Secure Internet Live
157 Conferencing, Protocol Specification Internet Draft [SILC1]. This
158 protocol describes the packet types and packet payloads which defines
159 the contents of the packets. The protocol provides secure binary packet
160 protocol that assures that the contents of the packets are secured and
161 authenticated. The packet protocol is designed to be compact to avoid
162 unnecessary overhead as much as possible. This makes the SILC suitable
163 also in environment of low bandwidth requirements such as mobile networks.
164 All packet payloads can also be compressed to further reduce the size
167 All packets in SILC network are always encrypted and their integrity
168 is assured by computed MACs. The protocol defines several packet types
169 and packet payloads. Each packet type usually has a specific packet
170 payload that actually defines the contents of the packet. Each packet
171 also includes a default SILC Packet Header that provides sufficient
172 information about the origin of the packet and destination of the
177 1.1 Requirements Terminology
179 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
180 MAY, and OPTIONAL, when they appear in this document, are to be
181 interpreted as described in [RFC2119].
185 2 SILC Packet Protocol
190 SILC packets deliver messages from sender to receiver securely by
191 encrypting important fields of the packet. The packet consists of
192 default SILC Packet Header, Padding, Packet Payload data, and, packet
195 The following diagram illustrates typical SILC packet.
200 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
201 | n bytes | 1 - n bytes | n bytes | n bytes
202 | SILC Header | Padding | Data Payload | MAC
203 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
207 Figure 1: Typical SILC Packet
210 SILC Header is always the first part of the packet and its purpose
211 is to provide information about the packet. It provides for example
212 the packet type, origin of the packet and the destination of the packet.
213 The header is variable in length. See the following section for
214 description of SILC Packet header. Packets without SILC header or
215 with malformed SILC header MUST be dropped.
217 Padding follows the packet header. The purpose of the padding is to
218 make the packet multiple by eight (8) or by the block size of the
219 cipher used in the encryption, which ever is larger. The maximum
220 length of padding is currently 128 bytes. The padding is always
221 encrypted. The padding is applied always, even if the packet is
222 not encrypted. See the section 2.7 Padding Generation for more
223 detailed information.
225 Data payload area follows padding and it is the actual data of the
226 packet. The packet data is the packet payloads defined in this
227 protocol. The data payload area is always encrypted.
229 The last part of SILC packet is the packet MAC that assures the
230 integrity of the packet. See the section 2.6 Packet MAC Generation
231 for more information. If compression is used the compression is
232 always applied before encryption.
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 | Pad Length | RESERVED | Source ID Len | Dest ID Len |
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
330 Marks that the payload of the packet is compressed.
331 The sender of the packet marks this flag when it
332 compresses the payload, and any server or router
333 en route to the recipient MUST NOT unset this flag.
334 See section 2.8 Packet Compression for description of
339 o Packet Type (1 byte) - Is the type of the packet. Receiver
340 uses this field to parse the packet. See section 2.3
341 SILC Packets for list of defined packet types.
343 o Pad Length (1 byte) - Indicates the length of the padding
344 applied after the SILC Packet header. Maximum length for
345 padding is 128 bytes.
347 o RESERVED (1 byte) - Reserved field and must include a
350 o Source ID Length (1 byte) - Indicates the length of the
351 Source ID field in the header, not including this or any
354 o Destination ID Length (1 byte) - Indicates the length of the
355 Destination ID field in the header, not including this or
358 o Src ID Type (1 byte) - Indicates the type of ID in the
359 Source ID field. See section 2.4 SILC ID Types for
362 o Source ID (variable length) - The actual source ID that
363 indicates which is the original sender of the packet.
365 o Dst ID Type (1 byte) - Indicates the type of ID in the
366 Destination ID field. See section 2.4 SILC ID Types for
369 o Destination ID (variable length) - The actual destination
370 ID that indicates which is the end receiver of the packet.
378 2.3 SILC Packet Types
380 SILC packet types defines the contents of the packet and it is used by
381 the receiver to parse the packet. The packet type is 8 bits, as a one
382 byte, in length. The range for the packet types are from 0 - 255,
383 where 0 is never sent and 255 is currently reserved for future
384 extensions and MUST NOT be defined to any other purpose. Every SILC
385 specification compliant implementation SHOULD support all of these packet
388 The below list of the SILC Packet types includes reference to the packet
389 payload as well. Packet payloads are the actual packet data area. Each
390 packet type defines packet payload which usually may only be sent with
391 the specific packet type.
393 Most of the packets are packets that must be destined directly to entity
394 that is connected to the sender. It is not allowed, for example, for
395 router to send disconnect packet to client that is not directly connected
396 to the router. However, there are some special packet types that may
397 be destined to some entity that the sender does not have direct
398 connection with. These packets are for example private message packets,
399 channel message packets, command packets and some other packets that may
400 be broadcasted in the SILC network. If the packet is allowed to be sent
401 to indirectly connected entity it is defined separately in the packet
402 description below. Other packets MUST NOT be sent or accepted, if sent,
403 to indirectly connected entities.
405 Some packets MAY be sent as lists by adding the List flag to the Packet
406 Header and constructing multiple packet payloads one after the other.
407 When this is allowed it is separately defined below. Other packets
408 MUST NOT be sent as list and the List flag MUST NOT be set.
411 List of SILC Packet types are defined as follows.
416 This type is reserved and it is never sent.
419 1 SILC_PACKET_DISCONNECT
421 This packet is sent to disconnect the remote end. Reason of
422 the disconnection is sent inside the packet payload. Client
423 usually does not send this packet.
425 Payload of the packet: See section 2.3.3 Disconnect Payload
428 2 SILC_PACKET_SUCCESS
430 This packet is sent upon successful execution of some protocol.
431 The status of the success is sent in the packet.
433 Payload of the packet: See section 2.3.4 Success Payload
436 3 SILC_PACKET_FAILURE
438 This packet is sent upon failure of some protocol. The status
439 of the failure is sent in the packet.
441 Payload of the packet: See section 2.3.5 Failure Payload
446 This packet MAY be sent upon rejection of some protocol.
447 The status of the rejection is sent in the packet.
449 Payload of the packet: See section 2.3.6 Reject Payload
454 This packet is used to send notify message. The packet is
455 usually sent between server and client, but also between
456 server and router. Client MUST NOT send this packet. Server
457 MAY send this packet to channel as well when the packet is
458 distributed to all clients on the channel. This packet MAY
461 Payload of the packet: See section 2.3.7 Notify Payload.
467 This packet is sent when an error occurs. Server MAY
468 send this packet. Client MUST NOT send this packet. The
469 client MAY entirely ignore the packet, however, server is
470 most likely to take action anyway. This packet MAY be sent
471 to entity that is indirectly connected to the sender.
473 Payload of the packet: See section 2.3.8 Error Payload.
476 7 SILC_PACKET_CHANNEL_MESSAGE
478 This packet is used to send messages to channels. The packet
479 includes Channel ID of the channel and the actual message to
480 the channel. Messages sent to the channel are always protected
481 by channel specific keys. Channel Keys are distributed by
482 SILC_PACKET_CHANNEL_KEY packet. This packet MAY be sent to
483 entity that is indirectly connected to the sender.
485 Payload of the packet: See section 2.3.9 Channel Message
489 8 SILC_PACKET_CHANNEL_KEY
491 This packet is used to distribute new key for particular
492 channel. Each channel has their own independent keys that
493 is used to protect the traffic on the channel. Only server
494 may send this packet. This packet MAY be sent to entity
495 that is indirectly connected to the sender.
497 Payload of the packet: See section 2.3.10 Channel Key Payload
500 9 SILC_PACKET_PRIVATE_MESSAGE
502 This packet is used to send private messages from client
503 to another client. By default, private messages are protected
504 by session keys established by normal key exchange protocol.
505 However, it is possible to use specific key to protect private
506 messages. See [SILC1] for private message key generation.
507 This packet MAY be sent to entity that is indirectly connected
510 Payload of the packet: See section 2.3.11 Private Message
514 10 SILC_PACKET_PRIVATE_MESSAGE_KEY
516 This packet can be used to agree about a key to be used to
517 protect private messages between two clients. This packet
518 is sent inside the SILC network and protected with session
519 keys. There are other means of agreeing to use private message
520 keys as well, than sending this packet, which may not be
521 desirable on all situations. See the [SILC1] for private
522 message key generation.
524 Payload of the packet: See section 2.3.12 Private Message
528 11 SILC_PACKET_COMMAND
530 This packet is used to send commands from client to server.
531 Server MAY send this packet to other servers as well. All
532 commands are listed in their own section SILC Command Types
533 in [SILC4]. The contents of this packet is command specific.
534 This packet MAY be sent to entity that is indirectly connected
537 Payload of the packet: See section 2.3.13 Command Payload
540 12 SILC_PACKET_COMMAND_REPLY
542 This packet is sent as reply to the SILC_PACKET_COMMAND packet.
543 The contents of this packet is command specific. This packet
544 MAY be sent to entity that is indirectly connected to the
547 Payload of the packet: See section 2.3.14 Command Reply
548 Payload and section 2.3.13 Command
554 13 SILC_PACKET_KEY_EXCHANGE
556 This packet is used to start SILC Key Exchange Protocol,
557 described in detail in [SILC3].
559 Payload of the packet: Payload of this packet is described
560 in the section SILC Key Exchange
561 Protocol and its sub sections in
565 14 SILC_PACKET_KEY_EXCHANGE_1
567 This packet is used as part of the SILC Key Exchange Protocol.
569 Payload of the packet: Payload of this packet is described
570 in the section SILC Key Exchange
571 Protocol and its sub sections in
575 15 SILC_PACKET_KEY_EXCHANGE_2
577 This packet is used as part of the SILC Key Exchange Protocol.
579 Payload of the packet: Payload of this packet is described
580 in the section SILC Key Exchange
581 Protocol and its sub sections in
585 16 SILC_PACKET_CONNECTION_AUTH_REQUEST
587 This packet is used to request an authentication method to
588 be used in the SILC Connection Authentication Protocol. If
589 initiator of the protocol does not know the mandatory
590 authentication method this packet MAY be used to determine it.
591 The party receiving this payload SHOULD respond with the same
592 packet including the mandatory authentication method.
594 Payload of the packet: See section 2.3.15 Connection Auth
600 17 SILC_PACKET_CONNECTION_AUTH
602 This packet is used to start and perform the SILC Connection
603 Authentication Protocol. This protocol is used to authenticate
604 the connecting party. The protocol is described in detail in
607 Payload of the packet: Payload of this packet is described
608 in the section SILC Authentication
609 Protocol and it sub sections in [SILC].
612 18 SILC_PACKET_NEW_ID
614 This packet is used to distribute new IDs from server to
615 router and from router to all other routers in SILC network.
616 This is used when for example new client is registered to
617 SILC network. The newly created IDs of these operations are
618 distributed by this packet. Only server may send this packet,
619 however, client MUST be able to receive this packet. This
620 packet MAY be sent to entity that is indirectly connected
621 to the sender. This packet MAY be sent as list.
623 Payload of the packet: See section 2.3.16 New ID Payload
626 19 SILC_PACKET_NEW_CLIENT
628 This packet is used by client to register itself to the
629 SILC network. This is sent after key exchange and
630 authentication protocols has been completed. Client sends
631 various information about itself in this packet.
633 Payload of the packet: See section 2.3.17 New Client Payload
636 20 SILC_PACKET_NEW_SERVER
638 This packet is used by server to register itself to the
639 SILC network. This is sent after key exchange and
640 authentication protocols has been completed. Server sends
641 this to the router it connected to, or, if router was
642 connecting, to the connected router. Server sends its
643 Server ID and other information in this packet. The client
644 MUST NOT send or receive this packet.
646 Payload of the packet: See section 2.3.18 New Server Payload
649 21 SILC_PACKET_NEW_CHANNEL
651 This packet is used to notify routers about newly created
652 channel. Channels are always created by the router and it MUST
653 notify other routers about the created channel. Router sends
654 this packet to its primary route. Client MUST NOT send this
655 packet. This packet MAY be sent to entity that is indirectly
656 connected to the sender. This packet MAY be sent as list.
658 Payload of the packet: See section 2.3.19 New Channel Payload
663 This packet is used to indicate that re-key must be performed
664 for session keys. See section Session Key Regeneration in
665 [SILC1] for more information. This packet does not have
669 23 SILC_PACKET_REKEY_DONE
671 This packet is used to indicate that re-key is performed and
672 new keys must be used hereafter. This packet does not have a
676 24 SILC_PACKET_HEARTBEAT
678 This packet is used by clients, servers and routers to keep the
679 connection alive. It is RECOMMENDED that all servers implement
680 keepalive actions and perform it to both direction in a link.
681 This packet does not have a payload.
684 25 SILC_PACKET_KEY_AGREEMENT
686 This packet is used by clients to request key negotiation
687 between another client in the SILC network. If the negotiation
688 is started it is performed using the SKE protocol. The result of
689 the negotiation, the secret key material, can be used for
690 example as private message key. The server and router MUST NOT
693 Payload of the packet: See section 2.3.20 Key Agreement Payload
696 26 SILC_PACKET_RESUME_ROUTER
698 This packet is used during backup router protocol when the
699 original primary router of the cell comes back online and wishes
700 to resume the position as being the primary router of the cell.
702 Payload of the packet: See section 2.3.21 Resume Router Payload
707 This packet is used to perform an file transfer protocol in the
708 SILC session with some entity in the network. The packet is
709 multi purpose. The packet is used to tell other entity in the
710 network that the sender wishes to perform an file transfer
711 protocol. The packet is also used to actually tunnel the
712 file transfer protocol stream. The file transfer protocol
713 stream is always protected with the SILC binary packet protocol.
715 Payload of the packet: See section 2.3.22 File Transfer Payload
718 28 SILC_PACKET_RESUME_CLIENT
720 This packet is used to resume a client back to the network
721 after it has been detached. A client is able to detach from
722 the network but the client is still valid client in the network.
723 The client may then later resume its session back by sending
724 this packet to a server. Routers also use this packet to notify
725 other routers in the network that the detached client has resumed.
727 Payload of the packet: See section 2.3.23 Resume Client Payload
732 Currently undefined commands.
737 These packet types are reserved for private use and they will
738 not be defined by this document.
743 This type is reserved for future extensions and currently it
749 2.3.1 SILC Packet Payloads
751 All payloads resides in the main data area of the SILC packet. However
752 all payloads MUST be at the start of the data area after the SILC
753 packet header and padding. All fields in the packet payload are always
754 encrypted, as they reside in the data area of the packet which is
757 Payloads described in this section are common payloads that MUST be
758 accepted anytime during SILC session. Most of the payloads may only
759 be sent with specific packet type which is defined in the description
762 There are many other payloads in SILC as well. However, they are not
763 common in the sense that they could be sent at any time. These payloads
764 are not described in this section. These are payloads such as SILC
765 Key Exchange payloads and so on. These are described in [SILC1],
770 2.3.2 Generic payloads
772 This section describes generic payloads that are not associated to any
773 specific packet type. They can be used for example inside some other
780 This payload can be used to send an ID. ID's are variable in length
781 thus this payload provides a way to send variable length ID.
783 The following diagram represents the ID Payload.
788 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
789 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
790 | ID Type | ID Length |
791 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
795 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
803 o ID Type (2 bytes) - Indicates the type of the ID. See
804 section 2.4 SILC ID Types for list of defined ID types.
806 o ID Length (2 bytes) - Length of the ID Data area not
807 including the length of any other fields in the payload.
809 o ID Data (variable length) - The actual ID data. The encoding
810 of the ID data is defined in section 2.4 SILC ID Types.
815 2.3.2.2 Argument Payload
817 Argument Payload is used to set arguments for any packet payload that
818 need and support arguments, such as commands. Number of arguments
819 associated with a packet MUST be indicated by the packet payload which
820 need the arguments. Argument Payloads MUST always reside right after
821 the packet payload needing the arguments. Incorrect amount of argument
822 payloads MUST cause rejection of the packet.
824 The following diagram represents the Argument Payload.
829 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
830 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
831 | Payload Length | Argument Type | |
832 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
836 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
840 Figure 4: Argument Payload
844 o Payload Length (2 bytes) - Length of the Argument Data
845 area not including the length of any other field in the
848 o Argument Type (1 byte) - Indicates the type of the argument.
849 Every argument can have a specific type that MUST be defined
850 by the packet payload needing the argument. For example
851 every command specify a number for each argument that may be
852 associated with the command. By using this number the receiver
853 of the packet knows what type of argument this is. If there is
854 no specific argument type this field is set to zero (0) value.
856 o Argument Data (variable length) - Argument data.
861 2.3.2.3 Channel Payload
863 Generic Channel Payload may be used to send information about channel,
864 its name, the Channel ID and a mode.
866 The following diagram represents the Channel Payload.
872 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
873 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
874 | Channel Name Length | |
875 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
879 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
880 | Channel ID Length | |
881 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
885 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
887 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
891 Figure 5: New Channel Payload
895 o Channel Name Length (2 bytes) - Length of the channel name
898 o Channel Name (variable length) - The name of the channel.
900 o Channel ID Length (2 bytes) - Length of the Channel ID field.
902 o Channel ID (variable length) - The Channel ID.
904 o Mode Mask (4 bytes) - A mode. This can be the mode of the
905 channel but it can also be the mode of a client on the
906 channel. The contents of this field is dependent of the
907 usage of this payload. The usage is defined separately
908 when this payload is used. This is a 32 bit MSB first value.
913 2.3.2.4 Public Key Payload
915 Generic Public Key Payload may be used to send different type of
916 public keys and certificates.
918 The following diagram represents the Public Key Payload.
923 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
924 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
925 | Public Key Length | Public Key Type |
926 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
928 ~ Public Key (or certificate) ~
930 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
934 Figure 6: Public Key Payload
938 o Public Key Length (2 bytes) - The length of the Public Key
939 (or certificate) field, not including any other field.
941 o Public Key Type (2 bytes) - The public key (or certificate)
942 type. This field indicates the type of the public key in
943 the packet. See the [SILC3] for defined public key types.
945 o Public Key (or certificate) (variable length) - The
946 public key or certificate data.
951 2.3.2.5 Message Payload
953 Generic Message Payload can be used to send messages in SILC. It
954 is used to send channel messages and private messages.
956 The following diagram represents the Message Payload.
958 (*) indicates that the field is not encrypted.
963 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
964 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
965 | Message Flags | Message Length |
966 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
970 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
972 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
976 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
980 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
984 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
988 Figure 7: Message Payload
992 o Message Flags (2 bytes) - Includes the Message Flags of the
993 message. The flags can indicate a reason or a purpose for
994 the message. The following Message Flags are defined:
996 0x0000 SILC_MESSAGE_FLAG_NONE
998 No specific flags set.
1000 0x0001 SILC_MESSAGE_FLAG_AUTOREPLY
1002 This message is an automatic reply to an earlier
1005 0x0002 SILC_MESSAGE_FLAG_NOREPLY
1007 There should not be reply messages to this
1010 0x0004 SILC_MESSAGE_FLAG_ACTION
1012 The sender is performing an action and the message
1013 is the indication of the action.
1015 0x0008 SILC_MESSAGE_FLAG_NOTICE
1017 The message is for example an informational notice
1020 0x0010 SILC_MESSAGE_FLAG_REQUEST
1022 This is a generic request flag to send request
1023 messages. A separate document should define any
1024 payloads associated to this flag.
1026 0x0020 SILC_MESSAGE_FLAG_SIGNED
1028 This flag indicates that the message is signed
1029 with sender's private key and thus can be verified
1030 by the receiver using the sender's public key. A
1031 separate document should define the detailed procedure
1032 of the signing process and any associated payloads
1035 0x0040 SILC_MESSAGE_FLAG_REPLY
1037 This is a generic reply flag to send a reply to
1038 previously received request. A separate document
1039 should define any payloads associated to this flag.
1041 0x0080 SILC_MESSAGE_FLAG_DATA
1043 This is a generic data flag, indicating that the
1044 message includes some data which can be interpreted
1045 in a specific way. Using this flag any kind of data
1046 can be delivered inside message payload. A separate
1047 document should define how this flag is interpreted
1048 and define any associated payloads.
1050 0x0100 SILC_MESSAGE_FLAG_UTF8
1052 This flag indicates that the message is UTF-8 encoded
1053 textual message. When sending text messages in SILC
1054 this flag SHOULD be used. When this flag is used the
1055 text sent as message MUST be UTF-8 encoded.
1057 0x0200 - 0x0800 RESERVED
1059 Reserved for future flags.
1061 0x1000 - 0x8000 PRIVATE RANGE
1063 Private range for free use.
1065 o Message Length (2 bytes) - Indicates the length of the
1066 Message Data field in the payload, not including any
1069 o Message Data (variable length) - The actual message data.
1071 o Padding Length (2 bytes) - Indicates the length of the
1072 Padding field in the payload, not including any other
1075 o Padding (variable length) - If this payload is used as
1076 channel messages, the padding MUST be applied because
1077 this payload is encrypted separately from other parts
1078 of the packet. If this payload is used as private
1079 messages, the padding is present only when the payload
1080 is encrypted with private message key. If encrypted
1081 with session keys this field MUST NOT be present and the
1082 Padding Length field includes a zero (0) value. The
1083 padding SHOULD be random data.
1085 o Initial Vector (variable length) - This field MUST be
1086 present when this payload is used as channel messages.
1087 The IV SHOULD be random data for each channel message.
1089 When encrypting private messages with session keys this
1090 field MUST NOT be present. For private messages this
1091 field is present only when encrypting with a static
1092 private message key (pre-shared key). If randomly
1093 generated key material is used this field MUST NOT be
1094 present. Also, If Key Agreement (SKE) was used to
1095 negotiate fresh key material for private message key
1096 this field MUST NOT be present. See the section 4.6
1097 in [SILC1] for more information about IVs when
1098 encrypting private messages.
1100 This field includes the initial vector used in message
1101 encryption. It need to be used in the packet decryption
1102 as well. Contents of this field depends on the encryption
1103 algorithm and encryption mode. This field is not encrypted,
1104 is not included in padding calculation and its length
1105 equals to cipher's block size. This field is authenticated
1108 o MAC (variable length) - The MAC computed from the
1109 Message Flags, Message Length, Message Data, Padding Length,
1110 Padding and Initial Vector fields in that order. The MAC
1111 is computed after the payload is encrypted. This is so
1112 called Encrypt-Then-MAC order; first encrypt, then compute
1113 MAC from ciphertext. The MAC protects the integrity of
1114 the Message Payload. Also, when used as channel messages
1115 it is possible to have multiple private channel keys set,
1116 and receiver can use the MAC to verify which of the keys
1117 must be used in decryption. This field is not encrypted.
1122 2.3.3 Disconnect Payload
1124 Disconnect payload is sent upon disconnection. Reason of the
1125 disconnection is sent to the disconnected party in the payload.
1127 The payload may only be sent with SILC_PACKET_DISCONNECT packet. It
1128 MUST NOT be sent in any other packet type. The following diagram
1129 represents the Disconnect Payload.
1135 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
1136 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1140 ~ Disconnect Message ~
1142 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1146 Figure 8: Disconnect Payload
1149 o Status (1 byte) - Indicates the Status Type, defined in [SILC3]
1150 for the reason of disconnection.
1152 o Disconnect Message (variable length) - Human readable UTF-8
1153 encoded string indicating reason of the disconnection. This
1154 field MAY be omitted.
1159 2.3.4 Success Payload
1161 Success payload is sent when some protocol execution is successfully
1162 completed. The payload is simple; indication of the success is sent.
1163 This may be any data, including binary or human readable data, and
1164 it is protocol dependent.
1169 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
1170 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1172 ~ Success Indication ~
1174 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1178 Figure 9: Success Payload
1182 o Success Indication (variable length) - Indication of
1183 the success. This may be for example some flag that
1184 indicates the protocol and the success status or human
1185 readable success message. The true length of this
1186 payload is available by calculating it from the SILC
1193 2.3.5 Failure Payload
1195 This is opposite of Success Payload. Indication of failure of
1196 some protocol is sent in the payload.
1207 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
1208 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1210 ~ Failure Indication ~
1212 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1216 Figure 10: Failure Payload
1220 o Failure Indication (variable length) - Indication of
1221 the failure. This may be for example some flag that
1222 indicates the protocol and the failure status or human
1223 readable failure message. The true length of this
1224 payload is available by calculating it from the SILC
1230 2.3.6 Reject Payload
1232 This payload is sent when some protocol is rejected to be executed.
1233 Other operations MAY send this as well that was rejected. The
1234 indication of the rejection is sent in the payload. The indication
1235 may be binary or human readable data and is protocol dependent.
1241 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
1242 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1244 ~ Reject Indication ~
1246 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1250 Figure 11: Reject Payload
1254 o Reject Indication (variable length) - Indication of
1255 the rejection. This maybe for example some flag that
1256 indicates the protocol and the rejection status or human
1257 readable rejection message. The true length of this
1258 payload is available by calculating it from the SILC
1266 2.3.7 Notify Payload
1268 Notify payload is used to send notify messages. The payload is usually
1269 sent from server to client and from server to router. It is also used
1270 by routers to notify other routers in the network. This payload MAY also
1271 be sent to a channel. Client MUST NOT send this payload. If client
1272 receives this payload MAY ignore the contents of the payload, however,
1273 notify message SHOULD be audited. Servers and routers MUST process
1276 The payload may only be sent with SILC_PACKET_NOTIFY packet. It MUST
1277 not be sent in any other packet type. The following diagram represents
1285 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
1286 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1287 | Notify Type | Payload Length |
1288 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1294 Figure 12: Notify Payload
1298 o Notify Type (2 bytes) - Indicates the type of the notify
1301 o Payload Length (2 bytes) - Length of the entire Notify Payload
1302 including any associated Argument Payloads.
1304 o Argument Nums (1 byte) - Indicates the number of Argument
1305 Payloads associated to this payload. Notify types may define
1306 arguments to be send along the notify message.
1309 The following list of currently defined notify types. The format for
1310 notify arguments is same as in SILC commands described in [SILC4].
1311 Note that all IDs sent in arguments are sent inside ID Payload. Also
1312 note that all passphrases that may be sent inside arguments MUST be
1313 UTF-8 [RFC2279] encoded. Also note that all public keys or certificates
1314 sent inside arguments are actually Public Key Payloads.
1318 0 SILC_NOTIFY_TYPE_NONE
1320 If no specific notify type apply for the notify message this type
1324 Arguments: (1) <message>
1326 The <message> is implementation specific free UTF-8 text string.
1327 Receiver MAY ignore this message.
1330 1 SILC_NOTIFY_TYPE_INVITE
1332 Sent when an client is invited to a channel. This is also sent
1333 when the invite list of the channel is changed. This notify type
1334 is sent between routers and if an client was invited, to the
1335 client as well. In this case the packet is destined to the client.
1338 Arguments: (1) <Channel ID> (2) <channel name>
1339 (3) [<sender Client ID>] (4) [<add | del>]
1342 The <Channel ID> is the channel. The <channel name> is the name
1343 of the channel and is provided because the client which receives
1344 this notify packet may not have a way to resolve the name of the
1345 channel from the <Channel ID>. The <sender Client ID> is the
1346 Client ID which invited the client to the channel. The <add | del>
1347 is an argument of size of 1 byte where 0x00 means adding a client
1348 to invite list, and 0x01 means deleting a client from invite list.
1349 The <invite list>, if present, indicates the information to be
1350 added to or removed from the invite list. The <invite list>
1351 format is defined in [SILC4] with SILC_COMMAND_INVITE command.
1352 When this notify is destined to a client the <add | del> and
1353 <invite list> MUST NOT be sent.
1356 2 SILC_NOTIFY_TYPE_JOIN
1358 Sent when client has joined to a channel. The server MUST
1359 distribute this type to the local clients on the channel and then
1360 send it to its primary router. The router or server receiving the
1361 packet distributes this type to the local clients on the channel
1362 and broadcast it to the network.
1365 Arguments: (1) [<Client ID>] (2) <Channel ID>
1367 The <Client ID> is the client that joined to the channel indicated
1368 by the <Channel ID>.
1371 3 SILC_NOTIFY_TYPE_LEAVE
1373 Sent when client has left a channel. The server must distribute
1374 this type to the local clients on the channel and then send it
1375 to its primary router. The router or server receiving the
1376 packet distributes this type to the local clients on the channel
1377 and broadcast it to the network.
1380 Arguments: (1) <Client ID>
1382 The <Client ID> is the client which left the channel.
1385 4 SILC_NOTIFY_TYPE_SIGNOFF
1387 Sent when client signoff from SILC network. The server MUST
1388 distribute this type to the local clients on the channel and then
1389 send it to its primary router. The router or server receiving
1390 the packet distributes this type to the local clients on the
1391 channel and broadcast it to the network.
1394 Arguments: (1) <Client ID> (2) <message>
1396 The <Client ID> is the client which left SILC network. The
1397 <message> is free text string indicating the reason of the signoff.
1400 5 SILC_NOTIFY_TYPE_TOPIC_SET
1402 Sent when topic is set/changed on a channel. This type must be
1403 sent only to the clients which are joined on the channel which
1404 topic was set or changed.
1407 Arguments: (1) <ID Payload> (2) <topic>
1409 The <ID Payload> is the ID of the entity who set the topic. It
1410 usually is Client ID but it can be Server ID and Channel ID as well.
1413 6 SILC_NOTIFY_TYPE_NICK_CHANGE
1415 Sent when client changes nick on a channel. The server MUST
1416 distribute this type only to the local clients on the channel
1417 and then send it to its primary router. The router or server
1418 receiving the packet distributes this type to the local clients
1419 on the channel and broadcast it to the network.
1422 Arguments: (1) <Old Client ID> (2) <New Client ID>
1425 The <Old Client ID> is the old ID of the client which changed
1426 the nickname. The <New Client ID> is the new ID generated by
1427 the change of the nickname. The <nickname> is the new nickname.
1428 Note that it is possible to send this notify even if the nickname
1429 has not changed, but client ID was changed.
1432 7 SILC_NOTIFY_TYPE_CMODE_CHANGE
1434 Sent when channel mode has changed. This type MUST be sent only
1435 to the clients which are joined on the channel which mode was
1439 Arguments: (1) <ID Payload> (2) <mode mask>
1440 (3) [<cipher>] (4) <[hmac>]
1441 (5) [<passphrase>] (6) [<founder public key>]
1443 The <ID Payload> is the ID (usually Client ID but it can be
1444 Server ID as well when the router is enforcing channel mode
1445 change) of the entity which changed the mode. The <mode mask>
1446 is the new mode mask of the channel. The client can safely
1447 ignore the <cipher> argument since the SILC_PACKET_CHANNEL_KEY
1448 packet will force the new channel key change anyway. The <hmac>
1449 argument is important since the client is responsible of setting
1450 the new HMAC and the hmac key into use. The <passphrase> is
1451 the passphrase of the channel, if it was now set. The <founder
1452 public key> argument is sent when the founder mode on the
1453 channel was set. All routers and servers that receive the packet
1454 MUST save the founder's public key so that the founder can
1455 reclaim the channel founder rights back for the channel on any
1456 server in the network.
1459 8 SILC_NOTIFY_TYPE_CUMODE_CHANGE
1461 Sent when user mode on channel has changed. This type MUST be
1462 sent only to the clients which are joined on the channel where
1463 the target client is on.
1466 Arguments: (1) <ID Payload> (2) <mode mask>
1467 (3) <Target Client ID> (3) [<founder pubkey>]
1469 The <ID Payload> is the ID (usually Client ID but it can be
1470 Server ID as well when the router is enforcing user's mode
1471 change) of the entity which changed the mode. The <mode mask>
1472 is the new mode mask of the channel. The <Target Client ID>
1473 is the client which mode was changed. The <founder pubkey>
1474 is the public key of the channel founder and is sent only
1475 when first setting the channel founder mode using the
1476 SILC_COMMAND_CUMODE command, and when sending this notify.
1479 9 SILC_NOTIFY_TYPE_MOTD
1481 Sent when Message of the Day (motd) is sent to a client.
1484 Arguments: (1) <motd>
1486 The <motd> is the Message of the Day. This notify MAY be
1490 10 SILC_NOTIFY_TYPE_CHANNEL_CHANGE
1492 Sent when channel's ID has changed for a reason or another.
1493 This is sent by normal server to the client. This can also be
1494 sent by router to other server to force the Channel ID change.
1495 The Channel ID MUST be changed to use the new one. When sent
1496 to clients, this type MUST be sent only to the clients which is
1497 joined on the channel.
1500 Arguments: (1) <Old Channel ID> (2) <New Channel ID>
1502 The <Old Channel ID> is the channel's old ID and the <New
1503 Channel ID> is the new one that MUST replace the old one.
1504 Server which receives this from router MUST re-announce the
1505 channel to the router by sending SILC_PACKET_NEW_CHANNEL packet
1506 with the new Channel ID.
1509 11 SILC_NOTIFY_TYPE_SERVER_SIGNOFF
1511 Sent when server quits SILC network. Those clients from this
1512 server that are on channels must be removed from the channel.
1515 Arguments: (1) <Server ID> (n) [<Client ID>] [...]
1517 The <Server ID> is the server's ID. The rest of the arguments
1518 are the Client IDs of the clients which are coming from this
1519 server and are thus quitting the SILC network also. If the
1520 maximum number of arguments are reached another
1521 SILC_NOTIFY_TYPE_SERVER_SIGNOFF notify packet MUST be sent.
1522 When this notify packet is sent between routers the Client ID's
1523 MAY be omitted. Server receiving the Client ID's in the payload
1524 may use them directly to remove the client.
1527 12 SILC_NOTIFY_TYPE_KICKED
1529 Sent when a client has been kicked from a channel. This is
1530 sent also to the client which was kicked from the channel.
1531 The client which was kicked from the channel MUST be removed
1532 from the channel. The client MUST also be removed from channel's
1533 invite list if it is explicitly added in the list. This notify
1534 type is always destined to the channel. The router or server
1535 receiving the packet distributes this type to the local clients
1536 on the channel and broadcast it to the network.
1539 Arguments: (1) <Client ID> (2) [<comment>]
1540 (3) <Kicker's Client ID>
1542 The <Client ID> is the client which was kicked from the channel.
1543 The kicker may have set the <comment> to indicate the reason for
1544 the kicking. The <Kicker's Client ID> is the kicker.
1547 13 SILC_NOTIFY_TYPE_KILLED
1549 Sent when a client has been killed from the network. This is sent
1550 also to the client which was killed from the network. The client
1551 which was killed from the network MUST be removed from the network.
1552 This notify type is destined directly to the client which was
1553 killed and to channel if the client is on any channel. The router
1554 or server receiving the packet distributes this type to the local
1555 clients on the channel and broadcast it to the network. The client
1556 MUST also be removed from joined channels invite list if it is
1557 explicitly added in the lists.
1560 Arguments: (1) <Client ID> (2) [<comment>]
1563 The <Client ID> is the client which was killed from the network.
1564 The killer may have set the <comment> to indicate the reason for
1565 the killing. The <Killer's ID> is the killer, which may be
1566 client but also router server.
1569 14 SILC_NOTIFY_TYPE_UMODE_CHANGE
1571 Sent when user's mode in the SILC changes. This type is sent
1572 only between routers as broadcast packet.
1575 Arguments: (1) <Client ID> (2) <mode mask>
1577 The <Client ID> is the client which mode was changed. The
1578 <mode mask> is the new mode mask.
1581 15 SILC_NOTIFY_TYPE_BAN
1583 Sent when the ban list of the channel is changed. This type is
1584 sent only between routers as broadcast packet.
1587 Arguments: (1) <Channel ID> (2) [<add | del>]
1590 The <Channel ID> is the channel which ban list was changed.
1591 The <add | del> is an argument of size of 1 byte where 0x00 means
1592 adding a client to ban list, and 0x01 means deleting a client
1593 from ban list. The <ban list> indicates the information to be
1594 added to or removed from the ban list. The <ban list> format
1595 format is defined in [SILC4] with SILC_COMMAND_BAN command.
1598 16 SILC_NOTIFY_TYPE_ERROR
1600 Sent when an error occurs during processing some SILC procedure.
1601 This is not used when error occurs during command processing, see
1602 [SILC4] for more information about commands and command replies.
1603 This type is sent directly to the sender of the packet whose packet
1604 caused the error. See [SILC1] for definition when this type
1608 Arguments: (1) <Status Type> (n) [...]
1610 The <Status Type> is the error type defined in [SILC4]. Note that
1611 same types are also used with command replies to indicate the
1612 status of a command. Both commands and this notify type share
1613 same status types. Rest of the arguments are status type
1614 dependent and are specified with those status types that can be
1615 sent currently inside this notify type in [SILC4]. The <Status
1616 Type> is size of 1 byte.
1619 17 SILC_NOTIFY_TYPE_WATCH
1621 Sent to indicate change in a watched user. Client can set
1622 nicknames to be watched with SILC_COMMAND_WATCH command, and
1623 receive notifications when they login to network, signoff from
1624 the network or their user mode is changed. This notify type
1625 is used to deliver these notifications. The notify type is
1626 sent directly to the watching client.
1629 Arguments: (1) <Client ID> (2) [<nickname>]
1630 (3) <user mode> (4) [<Notify Type>]
1632 The <Client ID> is the user's Client ID which is being watched,
1633 and the <nickname> is its nickname. If the client just
1634 changed the nickname, then <nickname> is the new nickname, but
1635 the <Client ID> is the old client ID. The <user mode> is the
1636 user's current user mode. The <Notify Type> can be same as the
1637 Notify Payload's Notify Type, and is 16 bit MSB first order value.
1638 If provided it may indicate the notify that occurred for the
1639 client. If client logged in to the network the <Notify Type>
1640 MUST NOT be present.
1643 Notify types starting from 16384 are reserved for private notify
1646 Router server which receives SILC_NOTIFY_TYPE_SIGNOFF,
1647 SILC_NOTIFY_TYPE_SERVER_SIGNOFF, SILC_NOTIFY_TYPE_KILLED,
1648 SILC_NOTIFY_TYPE_NICK_CHANGE and SILC_NOTIFY_TYPE_UMODE_CHANGE
1649 MUST check whether someone in the local cell is watching the nickname
1650 the client has, and send the SILC_NOTIFY_TYPE_WATCH notify to the
1651 watcher, unless the client in case has the SILC_UMODE_REJECT_WATCHING
1652 user mode set. If the watcher client and the client that was
1653 watched is same the notify SHOULD NOT be sent.
1659 Error payload is sent upon error in protocol. Error may occur in
1660 various conditions when server sends this packet. Client MUST NOT
1661 send this payload but MUST be able to accept it. However, client
1662 MAY totally ignore the contents of the packet as server is going to
1663 take action on the error anyway. However, it is recommended
1664 that the client takes error packet seriously.
1670 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
1671 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1675 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1679 Figure 13: Error Payload
1683 o Error Message (variable length) - Human readable error
1684 message as UTF-8 string.
1689 2.3.9 Channel Message Payload
1691 Channel Message Payload is used to send message to channels, a group
1692 of users. These messages can only be sent if client has joined to
1693 some channel. Even though this packet is very common in SILC it
1694 is still special packet. Some special handling on sending and
1695 reception of channel message is required.
1697 Padding MUST be applied into this payload since the payload is
1698 encrypted separately from other parts of the packet with the
1699 channel specific key. Hence the requirement of the padding.
1700 The packet MUST be made multiple by eight (8) or by the block
1701 size of the cipher, which ever is larger.
1703 The SILC header in this packet is encrypted with the session key
1704 of the next receiver of the packet. Nothing else is encrypted
1705 with that key. Thus, the actual packet and padding to be
1706 encrypted with the session key is SILC Header plus padding to it
1707 to make it multiple by eight (8) or multiple by the block size
1708 of the cipher, which ever is larger.
1710 Receiver of the the channel message packet is able to determine
1711 the channel the message is destined to by checking the destination
1712 ID from the SILC Packet header which tells the destination channel.
1713 The original sender of the packet is also determined by checking
1714 the source ID from the header which tells the client which sent
1717 This packet use generic Message Payload as Channel Message Payload.
1718 See section 2.3.2.5 for generic Message Payload.
1722 2.3.10 Channel Key Payload
1724 All traffic in channels are protected by channel specific keys.
1725 Channel Key Payload is used to distribute channel keys to all
1726 clients on the particular channel. Channel keys are sent when
1727 the channel is created, when new user joins to the channel and
1728 whenever a user has left a channel. Server creates the new
1729 channel key and distributes it to the clients by encrypting this
1730 payload with the session key shared between the server and
1731 the client. After that, client starts using the key received
1732 in this payload to protect the traffic on the channel.
1734 The client which is joining to the channel receives its key in the
1735 SILC_COMMAND_JOIN command reply message thus it is not necessary to
1736 send this payload to the entity which sent the SILC_COMMAND_JOIN
1739 Channel keys are cell specific thus every router in the cell have
1740 to create a channel key and distribute it if any client in the
1741 cell has joined to a channel. Channel traffic between cell's
1742 are not encrypted using channel keys, they are encrypted using
1743 normal session keys between two routers. Inside a cell, all
1744 channel traffic is encrypted with the specified channel key.
1745 Channel key SHOULD expire periodically, say, in one hour, in
1746 which case new channel key is created and distributed.
1748 The payload may only be sent with SILC_PACKET_CHANNEL_KEY packet.
1749 It MUST NOT be sent in any other packet type. The following diagram
1750 represents the Channel Key Payload.
1756 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
1757 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1758 | Channel ID Length | |
1759 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1763 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1764 | Cipher Name Length | |
1765 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1769 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1770 | Channel Key Length | |
1771 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1775 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1779 Figure 14: Channel Key Payload
1784 o Channel ID Length (2 bytes) - Indicates the length of the
1785 Channel ID field in the payload, not including any other
1788 o Channel ID (variable length) - The Channel ID of the
1789 channel this key is meant for.
1791 o Cipher Name Length (2 bytes) - Indicates the length of the
1792 Cipher name field in the payload, not including any other
1795 o Cipher Name (variable length) - Name of the cipher used
1796 in the protection of channel traffic. This name is
1797 initially decided by the creator of the channel but it
1798 MAY change during the life time of the channel as well.
1800 o Channel Key Length (2 bytes) - Indicates the length of the
1801 Channel Key field in the payload, not including any other
1804 o Channel Key (variable length) - The actual channel key
1810 2.3.11 Private Message Payload
1812 Private Message Payload is used to send private message between
1813 two clients. The messages are sent only to the specified user
1814 and no other user inside SILC network is able to see the message.
1816 The message can be protected by the session key established by the
1817 SILC Key Exchange Protocol. However, it is also possible to agree
1818 to use a private key to protect just the private messages. It is
1819 for example possible to perform Key Agreement between two clients.
1820 See section 2.3.20 Key Agreement Payload how to perform key
1821 agreement. See also section 2.3.12 Private Message Key Payload
1822 for another way of using private keys with private messages. See
1823 [SILC1] section 4.6 for detailed description for private message
1824 key generation procedure.
1826 If normal session key is used to protect the message, every server
1827 between the sender client and the receiving client MUST decrypt the
1828 packet and always re-encrypt it with the session key of the next
1829 receiver of the packet. See section Client To Client in [SILC1].
1831 When private key is used to protect the message, servers between
1832 the sender and the receiver needs not to decrypt/re-encrypt the
1833 packet. Section Client To Client in [SILC1] gives example of this
1836 This packet use generic Message Payload as Private Message Payload.
1837 See section 2.3.2.5 for generic Message Payload.
1841 2.3.12 Private Message Key Payload
1843 This payload is OPTIONAL and can be used to send private message
1844 key between two clients in the network. The packet is secured with
1845 normal session keys. By default private messages are encrypted
1846 with session keys, and with this payload it is possible to set
1847 private key for private message encryption between two clients.
1849 The receiver of this payload SHOULD verify for example from user
1850 whether user want to receive private message key. Note that there
1851 are other, more secure ways of exchanging private message keys in
1852 the SILC network. Instead of sending this payload it is possible to
1853 negotiate the private message key with SKE protocol using the Key
1854 Agreement payload directly peer to peer, see section 2.3.20.
1856 This payload may only be sent by client to another client. Server
1857 MUST NOT send this payload at any time. After sending this payload
1858 the sender of private messages must set the Private Message Key
1859 flag into SILC Packet Header.
1861 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE_KEY
1862 packet. It MUST NOT be sent in any other packet type. The following
1863 diagram represents the Private Message Key Payload.
1873 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
1874 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1875 | Private Message Key Length | |
1876 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1878 ~ Private Message Key ~
1880 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1881 | Cipher Name Length | |
1882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1886 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1887 | HMAC Name Length | |
1888 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1892 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1896 Figure 15: Private Message Key Payload
1901 o Private Message Key Length (2 bytes) - Indicates the length
1902 of the Private Message Key field in the payload, not including
1905 o Private Message Key (variable length) - The actual private
1906 message key material.
1908 o Cipher Name Length (2 bytes) - Indicates the length of the
1909 Cipher Name field in the payload, not including any other
1912 o Cipher Name (variable length) - Name of the cipher to use
1913 in the private message encryption. If this field does not
1914 exist then the default cipher of the SILC protocol is used.
1915 See the [SILC1] for defined ciphers.
1917 o HMAC Name Length (2 bytes) - Indicates the length of the
1918 HMAC Name field in the payload, not including any other
1921 o HMAC Name (variable length) - Name of the HMAC to use
1922 in the private message MAC computation. If this field does
1923 not exist then the default HMAC of the SILC protocol is used.
1924 See the [SILC1] for defined HMACs.
1929 2.3.13 Command Payload
1931 Command Payload is used to send SILC commands from client to server.
1932 Also server MAY send commands to other servers. The following diagram
1933 represents the Command Payload.
1939 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
1940 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1941 | Payload Length | SILC Command | Arguments Num |
1942 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1943 | Command Identifier |
1944 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1948 Figure 16: Command Payload
1952 o Payload Length (2 bytes) - Length of the entire command
1953 payload including any command argument payloads associated
1956 o SILC Command (1 byte) - Indicates the SILC command. This MUST
1957 be set to non-zero value. If zero (0) value is found in this
1958 field the packet MUST be discarded.
1960 o Arguments Num (1 byte) - Indicates the number of arguments
1961 associated with the command. If there are no arguments this
1962 field is set to zero (0). The arguments MUST follow the
1963 command payload. See section 2.3.2.2 for definition of the
1966 o Command Identifier (2 bytes) - Identifies this command at the
1967 sender's end. The entity which replies to this command MUST
1968 set the value found from this field into the Command Payload
1969 used to send the reply to the sender. This way the sender
1970 can identify which command reply belongs to which originally
1971 sent command. What this field includes is implementation
1972 issue but it is RECOMMENDED that wrapping counter value is
1973 used in the field. Value zero (0) in this field means that
1974 no specific value is set.
1977 See [SILC4] for detailed description of different SILC commands,
1978 their arguments and their reply messages.
1983 2.3.14 Command Reply Payload
1985 Command Reply Payload is used to send replies to the commands. The
1986 Command Reply Payload is identical to the Command Payload thus see
1987 the 2.3.13 section for the payload specification.
1989 The entity which sends the reply packet MUST set the Command Identifier
1990 field in the reply packet's Command Payload to the value it received
1991 in the original command packet.
1993 See SILC Commands in [SILC4] for detailed description of different
1994 SILC commands, their arguments and their reply messages.
1998 2.3.15 Connection Auth Request Payload
2000 Client MAY send this payload to server to request the authentication
2001 method that must be used in authentication protocol. If client knows
2002 this information beforehand this payload is not necessary to be sent.
2003 Server performing authentication with another server MAY also send
2004 this payload to request the authentication method. If the connecting
2005 server already knows this information this payload is not necessary
2008 Server receiving this request SHOULD reply with same payload sending
2009 the mandatory authentication method. Algorithms that may be required
2010 to be used by the authentication method are the ones already
2011 established by the SILC Key Exchange protocol. See section Key
2012 Exchange Start Payload in [SILC3] for detailed information.
2014 The payload may only be sent with SILC_PACKET_CONNECTION_AUTH_REQUEST
2015 packet. It MUST NOT be sent in any other packet type. The following
2016 diagram represents the Connection Auth Request Payload.
2022 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
2023 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2024 | Connection Type | Authentication Method |
2025 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2029 Figure 17: Connection Auth Request Payload
2033 o Connection Type (2 bytes) - Indicates the type of the
2034 connection. The following connection types are defined:
2041 If any other type is found in this field the packet MUST be
2042 discarded and the authentication MUST be failed.
2044 o Authentication Method (2 bytes) - Indicates the authentication
2045 method to be used in the authentication protocol. The following
2046 authentication methods are defined:
2049 1 password (mandatory)
2050 2 public key (mandatory)
2052 If any other type is found in this field the packet MUST be
2053 discarded and the authentication MUST be failed. If this
2054 payload is sent as request to receive the mandatory
2055 authentication method this field MUST be set to zero (0),
2056 indicating that receiver should send the mandatory
2057 authentication method. The receiver sending this payload
2058 to the requesting party, MAY also set this field to zero (0)
2059 to indicate that authentication is not required. In this
2060 case authentication protocol still MUST be started but
2061 server is most likely to respond with SILC_PACKET_SUCCESS
2069 2.3.16 New ID Payload
2071 New ID Payload is a multipurpose payload. It is used to send newly
2072 created ID's from clients and servers. When client connects to server
2073 and registers itself to the server by sending SILC_PACKET_NEW_CLIENT
2074 packet, server replies with this packet by sending the created ID for
2075 the client. Server always creates the ID for the client.
2077 This payload is also used when server tells its router that new client
2078 has registered to the SILC network. In this case the server sends
2079 the Client ID of the client to the router. Similarly when router
2080 distributes information to other routers about the client in the SILC
2081 network this payload is used.
2083 Also, when server connects to router, router use this payload to inform
2084 other routers about new server in the SILC network. However, every
2085 server (or router) creates their own ID's thus the ID distributed by
2086 this payload is not created by the distributor in this case. Servers
2087 create their own ID's. Server registers itself to the network by
2088 sending SILC_PACKET_NEW_SERVER to the router it connected to. The case
2089 is same when router connects to another router.
2091 However, this payload MUST NOT be used to send information about new
2092 channels. New channels are always distributed by sending the dedicated
2093 SILC_PACKET_NEW_CHANNEL packet. Client MUST NOT send this payload.
2094 Both client and server (and router) MAY receive this payload.
2096 The packet use generic ID Payload as New ID Payload. See section
2097 2.3.2.1 for generic ID Payload.
2101 2.3.17 New Client Payload
2103 When client is connected to the server, keys has been exchanged and
2104 connection has been authenticated, client MUST register itself to the
2105 server. Client's first packet after key exchange and authentication
2106 protocols must be SILC_PACKET_NEW_CLIENT. This payload tells server all
2107 the relevant information about the connected user. Server creates a new
2108 client ID for the client when received this payload and sends it to the
2109 client in New ID Payload.
2111 This payload sends username and real name of the user on the remote host
2112 which is connected to the SILC server with SILC client. The server
2113 creates the client ID according the information sent in this payload.
2114 The nickname of the user becomes the nickname sent in this payload.
2116 The payload may only be sent with SILC_PACKET_NEW_CLIENT packet. It
2117 MUST NOT be sent in any other packet type. The following diagram
2118 represents the New Client Payload.
2124 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
2125 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2126 | Username Length | |
2127 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2132 | Real Name Length | |
2133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2137 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2141 Figure 18: New Client Payload
2145 o Username Length (2 bytes) - Length of the Username field.
2147 o Username (variable length) - The username of the user on
2148 the host where connecting to the SILC server.
2150 o Real Name Length (2 bytes) - Length of the Real Name field.
2152 o Real Name (variable length) - The real name of the user
2153 on the host where connecting to the SILC server.
2158 2.3.18 New Server Payload
2160 This payload is sent by server when it has completed successfully both
2161 key exchange and connection authentication protocols. The server
2162 MUST register itself to the SILC Network by sending this payload.
2163 The first packet after these key exchange and authentication protocols
2164 is SILC_PACKET_NEW_SERVER packet. The payload includes the Server ID
2165 of the server that it has created by itself. It also includes a
2166 name of the server that is associated to the Server ID.
2168 The payload may only be sent with SILC_PACKET_NEW_SERVER packet. It
2169 MUST NOT be sent in any other packet type. The following diagram
2170 represents the New Server Payload.
2177 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
2178 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2179 | Server ID Length | |
2180 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2184 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2185 | Server Name Length | |
2186 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2190 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2194 Figure 19: New Server Payload
2198 o Server ID Length (2 bytes) - Length of the Server ID Data
2201 o Server ID Data (variable length) - The actual Server ID
2204 o Server Name Length (2 bytes) - Length of the server name
2207 o Server Name (variable length) - The server name.
2212 2.3.19 New Channel Payload
2214 Information about newly created channel is broadcasted to all routers
2215 in the SILC network by sending this packet payload. Channels are
2216 created by router of the cell. Server never creates channels unless
2217 it is a standalone server and it does not have router connection,
2218 in this case server acts as router. Normal server send JOIN command
2219 to the router (after it has received JOIN command from client) which
2220 then processes the command and creates the channel. Client MUST NOT
2221 send this packet. Server MAY send this packet to a router when it is
2222 announcing its existing channels to the router after it has connected
2225 The packet use generic Channel Payload as New Channel Payload. See
2226 section 2.3.2.3 for generic Channel Payload. The Mode Mask field in the
2227 Channel Payload is the mode of the channel.
2231 2.3.20 Key Agreement Payload
2233 This payload is used by clients to request key negotiation between
2234 another client in the SILC Network. The key agreement protocol used
2235 is the SKE protocol. The result of the protocol, the secret key
2236 material, can be used for example as private message key between the
2237 two clients. This significantly adds security as the key agreement
2238 is performed outside the SILC network. The server and router MUST NOT
2241 The sender MAY tell the receiver of this payload the hostname and the
2242 port where the SKE protocol is running in the sender's end. The
2243 receiver MAY then initiate the SKE negotiation with the sender. The
2244 sender MAY also optionally not to include the hostname and the port
2245 of its SKE protocol. In this case the receiver MAY reply to the
2246 request by sending the same payload filled with the receiver's hostname
2247 and the port where the SKE protocol is running. The sender MAY then
2248 initiate the SKE negotiation with the receiver.
2250 This payload may be sent with SILC_PACKET_KEY_AGREEMENT and
2251 SILC_PACKET_FTP packet types. It MUST NOT be sent in any other packet
2252 types. The following diagram represents the Key Agreement Payload.
2258 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
2259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2260 | Hostname Length | |
2261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2271 Figure 20: Key Agreement Payload
2275 o Hostname Length (2 bytes) - Indicates the length of the
2278 o Hostname (variable length) - The hostname or IP address where
2279 the SKE protocol is running. The sender MAY fill this field
2280 when sending the payload. If the receiver sends this payload
2281 as reply to the request it MUST fill this field.
2283 o Port (4 bytes) - The port where the SKE protocol is bound.
2284 The sender MAY fill this field when sending the payload. If
2285 the receiver sends this payload as reply to the request it
2286 MUST fill this field. This is a 32 bit MSB first order value.
2290 After the key material has been received from the SKE protocol it is
2291 processed as the [SILC3] describes. If the key material is used as
2292 channel private key then the Sending Encryption Key, as defined in
2293 [SILC3] is used as the channel private key. Other key material must
2294 be discarded. The [SILC1] in section 4.6 defines the way to use the
2295 key material if it is intended to be used as private message keys.
2296 Any other use for the key material is undefined.
2300 2.3.21 Resume Router Payload
2302 See the [SILC1] for Resume Router protocol where this payload is
2303 used. The payload may only be sent with SILC_PACKET_RESUME_ROUTER
2304 packet. It MUST NOT be sent in any other packet type. The following
2305 diagram represents the Resume Router Payload.
2311 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
2312 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2313 | Type | Session ID |
2314 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2318 Figure 21: Resume Router Payload
2322 o Type (1 byte) - Indicates the type of the backup resume
2323 protocol packet. The type values are defined in [SILC1].
2325 o Session ID (1 bytes) - Indicates the session ID for the
2326 backup resume protocol. The sender of the packet sets this
2327 value and the receiver MUST set the same value in subsequent
2333 2.3.22 File Transfer Payload
2335 File Transfer Payload is used to perform file transfer protocol
2336 between two entities in the network. The actual file transfer
2337 protocol is always encapsulated inside the SILC Packet. The actual
2338 data stream is also sent peer to peer outside SILC network.
2340 When an entity, usually a client wishes to perform file transfer
2341 protocol with another client in the network, they perform Key Agreement
2342 protocol as described in the section 2.3.20 Key Agreement Payload and
2343 in [SILC3], inside File Transfer Payload. After the Key Agreement
2344 protocol has been performed the subsequent packets in the data stream
2345 will be protected using the new key material. The actual file transfer
2346 protocol is also initialized in this stage. All file transfer protocol
2347 packets are always encapsulated in the File Transfer Payload and
2348 protected with the negotiated key material.
2350 The payload may only be sent with SILC_PACKET_FTP packet. It MUST NOT
2351 be sent in any other packet type. The following diagram represents the
2352 File Transfer Payload.
2363 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
2364 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2370 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2374 Figure 22: File Transfer Payload
2378 o Type (1 byte) - Indicates the type of the file transfer
2379 protocol. The following file transfer protocols has been
2382 1 Secure File Transfer Protocol (SFTP) (mandatory)
2384 If zero (0) value or any unsupported file transfer protocol
2385 type is found in this field the packet must be discarded.
2386 The currently mandatory file transfer protocol is SFTP.
2387 The SFTP protocol is defined in [SFTP].
2389 o Data (variable length) - Arbitrary file transfer data. The
2390 contents and encoding of this field is dependent of the usage
2391 of this payload and the type of the file transfer protocol.
2392 When this payload is used to perform the Key Agreement
2393 protocol, this field include the Key Agreement Payload,
2394 as defined in the section 2.3.20 Key Agreement Payload.
2395 When this payload is used to send the actual file transfer
2396 protocol data, the encoding is defined in the corresponding
2397 file transfer protocol.
2402 2.3.23 Resume Client Payload
2404 This payload is used by client to resume its detached session in the
2405 SILC Network. A client is able to detach itself from the network by
2406 sending SILC_COMMAND_DETACH command to its server. The network
2407 connection to the client is lost but the client remains as valid
2408 client in the network. The client is able to resume the session back
2409 by sending this packet and including the old Client ID, and an
2410 Authentication Payload [SILC1] which the server use to verify with
2411 the detached client's public key. This also implies that the
2412 mandatory authentication method is public key authentication.
2414 Server or router that receives this from the client also sends this,
2415 without the Authentication Payload, to routers in the network so that
2416 they know the detached client has resumed. Refer to the [SILC1] for
2417 detailed description how the detaching and resuming procedure is
2420 The payload may only be sent with SILC_PACKET_RESUME CLIENT packet. It
2421 MUST NOT be sent in any other packet type. The following diagram
2422 represents the Resume Client Payload.
2427 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
2428 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2429 | Client ID Length | |
2430 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
2434 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2436 ~ Authentication Payload ~
2438 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2442 Figure 23: Resume Client Payload
2446 o Client ID Length (1 byte) - The length of the Client ID
2447 field not including any other field.
2449 o Client ID (variable length) - The detached client's Client
2450 ID. The client that sends this payload must know the Client
2453 o Authentication Payload (variable length) - The authentication
2454 payload that the server will verify with the detached client's
2455 public key. If the server doesn't know the public key, it must
2456 retrieve it for example with SILC_COMMAND_GETKEY command.
2464 ID's are used in the SILC network to associate different entities.
2465 The following ID's has been defined to be used in the SILC network.
2470 This is used when other ID type is available at the time.
2474 Server ID to associate servers. See the format of
2479 Client ID to associate clients. See the format of
2484 Channel ID to associate channels. See the format of
2488 When encoding different IDs into the ID Payload, all fields are always
2489 in MSB first order. The IP address, port, and/or the random number
2490 are encoded in the MSB first order.
2494 2.5 Packet Encryption And Decryption
2496 SILC packets are encrypted almost entirely. Only the MAC at the end
2497 of the packet is never encrypted. The SILC Packet header is the first
2498 part of a packet to be encrypted and it is always encrypted with the
2499 key of the next receiver of the packet. The data payload area of the
2500 packet is always entirely encrypted and it is usually encrypted with
2501 the next receiver's key. However, there are some special packet types
2502 and packet payloads that require special encryption process. These
2503 special cases are described in the next sections. First is described
2504 the normal packet encryption process.
2508 2.5.1 Normal Packet Encryption And Decryption
2510 Normal SILC packets are encrypted with the session key of the next
2511 receiver of the packet. The entire SILC Packet header and the packet
2512 data payload is is encrypted with the same key. Padding of the packet
2513 is also encrypted always with the session key, also in special cases.
2514 Computed MAC of the packet MUST NOT be encrypted.
2516 Decryption process in these cases are straightforward. The receiver
2517 of the packet MUST first decrypt the SILC Packet header, or some parts
2518 of it, usually first 16 bytes of it. Then the receiver checks the
2519 packet type from the decrypted part of the header and can determine
2520 how the rest of the packet must be decrypted. If the packet type is
2521 any of the special cases described in the following sections the packet
2522 decryption is special. If the packet type is not among those special
2523 packet types rest of the packet can be decrypted with the same key.
2525 With out a doubt, this sort of decryption processing causes some
2526 overhead to packet decryption, but never the less, is required.
2528 The MAC of the packet is also verified at this point. The MAC is
2529 computed from the ciphertext of the packet so it can be verified
2530 at this stage. The length of the packet need to be known to be able
2531 to verify the MAC from the ciphertext so the first 16 bytes need to
2532 be decrypted to determine the packet length. However, the MAC MUST
2533 be verified from the entire ciphertext.
2537 2.5.2 Channel Message Encryption And Decryption
2539 Channel Messages (Channel Message Payload) are always encrypted with
2540 the channel specific key. However, the SILC Packet header is not
2541 encrypted with that key. As in normal case, the header is encrypted
2542 with the key of the next receiver of the packet, who ever that might
2543 be. Note that in this case the encrypted data area is not touched
2544 at all; it MUST NOT be re-encrypted with the session key.
2546 Receiver of a channel message, who ever that is, is REQUIRED to decrypt
2547 the SILC Packet header to be able to recognize the packet to be as
2548 channel message. This is same procedure as for normal SILC packets.
2549 As the receiver founds the packet to be channel message, rest of the
2550 packet processing is special. Rest of the SILC Packet header is
2551 decrypted with the same session key along with the padding of the
2552 packet. After that the packet is protected with the channel specific
2553 key and thus can be decrypted only if the receiver is the client on
2554 the channel. See section 2.7 Packet Padding Generation for more
2555 information about padding on special packets.
2557 If the receiver of the channel message is router which is routing the
2558 message to another router then it MUST decrypt the Channel Message
2559 payload. Between routers (that is, between cells) channel messages
2560 are protected with session keys shared between the routers. This
2561 causes another special packet processing for channel messages. If
2562 the channel message is received from another router then the entire
2563 packet, including Channel Message payload, MUST be encrypted with the
2564 session key shared between the routers. In this case the packet
2565 decryption process is as with normal SILC packets. Hence, if the
2566 router is sending channel message to another router the Channel
2567 Message payload MUST have been decrypted and MUST be re-encrypted
2568 with the session key shared between the another router. In this
2569 case the packet encryption is as with any normal SILC packet.
2571 It must be noted that this is only when the channel messages are sent
2572 from router to another router. In all other cases the channel
2573 message encryption and decryption is as described above. This
2574 different processing of channel messages with router to router
2575 connection is because channel keys are cell specific. All cells have
2576 their own channel keys thus the channel message traveling from one
2577 cell to another MUST be protected as it would be any normal SILC
2580 If the SILC_CMODE_PRIVKEY channel mode has been set for the channel
2581 then the router cannot decrypt the packet as it does not know the
2582 private key. In this case the entire packet MUST be encrypted with
2583 the session key and sent to the router. The router receiving the
2584 packet MUST check the channel mode and decrypt the packet accordingly.
2588 2.5.3 Private Message Encryption And Decryption
2590 By default, private message in SILC are protected by session keys.
2591 In this case the private message encryption and decryption process is
2592 equivalent to normal packet encryption and decryption.
2594 However, private messages MAY be protected with private message key
2595 which causes the packet to be special packet. The procedure in this
2596 case is very much alike to channel packets. The actual private message
2597 is encrypted with the private message key and other parts of the
2598 packet is encrypted with the session key. See 2.7 Packet Padding
2599 Generation for more information about padding on special packets.
2601 The difference from channel message processing is that server or router
2602 en route never decrypts the actual private message, as it does not
2603 have the key to do that. Thus, when sending packets between router
2604 the processing is same as in any other case as well; the packet's header
2605 and padding is protected by the session key and the data area is not
2608 The true receiver of the private message is able to decrypt the private
2609 message as it shares the key with the sender of the message.
2613 2.6 Packet MAC Generation
2615 Data integrity of a packet is protected by including a message
2616 authentication code (MAC) at the end of the packet. The MAC is computed
2617 from shared secret MAC key, that is established by the SILC Key Exchange
2618 protocol, from packet sequence number, and from the encrypted packet
2619 data. The MAC is always computed after packet is encrypted. This is
2620 so called Encrypt-Then-MAC order; packet is first encrypted, then MAC
2621 is computed from the encrypted data.
2623 The MAC is computed from entire packet. Every bit of data in the packet,
2624 including SILC Packet Header is used in the MAC computing. This way
2625 the entire packet becomes authenticated.
2627 Hence, packet's MAC generation is as follows:
2629 mac = MAC(key, sequence number | Encrypted SILC packet)
2631 The MAC key is negotiated during the SKE protocol. The sequence number
2632 is a 32 bit MSB first value starting from zero for first packet and
2633 increasing for subsequent packets, finally wrapping after 2^32 packets.
2634 The value is never reset, not even after rekey has been performed.
2635 However, rekey MUST be performed before the sequence number wraps
2636 and repeats from zero. Note that the sequence number is incremented only
2637 when MAC is computed for a packet. If packet is not encrypted and MAC is
2638 not computed then the sequence number is not incremented. Hence, the
2639 sequence number is zero for the very first encrypted packet.
2641 See [SILC1] for defined and allowed MAC algorithms.
2645 2.7 Packet Padding Generation
2647 Padding is needed in the packet because the packet is encrypted. It
2648 always MUST be multiple by eight (8) or multiple by the block size
2649 of the cipher, which ever is larger. The padding is always encrypted.
2651 For normal packets the padding is added after the SILC Packet Header
2652 and between the Data Payload area. The padding for normal packets
2653 may be calculated as follows:
2656 padding_length = 16 - (packet_length mod block_size)
2657 if (padding_length < 8)
2658 padding_length += block_size
2661 The `block_size' is the block size of the cipher. The maximum padding
2662 length is 128 bytes, and minimum is 8 bytes. For example, packets that
2663 include a passphrase or a password for authentication purposes SHOULD
2664 pad the packet up to the maximum padding length. The maximum padding
2665 is calculated as follows:
2668 padding_length = 128 - (packet_length mod block_size)
2671 For special packets the padding calculation is different as special
2672 packets may be encrypted differently. In these cases the encrypted
2673 data area MUST already be multiple by the block size thus in this case
2674 the padding is calculated only for SILC Packet Header, not for any
2675 other area of the packet. The same algorithm works in this case as
2676 well, except that the `packet length' is now the SILC Packet Header
2679 The padding MUST be random data, preferably, generated by
2680 cryptographically strong random number generator for each packet
2685 2.8 Packet Compression
2687 SILC Packets MAY be compressed. In this case the data payload area
2688 is compressed and all other areas of the packet MUST remain as they
2689 are. After compression is performed for the data area, the length
2690 field of Packet Header MUST be set to the compressed length of the
2693 The compression MUST always be applied before encryption. When
2694 the packet is received and decrypted the data area MUST be decompressed.
2695 Note that the true sender of the packet MUST apply the compression and
2696 the true receiver of the packet MUST apply the decompression. Any
2697 server or router en route SHOULD NOT decompress the packet.
2703 The sender of the packet MUST assemble the SILC Packet Header with
2704 correct values. It MUST set the Source ID of the header as its own
2705 ID, unless it is forwarding the packet. It MUST also set the Destination
2706 ID of the header to the true destination. If the destination is client
2707 it will be Client ID, if it is server it will be Server ID and if it is
2708 channel it will be Channel ID.
2710 If the sender wants to compress the packet it MUST apply the
2711 compression now. Sender MUST also compute the padding as described
2712 in above sections. Then sender MUST encrypt the packet as has been
2713 described in above sections according whether the packet is normal
2714 packet or special packet. Then sender MUST compute the MAC of the
2715 packet. The computed MAC MUST NOT be encrypted.
2719 2.10 Packet Reception
2721 On packet reception the receiver MUST check that all fields in the
2722 SILC Packet Header are valid. It MUST check the flags of the
2723 header and act accordingly. It MUST also check the MAC of the packet
2724 and if it is to be failed the packet MUST be discarded. Also if the
2725 header of the packet includes any bad fields the packet MUST be
2728 See above sections on the decryption process of the received packet.
2730 The receiver MUST also check that the ID's in the header are valid
2731 ID's. Unsupported ID types or malformed ID's MUST cause packet
2732 rejection. The padding on the reception is always ignored.
2734 The receiver MUST also check the packet type and start parsing the
2735 packet according to the type. However, note the above sections on
2736 special packet types and their parsing.
2742 Routers are the primary entities in the SILC network that takes care
2743 of packet routing. However, normal servers routes packets as well, for
2744 example, when they are routing channel message to the local clients.
2745 Routing is quite simple as every packet tells the true origin and the
2746 true destination of the packet.
2748 It is still RECOMMENDED for routers that has several routing connections
2749 to create route cache for those destinations that has faster route than
2750 the router's primary route. This information is available for the router
2751 when other router connects to the router. The connecting party then
2752 sends all of its locally connected clients, servers and channels. These
2753 informations helps to create the route cache. Also, when new channels
2754 are created to a cell its information is broadcasted to all routers
2755 in the network. Channel ID's are based on router's ID thus it is easy
2756 to create route cache based on these informations. If faster route for
2757 destination does not exist in router's route cache the packet MUST be
2758 routed to the primary route (default route).
2760 However, there are some issues when routing channel messages to group
2761 of users. Routers are responsible of routing the channel message to
2762 other routers, local servers and local clients as well. Routers MUST
2763 send the channel message to only one router in the network, preferably
2764 to the shortest route to reach the channel users. The message can be
2765 routed into either upstream or downstream. After the message is sent
2766 to a router in the network it MUST NOT be sent to any other router in
2767 either same route or other route. The message MUST NOT be routed to
2768 the router it came from.
2770 When routing for example private messages they should be routed to the
2771 shortest route always to reach the destination client as fast as possible.
2773 For server which receives a packet to be routed to its locally connected
2774 client the server MUST check whether the particular packet type is
2775 allowed to be routed to the client. Not all packets may be sent by
2776 some odd entity to client that is indirectly connected to the sender.
2777 See section 2.3 SILC Packet Types and paragraph about indirectly connected
2778 entities and sending packets to them. The section mentions the packets
2779 that may be sent to indirectly connected entities. It is clear that
2780 server cannot send, for example, disconnect packet to client that is not
2781 directly connected to the server.
2783 Routers form a ring in the SILC network. However, routers may have other
2784 direct connections to other routers in the network too. This can cause
2785 interesting routing problems in the network. Since the network is a ring,
2786 the packets usually should be routed into clock-wise direction, or if it
2787 cannot be used then always counter clock-wise (primary route) direction.
2788 Problems may arise when a faster direct route exists and router is routing
2789 a channel message. Currently channel messages must be routed either
2790 in upstream or downstream, they cannot be routed to other direct routes.
2791 The SILC protocol should have a shortest path discovery protocol, and some
2792 existing routing protocol, that can handle a ring network with other
2793 direct routes inside the ring (so called hybrid ring-mesh topology),
2794 MAY be defined to be used with the SILC protocol. Additional
2795 specifications MAY be written on the subject to permeate this
2800 2.12 Packet Broadcasting
2802 SILC packets MAY be broadcasted in SILC network. However, only router
2803 server may send or receive broadcast packets. Client and normal server
2804 MUST NOT send broadcast packets and they MUST ignore broadcast packets
2805 if they receive them. Broadcast packets are sent by setting Broadcast
2806 flag to the SILC packet header.
2808 Broadcasting packets means that the packet is sent to all routers in
2809 the SILC network, except to the router that sent the packet. The router
2810 receiving broadcast packet MUST send the packet to its primary route.
2811 The fact that SILC routers may have several router connections can
2812 cause problems, such as race conditions inside the SILC network, if
2813 care is not taken when broadcasting packets. Router MUST NOT send
2814 the broadcast packet to any other route except to its primary route.
2816 If the primary route of the router is the original sender of the packet
2817 the packet MUST NOT be sent to the primary route. This may happen
2818 if router has several router connections and some other router uses
2819 the router as its primary route.
2821 Routers use broadcast packets to broadcast for example information
2822 about newly registered clients, servers, channels etc. so that all the
2823 routers may keep these informations up to date.
2827 3 Security Considerations
2829 Security is central to the design of this protocol, and these security
2830 considerations permeate the specification. Common security considerations
2831 such as keeping private keys truly private and using adequate lengths for
2832 symmetric and asymmetric keys must be followed in order to maintain the
2833 security of this protocol.
2839 [SILC1] Riikonen, P., "Secure Internet Live Conferencing (SILC),
2840 Protocol Specification", Internet Draft, May 2002.
2842 [SILC3] Riikonen, P., "SILC Key Exchange and Authentication
2843 Protocols", Internet Draft, May 2002.
2845 [SILC4] Riikonen, P., "SILC Commands", Internet Draft, May 2002.
2847 [IRC] Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2850 [IRC-ARCH] Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2853 [IRC-CHAN] Kalt, C., "Internet Relay Chat: Channel Management", RFC
2856 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
2859 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
2862 [SSH-TRANS] Ylonen, T., et al, "SSH Transport Layer Protocol",
2865 [PGP] Callas, J., et al, "OpenPGP Message Format", RFC 2440,
2868 [SPKI] Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
2871 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key
2872 Infrastructure, Certificate and CRL Profile", RFC 2459,
2875 [Schneier] Schneier, B., "Applied Cryptography Second Edition",
2876 John Wiley & Sons, New York, NY, 1996.
2878 [Menezes] Menezes, A., et al, "Handbook of Applied Cryptography",
2881 [OAKLEY] Orman, H., "The OAKLEY Key Determination Protocol",
2882 RFC 2412, November 1998.
2884 [ISAKMP] Maughan D., et al, "Internet Security Association and
2885 Key Management Protocol (ISAKMP)", RFC 2408, November
2888 [IKE] Harkins D., and Carrel D., "The Internet Key Exchange
2889 (IKE)", RFC 2409, November 1998.
2891 [HMAC] Krawczyk, H., "HMAC: Keyed-Hashing for Message
2892 Authentication", RFC 2104, February 1997.
2894 [PKCS1] Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
2895 Specifications, Version 2.0", RFC 2437, October 1998.
2897 [RFC2119] Bradner, S., "Key Words for use in RFCs to Indicate
2898 Requirement Levels", BCP 14, RFC 2119, March 1997.
2900 [SFTP] Ylonen T., and Lehtinen S., "Secure Shell File Transfer
2901 Protocol", Internet Draft, March 2001.
2903 [RFC2279] Yergeau, F., "UTF-8, a transformation format of ISO
2904 10646", RFC 2279, January 1998.
2911 Snellmaninkatu 34 A 15
2915 EMail: priikone@iki.fi
2917 This Internet-Draft expires 25 April 2003