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

Commit 1479038

Browse files
authored
Merge pull request #1034 from jianjunz/web-transport
Move to WebTransport over HTTP/3.
2 parents da18c1a + 40d3959 commit 1479038

22 files changed

+2207
-213
lines changed

doc/design/pics/client_API.png

-24.8 KB
Binary file not shown.

doc/design/pics/client_api.svg

Lines changed: 914 additions & 0 deletions
Loading
-10.9 KB
Binary file not shown.

doc/design/pics/quic_block_diagram.svg

Lines changed: 280 additions & 0 deletions
Loading

doc/design/pics/server_API.png

-24.3 KB
Binary file not shown.

doc/design/pics/server_api.svg

Lines changed: 880 additions & 0 deletions
Loading

doc/design/quic-programming-guide.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Overview
55

6-
OWT QUIC SDK and Client SDKs provides the APIs for enabling QUIC Transport for reliable data transmission over QUIC protocol with OWT Conference Server.
6+
OWT QUIC SDK and Client SDKs provides the APIs for enabling WebTransport for reliable data transmission over QUIC protocol with OWT Conference Server.
77

88
# Scope
99

@@ -12,7 +12,7 @@ This document describes the programming models and API interfaces for following
1212
- Deploying a QUIC conference server that is capable of forwarding data over QUIC channel.
1313
- Implementing client application that is capable of sending data to QUIC server or receiving data from it.
1414

15-
Description of the details of QUIC transport is outside the scope of this document.
15+
Description of the details of WebTransport is outside the scope of this document.
1616

1717
# Related Repos
1818

@@ -27,21 +27,21 @@ Below are the repo locations of current SDK and server implementations:
2727

2828
The topology of components is shown in below diagram:
2929

30-
![plot](./pics/quic_block_diagram.png)
30+
![plot](./pics/quic_block_diagram.svg)
3131

32-
There are a few components involved and their relationships with streaming using QuicTransport are described as below:
32+
There are a few components involved and their relationships with streaming using WebTransport are described as below:
3333

3434
## OWT QUIC C++ SDK
3535

36-
This is the foundation of QUIC implementation in OWT. It provides the APIs to create QUIC transport clients and server forming a C/S architecture. Basically you can directly build your QUICTransport applications using the QUIC C++ SDK client API if you're not using the OWT native SDK.
36+
This is the foundation of WebTransport implementation in OWT. It provides the APIs to create WebTransport over HTTP/3 clients and server forming a C/S architecture. Basically you can directly build your WebTransport applications using the QUIC C++ SDK client API if you're not using the OWT native SDK.
3737

3838
## OWT Native SDK for Conference
3939

40-
The OWT conference SDK built upon OWT QUIC C++ SDK client API. It is used in combination with OWT QUIC conference server when you rely on OWT signaling protocol for QUIC connection setup as well as stream forwarding.
40+
The OWT conference SDK built upon OWT QUIC C++ SDK client API. It is used in combination with OWT QUIC conference server when you rely on OWT signaling protocol for WebTransport connection setup as well as stream forwarding.
4141

4242
## OWT QUIC Conference Server
4343

44-
The OWT QUIC conference server implements the signaling protocol for QUIC connection setup, as well as QUIC stream forwarding.
44+
The OWT QUIC conference server implements the signaling protocol for WebTransport connection setup, as well as QUIC stream forwarding.
4545

4646
## OWT QUIC JavaScript SDK
4747

@@ -59,37 +59,37 @@ In this section we provide a detailed description of the APIs provided by OWT QU
5959

6060
The server API calling flow is shown in below diagram and table.
6161

62-
![plot](./pics/server_API.png)
62+
![plot](./pics/server_api.svg)
6363

6464
| Step # | API calling flow |
6565
| --- | --- |
66-
| 1 | Application calls the factory method of QuicTransportFactory::Create() to get an instance of QuicTransportFactory |
67-
| 2 | Application calls QuicTransportFactory::CreateQuicTransportServer() on the QuicTransportFactory instance got in step #1, specifying the server port, certificate path either in the form of .pkcs12 or .pfx format. |
68-
| 3 | Application Creates the Visitor instance of QuicTransportServerInterface |
69-
| 4 | Application calls SetVisitor on the QuicTransportServerInterface instance got in step #2. |
70-
| 5 | Application calls Start() method on the QuicTransportServerInterface instance got in step #2 |
71-
| 6 | OnSession() callback will be invoked once the quictransportserver gets a connection request from client, and an QuicTransportSession instance is passed from the callback. |
72-
| 7 | Application calls CreateBidirectionalStream on the QuicTransportSession got in step 6 and get a QuicTransportStreamInterface instance. |
73-
| 8 | Application creates QuicTransportStream::Visitor instance and invokes QuicTransportStreamInterface::SetVisitor(). |
74-
| 9 | Application reads the QuicTransportStream when OnCanRead is invoked on the QuicTransportStream::Visitor; or write to the QuicTransportStream when OnCanWrite is invoked on the QuicTransportStreamVisitor; |
66+
| 1 | Application calls the factory method of WebTransportFactory::Create() to get an instance of WebTransportFactory |
67+
| 2 | Application calls WebTransportFactory::CreateWebTransportServer() on the WebTransportFactory instance got in step #1, specifying the server port, certificate path either in the form of .pkcs12 or .pfx format. |
68+
| 3 | Application Creates the Visitor instance of WebTransportServerInterface |
69+
| 4 | Application calls SetVisitor on the WebTransportServerInterface instance got in step #2. |
70+
| 5 | Application calls Start() method on the WebTransportServerInterface instance got in step #2 |
71+
| 6 | OnSession() callback will be invoked once the WebTransportserver gets a connection request from client, and an WebTransportSession instance is passed from the callback. |
72+
| 7 | Application calls CreateBidirectionalStream on the WebTransportSession got in step 6 and get a WebTransportStreamInterface instance. |
73+
| 8 | Application creates WebTransportStream::Visitor instance and invokes WebTransportStreamInterface::SetVisitor(). |
74+
| 9 | Application reads the WebTransportStream when OnCanRead is invoked on the WebTransportStream::Visitor; or write to the WebTransportStream when OnCanWrite is invoked on the WebTransportStreamVisitor; |
7575

7676
## OWT QUIC C++ SDK Client API Calling Flow
7777

78-
The client API calling flow is shown in below diagram and table. It's similar as the server side calling flow except the QuicTransportFactory creates a QuicTransportClientInterface, instead of a QUICTransportServerInterface, and client needs to call Connect() instead of Start() to get a QuicTransportSession.
78+
The client API calling flow is shown in below diagram and table. It's similar as the server side calling flow except the WebTransportFactory creates a WebTransportClientInterface, instead of a WebTransportServerInterface, and client needs to call Connect() instead of Start() to get a WebTransportSession.
7979

80-
![plot](./pics/client_API.png)
80+
![plot](./pics/client_api.svg)
8181

8282
| Step # | API calling flow |
8383
| --- | --- |
84-
| 1 | Application calls the factory method of QuicTransportFactory::Create() to get an instance of QuicTransportFactory |
85-
| 2 | Application calls QuicTransportFactory::CreateQuicTransportClient() on the QuicTransportFactory instance got in step #1, specifying the server URL to connect to. |
86-
| 3 | Application Creates the Visitor instance of QuicTransportClientInterface |
87-
| 4 | Application calls SetVisitor on the QuicTransportClientInterface instance got in step #2. |
88-
| 5 | Application calls Connect() method on the QuicTransportClientInterface instance got in step #2, passing the URL of the server. |
89-
| 6 | OnSession() callback will be invoked once the quictransportclient successfully connects to server, and an QuicTransportSession instance is passed from the callback. |
90-
| 7 | Application calls CreateBidirectionalStream on the QuicTransportSession got in step 6 and get a QuicTransportStreamInterface instance. |
91-
| 8 | Application creates QuicTransportStream::Visitor instance and invokes QuicTransportStreamInterface::SetVisitor(). |
92-
| 9 | Application reads the QuicTransportStream when OnCanRead is invoked on the QuicTransportStream::Visitor; or write to the QuicTransportStream when OnCanWrite is invoked on the QuicTransportStreamVisitor; |
84+
| 1 | Application calls the factory method of WebTransportFactory::Create() to get an instance of WebTransportFactory |
85+
| 2 | Application calls WebTransportFactory::CreateWebTransportClient() on the WebTransportFactory instance got in step #1, specifying the server URL to connect to. |
86+
| 3 | Application Creates the Visitor instance of WebTransportClientInterface |
87+
| 4 | Application calls SetVisitor on the WebTransportClientInterface instance got in step #2. |
88+
| 5 | Application calls Connect() method on the WebTransportClientInterface instance got in step #2, passing the URL of the server. |
89+
| 6 | OnSession() callback will be invoked once the WebTransportclient successfully connects to server, and an WebTransportSession instance is passed from the callback. |
90+
| 7 | Application calls CreateBidirectionalStream on the WebTransportSession got in step 6 and get a WebTransportStreamInterface instance. |
91+
| 8 | Application creates WebTransportStream::Visitor instance and invokes WebTransportStreamInterface::SetVisitor(). |
92+
| 9 | Application reads the WebTransportStream when OnCanRead is invoked on the WebTransportStream::Visitor; or write to the WebTransportStream when OnCanWrite is invoked on the WebTransportStreamVisitor; |
9393

9494
## Details of Callbacks and Data Structures of QUIC C++ SDK
9595

@@ -139,7 +139,7 @@ The Windows sample will be provided in OWT repo separately. More details will be
139139

140140
# How to Replace the Certificate for QUIC
141141

142-
OWT Conference Server is using a self-signed certificate during development phase, which would be only valid for 14 days. You can use a CA-signed certificate to avoid refreshing the certificate periodically. QUIC connection will fail if certificate is not valid or expires.
142+
OWT Conference Server is using a self-signed certificate during development phase, which would be only valid for 14 days. You can use a CA-signed certificate to avoid refreshing the certificate periodically. WebTransport connection will fail if certificate is not valid or expires.
143143

144144
## Precondition
145145

source/agent/addons/quic/QuicFactory.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
#include "QuicFactory.h"
8-
#include "owt/quic/quic_transport_factory.h"
8+
#include "owt/quic/web_transport_factory.h"
99
#include <mutex>
1010

1111
DEFINE_LOGGER(QuicFactory, "QuicFactory");
@@ -15,11 +15,11 @@ std::once_flag getQuicFactoryOnce;
1515
std::shared_ptr<QuicFactory> QuicFactory::s_quicFactory = nullptr;
1616

1717
QuicFactory::QuicFactory()
18-
: m_quicTransportFactory(std::shared_ptr<owt::quic::QuicTransportFactory>(owt::quic::QuicTransportFactory::Create()))
18+
: m_quicTransportFactory(std::shared_ptr<owt::quic::WebTransportFactory>(owt::quic::WebTransportFactory::Create()))
1919
{
2020
}
2121

22-
std::shared_ptr<owt::quic::QuicTransportFactory> QuicFactory::getQuicTransportFactory()
22+
std::shared_ptr<owt::quic::WebTransportFactory> QuicFactory::getQuicTransportFactory()
2323
{
2424
std::call_once(getQuicFactoryOnce, []() {
2525
QuicFactory* factory = new QuicFactory();

source/agent/addons/quic/QuicFactory.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212

1313
namespace owt {
1414
namespace quic {
15-
class QuicTransportFactory;
15+
class WebTransportFactory;
1616
}
1717
}
1818

1919
class QuicFactory {
2020
public:
2121
DECLARE_LOGGER();
2222
virtual ~QuicFactory() = default;
23-
static std::shared_ptr<owt::quic::QuicTransportFactory> getQuicTransportFactory();
23+
static std::shared_ptr<owt::quic::WebTransportFactory> getQuicTransportFactory();
2424

2525
private:
2626
explicit QuicFactory();
2727

2828
static std::shared_ptr<QuicFactory> s_quicFactory;
29-
std::shared_ptr<owt::quic::QuicTransportFactory> m_quicTransportFactory;
29+
std::shared_ptr<owt::quic::WebTransportFactory> m_quicTransportFactory;
3030
};
3131

3232
#endif

source/agent/addons/quic/QuicTransportConnection.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void QuicTransportConnection::setVisitor(Visitor* visitor)
5050
m_visitor = visitor;
5151
}
5252

53-
void QuicTransportConnection::OnIncomingStream(owt::quic::QuicTransportStreamInterface* stream)
53+
void QuicTransportConnection::OnIncomingStream(owt::quic::WebTransportStreamInterface* stream)
5454
{
5555
ELOG_DEBUG("OnIncomingStream.");
5656
{
@@ -77,7 +77,7 @@ NAN_METHOD(QuicTransportConnection::newInstance)
7777
info.GetReturnValue().Set(info.This());
7878
}
7979

80-
v8::Local<v8::Object> QuicTransportConnection::newInstance(owt::quic::QuicTransportSessionInterface* session)
80+
v8::Local<v8::Object> QuicTransportConnection::newInstance(owt::quic::WebTransportSessionInterface* session)
8181
{
8282
Local<Object> connectionObject = Nan::NewInstance(Nan::New(QuicTransportConnection::s_constructor)).ToLocalChecked();
8383
QuicTransportConnection* obj = Nan::ObjectWrap::Unwrap<QuicTransportConnection>(connectionObject);

0 commit comments

Comments
 (0)