From 36cedc3fdc4039df3dcf89cd984798af1d70d135 Mon Sep 17 00:00:00 2001 From: afrind Date: Wed, 20 Aug 2025 10:53:49 -0700 Subject: [PATCH 1/8] RFC: Generic Filters for Subscriptions and FETCH Based on proposal in #1068 One thing that is strange is allowing Group ID filters here, since these overlap with the built-in filters in Subscribe and Fetch. This may be what Victor was suggesting in Stockholm. The pathological case of this encoding is for every other object, which would double the length of the Values array. We could fix it by shifting the start value left by one and using the LSB to indicate single vs range, but it seemed like overkill. --- draft-ietf-moq-transport.md | 52 +++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index 484c5c18f..c316474a6 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1633,6 +1633,58 @@ multi-object stream will expire earlier than Objects later in the stream. Once Objects have expired from cache, their state becomes unknown, and a relay that handles a downstream request that includes those Objects re-requests them. +#### OBJECT FILTER Parameter + +The OBJECT_FILTER parameter(Parameter Type 0x05) MAY appear in SUBSCRIBE, +SUBSCRIBE_UPDATE, PUBLISH_OK, TRACK_STATUS or FETCH message. It is a structure +indicating Objects or ranges of Objects that the Publisher will deliver. + +~~~ +Object Filter { + Type (0x5), + Length (i), + Operand and Flag (i), + Values (i) ... +} +~~~ + +Operand and Flag contains both an enumeration indicating the Operand, with the +least significant bit indicating if the filter is negated. + +~~~ +Negated = Operand and Flag & 0x1 +Operand = Operand and Flag >> 1 +~~~ + +Operand | Meaning +0x0 | No Filter +0x1 | Group ID +0x2 | Subgroup ID +0x3 | Object ID +0x4 | Extension ID + +Values is an array of integers which encode the values of interest. When +Operand is Extension ID, the first Value indicates the Extension ID to filter. +This value MUST indicate an Extension with an integer type. The remainder of +the array is a sequence of pairs indicating the start and length of the matching +range. The Start is encoded as a delta from the previous End, or from 0 for the +first element. The length indicates the number of elements including Start to +match. A length of 0 indicates no endpoint. For example [ 10, 3, 1, 1, 20, 0 ] +would match values 10, 11, 12, 14 and 34-max. Only the first (excluding +Extension ID) or last value can be 0. If an endpoint receives a 0 value +anywhere else, it MUST treat the track as Malformed (see {{malformed-tracks}}). + +All filters can be removed from a Subscription by sending SUBSCRIBE_UPDATE with +Operand No Filter. + +This parameter MAY appear more than once, and filters are cumulative. When +filters are applied, delivery rules regarding Subgroups and FETCH responses are +modified. Within a Subgroup, the Publisher is allowed to send an Object on a +Subgroup stream even when it is not the next Object if the expected Objects +did not pass the filter. In a FETCH response, the Subscriber can only infer +Objects do not exist from their absence if they pass all filters. + + ## CLIENT_SETUP and SERVER_SETUP {#message-setup} The `CLIENT_SETUP` and `SERVER_SETUP` messages are the first messages exchanged From beb7072186e198ed05fce143a777e2e5e7d6ba0e Mon Sep 17 00:00:00 2001 From: afrind Date: Wed, 20 Aug 2025 10:59:27 -0700 Subject: [PATCH 2/8] Add priority to the filter. --- draft-ietf-moq-transport.md | 1 + 1 file changed, 1 insertion(+) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index c316474a6..5b9bc1f6b 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1662,6 +1662,7 @@ Operand | Meaning 0x2 | Subgroup ID 0x3 | Object ID 0x4 | Extension ID +0x5 | Publisher Priority Values is an array of integers which encode the values of interest. When Operand is Extension ID, the first Value indicates the Extension ID to filter. From 455b640f900fef8d44352764321260e2263afd7e Mon Sep 17 00:00:00 2001 From: afrind Date: Thu, 21 Aug 2025 09:59:09 -0700 Subject: [PATCH 3/8] Apply suggestions from code review --- draft-ietf-moq-transport.md | 55 +++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index 5b9bc1f6b..71250e753 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1643,19 +1643,13 @@ indicating Objects or ranges of Objects that the Publisher will deliver. Object Filter { Type (0x5), Length (i), - Operand and Flag (i), + Operand (7), + Negation Flag (1), + [Extension ID (i), Values (i) ... } ~~~ -Operand and Flag contains both an enumeration indicating the Operand, with the -least significant bit indicating if the filter is negated. - -~~~ -Negated = Operand and Flag & 0x1 -Operand = Operand and Flag >> 1 -~~~ - Operand | Meaning 0x0 | No Filter 0x1 | Group ID @@ -1664,26 +1658,35 @@ Operand | Meaning 0x4 | Extension ID 0x5 | Publisher Priority -Values is an array of integers which encode the values of interest. When -Operand is Extension ID, the first Value indicates the Extension ID to filter. -This value MUST indicate an Extension with an integer type. The remainder of -the array is a sequence of pairs indicating the start and length of the matching -range. The Start is encoded as a delta from the previous End, or from 0 for the -first element. The length indicates the number of elements including Start to -match. A length of 0 indicates no endpoint. For example [ 10, 3, 1, 1, 20, 0 ] -would match values 10, 11, 12, 14 and 34-max. Only the first (excluding -Extension ID) or last value can be 0. If an endpoint receives a 0 value -anywhere else, it MUST treat the track as Malformed (see {{malformed-tracks}}). - +When Negation Flag is 1, the result of the filter is negated to determine which Objects pass the filter. +Extension ID is present only when Operated is Extension ID (value 0x4) and +indicates the Extension to filter. This MUST indicate an Extension with an +integer type. Objects without the Extension do not pass the filter. + +Values is an array of integers which encode the values of interest. The +remainder of the array is a sequence of pairs indicating the start and length of +the matching range. The Start is encoded as a delta from the previous End, or +from 0 for the first element. The length indicates the number of elements +including Start to match. An odd number of elements indicates the final range +has no endpoint. For example [ 10, 3, 1, 1, 20 ] would match values 10, 11, 12, +14 and 34-max. Only the first value can be 0. If an endpoint receives a 0 +value anywhere else or length of the Values array exceeds TBD, it MUST reject +the request with `INVALID_FILTER`. All filters can be removed from a Subscription by sending SUBSCRIBE_UPDATE with Operand No Filter. -This parameter MAY appear more than once, and filters are cumulative. When -filters are applied, delivery rules regarding Subgroups and FETCH responses are -modified. Within a Subgroup, the Publisher is allowed to send an Object on a -Subgroup stream even when it is not the next Object if the expected Objects -did not pass the filter. In a FETCH response, the Subscriber can only infer -Objects do not exist from their absence if they pass all filters. +This parameter MAY appear up to TBD2 times in a request, and filters are +cumulative. If the parameter appears more than TBD2 times, the endpoint MUST +reject the request with `INVALID_FILTER`. When filters are applied, delivery +rules regarding FETCH responses are modified (see {{message-fetch}}). In a +filtered FETCH response, the Subscriber can only infer Objects do not exist from +their absence if they pass all filters. This is only possible when filtering on +Group ID and/or Object ID, as the Subscriber lacks other fields needed to +evaluate the filters. + +Publishers MUST respect Subgroup delivery rules even for filtered responses. If +an Object in the middle of a Subgroup is filtered out, the Publisher MUST NOT +place another Object in that Subgroup stream (see {{closing-subgroup-streams}}). ## CLIENT_SETUP and SERVER_SETUP {#message-setup} From 5705af42a71c25b18e9932f4f7261acfaf5a4e12 Mon Sep 17 00:00:00 2001 From: afrind Date: Thu, 21 Aug 2025 10:00:07 -0700 Subject: [PATCH 4/8] wrap and newline --- draft-ietf-moq-transport.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index 71250e753..2d61978d8 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1658,7 +1658,9 @@ Operand | Meaning 0x4 | Extension ID 0x5 | Publisher Priority -When Negation Flag is 1, the result of the filter is negated to determine which Objects pass the filter. +When Negation Flag is 1, the result of the filter is negated to determine which +Objects pass the filter. + Extension ID is present only when Operated is Extension ID (value 0x4) and indicates the Extension to filter. This MUST indicate an Extension with an integer type. Objects without the Extension do not pass the filter. From bd664122732e823d313cf47ebf6baeefcbba98d5 Mon Sep 17 00:00:00 2001 From: afrind Date: Thu, 21 Aug 2025 10:02:12 -0700 Subject: [PATCH 5/8] More cleanup --- draft-ietf-moq-transport.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index 2d61978d8..99fce056e 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1661,7 +1661,7 @@ Operand | Meaning When Negation Flag is 1, the result of the filter is negated to determine which Objects pass the filter. -Extension ID is present only when Operated is Extension ID (value 0x4) and +Extension ID is present only when Operand is Extension ID (value 0x4) and indicates the Extension to filter. This MUST indicate an Extension with an integer type. Objects without the Extension do not pass the filter. @@ -1674,6 +1674,7 @@ has no endpoint. For example [ 10, 3, 1, 1, 20 ] would match values 10, 11, 12, 14 and 34-max. Only the first value can be 0. If an endpoint receives a 0 value anywhere else or length of the Values array exceeds TBD, it MUST reject the request with `INVALID_FILTER`. + All filters can be removed from a Subscription by sending SUBSCRIBE_UPDATE with Operand No Filter. From d5c2340edb2450d1535c1aef51b049ff34389fdf Mon Sep 17 00:00:00 2001 From: afrind Date: Thu, 18 Sep 2025 14:17:34 -0700 Subject: [PATCH 6/8] Apply suggestions from code review Co-authored-by: Ye-Kui Wang <98077873+yekuiwang@users.noreply.github.com> --- draft-ietf-moq-transport.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index 99fce056e..715056088 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1645,7 +1645,7 @@ Object Filter { Length (i), Operand (7), Negation Flag (1), - [Extension ID (i), + [Extension ID (i),] Values (i) ... } ~~~ @@ -1666,7 +1666,7 @@ indicates the Extension to filter. This MUST indicate an Extension with an integer type. Objects without the Extension do not pass the filter. Values is an array of integers which encode the values of interest. The -remainder of the array is a sequence of pairs indicating the start and length of +array is a sequence of pairs indicating the start and length of the matching range. The Start is encoded as a delta from the previous End, or from 0 for the first element. The length indicates the number of elements including Start to match. An odd number of elements indicates the final range From 19e15cd52a651783afc4b64f5a3d1a23c5bc299c Mon Sep 17 00:00:00 2001 From: afrind Date: Thu, 18 Sep 2025 14:18:19 -0700 Subject: [PATCH 7/8] Update draft-ietf-moq-transport.md --- draft-ietf-moq-transport.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index 715056088..0b7a5078c 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1646,7 +1646,7 @@ Object Filter { Operand (7), Negation Flag (1), [Extension ID (i),] - Values (i) ... + Values (..) ... } ~~~ From 65a7e24d5f75a101438341f6fe0ebe67d92addf0 Mon Sep 17 00:00:00 2001 From: afrind Date: Thu, 18 Sep 2025 14:19:42 -0700 Subject: [PATCH 8/8] Update draft-ietf-moq-transport.md --- draft-ietf-moq-transport.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/draft-ietf-moq-transport.md b/draft-ietf-moq-transport.md index 0b7a5078c..c606a5bf3 100644 --- a/draft-ietf-moq-transport.md +++ b/draft-ietf-moq-transport.md @@ -1665,8 +1665,8 @@ Extension ID is present only when Operand is Extension ID (value 0x4) and indicates the Extension to filter. This MUST indicate an Extension with an integer type. Objects without the Extension do not pass the filter. -Values is an array of integers which encode the values of interest. The -array is a sequence of pairs indicating the start and length of +Values is an array of variable-length integers (i) which encode the values of +interest. The array is a sequence of pairs indicating the start and length of the matching range. The Start is encoded as a delta from the previous End, or from 0 for the first element. The length indicates the number of elements including Start to match. An odd number of elements indicates the final range