Some control messages include a field that encodes optional Message Parameters. Message Parameters are serialized as follows:
Message Parameter {
Type Delta (vi64),
Value (..)
}
Type Delta: The difference between this Parameter Type and the previous
Parameter Type in the message, or the Parameter Type itself for the first
parameter. Parameters MUST be serialized in ascending order by Type.
If the resulting Type would be greater than 2^64 - 1, the endpoint
MUST close the session with a PROTOCOL_VIOLATION.
-
Value: The encoding is specified by each parameter definition. The encodings defined in this draft are:
-
uint8: A single-byte unsigned integer (0-255)
-
varint: A variable-length integer
-
Location: Two consecutive varints (Group, Object)
-
Length-prefixed: A varint length followed by that many bytes
-
Message Parameters are intended for the peer only and are not forwarded by Relays, though relays can consider received parameter values when making a request.
All Message Parameters MUST be defined in the negotiated version of MOQT or
negotiated via Setup Options. An endpoint that receives an unknown Message
Parameter MUST close the session with PROTOCOL_VIOLATION. Because the receiver
has to understand every Message Parameter, there is no need for a mechanism to
skip unknown parameters. Because unknown parameters cannot be skipped, the block
is bounded by a parameter count rather than a length.
The Message Parameter types defined in this version of MOQT are defined in the following subsections.
Senders MUST NOT repeat the same Parameter Type in a message unless the
parameter definition explicitly allows multiple instances of that type to
be sent in a single message. Receivers SHOULD check that there are no
unexpected duplicate parameters and close the session with PROTOCOL_VIOLATION
if found.
The number of Message Parameters is not specifically limited, but the total length of a control message is limited to 2^16-1 bytes.
Message Parameters in SUBSCRIBE, PUBLISH_OK and FETCH MUST NOT cause the publisher to alter the payload of the objects it sends, as that would violate the track uniqueness guarantee described in Section 2.4.3.
10.2.1. Parameter Scope
Message Parameters are always intended for the peer endpoint only and are not forwarded by Relays, though relays can consider received parameter values when making a request. Track information not specific to the Message or Session is encoded in Track Properties. See Section 2.5.
Each Message Parameter definition indicates the message types in which
it can appear. If it appears in some other type of message, the receiving
endpoint MUST close the connection with a PROTOCOL_VIOLATION.
Note that since Setup Options use a separate namespace, it is impossible for
Message Parameters to appear in Setup messages.
10.2.3. SUBGROUP_DELIVERY_TIMEOUT Parameter
The SUBGROUP_DELIVERY_TIMEOUT parameter (Parameter Type 0x06) is a varint. It MAY appear in a PUBLISH_OK, SUBSCRIBE, or REQUEST_UPDATE message. Its semantics are defined in Section 8.
This parameter is intended to be specific to a subscription, so it SHOULD NOT be forwarded upstream by a relay that intends to serve multiple subscriptions for the same track.
10.2.4. OBJECT_DELIVERY_TIMEOUT Parameter
The OBJECT_DELIVERY_TIMEOUT parameter (Parameter Type 0x02) is a varint. It MAY appear in a PUBLISH_OK, SUBSCRIBE, or REQUEST_UPDATE message. Its semantics are defined in Section 8.
This parameter is intended to be specific to a subscription, so it SHOULD NOT be forwarded upstream by a relay that intends to serve multiple subscriptions for the same track.
10.2.5. FILL TIMEOUT Parameter
The FILL_TIMEOUT parameter (Parameter Type 0x0A) MAY appear in a FETCH message.
It is the maximum total duration in milliseconds a relay SHOULD spend waiting for upstream sources to provide Objects that are not immediately available before reporting them as Unknown gaps in the FETCH response. When a relay encounters Objects within the requested range that are not immediately available and have unknown status, it issues upstream FETCHes to retrieve them. The Fill Timeout represents a total budget for all such upstream FETCHes generated by this request. If the budget is exhausted, the relay reports any remaining unavailable Objects as Unknown gaps and continues delivering available Objects in the range.
A value of 0 indicates the subscriber only wants Objects that are immediately available; the relay MUST NOT wait for upstream delivery and MUST report any unavailable Objects as Unknown gaps.
If the Fill Timeout parameter is absent, the relay waits for an implementation specific duration before reporting Unknown gaps. If the subscriber specifies a Fill Timeout larger than the relay is willing to wait, the relay MAY use a shorter timeout without informing the subscriber.
10.2.6. RENDEZVOUS TIMEOUT Parameter
The RENDEZVOUS_TIMEOUT parameter (Parameter Type 0x04) MAY appear in a SUBSCRIBE message.
It is the duration in milliseconds the subscriber is willing to wait for a publisher to become available. This applies when a relay receives a SUBSCRIBE for a Track that has no current publisher.
If the RENDEZVOUS_TIMEOUT is present, the relay SHOULD hold the subscription and wait for a publisher to appear, up to the specified duration. The relay does not send SUBSCRIBE_OK until a publisher becomes available. If a publisher becomes available within this time, the relay proceeds with the subscription normally. If the timeout expires without a publisher, the relay SHOULD respond with REQUEST_ERROR with error code TIMEOUT.
The relay MAY use a shorter timeout than requested by the subscriber. For example, a relay might limit the maximum rendezvous timeout to protect its resources.
A value of 0 indicates the subscriber does not want to wait and expects an immediate response. The relay MUST immediately return REQUEST_ERROR with error code DOES_NOT_EXIST if no publisher is available
If RENDEZVOUS_TIMEOUT is absent, the default is 0.
10.2.7. SUBSCRIBER PRIORITY Parameter
The SUBSCRIBER_PRIORITY parameter (Parameter Type 0x20) is a uint8. It MAY appear in a SUBSCRIBE, FETCH, REQUEST_UPDATE (for a subscription or FETCH), or PUBLISH_OK message. It is an integer expressing the priority of a subscription relative to other subscriptions and fetch responses in the same session. Lower numbers get higher priority. See Section 7.
If omitted from SUBSCRIBE, PUBLISH_OK or FETCH, the publisher uses the value 128.
10.2.8. GROUP ORDER Parameter
The GROUP_ORDER parameter (Parameter Type 0x22) is a uint8. It MAY appear in a SUBSCRIBE, SUBSCRIBE_TRACKS, or FETCH.
Its value indicates how to prioritize Objects from different groups within
the same subscription (see Section 7), or how to order Groups in a Fetch
response (see Section 10.12.3). The allowed values are Ascending (0x1) or
Descending (0x2). If an endpoint receives a value outside this range, it MUST
close the session with PROTOCOL_VIOLATION.
If omitted from SUBSCRIBE or SUBSCRIBE_TRACKS, the publisher's preference from the Track is used. If omitted from FETCH, the receiver uses Ascending (0x1).
10.2.9. LOCATION FILTER Parameter
The LOCATION_FILTER parameter (Parameter Type 0x21) uses length-prefixed encoding. It MAY appear in a SUBSCRIBE, PUBLISH_OK or REQUEST_UPDATE (for a subscription) message. It is a Location Filter (see Section 5.1.2).
If omitted from SUBSCRIBE or PUBLISH_OK, the subscription is unfiltered. If omitted from REQUEST_UPDATE, the value is unchanged.
10.2.10. SUBGROUP FILTER Parameter
The SUBGROUP_FILTER parameter (Type 0x25) selects objects with specified Ranges of Subgroup ID. See Section 5.1.3.
10.2.11. OBJECTID FILTER Parameter
The OBJECTID_FILTER parameter (Type 0x26) selects objects with specified Ranges of Object ID. See Section 5.1.3.
10.2.12. PRIORITY FILTER Parameter
The PRIORITY_FILTER parameter (Type 0x27) selects objects with specified Ranges of Publisher Priority. See Section 5.1.3. If a decoded value exceeds 255, the endpoint MUST reject this with REQUEST_ERROR with error code INVALID_FILTER since Publisher Priority is an 8-bit field.
10.2.13. OBJECT PROPERTY FILTER Parameter
The OBJECT_PROPERTY_FILTER parameter (Type 0x28) selects objects with required Ranges of Property Value for a required Object Property Type which MUST be even, i.e. a single integer value (see Figure 2), otherwise the endpoint MUST reject this with REQUEST_ERROR with error code INVALID_FILTER. See Section 5.1.3.
10.2.14. TRACK PROPERTY FILTER Parameter
The TRACK_PROPERTY_FILTER parameter (Type 0x29) selects tracks with required Ranges of Property Value for a required Track Property Type which MUST be even, i.e. a single integer value (see Figure 2), otherwise the endpoint MUST reject this with REQUEST_ERROR with error code INVALID_FILTER. See Section 5.1.3.
10.2.15. EXPIRES Parameter
The EXPIRES parameter (Parameter Type 0x8) is a varint. It MAY appear in SUBSCRIBE_OK, PUBLISH, PUBLISH_OK, SUBSCRIBE_NAMESPACE_OK, SUBSCRIBE_TRACKS_OK, PUBLISH_NAMESPACE_OK, or REQUEST_UPDATE_OK. It encodes the time in milliseconds after which the sender of the parameter will terminate the subscription. The sender will terminate the subscription using PUBLISH_DONE or by cancelling the request (see Section 3.3.3). This value is advisory and the sender can terminate the subscription prior to or after the expiry time.
The receiver of the parameter can attempt to extend the subscription by sending a REQUEST_UPDATE with 0 or more updated parameters. If the receiver has one or more updated AUTHORIZATION_TOKENs, it SHOULD include those in the REQUEST_UPDATE. If the extension is granted, the sender includes a new EXPIRES value in REQUEST_UPDATE_OK. Relays that send this parameter and applications that receive it MAY introduce jitter to prevent many endpoints from updating simultaneously.
If the EXPIRES parameter is 0 or is not present in a message, the subscription does not expire or expires at an unknown time.
10.2.16. LARGEST OBJECT Parameter
The LARGEST_OBJECT parameter (Parameter Type 0x9) is a Location. It MAY appear in SUBSCRIBE_OK, PUBLISH, REQUEST_UPDATE_OK, or TRACK_STATUS_OK. It contains the largest Location (see Section 1.4.2) in the Track observed by the sending endpoint (see Section 5.1.2). If Objects have been published on this Track the Publisher MUST include this parameter.
If omitted from a message, the sending endpoint has not published or received any Objects in the Track.
A relay MUST set LARGEST_OBJECT to the largest of the following:
-
Any LARGEST_OBJECT value received from the upstream publisher in SUBSCRIBE_OK, PUBLISH, or REQUEST_UPDATE_OK
-
The largest Location of an Object received on an upstream subscription
10.2.17. FORWARD Parameter
The FORWARD parameter (Parameter Type 0x10) is a uint8. It MAY appear in
SUBSCRIBE, REQUEST_UPDATE (for a subscription), PUBLISH, PUBLISH_OK and
SUBSCRIBE_TRACKS. It specifies the Forwarding State on affected subscriptions
(see Section 5.1). The allowed values are 0 (don't forward) or 1 (forward).
If an endpoint receives a value outside this range, it MUST close the session
with PROTOCOL_VIOLATION.
If the parameter is omitted from REQUEST_UPDATE, the value for the subscription remains unchanged. If the parameter is omitted from any other message, the default value is 1.
10.2.18. NEW GROUP REQUEST Parameter
The NEW_GROUP_REQUEST parameter (Parameter Type 0x32) is a varint. It MAY appear in PUBLISH_OK, SUBSCRIBE or REQUEST_UPDATE for a subscription. It represents the largest Group ID in the Track known by the subscriber, plus 1. A value of 0 indicates that the subscriber has no Group information for the Track. A subscriber MUST NOT send this parameter in PUBLISH_OK or REQUEST_UPDATE if the Track did not include the DYNAMIC_GROUPS Property with value 1. A subscriber MAY include this parameter in SUBSCRIBE without foreknowledge of support. If the original publisher does not support dynamic Groups, it ignores the parameter in that case.
When an Original Publisher that supports dynamic Groups receives a NEW_GROUP_REQUEST with a value of 0 or a value larger than the current Group, it SHOULD end the current Group and begin a new Group as soon as practical. The Original Publisher MAY delay the NEW_GROUP_REQUEST subject to implementation specific concerns, for example, achieving a minimum duration for each Group. The Original Publisher chooses the next Group ID; there are no requirements that it be equal to the NEW_GROUP_REQUEST parameter value.
Relay Handling:
A relay that receives a NEW_GROUP_REQUEST for a Track without an Established
subscription MUST include the NEW_GROUP_REQUEST when subscribing upstream.
A relay that receives a NEW_GROUP_REQUEST for an Established subscription with a
value of 0 or a value larger than the Largest Group MUST send a REQUEST_UPDATE
including the NEW_GROUP_REQUEST to the publisher unless:
-
The Track does not support dynamic Groups
-
There is already an outstanding NEW_GROUP_REQUEST from this Relay with a greater or equal value
If a relay receives a NEW_GROUP_REQUEST with a non-zero value less than or equal to the Largest Group, it does not send a NEW_GROUP_REQUEST upstream.
After sending a NEW_GROUP_REQUEST upstream, the request is considered outstanding until the Largest Group increases.
10.2.19. TRACK_NAMESPACE_PREFIX Parameter
The TRACK_NAMESPACE_PREFIX parameter (Parameter Type 0x34) uses the Track
Namespace encoding described in Section 2.4.1. It MAY appear in REQUEST_UPDATE
for a SUBSCRIBE_NAMESPACE or SUBSCRIBE_TRACKS request. It updates the Track
Namespace Prefix for that subscription. If the new prefix would share a common prefix with
another active subscription of the same type in the same session, the receiver
MUST respond with REQUEST_ERROR with error code PREFIX_OVERLAP.