2.2.10.1 Message Command Fields

The Message command fields are defined as shown in the following table.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

CommandId

CommandLength

SessionId

...

MessageCount

...

A

B

C

D

E

F

G

H

UserRef (variable)

...

Ephemeral Fields

StreamSize Fields (24 bytes)

...

...

Fragmentation Fields (variable)

...

CommandId (1 byte): The command identifier. This field MUST be set to 0x0d.

CommandLength (2 bytes): The total length of the command, in bytes.

SessionId (4 bytes): The identifier for the SSTP session, as specified in section 3.1.1.3.

MessageCount (4 bytes): The number of SSTP messages that the sending device acknowledges it has successfully received and processed. Although this field is contained within a session message, this is a connection-level acknowledgment.

A - r1 (1 bit): This field is reserved and MUST be set to zero.

B - F (1 bit): If set to 1, this value indicates that the Fragmentation Fields are present.

C - G (1 bit): If set to 1, this value indicates that the receiving application SHOULD track this message and report message status to the resource handler.

D - S (1 bit): If set to 1, this value indicates that the StreamSize Fields are present.

E - r2 (1 bit): This field is reserved and MUST be set to zero.

F - A (1 bit): If set to 1, this value indicates that the sending device is requesting that the receiving device acknowledge this message immediately. An alternate name for this field is AcknowledgeImmediately.

G - E (1 bit): If set to 1, this value indicates a message has Ephemeral Fields present. An alternate name for this field is Ephemeral.

H - D (1 bit): If set to 1, this value indicates that the sending device is requesting that the message be discarded by the relay server if the destination device is offline. An alternate name for this field is DoNotDeliverIfOffline.

UserRef (variable): A variable-length ASCII string terminated by 0x00 containing an optional arbitrary string containing a higher-layer application-defined identifier for the message.

Ephemeral Fields (4 bytes): If the E bit is set to 1, these MUST be present. Otherwise, these fields MUST NOT be present.

These fields are defined as shown in the following table.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

TTL

Reserved1 (optional)

Reserved2 (optional)

TTL (4 bytes): The message time to live, in seconds. Only relay servers SHOULD act on this field. A TTL field value of 0 indicates an infinite time to live for the message. Setting the TTL field to 0 is functionally equivalent to clearing the E bit, and not including the Ephemeral Fields in the Message command.

Reserved1 (4 bytes, optional): MUST be set to 0x00000000 if present.

Reserved2 (1 byte, optional): MUST be set to 0x00 if present.

StreamSize Fields (96 bytes): If the S bit is set to 1, these MUST be present. Otherwise, these fields MUST NOT be present.

These fields are defined as shown in the following table.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

ByteStreamSize

...

SessionSize

...

MessageSize

...

ByteStreamSize (8 bytes): The total number of bytes in the message in the higher-layer byte stream. An application can divide a single byte stream into multiple SSTP message sequences. This field MUST be the size of the original byte stream. A value of zero indicates the length of the byte stream is unknown.

SessionSize (8 bytes): The total number of bytes of the higher-layer byte stream that remain to be sent, including the size of the current message sequence byte stream. A value of zero indicates that the amount of data waiting to be sent is unknown.

MessageSize (8 bytes): The size of the message sequence, in bytes, before being divided up for transmission via individual Data commands. A value of zero indicates that the length of the message sequence is unknown.

Fragmentation Fields (variable): If the F bit is set to 1, these MUST be present. Otherwise, these fields MUST NOT be present.

These fields are defined as shown in the following table.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

NumFragments

ThisFragment

FragmentId (variable)

...

FragmentOffset

...

NumFragments (4 bytes): The total number of fragments in the fragmented message.

ThisFragment (4 bytes): The number of this fragment.

FragmentId (variable): A variable-length ASCII string terminated by 0x00 containing a unique identifier that is common to all the message sequences that are part of the same higher-layer byte stream.

FragmentOffset (8 bytes): The offset in the fragmented byte stream.