Skip to content

Remove length field from OBJECT_DATAGRAM #625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Conversation

afrind
Copy link
Collaborator

@afrind afrind commented Nov 16, 2024

The length is inferred from the transport datagram. Add a new datagram type for conveying an Object Status. This saves 1-2 bytes per datagram.

Fixes: #552

The length is inferred from the transport datagram.  Add a new datagram type for conveying an Object Status.  This saves 1-2 bytes per datagram.

Fixes: #552
@ianswett ianswett added Design Issues or PRs that change how MoQ works including the wire format. Object Model Relating to the properties of Tracks, Groups and Object Wire Format Related to how messages are serialized and parsed and removed Object Model Relating to the properties of Tracks, Groups and Object labels Nov 19, 2024
conveys an Object Status and has no payload.

~~~
OBJECT_DATAGRAM_STATUS Message {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if there is a needed for explicit message for reporting status. Can't we just use the status in the original message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@suhasHere The current DATAGRAM message has a status field that is present when length is 0. Since this PR removes the length field, the only thing I could see was either 1) include the status in every datagram, wasting space in the common case, or 2) define a special datagram message that carries only the status.

Do you have an alternative encoding to what is here that is unambiguous and compact?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's an alternate with a "single" message (single in scare quotes because there are technically 5 code points):

OBJECT_DATAGRAM Message {
  TypeAndStatus(i) 0x00..0x04
  Track Alias (i),
  Group ID (i),
  Object ID (i),
  Publisher Priority (8),
  [Payload(..)]
}

The first varint in the datagram is TypeAndStatus. Values 0-4 convey an Object. If TypeAndStatus is 0, the Status is Normal and a Payload exists to the remainder of the datagram. It is an error if the payload is empty. TypeAndStatus 1-4 indicate the given object status and have no payload. It is an error if the datagram has bytes beyond Publisher Priority. TypeAndStatus > 4 are undefined.

Copy link
Collaborator

@suhasHere suhasHere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wonder if we can define the encoding in a way that we don't need 2 messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Issues or PRs that change how MoQ works including the wire format. Wire Format Related to how messages are serialized and parsed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why does OBJECT_DATAGRAM have a length?
4 participants