Files
wolfssl/examples/benchmark/include.am
T
Juliusz Sosinowicz c815d98ef4 DTLS throughput: add benchmark tool and optimize the record send path
Add examples/benchmark/dtls_bench, a DTLS throughput benchmark that
completes a handshake and then measures bulk-send throughput. It
supports DTLS 1.2 and 1.3, selectable cipher suites, an end-to-end
mode, and a -z sink mode that discards records on the server after the
handshake to isolate the sender's record-layer cost. The socket is set
up with wolfSSL_set_dtls_fd_connected.

Optimize the send path exercised by the benchmark:

- wolfio (EmbedSendTo): cache the per-descriptor socket-type probe
  (getsockopt SO_TYPE) in WOLFSSL_DTLS_CTX instead of running it on
  every send, removing a syscall from the record send path. The cache
  is invalidated whenever rfd/wfd is reassigned.

- internal (BuildMessage): for AEAD suites whose explicit nonce is the
  8-byte record sequence number, write the sequence number directly as
  nonce_explicit instead of drawing it from the RNG. This covers
  AES-GCM (RFC 5288 sec 3), AES-CCM (RFC 6655 sec 3), SM4-GCM/CCM
  (RFC 8998 sec 3), and Camellia-/ARIA-GCM which inherit the RFC 5288
  construction; ChaCha20 uses an implicit nonce and is excluded. A new
  read-only PeekSEQ() helper reads the sequence number without advancing
  the per-direction counter, leaving the single mandated increment to
  writeAeadAuthData().

Also ignore the built dtls_bench binary in .gitignore.
2026-06-10 14:03:52 +02:00

27 lines
1.0 KiB
Plaintext

# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
if BUILD_THREADED_EXAMPLES
noinst_PROGRAMS += examples/benchmark/tls_bench
noinst_HEADERS += examples/benchmark/tls_bench.h
examples_benchmark_tls_bench_SOURCES = examples/benchmark/tls_bench.c
examples_benchmark_tls_bench_LDADD = src/libwolfssl@LIBSUFFIX@.la $(LIB_STATIC_ADD)
examples_benchmark_tls_bench_DEPENDENCIES = src/libwolfssl@LIBSUFFIX@.la
endif
if BUILD_DTLS
if BUILD_EXAMPLE_SERVERS
noinst_PROGRAMS += examples/benchmark/dtls_bench
examples_benchmark_dtls_bench_SOURCES = examples/benchmark/dtls_bench.c
examples_benchmark_dtls_bench_LDADD = src/libwolfssl@LIBSUFFIX@.la $(LIB_STATIC_ADD)
examples_benchmark_dtls_bench_DEPENDENCIES = src/libwolfssl@LIBSUFFIX@.la
endif
endif
dist_example_DATA+= examples/benchmark/tls_bench.c
dist_example_DATA+= examples/benchmark/dtls_bench.c
DISTCLEANFILES+= examples/benchmark/.libs/tls_bench
DISTCLEANFILES+= examples/benchmark/.libs/dtls_bench