Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit a9e0aa2

Browse files
committed
Modify client portal protocol for QuicTransport.
Since QuicTransport of WebTransport has partially been implemented in Chrome, we'll skip P2P mode and move forward to WebTransport.
1 parent 841b837 commit a9e0aa2

File tree

2 files changed

+46
-62
lines changed

2 files changed

+46
-62
lines changed

doc/Client-Portal Protocol.md

Lines changed: 9 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ This a format for client reconnects.
249249
object(PublicationInfo):
250250
{
251251
owner: string(ParticipantId),
252-
type: "webrtc" | "streaming" | "sip" | "quic-p2p",
252+
type: "webrtc" | "streaming" | "sip" | "quic",
253253
inViews: [String(ViewLabel)],
254254
attributes: object(ClientDefinedAttributes)
255255
}
@@ -538,7 +538,7 @@ A publication can send either media or data, but a QUIC *transport* channel can
538538
object(SOACMessage)::
539539
{
540540
id: string(transportId), /* Transport ID returned in publishing or subscribing*/
541-
signaling: object(OfferAnswer) | object(CandidateMessage) | object(RemovedCandidatesMessage) | object(P2PQuicParametersMessage)
541+
signaling: object(OfferAnswer) | object(CandidateMessage) | object(RemovedCandidatesMessage)
542542
}
543543

544544
object(OfferAnswer)::
@@ -568,27 +568,10 @@ A publication can send either media or data, but a QUIC *transport* channel can
568568

569569
object(TransportOptions)::
570570
{
571-
type: "webrtc" | "quic-p2p",
571+
type: "webrtc" | "quic",
572572
id: string(transportId) | null, // null will result to create a new transport channel. Always be null if transport type is webrtc because webrtc agent doesn't support multiple transceivers on a single PeerConnection at this time.
573573
}
574574

575-
object(P2PQuicParametersMessage)::
576-
{
577-
type: "quic-p2p-parameters",
578-
clientTransportParameters: object(P2PQuicClientParametersMessage) | undefined,
579-
serverTransportParameters: object(P2PQuicServerParametersMessage) | undefined
580-
}
581-
582-
object(P2PQuicClientParametersMessage)::
583-
{
584-
quicKey: arrayBuffer(Key),
585-
iceParameters: object(IceParameters)
586-
}
587-
object(P2PQuicServerParametersMessage)::
588-
{
589-
iceParameters: object(IceParameters)
590-
}
591-
592575
object(IceParameters)::
593576
{
594577
usernameFragment: string(UsernameFragment),
@@ -604,7 +587,7 @@ A publication can send either media or data, but a QUIC *transport* channel can
604587
{
605588
id: string(transportId),
606589
status: "soac" | "ready" | "error",
607-
data: object(OfferAnswer) | object(CandidateMessage) | object(P2PQuicParametersMessage) /*If status equals “soac”*/
590+
data: object(OfferAnswer) | object(CandidateMessage) /*If status equals “soac”*/
608591
| (undefined/*If status equals “ready” and session is NOT for recording*/
609592
| string(Reason)/*If status equals “error”*/
610593
}
@@ -621,61 +604,25 @@ This section provides a few examples of signaling messages for specific purposes
621604

622605
## 4.1 Forward data through data channel over QUIC
623606

624-
An endpoint is joined the meeting, and it wants to publish a data stream over a newly created QUIC transport channel.
607+
An endpoint is joined the meeting, and it wants to publish a data stream over a QUIC transport channel.
625608

626609
Step 1: Client sends a "publish" request.
627610

628611
```
629612
{
630613
media: null,
631614
data: true,
632-
transport: {type: 'quic-p2p'}
615+
transport: {type: 'quic'}
633616
}
634617
```
635618

636619
Step 2: Receive a response from server.
637620

638621
```
639622
{
640-
transportId: 'b1ff706f-7352-4d02-a6dc-dc840fb3963e'
641-
publicationId: '91e24705-1d49-4cdd-bd4a-d461445637c4'
642-
}
643-
```
644-
645-
Step 3: Send client QUIC transport parameters.
646-
647-
```
648-
{
649-
id: 'b1ff706f-7352-4d02-a6dc-dc840fb3963e',
650-
signaling: {
651-
type: "quic-p2p-parameters",
652-
clientTransportParameters: {
653-
quicKey: 'key',
654-
iceParameters: {
655-
usernameFragment: 'userfrag',
656-
password: 'password'
657-
}
658-
}
659-
}
660-
}
661-
```
662-
663-
Step 4: Receive server QUIC transport paramters.
664-
665-
```
666-
{
667-
id: ''
668-
status: 'soac',
669-
data: {
670-
type: "quic-p2p-parameters",
671-
serverTransportParameters: {
672-
iceParameters: {
673-
usernameFragment: 'userfrag',
674-
password: 'password'
675-
}
676-
}
677-
}
623+
transportId: undefined,
624+
publicationId: '91e247051d494cddbd4ad461445637c4'
678625
}
679626
```
680627

681-
Step 5: Receive transport ready and session ready from server.
628+
Step 3: Create a new QuicTransport or get an existing QuicTransport, then create a new BidirectionalStream or SendStream. Write data to stream. The URL of QuicTransport should be included in token. QuicTransport is shared by all media streams, data streams and signaling which belong to the same client.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# QUIC Transport Payload and Message Format
2+
3+
This post defines the payload and message format for data transmitted over [QuicTransport](https://wicg.github.io/web-transport/#quic-transport).
4+
5+
## Streams
6+
7+
Both server and client can initialize a stream. When a stream is created, initial side sends a session ID, which is a 128 bit length message to the remote side. Session ID could be a publication ID or subscription ID as defined in [Client-Portal Protocol](https://github.com/open-webrtc-toolkit/owt-server/blob/master/doc/Client-Portal%20Protocol.md). As the session ID issued by server may less than 128 bit right now, fill it with 0 in most significant bits. Session ID 0 is reserved for signaling. When remote side receives the session ID, it should check whether session ID is valid. Terminate the stream if session ID is invalid, or send the same session ID to client if it is valid. Depends on the type of stream it created, one side or both sides are ready to send data.
8+
9+
## Datagram
10+
11+
Each package has a 128 bit header for session ID.
12+
13+
```
14+
0 1 2 3
15+
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
16+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
17+
| |
18+
| Session Identifier |
19+
| .... |
20+
| |
21+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
22+
| Datagram Data (*) ...
23+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
24+
```
25+
26+
It may increase about 2% network cost.
27+
28+
29+
## Authentication
30+
31+
After creating a QuicTransport, a stream with session 0 should be created for authentication. If signaling is transmitted over QuicTransport, authentication follows the regular process defined by [Client-Portal Protocol](https://github.com/open-webrtc-toolkit/owt-server/blob/master/doc/Client-Portal%20Protocol.md). Otherwise, client sends a following message with UTF-8 encoding in JSON format to server.
32+
33+
```webidl
34+
interface QuicTransportLoginInfo {
35+
attribute DOMString? token; // Base64 encoded token.
36+
};
37+
```

0 commit comments

Comments
 (0)