openssl

Report on the Conclusions of the QUIC DDD Process

The QUIC Demo-Driven Design process was undertaken to meet the OMC requirement to develop a QUIC API that required only minimal changes to existing applications to be able to adapt their code to use QUIC. The demo-driven design process developed a set of representative demos modelling a variety of common OpenSSL usage patterns based on analysis of a broad spectrum of open source software projects using OpenSSL.

As part of this process, a set of proposed diffs were produced. These proposed diffs were the expected changes which would be needed to the baseline demos to support QUIC based on theoretical analysis of the minimum requirements to be able to support QUIC. This analysis concluded that the changes needed to applications could be kept very small in many circumstances, with only minimal diff sizes to the baseline demos.

Following the development of QUIC MVP, these demos have been revisited and the correspondence of our actual final API and usage patterns with the planned diffs have been reviewed.

This document discusses the planned changes and the actual changes for each demo and draws conclusions on the level of disparity.

Since tracking a set of diffs separately is unwieldy, both the planned and unplanned changes have been folded into the original baseline demo files guarded with #ifdef USE_QUIC. Viewing these files therefore is informative to application writers as it provides a clear view of what is different when using QUIC. (The originally planned changes, and the final changes, are added in separate, clearly-labelled commits; to view the originally planned changes only, view the commit history for a given demo file.)

ddd-01-conn-blocking

This demo exists to demonstrate the simplest possible usage of OpenSSL, whether with TLS or QUIC.

Originally planned changes

The originally planned change to enable applications for QUIC amounted to just a single line:

+    ctx = SSL_CTX_new(QUIC_client_method());
-    ctx = SSL_CTX_new(TLS_client_method());

Actual changes

The following additional changes needed to be made:

ddd-02-conn-nonblocking

This demo exists to demonstrate simple non-blocking usage. As with ddd-01-conn-blocking, the name resolution process is managed by BIO_s_connect.

It also arbitrarily adds a BIO_f_buffer pushed onto the BIO stack as this is a common application usage pattern.

Originally planned changes

The originally planned changes to enable applications for QUIC amounted to:

Note that some of these changes are unnecessary when using the thread assisted mode (see the variant ddd-02-conn-nonblocking-threads below).

Actual changes

The following additional changes needed to be made:

The following changes were foreseen to be necessary, but turned out to actually not be necessary:

ddd-02-conn-nonblocking-threads

This is a variant of the ddd-02-conn-nonblocking demo. The base is the same, but the changes made are different. The use of thread-assisted mode, in which an internal assist thread is used to perform QUIC event handling, enables an application to make fewer changes than are needed in the ddd-02-conn-nonblocking demo.

Originally planned changes

The originally planned changes to enable applications for QUIC amounted to:

Actual changes

The following additional changes needed to be made:

ddd-03-fd-blocking

This demo is similar to ddd-01-conn-blocking but uses a file descriptor passed directly by the application rather than BIO_s_connect.

Originally planned changes

Actual changes

The following additional changes needed to be made:

ddd-04-fd-nonblocking

This demo is similar to ddd-01-conn-nonblocking but uses a file descriptor passed directly by the application rather than BIO_s_connect.

Originally planned changes

Actual changes

The following additional changes needed to be made:

ddd-05-mem-nonblocking

This demo is more elaborate. It uses memory buffers created and managed by an application as an intermediary between libssl and the network, which is a common usage pattern for applications. Managing this pattern for QUIC is more elaborate since datagram semantics on the network channel need to be maintained.

Originally planned changes

Actual changes

The following additional changes needed to be made:

ddd-06-mem-uv

This demo is the most elaborate of the set. It uses a real-world asynchronous I/O reactor, namely libuv (the engine used by Node.js). In doing so it seeks to demonstrate and prove the viability of our API design with a real-world asynchronous I/O system. It operates wholly in non-blocking mode and uses memory buffers on either side of the QUIC stack to feed data to and from the application and the network.

Originally planned changes

Actual changes

The following additional changes needed to be made:

Conclusions

The DDD process has successfully delivered on the objective of delivering a QUIC API which can be used with only minimal API changes. The additional changes on top of those originally planned which were required to successfully execute the demos using QUIC were highly limited in scope and mostly constituted only minor changes. The sum total of the changes required for each demo (both planned and additional), as denoted in each DDD demo file under #ifdef USE_QUIC guards, are both minimal and limited in scope.

“Minimal” and “limited” are distinct criteria. If inexorable technical requirements dictate, an enormous set of changes to an application could be considered “minimal”. The changes required to representative applications, as demonstrated by the DDD demos, are not merely minimal but also limited.

For example, while the extent of these necessary changes varies by the sophistication of each demo and the kind of application usage pattern it represents, some demos in particular demonstrate exceptionally small changesets; for example, ddd-01-conn-blocking and ddd-02-conn-nonblocking-threads, with ddd-01-conn-blocking literally being enabled by a single line change assuming ALPN is already configured.

This report concludes the DDD process for the single-stream QUIC client API design process, which sought to validate our API design and API ease of use for existing applications seeking to adopt QUIC.