Skip to content
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

Header Length for improving parsing #520

Merged
merged 8 commits into from
Sep 20, 2024
Merged

Header Length for improving parsing #520

merged 8 commits into from
Sep 20, 2024

Conversation

suhasHere
Copy link
Collaborator

Addresses #474

Copy link
Collaborator

@afrind afrind left a comment

Choose a reason for hiding this comment

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

Individual Review:

We also need to specify what happens when:

  1. the section ends before the section length
  2. the section extends beyond the section length (eg: the varint length would extend past the section length).

Probably ought to make both a protocol violation and tear the whole session down?

~~~
OBJECT_DATAGRAM Message {
Object Header Length (i),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one isn't strictly necessary because it's a datagram -- you have to have the whole message so there is no need for trial parsing.

Choose a reason for hiding this comment

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

+1

@vasilvv
Copy link
Collaborator

vasilvv commented Sep 9, 2024

I think this is good for control messages, but I'd mildly prefer to keep the data stream headers without length, since those are sensitive to the framing overhead.

@@ -1877,17 +1893,20 @@ Sending a track on one stream:

~~~
STREAM_HEADER_TRACK {
Stream Header Length = 3

Choose a reason for hiding this comment

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

I would normally consider payload length var int as a header. It seems a bit weird that a separate var int isn't considered a header.

Copy link
Contributor

Choose a reason for hiding this comment

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

Trying to think about how I would code this either way. Lets say there were 62 bytes of data after this header. If I encode this number as 1 byte varint with value 63. Or I could encode as 2 byte varint with value of 64. Not sure how this changes what I think we should do - just an edge case worth thinking about.

payload and send the Object as datagram. In certain scenarios where the object
size can be larger than maximum datagram size for the session, the Object
will be dropped.

The `Object Header Length` specifies the total encoded length in bytes for

Choose a reason for hiding this comment

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

Does it include the size of the header length itself?

@@ -1797,10 +1801,13 @@ TODO: figure out how a relay closes these streams
When a stream begins with `STREAM_HEADER_TRACK`, all objects on the stream
belong to the track requested in the Subscribe message identified by `Subscribe
ID`. All objects on the stream have the `Publisher Priority` specified in the
stream header.
stream header. The `Stream Header Length` specifies the total encoded length
of the header in bytes which includes Subscribe ID, Track Alias and Publisher

Choose a reason for hiding this comment

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

May not need to call out each header as including ...

@TimEvens
Copy link

I think this is good for control messages, but I'd mildly prefer to keep the data stream headers without length, since those are sensitive to the framing overhead.

Suppose it depends how often streams are changing. Adding object header length does add overhead, but it should be one byte in most uses.

@fluffy
Copy link
Contributor

fluffy commented Sep 13, 2024

Victors comment is really making me think about if we need this on objects or not. I'm very torn and think we should talk about how to do while still keeping the framing overhead as low as possible.

@afrind
Copy link
Collaborator

afrind commented Sep 13, 2024

Chair Comment:

It seems like there's general support for control messages, but some discussion required for objects. Can we move the object changes to a separate PR so we can land the control changes for the next draft cut?


~~~
STREAM_HEADER_TRACK Message {
Stream Header Length (i),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wouldn't bother fixing STREAM_HEADER_TRACK, since I expect it'll be removed soonish.

Copy link
Collaborator

@ianswett ianswett left a comment

Choose a reason for hiding this comment

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

Adding a length for control messages seems sensible, but in other cases I don't think we need an additional length.

@ianswett ianswett merged commit 65b9aba into main Sep 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants