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 28 July 2003
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-07.txt 28 July 2003
20 Expires: 28 January 2004
21
22 .in 3
23
24 .ce 2
25 SILC Packet Protocol
26 <draft-riikonen-silc-pp-07.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 ...................................... 24
91 2.3.7 Notify Payload ...................................... 25
92 2.3.8 Error Payload ....................................... 34
93 2.3.9 Channel Message Payload ............................. 34
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 ..................................... 41
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 .............................. 46
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 ................................. 52
115 2.8 Packet Compression ........................................ 53
116 2.9 Packet Sending ............................................ 53
117 2.10 Packet Reception ......................................... 54
118 2.11 Packet Routing ........................................... 54
119 2.12 Packet Broadcasting ...................................... 55
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. If the packet is allowed to
394 be sent to indirectly connected entity it is defined separately in the
395 following packet description list. 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 can be used to agree about a key to be used to
509 protect private messages between two clients. This packet
510 is sent inside the SILC network and protected with session
511 keys. There are other means of agreeing to use private message
512 keys as well, than sending this packet which may not be
513 desirable on all situations. See the [SILC1] for private
514 message key generation.
515
516 Payload of the packet: See section 2.3.12 Private Message
517 Key Payload
518
519
520 11 SILC_PACKET_COMMAND
521
522 This packet is used to send commands from client to server.
523 Server MAY send this packet to other servers as well. All
524 commands are listed in their own section SILC Command Types
525 in [SILC4]. The contents of this packet is command specific.
526 This packet MAY be sent to entity that is indirectly connected
527 to the sender.
528
529 Payload of the packet: See section 2.3.13 Command Payload
530
531
532 12 SILC_PACKET_COMMAND_REPLY
533
534 This packet is sent as reply to the SILC_PACKET_COMMAND packet.
535 The contents of this packet is command specific. This packet
536 MAY be sent to entity that is indirectly connected to the
537 sender. This packet MAY be sent as list.
538
539 Payload of the packet: See section 2.3.14 Command Reply
540 Payload and section 2.3.13 Command
541 Payload
542
543
544
545 13 SILC_PACKET_KEY_EXCHANGE
546
547 This packet is used to start SILC Key Exchange Protocol,
548 described in detail in [SILC3].
549
550 Payload of the packet: Payload of this packet is described
551 in the section SILC Key Exchange
552 Protocol and its sub sections in
553 [SILC3].
554
555
556 14 SILC_PACKET_KEY_EXCHANGE_1
557
558 This packet is used as part of the SILC Key Exchange Protocol.
559
560 Payload of the packet: Payload of this packet is described
561 in the section SILC Key Exchange
562 Protocol and its sub sections in
563 [SILC3].
564
565
566 15 SILC_PACKET_KEY_EXCHANGE_2
567
568 This packet is used as part of the SILC Key Exchange Protocol.
569
570 Payload of the packet: Payload of this packet is described
571 in the section SILC Key Exchange
572 Protocol and its sub sections in
573 [SILC3].
574
575
576 16 SILC_PACKET_CONNECTION_AUTH_REQUEST
577
578 This packet is used to request an authentication method to
579 be used in the SILC Connection Authentication Protocol. If
580 initiator of the protocol does not know the mandatory
581 authentication method this packet MAY be used to determine it.
582 The party receiving this payload SHOULD respond with the same
583 packet including the mandatory authentication method.
584
585 Payload of the packet: See section 2.3.15 Connection Auth
586 Request Payload
587
588
589 17 SILC_PACKET_CONNECTION_AUTH
590
591 This packet is used to start and perform the SILC Connection
592 Authentication Protocol. This protocol is used to authenticate
593 the connecting party. The protocol is described in detail in
594 [SILC3].
595
596 Payload of the packet: Payload of this packet is described
597 in the section SILC Authentication
598 Protocol and it sub sections in [SILC].
599
600
601 18 SILC_PACKET_NEW_ID
602
603 This packet is used to distribute new IDs from server to
604 router and from router to all other routers in SILC network.
605 This is used when for example new client is registered to
606 SILC network. The newly created IDs of these operations are
607 distributed by this packet. Only server may send this packet,
608 however, client MUST be able to receive this packet. This
609 packet MAY be sent to entity that is indirectly connected
610 to the sender. This packet MAY be sent as list.
611
612 Payload of the packet: See section 2.3.16 New ID Payload
613
614
615 19 SILC_PACKET_NEW_CLIENT
616
617 This packet is used by client to register itself to the
618 SILC network. This is sent after key exchange and
619 authentication protocols has been completed. Client sends
620 various information about itself in this packet to the server.
621
622 Payload of the packet: See section 2.3.17 New Client Payload
623
624
625 20 SILC_PACKET_NEW_SERVER
626
627 This packet is used by server to register itself to the
628 SILC network. This is sent after key exchange and
629 authentication protocols has been completed. Server sends
630 this to the router it connected to, or, if router was
631 connecting, to the connected router. Server sends its
632 Server ID and other information in this packet. The client
633 MUST NOT send or receive this packet.
634
635 Payload of the packet: See section 2.3.18 New Server Payload
636
637
638 21 SILC_PACKET_NEW_CHANNEL
639
640 This packet is used to notify routers about newly created
641 channel. Channels are always created by the router and it MUST
642 notify other routers about the created channel. Router sends
643 this packet to its primary route. Client MUST NOT send this
644 packet. This packet MAY be sent to entity that is indirectly
645 connected to the sender. This packet MAY be sent as list.
646
647 Payload of the packet: See section 2.3.19 New Channel Payload
648
649
650 22 SILC_PACKET_REKEY
651
652 This packet is used to indicate that re-key must be performed
653 for session keys. See section Session Key Regeneration in
654 [SILC1] for more information. This packet does not have
655 a payload.
656
657
658 23 SILC_PACKET_REKEY_DONE
659
660 This packet is used to indicate that re-key is performed and
661 new keys must be used hereafter. This packet does not have a
662 payload.
663
664
665 24 SILC_PACKET_HEARTBEAT
666
667 This packet is used by clients, servers and routers to keep the
668 connection alive. It is RECOMMENDED that all servers implement
669 keepalive actions and perform it to both direction in a link.
670 This packet does not have a payload.
671
672
673 25 SILC_PACKET_KEY_AGREEMENT
674
675 This packet is used by clients to request key negotiation
676 between another client in the SILC network. If the negotiation
677 is started it is performed using the SKE protocol. The result of
678 the negotiation, the secret key material, can be used for
679 example as private message key. The server and router MUST NOT
680 send this packet.
681
682 Payload of the packet: See section 2.3.20 Key Agreement Payload
683
684
685 26 SILC_PACKET_RESUME_ROUTER
686
687 This packet is used during backup router protocol when the
688 original primary router of the cell comes back online and wishes
689 to resume the position as being the primary router of the cell.
690
691 Payload of the packet: See section 2.3.21 Resume Router Payload
692
693
694 27 SILC_PACKET_FTP
695
696 This packet is used to perform an file transfer protocol in the
697 SILC session with some entity in the network. The packet is
698 multi purpose. The packet is used to tell other entity in the
699 network that the sender wishes to perform an file transfer
700 protocol. The packet is also used to actually tunnel the
701 file transfer protocol stream. The file transfer protocol
702 stream is always protected with the SILC binary packet protocol.
703
704 Payload of the packet: See section 2.3.22 File Transfer Payload
705
706
707 28 SILC_PACKET_RESUME_CLIENT
708
709 This packet is used to resume a client back to the network
710 after it has been detached. A client is able to detach from
711 the network but the client is still valid client in the network.
712 The client may then later resume its session back by sending
713 this packet to a server. Routers also use this packet to notify
714 other routers in the network that the detached client has resumed.
715
716 Payload of the packet: See section 2.3.23 Resume Client Payload
717
718
719 29 - 199
720
721 Currently undefined commands.
722
723
724 200 - 254
725
726 These packet types are reserved for private use and they will
727 not be defined by this document.
728
729
730 255 SILC_PACKET_MAX
731
732 This type is reserved for future extensions and currently it
733 MUST NOT be sent.
734 .in 3
735
736
737 .ti 0
738 2.3.1 SILC Packet Payloads
739
740 All payloads resides in the main data area of the SILC packet. However
741 all payloads MUST be at the start of the data area after the SILC
742 packet header and padding. All fields in the packet payload are always
743 encrypted, as they reside in the data area of the packet which is
744 always encrypted. Most of the payloads may only be sent with specific
745 packet type which is defined in the description of the payload.
746
747 There are some other payloads in SILC as well. However, they are not
748 common in the sense that they could be sent at any time. These payloads
749 are not described in this section. These are payloads such as SILC
750 Key Exchange payloads and so on. These are described in [SILC1],
751 [SILC3] and [SILC4].
752
753
754 .ti 0
755 2.3.2 Generic payloads
756
757 This section describes generic payloads that are not associated to any
758 specific packet type. They can be used for example inside some other
759 packet payload.
760
761
762 .ti 0
763 2.3.2.1 ID Payload
764
765 This payload can be used to send an ID. ID's are variable in length
766 thus this payload provides a way to send variable length ID.
767
768 The following diagram represents the ID Payload.
769
770 .in 5
771 .nf
772 1 2 3
773 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
774 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
775 | ID Type | ID Length |
776 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
777 | |
778 ~ ID Data ~
779 | |
780 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
781 .in 3
782
783 .ce
784 Figure 3: ID Payload
785
786
787 .in 6
788 o ID Type (2 bytes) - Indicates the type of the ID. See
789 section 2.4 SILC ID Types for list of defined ID types.
790
791 o ID Length (2 bytes) - Length of the ID Data area not
792 including the length of any other fields in the payload.
793
794 o ID Data (variable length) - The actual ID data. The encoding
795 of the ID data is defined in section 2.4 SILC ID Types.
796 .in 3
797
798
799 .ti 0
800 2.3.2.2 Argument Payload
801
802 Argument Payload is used to set arguments for any packet payload that
803 need and support arguments, such as commands. Number of arguments
804 associated with a packet MUST be indicated by the packet payload which
805 need the arguments. Argument Payloads MUST always reside right after
806 the packet payload needing the arguments. Incorrect amount of argument
807 payloads MUST cause rejection of the packet.
808
809 The following diagram represents the Argument Payload.
810
811 .in 5
812 .nf
813 1 2 3
814 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
815 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
816 | Payload Length | Argument Type | |
817 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
818 | |
819 ~ Argument Data ~
820 | |
821 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
822 .in 3
823
824 .ce
825 Figure 4: Argument Payload
826
827
828 .in 6
829 o Payload Length (2 bytes) - Length of the Argument Data
830 field not including the length of any other field in the
831 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 .ti 0
886 2.3.2.4 Channel Payload
887
888 Generic Channel Payload may be used to send information about a channel,
889 its name, the Channel ID and a mode.
890
891 The following diagram represents the Channel Payload.
892
893
894 .in 5
895 .nf
896 1 2 3
897 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
898 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
899 | Channel Name Length | |
900 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
901 | |
902 ~ Channel Name ~
903 | |
904 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
905 | Channel ID Length | |
906 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
907 | |
908 ~ Channel ID ~
909 | |
910 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
911 | Mode Mask |
912 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
913 .in 3
914
915 .ce
916 Figure 6: New Channel Payload
917
918
919 .in 6
920 o Channel Name Length (2 bytes) - Length of the Channel Name
921 field.
922
923 o Channel Name (variable length) - The name of the channel.
924
925 o Channel ID Length (2 bytes) - Length of the Channel ID field.
926
927 o Channel ID (variable length) - The encoded Channel ID.
928
929 o Mode Mask (4 bytes) - A mode. This can be the mode of the
930 channel but it can also be the mode of a client on the
931 channel. The contents of this field is dependent of the
932 usage of this payload. The usage is defined separately
933 when this payload is used. This is a 32 bit MSB first value.
934 .in 3
935
936
937
938
939
940
941 .ti 0
942 2.3.2.5 Public Key Payload
943
944 Generic Public Key Payload may be used to send different type of
945 public keys and certificates.
946
947 The following diagram represents the Public Key Payload.
948
949 .in 5
950 .nf
951 1 2 3
952 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
953 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
954 | Public Key Length | Public Key Type |
955 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
956 | |
957 ~ Public Key (or certificate) ~
958 | |
959 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
960 .in 3
961
962 .ce
963 Figure 7: Public Key Payload
964
965
966 .in 6
967 o Public Key Length (2 bytes) - The length of the Public Key
968 (or certificate) field, not including any other field.
969
970 o Public Key Type (2 bytes) - The public key (or certificate)
971 type. This field indicates the type of the public key in
972 the packet. See the [SILC3] for defined public key types.
973
974 o Public Key (or certificate) (variable length) - The
975 encoded public key or certificate data.
976 .in 3
977
978
979 .ti 0
980 2.3.2.6 Message Payload
981
982 Generic Message Payload can be used to send messages in SILC. It
983 is used to send channel messages and private messages.
984
985 The following diagram represents the Message Payload.
986
987 (*) indicates that the field is not encrypted.
988
989
990
991
992
993
994
995
996
997 .in 5
998 .nf
999 1 2 3
1000 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
1001 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1002 | Message Flags | Message Length |
1003 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1004 | |
1005 ~ Message Data ~
1006 | |
1007 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1008 | Padding Length | |
1009 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +
1010 | |
1011 ~ Padding ~
1012 | |
1013 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1014 | |
1015 ~ Initial Vector * ~
1016 | |
1017 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1018 | |
1019 ~ MAC * ~
1020 | |
1021 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1022 .in 3
1023
1024 .ce
1025 Figure 8: Message Payload
1026
1027
1028 .in 6
1029 o Message Flags (2 bytes) - Includes the Message Flags of the
1030 message. The flags can indicate a reason or a purpose for
1031 the message. The following Message Flags are defined:
1032
1033 0x0000 SILC_MESSAGE_FLAG_NONE
1034
1035 No specific flags set.
1036
1037 0x0001 SILC_MESSAGE_FLAG_AUTOREPLY
1038
1039 This message is an automatic reply to an earlier
1040 received message.
1041
1042 0x0002 SILC_MESSAGE_FLAG_NOREPLY
1043
1044 There should not be reply messages to this
1045 message.
1046
1047 0x0004 SILC_MESSAGE_FLAG_ACTION
1048
1049 The sender is performing an action and the message
1050 is the indication of the action.
1051
1052 0x0008 SILC_MESSAGE_FLAG_NOTICE
1053
1054 The message is for example an informational notice
1055 type message.
1056
1057 0x0010 SILC_MESSAGE_FLAG_REQUEST
1058
1059 This is a generic request flag to send request
1060 messages. A separate document should define any
1061 payloads associated to this flag.
1062
1063 0x0020 SILC_MESSAGE_FLAG_SIGNED
1064
1065 This flag indicates that the message is signed
1066 with sender's private key and thus can be verified
1067 by the receiver using the sender's public key. A
1068 separate document should define the detailed procedure
1069 of the signing process and any associated payloads
1070 for this flag.
1071
1072 0x0040 SILC_MESSAGE_FLAG_REPLY
1073
1074 This is a generic reply flag to send a reply to
1075 previously received request. A separate document
1076 should define any payloads associated to this flag.
1077
1078 0x0080 SILC_MESSAGE_FLAG_DATA
1079
1080 This is a generic data flag, indicating that the
1081 message includes some data which can be interpreted
1082 in a specific way. Using this flag any kind of data
1083 can be delivered inside message payload. A separate
1084 document should define how this flag is interpreted
1085 and define any associated payloads.
1086
1087 0x0100 SILC_MESSAGE_FLAG_UTF8
1088
1089 This flag indicates that the message is UTF-8 encoded
1090 textual message. When sending text messages in SILC
1091 this flag SHOULD be used. When this flag is used the
1092 text sent as message MUST be UTF-8 encoded.
1093
1094 0x0200 - 0x0800 RESERVED
1095
1096 Reserved for future flags.
1097
1098 0x1000 - 0x8000 PRIVATE RANGE
1099
1100 Private range for free use.
1101
1102 o Message Length (2 bytes) - Indicates the length of the
1103 Message Data field in the payload, not including any
1104 other field.
1105
1106 o Message Data (variable length) - The actual message data.
1107
1108 o Padding Length (2 bytes) - Indicates the length of the
1109 Padding field in the payload, not including any other
1110 field.
1111
1112 o Padding (variable length) - If this payload is used as
1113 channel messages, the padding MUST be applied because
1114 this payload is encrypted separately from other parts
1115 of the packet. If this payload is used as private
1116 messages, the padding is present only when the payload
1117 is encrypted with private message key. If encrypted
1118 with session keys this field MUST NOT be present and the
1119 Padding Length field includes a zero (0) value. The
1120 padding SHOULD be random data.
1121
1122 o Initial Vector (variable length) - This field MUST be
1123 present when this payload is used as channel messages.
1124 The IV SHOULD be random data for each channel message.
1125
1126 When encrypting private messages with session keys this
1127 field MUST NOT be present. For private messages this
1128 field is present only when encrypting with a static
1129 private message key (pre-shared key). If randomly
1130 generated key material is used this field MUST NOT be
1131 present. Also, If Key Agreement (SKE) was used to
1132 negotiate fresh key material for private message key
1133 this field MUST NOT be present. See the section 4.6
1134 in [SILC1] for more information about IVs when
1135 encrypting private messages.
1136
1137 This field includes the initial vector used in message
1138 encryption. It need to be used in the packet decryption