1 .pl 10.0i
2 .po 0
3 .ll 7.2i
4 .lt 7.2i
5 .nr LL 7.2i
6 .nr LT 7.2i
7 .ds LF Riikonen
8 .ds RF FORMFEED[Page %]
9 .ds CF
10 .ds LH Internet Draft
11 .ds RH 11 February 2004
12 .ds CH
13 .na
14 .hy 0
15 .in 0
16 .nf
17 Network Working Group P. Riikonen
18 Internet-Draft
19 draft-riikonen-silc-pp-08.txt 11 February 2004
20 Expires: 11 August 2004
21
22 .in 3
23
24 .ce 2
25 SILC Packet Protocol
26 <draft-riikonen-silc-pp-08.txt>
27
28 .ti 0
29 Status of this Memo
30
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.
36
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."
41
42 The list of current Internet-Drafts can be accessed at
43 http://www.ietf.org/ietf/1id-abstracts.txt
44
45 The list of Internet-Draft Shadow Directories can be accessed at
46 http://www.ietf.org/shadow.html
47
48 The distribution of this memo is unlimited.
49
50
51 .ti 0
52 Abstract
53
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 [SILC1]. This protocol describes
57 the packet types and packet payloads which defines the contents of the
58 packets. The protocol provides secure binary packet protocol that
59 assures that the contents of the packets are secured and authenticated.
60
61
62
63
64
65
66
67
68
69 .ti 0
70 Table of Contents
71
72 .nf
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 ......................................... 7
79 2.3.1 SILC Packet Payloads ................................ 15
80 2.3.2 Generic payloads .................................... 15
81 2.3.2.1 ID Payload .................................. 15
82 2.3.2.2 Argument Payload ............................ 16
83 2.3.2.3 Argument List Payload ....................... 17
84 2.3.2.4 Channel Payload ............................. 18
85 2.3.2.5 Public Key Payload .......................... 19
86 2.3.2.6 Message Payload ............................. 19
87 2.3.3 Disconnect Payload .................................. 23
88 2.3.4 Success Payload ..................................... 23
89 2.3.5 Failure Payload ..................................... 24
90 2.3.6 Reject Payload ...................................... 25
91 2.3.7 Notify Payload ...................................... 25
92 2.3.8 Error Payload ....................................... 34
93 2.3.9 Channel Message Payload ............................. 35
94 2.3.10 Channel Key Payload ................................ 35
95 2.3.11 Private Message Payload ............................ 37
96 2.3.12 Private Message Key Payload ........................ 37
97 2.3.13 Command Payload .................................... 39
98 2.3.14 Command Reply Payload .............................. 40
99 2.3.15 Connection Auth Request Payload .................... 40
100 2.3.16 New ID Payload ..................................... 42
101 2.3.17 New Client Payload ................................. 42
102 2.3.18 New Server Payload ................................. 43
103 2.3.19 New Channel Payload ................................ 44
104 2.3.20 Key Agreement Payload .............................. 45
105 2.3.21 Resume Router Payload .............................. 46
106 2.3.22 File Transfer Payload .............................. 47
107 2.3.23 Resume Client Payload .............................. 48
108 2.4 SILC ID Types ............................................. 49
109 2.5 Packet Encryption And Decryption .......................... 49
110 2.5.1 Normal Packet Encryption And Decryption ............. 50
111 2.5.2 Channel Message Encryption And Decryption ........... 50
112 2.5.3 Private Message Encryption And Decryption ........... 51
113 2.6 Packet MAC Generation ..................................... 52
114 2.7 Packet Padding Generation ................................. 53
115 2.8 Packet Compression ........................................ 53
116 2.9 Packet Sending ............................................ 54
117 2.10 Packet Reception ......................................... 54
118 2.11 Packet Routing ........................................... 54
119 2.12 Packet Broadcasting ...................................... 56
120 3 Security Considerations ....................................... 56
121 4 References .................................................... 56
122 5 Author's Address .............................................. 58
123 6 Full Copyright Statement ...................................... 58
124
125 .ti 0
126 List of Figures
127
128 .nf
129 Figure 1: Typical SILC Packet
130 Figure 2: SILC Packet Header
131 Figure 3: ID Payload
132 Figure 4: Argument Payload
133 Figure 5: Argument List Payload
134 Figure 6: Channel Payload
135 Figure 7: Public Key Payload
136 Figure 8: Message Payload
137 Figure 9: Disconnect Payload
138 Figure 10: Success Payload
139 Figure 11: Failure Payload
140 Figure 12: Reject Payload
141 Figure 13: Notify Payload
142 Figure 14: Error Payload
143 Figure 15: Channel Key Payload
144 Figure 16: Private Message Key Payload
145 Figure 17: Command Payload
146 Figure 18: Connection Auth Request Payload
147 Figure 19: New Client Payload
148 Figure 20: New Server Payload
149 Figure 21: Key Agreement Payload
150 Figure 22: Resume Router Payload
151 Figure 23: File Transfer Payload
152 Figure 24: Resume Client Payload
153
154
155 .ti 0
156 1. Introduction
157
158 This document describes a Packet Protocol used in the Secure Internet
159 Live Conferencing (SILC) protocol specified in the Secure Internet Live
160 Conferencing, Protocol Specification [SILC1]. This protocol describes
161 the packet types and packet payloads which defines the contents of the
162 packets. The protocol provides secure binary packet protocol that
163 assures that the contents of the packets are secured and authenticated.
164 The packet protocol is designed to be compact to avoid unnecessary
165 overhead as much as possible. This makes the SILC suitable also in
166 environment of low bandwidth requirements such as mobile networks. All
167 packet payloads can also be compressed to further reduce the size of
168 the packets.
169
170 All packets in SILC network are always encrypted and their integrity
171 is assured by computed MACs. The protocol defines several packet types
172 and packet payloads. Each packet type usually has a specific packet
173 payload that actually defines the contents of the packet. Each packet
174 also includes a default SILC Packet Header that provides sufficient
175 information about the origin and the destination of the packet.
176
177
178 .ti 0
179 1.1 Requirements Terminology
180
181 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
182 MAY, and OPTIONAL, when they appear in this document, are to be
183 interpreted as described in [RFC2119].
184
185
186 .ti 0
187 2 SILC Packet Protocol
188
189 .ti 0
190 2.1 SILC Packet
191
192 SILC packets deliver messages from sender to receiver securely by
193 encrypting important fields of the packet. The packet consists of
194 default SILC Packet Header, Padding, Packet Payload data, and, packet
195 MAC.
196
197 The following diagram illustrates typical SILC packet.
198
199 .in 5
200 .nf
201 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
202 | n bytes | 1 - n bytes | n bytes | n bytes
203 | SILC Header | Padding | Data Payload | MAC
204 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
205 .in 3
206
207 .ce
208 Figure 1: Typical SILC Packet
209
210
211 SILC Header is always the first part of the packet and its purpose
212 is to provide information about the packet. It provides for example
213 the packet type, origin of the packet and the destination of the packet.
214 The header is variable in length. See the following section for
215 description of SILC Packet header. Packets without SILC header or
216 with malformed SILC header MUST be dropped.
217
218 Padding follows the packet header. The purpose of the padding is to
219 make the packet multiple by eight (8) or by the block size of the
220 cipher used in the encryption, which ever is larger. The maximum
221 length of padding is currently 128 bytes. The padding is always
222 encrypted. The padding is applied always, even if the packet is
223 not encrypted. See the section 2.7 Padding Generation for more
224 detailed information.
225
226 Data payload area follows padding and it is the actual data of the
227 packet. The packet data is the packet payloads defined in this
228 protocol. The data payload area is always encrypted.
229
230 The last part of SILC packet is the packet MAC that assures the
231 integrity of the packet. See the section 2.6 Packet MAC Generation
232 for more information. If compression is used the compression is
233 always applied before encryption.
234
235 All fields in all packet payloads are always in MSB (most significant
236 byte first) order.
237
238
239 .ti 0
240 2.2 SILC Packet Header
241
242 The SILC packet header is applied to all SILC packets and it is
243 variable in length. The purpose of SILC Packet header is to provide
244 detailed information about the packet. The receiver of the packet
245 uses the packet header to parse the packet and gain other relevant
246 parameters of the packet.
247
248 The following diagram represents the SILC packet header.
249
250 .in 5
251 .nf
252 1 2 3
253 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
254 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
255 | Payload Length | Flags | Packet Type |
256 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
257 | Pad Length | RESERVED | Source ID Len | Dest ID Len |
258 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
259 | Src ID Type | |
260 +-+-+-+-+-+-+-+-+ +
261 | |
262 ~ Source ID ~
263 | |
264 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
265 | Dst ID Type | |
266 +-+-+-+-+-+-+-+-+ +
267 | |
268 ~ Destination ID ~
269 | |
270 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
271 .in 3
272
273 .ce
274 Figure 2: SILC Packet Header
275
276 .in 6
277 o Payload Length (2 bytes) - Indicates the length of the
278 packet not including the padding of the packet.
279
280 o Flags (1 byte) - Indicates flags to be used in packet
281 processing. Several flags may be set by ORing the flags
282 together.
283
284 The following flags are reserved for this field:
285
286
287 No flags 0x00
288
289 In this case the field is ignored.
290
291
292 Private Message Key 0x01
293
294 Indicates that the packet data MUST include private
295 message that is encrypted using private key set by
296 client. Servers does not know this key and cannot
297 handle the packet, but passes it along. See section
298 2.5.3 Private Message Encryption And Decryption for
299 more information.
300
301
302 List 0x02
303
304 Indicates that the packet consists of list of
305 packet payloads indicated by the Packet Type field.
306 The payloads are added one after the other. Note that
307 there are packet types that must not be used as
308 list. Parsing of list packet is done by calculating
309 the length of each payload and parsing them one by
310 one.
311
312
313 Broadcast 0x04
314
315 Marks the packet to be broadcasted. Client and normal
316 server cannot send broadcast packets. Only router server
317 may send broadcast packet. The router receiving of packet
318 with this flag set MUST send (broadcast) the packet to
319 its primary route. If router has several router connections
320 the packet may be sent only to the primary route. See
321 section 2.12 Packet Broadcasting for description of
322 packet broadcasting.
323
324
325 Compressed 0x08
326
327 Marks that the payload of the packet is compressed.
328 The sender of the packet marks this flag when it
329 compresses the payload, and any server or router
330 en route to the recipient MUST NOT unset this flag.
331 See section 2.8 Packet Compression for description of
332 packet compressing.
333
334 .in 3
335
336 o Packet Type (1 byte) - Indicates the type of the packet.
337 Receiver uses this field to parse the packet. See section
338 2.3 SILC Packets for list of defined packet types.
339
340 o Pad Length (1 byte) - Indicates the length of the padding
341 applied after the SILC Packet header. Maximum length for
342 padding is 128 bytes.
343
344 o RESERVED (1 byte) - Reserved field and must include a
345 zero (0) value.
346
347 o Source ID Length (1 byte) - Indicates the length of the
348 Source ID field in the header, not including this or any
349 other fields.
350
351 o Destination ID Length (1 byte) - Indicates the length of the
352 Destination ID field in the header, not including this or
353 any other fields.
354
355 o Src ID Type (1 byte) - Indicates the type of ID in the
356 Source ID field. See section 2.4 SILC ID Types for
357 defined ID types.
358
359 o Source ID (variable length) - The actual source ID that
360 indicates which is the original sender of the packet.
361
362 o Dst ID Type (1 byte) - Indicates the type of ID in the
363 Destination ID field. See section 2.4 SILC ID Types for
364 defined ID types.
365
366 o Destination ID (variable length) - The actual destination
367 ID that indicates which is the end receiver of the packet.
368
369
370
371 .ti 0
372 2.3 SILC Packet Types
373
374 SILC packet types defines the contents of the packet and it is used by
375 the receiver to parse the packet. The packet type is 8 bits in length.
376 The range for the packet types are from 0 - 255, where 0 is never sent and
377 255 is currently reserved for future extensions and MUST NOT be defined to
378 any other purpose. Every SILC specification compliant implementation
379 SHOULD support all the following packet types.
380
381 The below list of the SILC Packet types includes reference to the packet
382 payload as well. Packet payloads are the actual packet data area. Each
383 packet type defines packet payload which usually may only be sent with
384 the specific packet type.
385
386 Most of the packets are packets that must be destined directly to entity
387 that is connected to the sender. It is not allowed, for example, for a
388 router to send SILC_PACKET_DISCONNECT packet to client that is not
389 directly connected to the router. However, there are some special packet
390 types that may be destined to some entity that the sender does not have
391 direct connection with. These packets are for example private message
392 packets, channel message packets, command packets and some other packets
393 that may be broadcasted in the SILC network. The following packet
394 desription list will define it separately if a packet is allowed to be
395 sent to indirectly connected entity. Other packets MUST NOT be sent or
396 accepted, if sent, to indirectly connected entities.
397
398 Some packets MAY be sent as lists by adding the List flag to the Packet
399 Header and constructing multiple packet payloads one after the other.
400 When this is allowed it is separately defined in the following list.
401 Other packets MUST NOT be sent as list and the List flag MUST NOT be set.
402
403
404 List of SILC Packet types are defined as follows.
405
406 .in 1
407 0 SILC_PACKET_NONE
408
409 This type is reserved and it is never sent.
410
411
412 1 SILC_PACKET_DISCONNECT
413
414 This packet is sent to disconnect the remote end. Reason of
415 the disconnection is sent inside the packet payload.
416
417 Payload of the packet: See section 2.3.3 Disconnect Payload
418
419
420 2 SILC_PACKET_SUCCESS
421
422 This packet is sent upon successful execution of a protocol.
423 The status of the success is sent in the packet payload.
424
425 Payload of the packet: See section 2.3.4 Success Payload
426
427
428 3 SILC_PACKET_FAILURE
429
430 This packet is sent upon failure of a protocol. The status
431 of the failure is sent in the packet payload.
432
433 Payload of the packet: See section 2.3.5 Failure Payload
434
435
436 4 SILC_PACKET_REJECT
437
438 This packet MAY be sent upon rejection of a protocol. The
439 status of the rejection is sent in the packet payload.
440
441 Payload of the packet: See section 2.3.6 Reject Payload
442
443
444 5 SILC_PACKET_NOTIFY
445
446 This packet is used to send notify message. The packet is
447 usually sent between server and client, but also between
448 server and router. Client MUST NOT send this packet. Server
449 MAY destine this packet to channel as well when the packet is
450 distributed to all clients on the channel. This packet MAY
451 be sent as list.
452
453 Payload of the packet: See section 2.3.7 Notify Payload.
454
455
456 6 SILC_PACKET_ERROR
457
458 This packet is sent when an error occurs. Server MAY
459 send this packet. Client MUST NOT send this packet. The
460 client MAY entirely ignore the packet, however, server is
461 most likely to take action anyway. This packet MAY be sent
462 to entity that is indirectly connected to the sender.
463
464 Payload of the packet: See section 2.3.8 Error Payload.
465
466
467 7 SILC_PACKET_CHANNEL_MESSAGE
468
469 This packet is used to send messages to channels. The packet
470 includes Channel ID of the channel and the actual message to
471 the channel. Messages sent to the channel are always protected
472 by channel specific keys. This packet MAY be sent to entity
473 that is indirectly connected to the sender.
474
475 Payload of the packet: See section 2.3.9 Channel Message
476 Payload
477
478
479 8 SILC_PACKET_CHANNEL_KEY
480
481 This packet is used to distribute new key for particular
482 channel when server generates it. Each channel has their own
483 independent keys that is used to protect the traffic on the
484 channel. It is also possible to use channel private keys that
485 are not server generated. In this case this packet is not used.
486 Client MUST NOT send this packet. This packet MAY be sent to
487 entity that is indirectly connected to the sender.
488
489 Payload of the packet: See section 2.3.10 Channel Key Payload
490
491
492 9 SILC_PACKET_PRIVATE_MESSAGE
493
494 This packet is used to send private messages from client
495 to another client. By default, private messages are protected
496 by session keys established by normal key exchange protocol.
497 However, it is possible to use specific key to protect private
498 messages. See [SILC1] for private message key generation.
499 This packet MAY be sent to entity that is indirectly connected
500 to the sender.
501
502 Payload of the packet: See section 2.3.11 Private Message
503 Payload
504
505
506 10 SILC_PACKET_PRIVATE_MESSAGE_KEY
507
508 This packet is OPTIONAL and sender of the packet can indicate
509 that a private message key should be used in private message
510 communication. The actual key material is not sent in this
511 packet but must be either static or pre-shared key. The
512 receiver of the packet is considered to be the responder
513 when processing the static or pre-shared key material as
514 defined in [SILC1] and [SILC3] for private message keys.
515 This packet MAY be sent to entity that is indirectly connected
516 to the sender.
517
518 Payload of the packet: See section 2.3.12 Private Message
519 Key Payload
520
521
522 11 SILC_PACKET_COMMAND
523
524 This packet is used to send commands from client to server.
525 Server MAY send this packet to other servers as well. All
526 commands are listed in their own section SILC Command Types
527 in [SILC4]. The contents of this packet is command specific.
528 This packet MAY be sent to entity that is indirectly connected
529 to the sender.
530
531 Payload of the packet: See section 2.3.13 Command Payload
532
533
534 12 SILC_PACKET_COMMAND_REPLY
535
536 This packet is sent as reply to the SILC_PACKET_COMMAND packet.
537 The contents of this packet is command specific. This packet
538 MAY be sent to entity that is indirectly connected to the
539 sender. This packet MAY be sent as list.
540
541 Payload of the packet: See section 2.3.14 Command Reply
542 Payload and section 2.3.13 Command
543 Payload
544
545
546 13 SILC_PACKET_KEY_EXCHANGE
547
548 This packet is used to start SILC Key Exchange Protocol,
549 described in detail in [SILC3].
550
551 Payload of the packet: Payload of this packet is described
552 in the section SILC Key Exchange
553 Protocol and its sub sections in
554 [SILC3].
555
556
557 14 SILC_PACKET_KEY_EXCHANGE_1
558
559 This packet is used as part of the SILC Key Exchange Protocol.
560
561 Payload of the packet: Payload of this packet is described
562 in the section SILC Key Exchange
563 Protocol and its sub sections in
564 [SILC3].
565
566
567 15 SILC_PACKET_KEY_EXCHANGE_2
568
569 This packet is used as part of the SILC Key Exchange Protocol.
570
571 Payload of the packet: Payload of this packet is described
572 in the section SILC Key Exchange
573 Protocol and its sub sections in
574 [SILC3].
575
576
577 16 SILC_PACKET_CONNECTION_AUTH_REQUEST
578
579 This packet is used to request an authentication method to
580 be used in the SILC Connection Authentication Protocol. If
581 initiator of the protocol does not know the mandatory
582 authentication method this packet MAY be used to determine it.
583 The party receiving this payload SHOULD respond with the same
584 packet including the mandatory authentication method.
585
586 Payload of the packet: See section 2.3.15 Connection Auth
587 Request Payload
588
589
590 17 SILC_PACKET_CONNECTION_AUTH
591
592 This packet is used to start and perform the SILC Connection
593 Authentication Protocol. This protocol is used to authenticate
594 the connecting party. The protocol is described in detail in
595 [SILC3].
596
597 Payload of the packet: Payload of this packet is described
598 in the section SILC Authentication
599 Protocol and it sub sections in [SILC].
600
601
602 18 SILC_PACKET_NEW_ID
603
604 This packet is used to distribute new IDs from server to
605 router and from router to all other routers in SILC network.
606 This is used when for example new client is registered to
607 SILC network. The newly created IDs of these operations are
608 distributed by this packet. Only server may send this packet,
609 however, client MUST be able to receive this packet. This
610 packet MAY be sent to entity that is indirectly connected
611 to the sender. This packet MAY be sent as list.
612
613 Payload of the packet: See section 2.3.16 New ID Payload
614
615
616 19 SILC_PACKET_NEW_CLIENT
617
618 This packet is used by client to register itself to the
619 SILC network. This is sent after key exchange and
620 authentication protocols has been completed. Client sends
621 various information about itself in this packet to the server.
622
623 Payload of the packet: See section 2.3.17 New Client Payload
624
625
626 20 SILC_PACKET_NEW_SERVER
627
628 This packet is used by server to register itself to the
629 SILC network. This is sent after key exchange and
630 authentication protocols has been completed. Server sends
631 this to the router it connected to, or, if router was
632 connecting, to the connected router. Server sends its
633 Server ID and other information in this packet. The client
634 MUST NOT send or receive this packet.
635
636 Payload of the packet: See section 2.3.18 New Server Payload
637
638
639 21 SILC_PACKET_NEW_CHANNEL
640
641 This packet is used to notify routers about newly created
642 channel. Channels are always created by the router and it MUST
643 notify other routers about the created channel. Router sends
644 this packet to its primary route. Client MUST NOT send this
645 packet. This packet MAY be sent to entity that is indirectly
646 connected to the sender. This packet MAY be sent as list.
647
648 Payload of the packet: See section 2.3.19 New Channel Payload
649
650
651 22 SILC_PACKET_REKEY
652
653 This packet is used to indicate that re-key must be performed
654 for session keys. See section Session Key Regeneration in
655 [SILC1] for more information. This packet does not have
656 a payload.
657
658
659 23 SILC_PACKET_REKEY_DONE
660
661 This packet is used to indicate that re-key is performed and
662 new keys must be used hereafter. This packet does not have a
663 payload.
664
665
666 24 SILC_PACKET_HEARTBEAT
667
668 This packet is used by clients, servers and routers to keep the
669 connection alive. It is RECOMMENDED that all servers implement
670 keepalive actions and perform it to both direction in a link.
671 This packet does not have a payload.
672
673
674 25 SILC_PACKET_KEY_AGREEMENT
675
676 This packet is used by clients to request key negotiation
677 between another client in the SILC network. If the negotiation
678 is started it is performed using the SKE protocol. The result of
679 the negotiation, the secret key material, can be used for
680 example as private message key. The server and router MUST NOT
681 send this packet.
682
683 Payload of the packet: See section 2.3.20 Key Agreement Payload
684
685
686 26 SILC_PACKET_RESUME_ROUTER
687
688 This packet is used during backup router protocol when the
689 original primary router of the cell comes back online and wishes
690 to resume the position as being the primary router of the cell.
691
692 Payload of the packet: See section 2.3.21 Resume Router Payload
693
694
695 27 SILC_PACKET_FTP
696
697 This packet is used to perform an file transfer protocol in the
698 SILC session with some entity in the network. The packet is
699 multi purpose. The packet is used to tell other entity in the
700 network that the sender wishes to perform an file transfer
701 protocol. The packet is also used to actually tunnel the
702 file transfer protocol stream. The file transfer protocol
703 stream is always protected with the SILC binary packet protocol.
704
705 Payload of the packet: See section 2.3.22 File Transfer Payload
706
707
708 28 SILC_PACKET_RESUME_CLIENT
709
710 This packet is used to resume a client back to the network
711 after it has been detached. A client is able to detach from
712 the network but the client is still valid client in the network.
713 The client may then later resume its session back by sending
714 this packet to a server. Routers also use this packet to notify
715 other routers in the network that the detached client has resumed.
716
717 Payload of the packet: See section 2.3.23 Resume Client Payload
718
719
720 29 - 199
721
722 Currently undefined commands.
723
724
725 200 - 254
726
727 These packet types are reserved for private use and they will
728 not be defined by this document.
729
730
731 255 SILC_PACKET_MAX
732
733 This type is reserved for future extensions and currently it
734 MUST NOT be sent.
735 .in 3
736
737
738 .ti 0
739 2.3.1 SILC Packet Payloads
740
741 All payloads resides in the main data area of the SILC packet. However
742 all payloads MUST be at the start of the data area after the SILC
743 packet header and padding. All fields in the packet payload are always
744 encrypted, as they reside in the data area of the packet which is
745 always encrypted. Most of the payloads may only be sent with specific
746 packet type which is defined in the description of the payload.
747
748 There are some other payloads in SILC as well. However, they are not
749 common in the sense that they could be sent at any time. These payloads
750 are not described in this section. These are payloads such as SILC
751 Key Exchange payloads and so on. These are described in [SILC1],
752 [SILC3] and [SILC4].
753
754
755 .ti 0
756 2.3.2 Generic payloads
757
758 This section describes generic payloads that are not associated to any
759 specific packet type. They can be used for example inside some other
760 packet payload.
761
762
763 .ti 0
764 2.3.2.1 ID Payload
765
766 This payload can be used to send an ID. ID's are variable in length
767 thus this payload provides a way to send variable length ID.
768
769 The following diagram represents the ID Payload.
770
771 .in 5
772 .nf
773 1 2 3
774 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
775 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
776 | ID Type | ID Length |
777 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
778 | |
779 ~ ID Data ~
780 | |
781 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
782 .in 3
783
784 .ce
785 Figure 3: ID Payload
786
787
788 .in 6
789 o ID Type (2 bytes) - Indicates the type of the ID. See
790 section 2.4 SILC ID Types for list of defined ID types.
791
792 o ID Length (2 bytes) - Length of the ID Data area not
793 including the length of any other fields in the payload.
794
795 o ID Data (variable length) - The actual ID data. The encoding
796 of the ID data is defined in section 2.4 SILC ID Types.
797 .in 3
798
799
800 .ti 0
801 2.3.2.2 Argument Payload
802
803 Argument Payload is used to set arguments for any packet payload that
804 need and support arguments, such as commands. Number of arguments
805 associated with a packet MUST be indicated by the packet payload which
806 need the arguments. Argument Payloads MUST always reside right after
807 the packet payload needing the arguments. Incorrect amount of argument
808 payloads MUST cause rejection of the packet.
809
810 The following diagram represents the Argument Payload.
811
812 .in 5
813 .nf
814 1 2 3
815 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
816 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
817 | Data Length | Argument Type | |
818 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
819 | |
820 ~ Argument Data ~
821 | |
822 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
823 .in 3
824
825 .ce
826 Figure 4: Argument Payload
827
828
829 .in 6
830 o Data Length (2 bytes) - Length of the Argument Data field
831 not including the length of any other field in the payload.
832
833 o Argument Type (1 byte) - Indicates the type of the argument.
834 Every argument can have a specific type that are defined
835 by the packet payload needing the argument. For example
836 every command specify a number for each argument that may be
837 associated with the command. By using this number the receiver
838 of the packet knows what type of argument this is. If there is
839 no specific argument type this field is set to zero (0) value.
840
841 o Argument Data (variable length) - Argument data.
842 .in 3
843
844
845 .ti 0
846 2.3.2.3 Argument List Payload
847
848 Argument List Payload is a list of Argument Payloads appended one
849 after the other. The number of arguments is indicated in the
850 payload.
851
852 The following diagram represents the Argument List Payload.
853
854 .in 5
855 .nf
856 1 2 3
857 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
858 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
859 | Argument Nums | |
860 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
861 | |
862 ~ Argument Payloads ~
863 | |
864 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
865 .in 3
866
867 .ce
868 Figure 5: Argument List Payload
869
870
871 .in 6
872 o Argument Nums (2 bytes) - Indicates the number of Argument
873 Payloads. If zero (0) value is found in this field no
874 arguments are present.
875
876 o Argument Payloads (variable length) - The Argument Payloads
877 appended one after the other. The payloads can be decoded
878 since the length of the payload is indicated in each of
879 the Argument Payload.
880 .in 3
881
882
883
884
885
886 .ti 0
887 2.3.2.4 Channel Payload
888
889 Generic Channel Payload may be used to send information about a channel,
890 its name, the Channel ID and a mode.
891
892 The following diagram represents the Channel Payload.
893
894
895 .in 5
896 .nf
897 1 2 3
898 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
899 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
900 | Channel Name Length | |
901 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
902 | |
903 ~ Channel Name ~
904 | |
905 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
906 | Channel ID Length | |
907 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
908 | |
909 ~ Channel ID ~
910 | |
911 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
912 | Mode Mask |
913 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
914 .in 3
915
916 .ce
917 Figure 6: New Channel Payload
918
919
920 .in 6
921 o Channel Name Length (2 bytes) - Length of the Channel Name
922 field.
923
924 o Channel Name (variable length) - The name of the channel.
925
926 o Channel ID Length (2 bytes) - Length of the Channel ID field.
927
928 o Channel ID (variable length) - The encoded Channel ID.
929
930 o Mode Mask (4 bytes) - A mode. This can be the mode of the
931 channel but it can also be the mode of a client on the
932 channel. The contents of this field is dependent of the
933 usage of this payload. The usage is defined separately
934 when this payload is used. This is a 32 bit MSB first value.
935 .in 3
936
937
938
939
940
941
942 .ti 0
943 2.3.2.5 Public Key Payload
944
945 Generic Public Key Payload may be used to send different type of
946 public keys and certificates.
947
948 The following diagram represents the Public Key Payload.
949
950 .in 5
951 .nf
952 1 2 3
953 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
954 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
955 | Public Key Length | Public Key Type |
956 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
957 | |
958 ~ Public Key (or certificate) ~
959 | |
960 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
961 .in 3
962
963 .ce
964 Figure 7: Public Key Payload
965
966
967 .in 6
968 o Public Key Length (2 bytes) - The length of the Public Key
969 (or certificate) field, not including any other field.
970
971 o Public Key Type (2 bytes) - The public key (or certificate)
972 type. This field indicates the type of the public key in
973 the packet. See the [SILC3] for defined public key types.
974
975 o Public Key (or certificate) (variable length) - The
976 encoded public key or certificate data.
977 .in 3
978
979
980 .ti 0
981 2.3.2.6 Message Payload
982
983 Generic Message Payload can be used to send messages in SILC. It
984 is used to send channel messages and private messages.
985
986 The following diagram represents the Message Payload.
987
988 (*) indicates that the field is not encrypted.
989
990
991
992
993
994
995
996
997
998 .in 5
999 .nf
1000 1 2 3
1001 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
1002 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1003 | Message Flags | Message Length |
1004 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1005 | |
1006 ~ Message Data ~
1007 | |
1008 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1009 | Padding Length | |
1010 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1011 | |
1012 ~ Padding ~
1013 | |
1014 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1015 | |
1016 ~ Initialization Vector * ~
1017 | |
1018 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1019 | |
1020 ~ MAC * ~
1021 | |
1022 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1023 .in 3
1024
1025 .ce
1026 Figure 8: Message Payload
1027
1028
1029 .in 6
1030 o Message Flags (2 bytes) - Includes the Message Flags of the
1031 message. The flags can indicate a reason or a purpose for
1032 the message. The following Message Flags are defined:
1033
1034 0x0000 SILC_MESSAGE_FLAG_NONE
1035
1036 No specific flags set.
1037
1038 0x0001 SILC_MESSAGE_FLAG_AUTOREPLY
1039
1040 This message is an automatic reply to an earlier
1041 received message.
1042
1043 0x0002 SILC_MESSAGE_FLAG_NOREPLY
1044
1045 There should not be reply messages to this
1046 message.
1047
1048 0x0004 SILC_MESSAGE_FLAG_ACTION
1049
1050 The sender is performing an action and the message
1051 is the indication of the action.
1052
1053 0x0008 SILC_MESSAGE_FLAG_NOTICE
1054
1055 The message is for example an informational notice
1056 type message.
1057
1058 0x0010 SILC_MESSAGE_FLAG_REQUEST
1059
1060 This is a generic request flag to send request
1061 messages. A separate document should define any
1062 payloads associated to this flag.
1063
1064 0x0020 SILC_MESSAGE_FLAG_SIGNED
1065
1066 This flag indicates that the message is signed
1067 with sender's private key and thus can be verified
1068 by the receiver using the sender's public key. A
1069 separate document should define the detailed procedure
1070 of the signing process and any associated payloads
1071 for this flag.
1072
1073 0x0040 SILC_MESSAGE_FLAG_REPLY
1074
1075 This is a generic reply flag to send a reply to
1076 previously received request. A separate document
1077 should define any payloads associated to this flag.
1078
1079 0x0080 SILC_MESSAGE_FLAG_DATA
1080
1081 This is a generic data flag, indicating that the
1082 message includes some data which can be interpreted
1083 in a specific way. Using this flag any kind of data
1084 can be delivered inside message payload. A separate
1085 document should define how this flag is interpreted
1086 and define any associated payloads.
1087
1088 0x0100 SILC_MESSAGE_FLAG_UTF8
1089
1090 This flag indicates that the message is UTF-8 encoded
1091 textual message. When sending text messages in SILC
1092 this flag SHOULD be used. When this flag is used the
1093 text sent as message MUST be UTF-8 encoded.
1094
1095 0x0200 SILC_MESSAGE_FLAG_ACK
1096
1097 This flag indicates the sender requires the recpipient
1098 to acknowledge the received message. This same flag
1099 is used in the acknowledgement. A separate document
1100 should define how the acknowledgement is performed.
1101
1102 0x0400 - 0x1000 RESERVED
1103
1104 Reserved for future flags.
1105
1106 0x2000 - 0x8000 PRIVATE RANGE
1107
1108 Private range for free use.
1109
1110 o Message Length (2 bytes) - Indicates the length of the
1111 Message Data field in the payload, not including any
1112 other field.
1113
1114 o Message Data (variable length) - The actual message data.
1115
1116 o Padding Length (2 bytes) - Indicates the length of the
1117 Padding field in the payload, not including any other
1118 field.
1119
1120 o Padding (variable length) - If this payload is used as
1121 channel messages, the padding MUST be applied because
1122 this payload is encrypted separately from other parts
1123 of the packet. If this payload is used as private
1124 messages, the padding is present only when the payload
1125 is encrypted with private message key. If encrypted
1126 with session keys this field MUST NOT be present and the
1127 Padding Length field includes a zero (0) value. The
1128 padding SHOULD be random data.
1129
1130 o Initialization Vector (variable length) - This field MUST
1131 be present when this payload is used as channel messages.
1132 The IV SHOULD be random data for each channel message.
1133
1134 When encrypting private messages with session keys this
1135 field MUST NOT be present. For private messages this
1136 field is present only when encrypting with a static
1137 private message key (pre-shared key). If randomly
1138 generated key material is used this field MUST