<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: moderation</title>
    <description>The latest articles on DEV Community by moderation (@moderation).</description>
    <link>https://dev.to/moderation</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F164339%2F0d716e6f-88f0-4864-894e-13d62884900f.jpg</url>
      <title>DEV Community: moderation</title>
      <link>https://dev.to/moderation</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/moderation"/>
    <language>en</language>
    <item>
      <title>Experiments with h3 clients + Envoy</title>
      <dc:creator>moderation</dc:creator>
      <pubDate>Tue, 13 Apr 2021 03:07:13 +0000</pubDate>
      <link>https://dev.to/moderation/experiments-with-h3-clients-envoy-52gj</link>
      <guid>https://dev.to/moderation/experiments-with-h3-clients-envoy-52gj</guid>
      <description>&lt;p&gt;I've been experimenting with HTTP/3 (h3) support in Envoy Proxy. I now have both upstream and downstream working&lt;/p&gt;

&lt;p&gt;Inspired by the paper referred to in &lt;/p&gt;
&lt;blockquote class="ltag__twitter-tweet"&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--PPshInBv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/1127689094094573571/X5fMGt0-_normal.jpg" alt="Theophilus A. Benson profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Theophilus A. Benson
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @dottheophilus
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ir1kO05j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-f95605061196010f91e64806688390eb1a4dbc9e913682e043eb8b1e06ca484f.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Interested to understand why (or rather when) QUIC  (HTTP3) outperforms TCP (HTTP2)? Check out my new WWW paper w/ &lt;a href="https://twitter.com/triplewy1"&gt;@triplewy1&lt;/a&gt; on demystifying QUIC:  &lt;a href="https://t.co/ydpPLoVm4Y"&gt;cs.brown.edu/~tab/papers/QU…&lt;/a&gt;&lt;br&gt;&lt;br&gt;Hint: Performance is a function of implementation and operational choices not necessarily the protocol.
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      06:41 AM - 16 Feb 2021
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1361566348887920640" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fFnoeFxk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-reply-action-238fe0a37991706a6880ed13941c3efd6b371e4aefe288fe8e0db85250708bc4.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1361566348887920640" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k6dcrOn8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-retweet-action-632c83532a4e7de573c5c08dbb090ee18b348b13e2793175fea914827bc42046.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/like?tweet_id=1361566348887920640" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SRQc9lOp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/twitter-like-action-1ea89f4b87c7d37465b0eb78d51fcb7fe6c03a089805d7ea014ba71365be5171.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;
 I set out to expand the number of h3 clients for testing

&lt;p&gt;Thanks to &lt;a href="https://github.com/howardjohn"&gt;@howardjohn&lt;/a&gt; at Google for helping with the initial h3 config. Thanks to &lt;a href="https://twitter.com/triplewy1"&gt;@triplewy1&lt;/a&gt; for helping me sort out the correct parameters to pass to proxygen.&lt;/p&gt;

&lt;p&gt;Big thanks to the Envoy team who have helped with configs, testing, ideas etc. In particular &lt;a href="https://github.com/alyssawilk"&gt;@alyssawilk&lt;/a&gt;, &lt;a href="https://github.com/danzh2010"&gt;@danzh2010&lt;/a&gt; + &lt;a href="https://github.com/mattklein123"&gt;@mattklein123&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Envoy
&lt;/h1&gt;

&lt;p&gt;I'm building Envoy from source (main branch) on Linux with a limited set of extensions&lt;/p&gt;
&lt;h1&gt;
  
  
  Clients
&lt;/h1&gt;

&lt;p&gt;I've ended up building and testing 7 h3 clients:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#.&lt;/th&gt;
&lt;th&gt;Client&lt;/th&gt;
&lt;th&gt;Language&lt;/th&gt;
&lt;th&gt;Compilation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/curl/curl/blob/master/docs/HTTP3.md"&gt;curl/curl&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;C&lt;/td&gt;
&lt;td&gt;cloudflare/quiche + BoringSSL&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/hyperium/h3"&gt;hyperium/h3&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;musl static&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/facebook/proxygen"&gt;proxygen/hq&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;C++&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/mozilla/neqo/blob/main/docs/linux_build.md"&gt;mozilla/neqo&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;NSS&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;5.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/istio/istio/tree/master/pkg/test/echo/cmd/client"&gt;istio/quic-go&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Go&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;6.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/cloudflare/quiche"&gt;cloudflare/quiche&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;musl static&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7.&lt;/td&gt;
&lt;td&gt;&lt;a href="https://github.com/quinn-rs/quinn"&gt;quinn-rs/quinn&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;Rust&lt;/td&gt;
&lt;td&gt;musl static&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;h1&gt;
  
  
  Testing
&lt;/h1&gt;
&lt;h2&gt;
  
  
  hyperfine
&lt;/h2&gt;

&lt;p&gt;I used the excellent &lt;a href="https://github.com/sharkdp/hyperfine"&gt;hyperfine&lt;/a&gt; for testing. Please note that benchmarking is hard and this is in no way a proper benchmark. This is more for fun, learning how to build and use new h3 clients and working out how to configure h3 / QUIC for Envoy. Please take all results with a huge grain of salt&lt;/p&gt;

&lt;p&gt;tl;dr - neqo generally slightly quicker followed closely by proxygen, quic-go + h3 (not always in that order). Then quinn, curl and cloudflare/quiche. I'm surprised by cloudflare/quiche being so slow however I believe it has not been optimized at this point&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;
 
&lt;h2&gt;
  
  
  h3spec
&lt;/h2&gt;

&lt;p&gt;I've also tested using the excellent &lt;a href="https://github.com/kazu-yamamoto/h3spec"&gt;h3spec&lt;/a&gt;. We found one crashing bug using this test suite which has subsequently been fixed&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;p&gt;45 examples, 13 failures. This suite has been great for catching crashes but it should be noted the goal is not to attain 100% as there are a number of performance trade-offs to consider&lt;/p&gt;

&lt;h1&gt;
  
  
  Config
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Downstream h3 with local direct responses + h2 upstream
&lt;/h2&gt;

&lt;p&gt;The first config shows how to set up a TCP + UDP listener on the same port, testing JSON structed logging, an Envoy direct response on &lt;code&gt;/local&lt;/code&gt;, &lt;code&gt;alt-svc&lt;/code&gt; headers on h2 responses&lt;/p&gt;

&lt;p&gt;I use CUE for all of these configs and these are exported YAML. The process is started on the Fish shell with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;path to&amp;gt;/envoy --concurrency 1 --log-level debug --config-path (cue export downstream_httpbin_org.cue | psub)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note that for h3 to worked today you'll need to set &lt;code&gt;concurrency&lt;/code&gt; to 1&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h2&gt;
  
  
  Downstream h1 with h3 upstream
&lt;/h2&gt;

&lt;p&gt;This is a simpler config with a stock h1 listener but talks h3 to the upstream service&lt;/p&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


&lt;h1&gt;
  
  
  Future
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Would be fun to test this with things like dynamic forward proxies&lt;/li&gt;
&lt;li&gt;The testing above is done on an Envoy proxy with a the runtime value &lt;code&gt;envoy.reloadable_features.prefer_quic_kernel_bpf_packet_routing: true&lt;/code&gt; set and Linux Capabilities of &lt;code&gt;sudo setcap cap_bpf+ep &amp;lt;path to&amp;gt;/envoy&lt;/code&gt; on a kernel &amp;gt;= 5.8.x. However as per the following issue it is not sure what effect this has &lt;div class="ltag_github-liquid-tag"&gt;
  &lt;h1&gt;
    &lt;a href="https://github.com/envoyproxy/envoy/issues/15845"&gt;
      &lt;img class="github-logo" alt="GitHub logo" src="https://res.cloudinary.com/practicaldev/image/fetch/s--i3JOwpme--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev.to/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg"&gt;
      &lt;span class="issue-title"&gt;
        Docs: clarify QUIC BPF operation
      &lt;/span&gt;
      &lt;span class="issue-number"&gt;#15845&lt;/span&gt;
    &lt;/a&gt;
  &lt;/h1&gt;
  &lt;div class="github-thread"&gt;
    &lt;div class="timeline-comment-header"&gt;
      &lt;a href="https://github.com/moderation"&gt;
        &lt;img class="github-liquid-tag-img" src="https://res.cloudinary.com/practicaldev/image/fetch/s--KpZgK7N---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://avatars.githubusercontent.com/u/246317%3Fv%3D4" alt="moderation avatar"&gt;
      &lt;/a&gt;
      &lt;div class="timeline-comment-header-text"&gt;
        &lt;strong&gt;
          &lt;a href="https://github.com/moderation"&gt;moderation&lt;/a&gt;
        &lt;/strong&gt; posted on &lt;a href="https://github.com/envoyproxy/envoy/issues/15845"&gt;&lt;time&gt;Apr 06, 2021&lt;/time&gt;&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag-github-body"&gt;
      &lt;p&gt;&lt;em&gt;Title&lt;/em&gt;: &lt;em&gt;Docs: clarify QUIC BPF operation&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Description&lt;/em&gt;:
Prompted by the Twitter chat at &lt;a href="https://twitter.com/mattklein123/status/1378172039870091265" rel="nofollow"&gt;https://twitter.com/mattklein123/status/1378172039870091265&lt;/a&gt; I looked into the runtime flag that allows QUIC routing in the kernal via BPF - &lt;a href="https://github.com/envoyproxy/envoy/blob/main/source/common/runtime/runtime_features.cc#L82"&gt;https://github.com/envoyproxy/envoy/blob/main/source/common/runtime/runtime_features.cc#L82&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight highlight-source-yaml js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-ent"&gt;layered_runtime&lt;/span&gt;:                                                             
  &lt;span class="pl-ent"&gt;layers&lt;/span&gt;:                                                                    
    - &lt;span class="pl-ent"&gt;name&lt;/span&gt;: &lt;span class="pl-s"&gt;static-layer                                                     &lt;/span&gt;
      &lt;span class="pl-ent"&gt;static_layer&lt;/span&gt;:                                                          
        &lt;span class="pl-ent"&gt;envoy.reloadable_features.prefer_quic_kernel_bpf_packet_routing&lt;/span&gt;: &lt;span class="pl-c1"&gt;true&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Installing BPF rules like this requires one of:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Envoy is running as root&lt;/li&gt;
&lt;li&gt;For kernels &amp;gt;= 5.8, Envoy is running with &lt;code&gt;sudo setcap cap_bpf+ep &amp;lt;envoy binary&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;For kernels &amp;lt; 5.8, Envoy is running with &lt;code&gt;sudo cap_net_admin,cap_sys_admin+ep &amp;lt;envoy binary&amp;gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;From initial testing Envoy doesn't display any different output when launched in different modes. QUIC / h3 listeners work whether Envoy was launched with the elevated permissions or not.&lt;/p&gt;
&lt;p&gt;It would be good to clarify in the docs what steps need to be taken to enable QUIC BPF kernel routing and what platforms work and don't work. It looks like this is Linux only at the moment. It might be worthwhile logging whether the BPF rule has been installed successfully - &lt;a href="https://github.com/envoyproxy/envoy/blob/main/source/common/quic/active_quic_listener.cc#L234-L298"&gt;https://github.com/envoyproxy/envoy/blob/main/source/common/quic/active_quic_listener.cc#L234-L298&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Relevant Links&lt;/em&gt;:
Handy reference on determine what Linux Capabilities your system supports - &lt;a href="https://linux-audit.com/linux-capabilities-101/" rel="nofollow"&gt;https://linux-audit.com/linux-capabilities-101/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;/cc @ggreenway @alyssawilk @danzh2010 @mattklein123&lt;/p&gt;

    &lt;/div&gt;
    &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/envoyproxy/envoy/issues/15845"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Updates
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;quinn removed support for their h3 test client in &lt;a href="https://github.com/quinn-rs/quinn/pull/1155"&gt;https://github.com/quinn-rs/quinn/pull/1155&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>envoyproxy</category>
      <category>http3</category>
      <category>quic</category>
    </item>
    <item>
      <title>Hello dev.to</title>
      <dc:creator>moderation</dc:creator>
      <pubDate>Mon, 06 May 2019 04:48:26 +0000</pubDate>
      <link>https://dev.to/moderation/hello-dev-to-2aed</link>
      <guid>https://dev.to/moderation/hello-dev-to-2aed</guid>
      <description>&lt;p&gt;Setting up my dev.to&lt;/p&gt;

</description>
      <category>intro</category>
    </item>
  </channel>
</rss>
