§11.3.

Datagrams

A single object can be conveyed in a datagram. The Track Alias field (Section 11.1) indicates the track this Datagram belongs to. If an endpoint receives a datagram with an unknown Track Alias, it MAY drop the datagram or choose to buffer it for a brief period to handle reordering with the control message that establishes the Track Alias.

An Object received in an OBJECT_DATAGRAM message has an Object Forwarding Preference = Datagram.

To send an Object with Object Forwarding Preference = Datagram, determine the length of the header and payload and send the Object as datagram. When the total size is larger than the maximum datagram size for the session, the Object will be dropped without any explicit notification.

Each session along the path between the Original Publisher and End Subscriber might have different maximum datagram sizes. Additionally, Object Properties (Section 11.2.1.2) can be added to Objects as they pass through the MOQT network, increasing the size of the Object and the chances it will exceed the maximum datagram size of a downstream session and be dropped.

11.3.1. Object Datagram

An OBJECT_DATAGRAM carries a single object in a datagram.

OBJECT_DATAGRAM {
  Type Flags (vi64),
  Track Alias (vi64),
  Group ID (vi64),
  [Object ID (vi64),]
  [Publisher Priority (8),]
  [Properties (..),]
  [Object Status (vi64),]
  [Object Payload (..),]
}
Figure 24: MOQT OBJECT_DATAGRAM

The Type Flags field in the OBJECT_DATAGRAM is a variable-length integer that encodes a set of flags. All values defined in this specification fit in a single-byte encoding (values less than 128). If a received value has bit 4 set, or has a bit set whose meaning is not specified, the endpoint MUST close the session with a PROTOCOL_VIOLATION.

The four low-order bits and bit 5 of the Type Flags field determine which fields are present in the datagram:

  • The PROPERTIES bit (0x01) indicates when the Properties field is present. When set to 1, the Object Properties structure defined in Section 11.2.1.2 is present. When set to 0, the field is absent. If an endpoint receives a datagram with the PROPERTIES bit set and an Properties Length of 0, it MUST close the session with a PROTOCOL_VIOLATION.

  • The END_OF_GROUP bit (0x02) indicates End of Group. When set to 1, this indicates that no Object with the same Group ID and an Object ID greater than the Object ID in this datagram exists.

  • The ZERO_OBJECT_ID bit (0x04) indicates when the Object ID field is present. When set to 1, the Object ID field is omitted and the Object ID is 0. When set to 0, the Object ID field is present.

  • The DEFAULT_PRIORITY bit (0x08) indicates when the Priority field is present. When set to 1, the Priority field is omitted and this Object inherits the Publisher Priority specified in the control message that established the subscription. When set to 0, the Priority field is present.

  • The STATUS bit (0x20) indicates whether the datagram contains an Object Status or Object Payload. When set to 1, the Object Status field is present and there is no Object Payload. When set to 0, the Object Payload is present and the Object Status field is omitted. There is no explicit length field for the Object Payload; the entirety of the transport datagram following the Object header contains the payload.

The following Type Flags values are invalid. If an endpoint receives a datagram with any of these values, it MUST close the session with a PROTOCOL_VIOLATION:

  • Values with both the STATUS bit (0x20) and END_OF_GROUP bit (0x02) set.

  • Values with bit 4 (0x10) set. This bit is reserved and MUST be zero.

  • Values with a bit set whose meaning is not specified.

If an Object Datagram includes both the STATUS bit and PROPERTIES bit, and the Object Status is not Normal (0x0), the endpoint MUST close the session with a PROTOCOL_VIOLATION, because only Normal Objects can have Properties.

This is one section of the MoQT specification, rendered per-section for quick reference and citation. The authoritative text is draft-ietf-moq-transport-20 at the IETF.