Skip to content
This repository has been archived by the owner on Aug 11, 2020. It is now read-only.

[WIP] benchmark: add basic QUIC benchmark #182

Draft
wants to merge 110 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
ad9d240
src: allow unique_ptrs with custom deleter in memory tracker
addaleax Oct 1, 2019
fefa469
src: enable `StreamPipe` for generic `StreamBase`s
addaleax Mar 12, 2018
de9a741
dgram: make UDPWrap more reusable
addaleax Oct 9, 2019
57883dd
quic: initial protocol implementation
danbev Jan 31, 2019
fd87b2f
deps: Add interface required to implement QUIC draft-17
jasnell Feb 1, 2019
b26804b
deps: Remove EOED when SSL_MODE_QUIC_HACK is enabled
jasnell Feb 1, 2019
455f965
quic: support memory tracking
addaleax Oct 1, 2019
acadf02
doc: fix lint issues in quic.md
danbev Oct 3, 2019
fef9d73
lib: fix typo in stream_base_commons.js
addaleax Oct 3, 2019
2f697d1
test: fix test-process-versions for QUIC
addaleax Oct 3, 2019
4ffd6ab
quic: test client connect invalid options
trivikr Oct 6, 2019
de945c2
quic: test invalid createSocket
trivikr Oct 5, 2019
74ce4d8
quic: default options parameter in constructor
trivikr Oct 5, 2019
1210b56
quic: compute retransmission timeout correctly
addaleax Oct 8, 2019
55c12a0
quic: client should work when receives invalid preferred address
oyyd Oct 7, 2019
081e1a4
test: add tests for quic `idleTimeout`
oyyd Oct 9, 2019
72d5162
test: make test-quic-process-cleanup work with --worker
addaleax Oct 8, 2019
68ffa82
Revert "deps: Add interface required to implement QUIC draft-17"
jasnell Oct 7, 2019
d55b970
Revert "deps: Remove EOED when SSL_MODE_QUIC_HACK is enabled"
jasnell Oct 7, 2019
6ea8048
deps: Port BoringSSL QUIC APIs
jasnell Oct 7, 2019
0088393
deps: update OpenSSL config
jasnell Oct 7, 2019
0c0e89d
deps: update ngtcp2
jasnell Sep 16, 2019
6b58255
[Upstream] deps: add handling for x509 and client hello cb
jasnell Oct 8, 2019
e66545a
quic: move to ngtcp2_crypto
jasnell Sep 27, 2019
8028d09
quic: fix build and tests
addaleax Oct 9, 2019
37d6d5e
quic: fix idle timeout
oyyd Oct 10, 2019
0785819
quic: implement sendFD() support
addaleax Oct 3, 2019
5b6b128
test: add tests for quic
oyyd Oct 12, 2019
c93680f
quic: simplify alpn selection callback
jasnell Oct 10, 2019
4f49a4b
quic: extract tls handshake to QuicCryptoContext object
jasnell Oct 11, 2019
0d615d7
quic: coalesce QuicClientSession and QuicServerSession
jasnell Oct 11, 2019
2293861
src: fix lint issue in node_quic_session.cc
danbev Oct 16, 2019
973d7ea
quic: use UDP code from dgram
addaleax Oct 9, 2019
672202c
quic: remove CleanupHook from Timer
addaleax Oct 11, 2019
2a88f26
quic: use BaseObjectPtr to keep WriteWrap alive
addaleax Oct 11, 2019
72fe66c
quic: allow `.connect()` when socket is already bound
addaleax Oct 16, 2019
9de15dd
quic: allow testing QUIC without real UDP handle
addaleax Oct 12, 2019
620edba
deps: update nghttp3
jasnell Oct 11, 2019
a5bfda5
quic: initial addition of QuicApplication
jasnell Oct 11, 2019
59ae2e0
deps: update ngtcp2
jasnell Oct 11, 2019
33a255a
quic: continued implementation of http/3
jasnell Oct 12, 2019
b24bf7d
quic: implement memory tracking for QuicApplication
addaleax Oct 16, 2019
be89e9a
test: enable test_quic_verifyhostnameidentity.cc
danbev Oct 16, 2019
b42e28f
quic: allow multiple independent .connect() calls
addaleax Oct 16, 2019
065c327
quic: fix linting and tests
addaleax Oct 16, 2019
8faf459
quic: rename shutdown to reset for RESET_STREAM methods
addaleax Oct 16, 2019
1236345
quic: make `maxConnectionsPerHost` works
oyyd Oct 26, 2019
8640fb8
quic: add pending state for streams
addaleax Oct 26, 2019
a10b1a4
quic: remove unused vector include
danbev Nov 4, 2019
51fa68b
quic: fix override warnings
danbev Nov 4, 2019
91cba97
quic: include limits in node_quic_util.h
danbev Nov 5, 2019
ddba7d0
quic: remove unused functional include in session
danbev Nov 6, 2019
345daac
quic: fix typo on setServerBusy on quic socket
juanarbol Nov 8, 2019
f51d4b5
quic: remove algorithm include
danbev Nov 8, 2019
04ab7d1
quic: replace unused includes in node_quic.cc
danbev Nov 7, 2019
b367e29
build: fail when quic is enabled with shared_openssl in configure
lundibundi Nov 12, 2019
5956ca4
test: improve code coverage on quic implementation
juanarbol Nov 8, 2019
006c42f
test: improves quic tests
juanarbol Nov 21, 2019
d82766a
quic: http3 work in progress
jasnell Oct 16, 2019
5dcc66a
deps: update ngtcp2, ngtcp2-crypto, nghttp3
jasnell Nov 21, 2019
9920b1b
quic: fixups after dep update
jasnell Nov 21, 2019
b89e2bf
quic: additional progress on http3
jasnell Nov 21, 2019
ed3164a
test: temporarily remove updateKey from test-quic-client-server
jasnell Nov 26, 2019
1f7e7cb
quic: show alpn identifier in debug output
jasnell Nov 26, 2019
a5ea553
quic: http3 configuration options
jasnell Nov 26, 2019
51f4767
quic: add qlog support
addaleax Nov 22, 2019
4b5e8e3
test: close method should throws on closed session
juanarbol Nov 26, 2019
da0c7cc
test: throws on ping closed quic session
juanarbol Nov 26, 2019
09fb293
test: throws ping and openStream on closed session
juanarbol Nov 26, 2019
7349bb0
test: valid halfOpen param in quic session
juanarbol Nov 26, 2019
73c6ad1
test: can't updateKey when quic session is closed
juanarbol Nov 26, 2019
cbbf2b0
quic: additional sendretry tweaks + bug fix
jasnell Dec 1, 2019
de70219
quic: use const references for QuicCID
jasnell Dec 4, 2019
43d8220
quic: miscelaneous http3 notes
jasnell Nov 27, 2019
bef1b25
quic: use const refs for QuicCID passing
jasnell Nov 27, 2019
ab3557b
quic: minor additional improvements to QuicCID
jasnell Nov 27, 2019
88f7e95
quic: move common crypto functions to node_crypto_common.h
jasnell Nov 27, 2019
4868060
src: use node_crypto_common for node_crypto
jasnell Nov 27, 2019
166ece1
src: move node_crypto_common-inl to cc
jasnell Dec 4, 2019
be206cf
quic: use ngtcp2_path_storage and ngtcp2_path structs
jasnell Dec 1, 2019
5d9fbb2
quic: refine QuicError
jasnell Dec 1, 2019
cb95abb
quic: refactoring node_quic_util to inline
jasnell Dec 1, 2019
2b32e5f
src: move SocketAddress into separate header
jasnell Dec 2, 2019
081a37f
quic: add QuicSocketListener
jasnell Dec 3, 2019
3eb955d
quic: minor refactor for QuicStream::Header
jasnell Dec 3, 2019
bfc228e
quic: add QuicSessionListener
jasnell Dec 3, 2019
a469bc7
quic: capture received connection_close details
jasnell Dec 3, 2019
cbbf74e
quic: additional session stats
jasnell Dec 3, 2019
a8d5f29
quic: expose retransmit counts to JS
jasnell Dec 3, 2019
c7a10c9
quic: record pkt_num_exhausted error
jasnell Dec 3, 2019
ac9781a
quic: update docs
jasnell Dec 3, 2019
046a0d0
quic: address multiple nits
jasnell Dec 4, 2019
81d638f
quic: additional suggested updates
jasnell Dec 4, 2019
98ea213
quic: address build issues on linux
jasnell Dec 4, 2019
42fa245
src: fix compiler warnings
jasnell Dec 4, 2019
7a5f980
quic: add connection id strategy
jasnell Dec 4, 2019
9509ec0
quic: add blockCount statistic
jasnell Dec 4, 2019
9772656
quic: add max offset statistic, expose stream stats to js
jasnell Dec 4, 2019
ed6a4d0
quic: use constants for QuicSocket stats
jasnell Dec 4, 2019
048cdcb
quic: fix lint issues
jasnell Dec 4, 2019
a025f7f
quic: additional doc updates
jasnell Dec 4, 2019
5693be4
quic: use const refs
jasnell Dec 5, 2019
6045212
quic: more idiomatic operators
jasnell Dec 5, 2019
42cc8ac
quic: stateless reset generate strategy
jasnell Dec 4, 2019
ef1fb08
quic: simplify and condense
jasnell Dec 5, 2019
fbafe8d
quic: minor cleanups
jasnell Dec 5, 2019
fe26977
quic: get name and value as std::string option
jasnell Dec 5, 2019
a8ac638
doc,tools: fix make doc target for quic.md
danbev Dec 6, 2019
3bd75b5
src: fix lint-cpp issues
danbev Dec 10, 2019
e86a500
[WIP] benchmark: add basic QUIC benchmark
addaleax Oct 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -1316,6 +1316,32 @@ The externally maintained libraries used by Node.js are:
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- ngtcp2, located at deps/ngtcp2, is licensed as follows:
"""
The MIT License

Copyright (c) 2016 ngtcp2 contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""

- node-inspect, located at deps/node-inspect, is licensed as follows:
"""
Copyright Node.js contributors. All rights reserved.
Expand Down
73 changes: 73 additions & 0 deletions benchmark/quic/quic-pipe.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Test the speed of .pipe() with QUIC sockets
'use strict';

const common = require('../common.js');
const quic = require('quic');
const fixtures = require('../../test/common/fixtures');

const key = fixtures.readKey('agent1-key.pem', 'binary');
const cert = fixtures.readKey('agent1-cert.pem', 'binary');
const ca = fixtures.readKey('ca1-cert.pem', 'binary');

const bench = common.createBenchmark(main, {
dur: [5],
});

function main({ dur, len, type }) {
const server = quic.createSocket({ port: 0, validateAddress: true });

server.listen({
key,
cert,
ca,
rejectUnauthorized: false,
alpn: 'meow'
});

server.on('session', (session) => {
session.on('stream', (stream) => {
stream.pipe(stream);
});
});

const buffer = Buffer.alloc(102400);
let received = 0;

server.on('ready', () => {
const client = quic.createSocket({
port: 0,
client: {
key,
cert,
ca,
alpn: 'meow'
}
});

const req = client.connect({
address: 'localhost',
port: server.address.port
});

req.on('secure', () => {
const stream = req.openStream({ halfOpen: false });
stream.on('data', (chunk) => received += chunk.length);

function write() {
stream.write(buffer, write);
}

bench.start();
write();

setTimeout(() => {
// Multiply by 2 since we're sending it first one way
// then then back again.
const bytes = received * 2;
const gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
});
}
36 changes: 36 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
choices=valid_os,
help='operating system to build for ({0})'.format(', '.join(valid_os)))

parser.add_option('--experimental-quic',
action='store_true',
dest='experimental_quic',
help='enable experimental quic support')

parser.add_option('--gdb',
action='store_true',
dest='gdb',
Expand Down Expand Up @@ -254,6 +259,27 @@
dest='shared_nghttp2_libpath',
help='a directory to search for the shared nghttp2 DLLs')

shared_optgroup.add_option('--shared-ngtcp2',
action='store_true',
dest='shared_ngtcp2',
help='link to a shared ngtcp2 DLL instead of static linking')

shared_optgroup.add_option('--shared-ngtcp2-includes',
action='store',
dest='shared_ngtcp2_includes',
help='directory containing ngtcp2 header files')

shared_optgroup.add_option('--shared-ngtcp2-libname',
action='store',
dest='shared_ngtcp2_libname',
default='ngtcp2',
help='alternative lib name to link to [default: %default]')

shared_optgroup.add_option('--shared-ngtcp2-libpath',
action='store',
dest='shared_ngctp2_libpath',
help='a directory to search for the shared ngtcp2 DLLs')

shared_optgroup.add_option('--shared-openssl',
action='store_true',
dest='shared_openssl',
Expand Down Expand Up @@ -1112,6 +1138,14 @@ def configure_node(o):
else:
o['variables']['debug_nghttp2'] = 'false'

if options.experimental_quic:
if options.shared_openssl:
raise Exception('QUIC requires modified version of OpenSSL and cannot be'
' enabled with --shared-openssl.')
o['variables']['experimental_quic'] = 1
else:
o['variables']['experimental_quic'] = 'false'

o['variables']['node_no_browser_globals'] = b(options.no_browser_globals)

o['variables']['node_shared'] = b(options.shared)
Expand Down Expand Up @@ -1230,6 +1264,8 @@ def without_ssl_error(option):
without_ssl_error('--openssl-no-asm')
if options.openssl_fips:
without_ssl_error('--openssl-fips')
if options.experimental_quic:
without_ssl_error('--experimental-quic')
return

if options.use_openssl_ca_store:
Expand Down
22 changes: 22 additions & 0 deletions deps/nghttp3/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License

Copyright (c) 2019 nghttp3 contributors

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
39 changes: 39 additions & 0 deletions deps/nghttp3/lib/includes/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

/* Edited to match src/node.h. */
#include <stdint.h>

#ifdef _WIN32
#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
typedef intptr_t ssize_t;
# define _SSIZE_T_
# define _SSIZE_T_DEFINED
#endif
#else // !_WIN32
# include <sys/types.h> // size_t, ssize_t
#endif // _WIN32

#ifdef _MSC_VER
# include <intrin.h>
# define __builtin_popcount __popcnt
#endif

/* Define to 1 to enable debug output. */
/* #undef DEBUGBUILD */

/* Define to 1 if you have the <arpa/inet.h> header file. */
/* #undef HAVE_ARPA_INET_H */

/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <unistd.h> header file. */
/* #undef HAVE_UNISTD_H */
Loading