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

Commit 4e350fc

Browse files
committed
Edit protocol for P2P QUIC and add an example.
1 parent a3d88b4 commit 4e350fc

File tree

1 file changed

+112
-30
lines changed

1 file changed

+112
-30
lines changed

doc/Client-Portal Protocol.md

Lines changed: 112 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ Here is a table describing the detailed name and definition.
1616
|:----|:-----------|
1717
| Portal | The MCU component listening at the Socket.io server port, accepting signaling connections initiated by Clients, receive/send signaling messages from/to Clients. |
1818
| Client | The program running on end-user’s device which interacts with MCU Server by messages defined in this documentation.|
19-
| Signaling Connection | The signaling channel between Client and Portal established by Client to send, receive and fetch signaling messages. |
19+
| Connection | A transport channel between client and server. Different kinds of connections may have different transport protocols. |
20+
| Signaling Connection | The signaling channel between client and Portal established by Client to send, receive and fetch signaling messages. |
21+
| WebRTC Connection | A WebRTC transport channel between client and WebRTC agent. It may carry audio and video data. Detailed information about WebRTC could be found [here](https://webrtc.org/). |
22+
| QUIC Connection | A QUIC transport channel between client and QUIC agent. Detailed information about QUIC could be found [here](https://quicwg.org/). |
2023
| Room | The logical entity of a conference in which all conference members (participants) exchange their video/audio streams, and where mixed streams are generated. Every room must be assigned with a unique identification **(RoomID)** in the MCU scope. |
2124
| User | The service account defined in the third-party integration application. The user ID and user role must be specified when asking for a token. |
2225
| Participant | The logical entity of a user when participating in a conference with a valid token. Every participant must be assigned with a unique identification **(ParticipantID)** in the room scope, and must be assigned a set of operation permissions according to its role. |
@@ -61,7 +64,7 @@ Given that Portal has accepted Clients connecting and the socket object is ready
6164
- **NotificationName** must be with type of string, and with value defined in this specification;
6265
- **NotificationData** must be with type of object, and with format defined in this specification, and will be absent if no notification data is present.
6366

64-
## 3.2 Connection Maintenance
67+
## 3.2 Signaling Connection Maintenance
6568
### 3.2.1 Client Connects
6669
Portal should be able to listen at either a secure or an insecure socket.io server port to accept Clients’ connecting requests. If the secure socket.io server is enabled, the SSL certificate and private key store path must be correctly specified by configuration item portal.keystorePath in portal.toml.<br>
6770

@@ -358,29 +361,33 @@ This a format for client reconnects.
358361

359362
**RequestData**: The PublicationRequest object with following definition:
360363

364+
```
361365
object(PublicationRequest)::
362366
{
363-
media: object(WebRTCMediaOptions),
367+
media: object(WebRTCMediaOptions) | null,
368+
data: boolean,
364369
transport: object(TransportOptions),
365-
attributes: object(ClientDefinedAttributes)
370+
attributes: object(ClientDefinedAttributes) | null
366371
}
367372
368-
object(WebRTCMediaOptions)::
369-
{
370-
audio: {
371-
source: "mic" | "screen-cast" | "raw-file" | "encoded-file"
372-
}
373-
| false,
374-
video: {
375-
source: "camera"| "screen-cast" | "raw-file" | "encoded-file",
376-
parameters:
377-
{
378-
resolution: object(Resolution),
379-
framerate: number(FramerateFPS)
380-
}
381-
}
382-
| false
383-
}
373+
object(WebRTCMediaOptions)::
374+
{
375+
audio: {
376+
source: "mic" | "screen-cast" | "raw-file" | "encoded-file"
377+
}
378+
| false,
379+
video: {
380+
source: "camera"| "screen-cast" | "raw-file" | "encoded-file",
381+
parameters:
382+
{
383+
resolution: object(Resolution),
384+
framerate: number(FramerateFPS)
385+
}
386+
}
387+
| false
388+
}
389+
```
390+
384391
**ResponseData**: The PublicationResult object with following definition if **ResponseStatus** is “ok”:
385392

386393
object(PublicationResult)::
@@ -526,15 +533,14 @@ This a format for client reconnects.
526533

527534
object(SOACMessage)::
528535
{
529-
id: string(SessionId), /* StreamId returned in publishing or SubscriptionId returned in subscribing*/
530-
signaling: object(OfferAnswer) | object(CandidateMessage) | object(RemovedCandidatesMessage)
536+
id: string(transportId), /* Transport ID returned in publishing or subscribing*/
537+
signaling: object(OfferAnswer) | object(CandidateMessage) | object(RemovedCandidatesMessage) | object(P2PQuicParametersMessage)
531538
}
532539

533540
object(OfferAnswer)::
534541
{
535542
type: "offer" | "answer",
536543
sdp: string(SDP) | null, // WebRTC connection
537-
clientTransportParameters: object(P2PQuicClientParametersMessage) | null // QUIC connection
538544
}
539545

540546
object(CandidateMessage)::
@@ -562,15 +568,20 @@ This a format for client reconnects.
562568
id: string(transportId) | null, // null will result to create a new transport channel.
563569
}
564570

571+
object(P2PQuicParametersMessage)::
572+
{
573+
type: "quic-parameters",
574+
clientTransportParameters: object(P2PQuicClientParametersMessage) | undefined,
575+
serverTransportParameters: object(P2PQuicServerParametersMessage) | undefined
576+
}
577+
565578
object(P2PQuicClientParametersMessage)::
566579
{
567-
type: "quic-p2p-client-parameters",
568580
quicKey: arrayBuffer(Key),
569581
iceParameters: object(IceParameters)
570582
}
571583
object(P2PQuicServerParametersMessage)::
572584
{
573-
type: "quic-p2p-server-parameters",
574585
iceParameters: object(IceParameters)
575586
}
576587

@@ -583,20 +594,91 @@ This a format for client reconnects.
583594
### 3.3.15 Participant Receives Session Progress
584595
**NotificationName**: “progress”<br>
585596

586-
**NotificationData**: The SessionProgress object with following definition.
597+
**NotificationData**: The SessionProgress or TransportProgress object with following definition.
598+
599+
object(TransportProgress)::
600+
{
601+
id: string(transportId),
602+
status: "soac" | "ready" | "error",
603+
data: object(OfferAnswer) | object(CandidateMessage) | object(P2PQuicParametersMessage) /*If status equals “soac”*/
604+
| (undefined/*If status equals “ready” and session is NOT for recording*/
605+
| string(Reason)/*If status equals “error”*/
606+
}
587607

588608
object(SessionProgress)::
589609
{
590610
id: string(SessionId), /* StreamId returned in publishing or SubscriptionId returned in subscribing*/
591611
status: "soac" | "ready" | "error",
592-
data: object(OfferAnswer) | object(CandidateMessage) | object(P2PQuicServerParametersMessage) /*If status equals “soac”*/
593-
| (undefined/*If status equals “ready” and session is NOT for recording*/
594-
| object(RecorderInfo)/*If status equals “ready” and session is for recording*/ )
595-
| string(Reason)/*If status equals “error”*/
612+
data: object(RecorderInfo)/*If status equals “ready” and session is for recording*/ )
596613
}
597614

598615
object(RecorderInfo)::
599616
{
600617
host: string(HostnameOrIPOfRecorder),
601618
file: string(FullPathNameOfRecordedFile)
602619
}
620+
621+
# 4. Examples
622+
623+
This section provides a few examples of signaling messages for specific purposes.
624+
625+
## 4.1 Forward data through data channel over QUIC
626+
627+
An endpoint is joined the meeting, and it wants to publish a data stream over a newly created QUIC transport channel.
628+
629+
Step 1: Client sends a "publish" request.
630+
631+
```
632+
{
633+
media: null,
634+
data: true,
635+
transport: {type: 'quic-p2p'}
636+
}
637+
```
638+
639+
Step 2: Receive a response from server.
640+
641+
```
642+
{
643+
transportId: 'b1ff706f-7352-4d02-a6dc-dc840fb3963e'
644+
publicationId: '91e24705-1d49-4cdd-bd4a-d461445637c4'
645+
}
646+
```
647+
648+
Step 3: Send client QUIC transport parameters.
649+
650+
```
651+
{
652+
id: 'b1ff706f-7352-4d02-a6dc-dc840fb3963e',
653+
signaling: {
654+
type: "quic-parameters",
655+
clientTransportParameters: {
656+
quicKey: 'key',
657+
iceParameters: {
658+
usernameFragment: 'userfrag',
659+
password: 'password'
660+
}
661+
}
662+
}
663+
}
664+
```
665+
666+
Step 4: Receive server QUIC transport paramters.
667+
668+
```
669+
{
670+
id: ''
671+
status: 'soac',
672+
data: {
673+
type: "quic-parameters",
674+
serverTransportParameters: {
675+
iceParameters: {
676+
usernameFragment: 'userfrag',
677+
password: 'password'
678+
}
679+
}
680+
}
681+
}
682+
```
683+
684+
Step 5: Receive transport ready and session ready from server.

0 commit comments

Comments
 (0)