Skip to content

HTTP 3 Documentation

Bryan Call edited this page Jan 25, 2023 · 38 revisions

Building the HTTP/3 tools and libraries

1. Install package dependencies

Fedora or RHEL

sudo dnf -y install libev-devel jemalloc-devel python2-devel libxml2-devel c-ares-devel libevent-devel jansson-devel zlib-devel systemd-devel

Ubuntu

sudo apt -y install libev-dev libjemalloc-dev python2-dev libxml2-dev libpython2-dev libc-ares-dev libsystemd-dev libevent-dev libjansson-dev zlib1g-dev

2. Build and install the HTTP/3 tools and libraries

There will be HTTTP/3 versions of curl and h2load under the /opt/bin directory

git clone [email protected]:apache/trafficserver.git
cd trafficserver
git checkout -b 10-Dev
cd tools
./build_h3_tools.sh

3. Building trafficserver with HTTP/3 support

mkdir target
cd target

gcc build

../configure --prefix=/opt/ats --enable-ccache --enable-werror --enable-experimental-plugins --enable-example-plugins --with-quiche=/opt/quiche --enable-expensive-tests

ASAN build with clang

LUAJIT_CFLAGS=-Wno-unused-command-line-argument CC=/bin/clang CXX=/bin/clang++ CLANG_TIDY=/bin/clang-tidy ../configure --prefix=/opt/ats --enable-ccache --enable-werror --enable-experimental-plugins --enable-example-plugins --with-quiche=/opt/quiche --enable-asan --enable-expensive-tests

4. Configuring trafficserver with HTTP/3 support

You will need to generate TLS certificates (see below) if you don't have any already. Below is an example configuration that will work with the benchmarking example below.

ETC_DIR=/opt/ats/etc/trafficserver
RECORDS_CONFIG=$ETC_DIR/records.config
REMAP_CONFIG=$ETC_DIR/remap.config
sed -i 's/8080 8080:ipv6/8080 4443:ssl 4443:quic/' $RECORDS_CONFIG
echo "CONFIG proxy.config.udp.threads INT 1" >> $RECORDS_CONFIG
echo "CONFIG proxy.config.diags.show_location INT 2" >> $RECORDS_CONFIG
echo "CONFIG proxy.config.diags.debug.tags STRING quic" >> $RECORDS_CONFIG
echo "CONFIG proxy.config.quic.initial_max_streams_bidi_in INT 100000" >> $RECORDS_CONFIG
echo "CONFIG proxy.config.quic.initial_max_streams_bidi_out INT 100000" >> $RECORDS_CONFIG
sed -i 's/CONFIG proxy.config.http.insert_response_via_str INT 0/CONFIG proxy.config.http.insert_response_via_str INT 3/' $RECORDS_CONFIG
echo map / http://127.0.0.1/ @plugin=generator.so >> $REMAP_CONFIG
echo "dest_ip=* ssl_cert_name=$ETC_DIR/localhost.crt ssl_key_name=$ETC_DIR/localhost.key" >> $ETC_DIR/ssl_multicert.config

5. Generating TLS certificates

6. Benchmarking HTTP/3

Start ATS

/opt/ats/bin/trafficserver start

Test one request

/opt/bin/curl --http3 https://127.0.0.1:4443/cache/1024

Run h2load

/opt/bin/h2load -n 500000 -c 100 --npn-list=h3 https://127.0.0.1:4443/cache/1024/asdfasdf
Clone this wiki locally