Skip to content

Commit 16e3b35

Browse files
authored
Joining Fetch (#638)
This PR adds the desired "Join" functionality as [discussed](https://meetecho-player.ietf.org/playout/?session=IETF121-MOQ-20241104-1730) [at IETF 121 in Dublin](https://datatracker.ietf.org/meeting/121/session/moq)[^1] Adding this functionality to Fetch unblocks further simplifications of Subscribe, allowing us to more clearly delineate between "past" (Fetch) and "future" (Subscribe). (see #598, #510 (review), etc.) There are several ways we could allow a publisher to "atomically" join a Fetch and a Subscribe. At IETF 121, @wilaw presented [slides](https://datatracker.ietf.org/meeting/121/materials/slides-121-moq-join-api-proposal-00) showing API options: 1. a new macro-like singular JOIN message that is decomposed at the publisher into both a SUBSCRIBE and a FETCH 2. a modified form of FETCH that can be joined together with an existing Subscribe The consensus of the discussion seemed to heavily favor the latter design, so, as was requested, this PR is written as a modified form of Fetch: **Joining Fetch**. This PR: - Adds "**Fetch Type**" field to Fetch messages - Redefines pre-existing behavior as a Fetch Type: "**Standalone Fetch**" - Defines new Fetch Type: "**Joining Fetch**" - Defines new error code: "**Invalid Subscribe ID**" [^1]: [21:18 ](https://youtu.be/zs5Y424tASE?feature=shared&t=1278) in the recording. Note: the [Meetecho page](https://meetecho-player.ietf.org/playout/?session=IETF121-MOQ-20241104-1730) includes the chat, synced to the video.
2 parents f35309b + 2529140 commit 16e3b35

File tree

1 file changed

+76
-17
lines changed

1 file changed

+76
-17
lines changed

draft-ietf-moq-transport.md

Lines changed: 76 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,6 +1472,27 @@ objects within a track. The publisher responding to a FETCH is responsible for r
14721472
all available Objects. If there are gaps between Objects, the publisher omits them from the
14731473
fetch response. All omitted objects have status Object Does Not Exist.
14741474

1475+
**Fetch Types**
1476+
1477+
There are two types of Fetch messages:
1478+
1479+
Standalone Fetch (0x1) : A Fetch of Objects performed independently of any Subscribe.
1480+
1481+
Joining Fetch (0x2) : A Fetch joined together with a Subscribe by specifying
1482+
the Subscribe ID of an active subscription. A publisher receiving a
1483+
Joining Fetch uses properties of the associated Subscribe to determine the
1484+
Track Namespace, Track, StartGroup, StartObject, EndGroup, and EndObject such that
1485+
it is contiguous with the associated Subscribe. The Joining Fetch begins the
1486+
Preceding Group Offset prior to the associated subscription.
1487+
1488+
A Subscriber can use a Joining Fetch to, for example, fill a playback buffer with a
1489+
certain number of groups prior to the live edge of a track.
1490+
1491+
A Joining Fetch is only permitted when the associated Subscribe has the Filter
1492+
Type Latest Object.
1493+
1494+
A Fetch Type other than 0x1 or 0x2 MUST be treated as an error.
1495+
14751496
A publisher responds to a FETCH request with either a FETCH_OK or a FETCH_ERROR
14761497
message. If it responds with FETCH_OK, the publisher creates a new unidirectional
14771498
stream that is used to send the Objects. A relay MAY start sending objects immediately
@@ -1491,29 +1512,29 @@ FETCH Message {
14911512
Type (i) = 0x16,
14921513
Length (i),
14931514
Subscribe ID (i),
1494-
Track Namespace (tuple),
1495-
Track Name Length (i),
1496-
Track Name (..),
14971515
Subscriber Priority (8),
14981516
Group Order (8),
1499-
StartGroup (i),
1500-
StartObject (i),
1501-
EndGroup (i),
1502-
EndObject (i),
1517+
Fetch Type (i),
1518+
[Track Namespace (tuple),
1519+
Track Name Length (i),
1520+
Track Name (..),
1521+
StartGroup (i),
1522+
StartObject (i),
1523+
EndGroup (i),
1524+
EndObject (i),]
1525+
[Joining Subscribe ID (i),
1526+
Preceding Group Offset (i),]
15031527
Number of Parameters (i),
15041528
Parameters (..) ...
15051529
}
15061530
~~~
15071531
{: #moq-transport-fetch-format title="MOQT FETCH Message"}
15081532

1533+
Fields common to all Fetch Types:
1534+
15091535
* Subscribe ID: The Subscribe ID identifies a given fetch request. Subscribe ID
15101536
is a variable length integer that MUST be unique and monotonically increasing
1511-
within a session.
1512-
1513-
* Track Namespace: Identifies the namespace of the track as defined in
1514-
({{track-name}}).
1515-
1516-
* Track Name: Identifies the track name as defined in ({{track-name}}).
1537+
within a session.
15171538

15181539
* Subscriber Priority: Specifies the priority of a fetch request relative to
15191540
other subscriptions or fetches in the same session. Lower numbers get higher
@@ -1524,6 +1545,17 @@ Ascending (0x1) or Descending (0x2) order by group. See {{priorities}}.
15241545
A value of 0x0 indicates the original publisher's Group Order SHOULD be
15251546
used. Values larger than 0x2 are a protocol error.
15261547

1548+
* Fetch Type: Identifies the type of Fetch, whether joining or standalone.
1549+
1550+
* Parameters: The parameters are defined in {{version-specific-params}}.
1551+
1552+
Fields present only for Standalone Fetch (0x1):
1553+
1554+
* Track Namespace: Identifies the namespace of the track as defined in
1555+
({{track-name}}).
1556+
1557+
* Track Name: Identifies the track name as defined in ({{track-name}}).
1558+
15271559
* StartGroup: The start Group ID.
15281560

15291561
* StartObject: The start Object ID.
@@ -1533,8 +1565,15 @@ used. Values larger than 0x2 are a protocol error.
15331565
* EndObject: The end Object ID, plus 1. A value of 0 means the entire group is
15341566
requested.
15351567

1536-
* Parameters: The parameters are defined in {{version-specific-params}}.
1568+
Fields present only for Joining Fetch (0x2):
1569+
1570+
* Joining Subscribe ID: The Subscribe ID of the existing subscription to be
1571+
joined. If a publisher receives a Joining Fetch with a Subscribe ID that does
1572+
not correspond to an existing Subscribe, it MUST respond with a Fetch Error.
15371573

1574+
* Preceding Group Offset: The group offset for the Fetch prior and relative
1575+
to the Current Group of the corresponding Subscribe. A value of 0 indicates
1576+
the Fetch starts at the beginning of the Current Group.
15381577

15391578
Objects that are not yet published will not be retrieved by a FETCH.
15401579
The latest available Object is indicated in the FETCH_OK, and is the last
@@ -1548,9 +1587,29 @@ subgroup ID is not used for ordering.
15481587
If StartGroup/StartObject is greater than the latest published Object group,
15491588
the publisher MUST return FETCH_ERROR with error code 'No Objects'.
15501589

1551-
A publisher MUST send fetched groups in group order, either ascending or
1552-
descending. Within each group, objects are sent in Object ID order;
1553-
subgroup ID is not used for ordering.
1590+
### Calculating the Range of a Joining Fetch
1591+
1592+
A publisher that receives a Fetch of type Type 0x2 treats it
1593+
as a Fetch with a range dynamically determined by the Preceding Group Offset
1594+
and field values derived from the corresponding subscription.
1595+
1596+
The Largest Group ID and Largest Object ID values from the corresponding
1597+
subscription are used to calculate the end of a Joining Fetch so the Objects
1598+
retrieved by the FETCH and SUBSCRIBE are contiguous and non-overlapping.
1599+
If no Objects have been published for the track, and the SUBSCRIBE_OK has a
1600+
ContentExists value of 0, the publisher responds with a FETCH_ERROR with
1601+
error code 'No Objects'.
1602+
1603+
The publisher receiving a Joining Fetch computes the range as follows:
1604+
1605+
* Fetch StartGroup: Subscribe Largest Group - Preceding Group Offset
1606+
* Fetch StartObject: 0
1607+
* Fetch EndGroup: Subscribe Largest Group
1608+
* Fetch EndObject: Subscribe Largest Object
1609+
1610+
A Fetch EndObject of 0 requests the entire group, but Fetch will not
1611+
retrieve Objects that have not yet been published, so 1 is subtracted from
1612+
the Fetch EndGroup if Fetch EndObject is 0.
15541613

15551614
## FETCH_CANCEL {#message-fetch-cancel}
15561615

0 commit comments

Comments
 (0)