Tag: quic

Get all of the QUIC news, tips, and thoughts from our developers here.

LiteSpeed believes in QUIC. We have publicly released our open source QUIC Client Library, we are participating in the QUIC standardization process alongside Google, Microsoft, Facebook, and others, and we currently power more than 97% of sites worldwide that run QUIC.

  • Developer’s Corner: Head-of-Line Blocking Allows Attacks

    Developer’s Corner: Head-of-Line Blocking Allows Attacks

    Developer's Corner: Head-of-Line Blocking Allows Attacks

    Protocol designers underestimate
    how badly people will implement
    their designs.

    – Adam Langley, Cryptographic Agility.

    Abstract

    Compression schemes that allow head-of-line blocking are targets for memory exhaustion attacks against the decoder. Detecting such an attack is not trivial. Without guidance, programmers are likely to produce vulnerable implementations. HoL blocking must either be prohibited at the protocol level or the attack mitigation mechanism must be specified explicitly in the compression specification. One way to avoid an attack is presented.

    Introduction

    In the previous article, we discussed how head-of-line blocking can cause priority inversion and vice versa. In the second part of the series, we will examine potential attacks made possible by head-of-line blocking.

    Problem Statement

    Head-of-line blocking causes the decoder to queue header blocks that cannot be decoded due to a missing dynamic entry. Under normal circumstances, this occurs because of packet loss or reordering. An adversary, however, may create this scenario artificially in order to get the decoder to queue data, thereby creating a denial-of-service attack.

    Here, a simple recommendation that the decoder use a timer is insufficient. The decoder must decide how much data it is willing to buffer and for how long. In other words, it must be able to differentiate between an attack and a regular packet loss/reordering situation. An incorrect determination may mean allowing a server to be DoSed; err the other way, and a valid connection is aborted.

    Sample Attack

    The attacker’s strategy is simple: send header blocks that contain a reference to a non-existent dynamic entry:

    Head-of-Line Blocking Allows Attacks: Sample Attack

    The decoder cannot resolve a reference and has to wait — buffering data. More and more header block data is sent. To maximize the effect of the attack, the adversary may use more than one — potentially all — available streams.

    Mitigation Strategies

    Strategy 1: Simple Timer

    The decoder may associate a simple timer with each stalled header block. A simple timer has to be quite conservative in order to eliminate false positives. During that time, the attacker writes more data to each of the header blocks in a round-robin fashion, perhaps even resolving the blocking entry to reset the decoder timer while introducing a new unresolved entry at the same time. The amount of data queued at the decoder grows and grows and the server is eventually hosed.

    Strategy 2: Adaptive Timer

    A conservative timer means that the attacker has plenty of time to write more blocking data. An adaptive timer aims to reduce that window by using recent network conditions for determining a smaller timeout value. Besides RTT, it may need information such as the current CWND as well as callbacks fired when packet loss or timeout is detected. (This is digging pretty deep into the transport.) Even then, the adaptive timer must take into account that data could be lost multiple times as well as the possibility that the peer retransmits lost packets after it sends new data.

    This approach lessens the impact (although without further analysis I cannot state to what degree), but does not solve the problem. In addition, the possibility of a false positive grows.

    Strategy 3: Application-Aided Attack Detection

    The decoder does not know whether the headers it receives make sense to the application or whether they are just fluff the attacker uses to blow up its blocked queue. The application knows about the headers it uses and thus could be called upon to evaluate the headers’ fluff level, sort of like an email SPAM filter.

    This idea is not workable:

    1. While we (the IETF QUIC Working Group) do control the direction the transport layer takes, requiring all applications to provide extra logic to fight attacks is a non-starter.
    2. The attacker may simply target an application with special header blocks that would pass the checks.

    Strategy 4: Change Application Interface

    It is possible to change the decoder API to require the application to receive out-of-order headers, allowing the decoder to queue just the unresolved references. This is not good enough, either:

    1. The problem is just kicked upstairs — now the application must queue the data and decide when to abort the connection.
    2. If an indexed-name/literal header representation is used, with the index being unresolved, the decoder still has to queue the whole header field.

    Strategy 5: Unread Data From Stream

    One can imagine requiring the stream interface to be able to revert a read; alternatively, a peeking functionality may be provided. Either will allow the decoder to leverage the underlying stream’s queuing functionality instead of doing its own: when an unresolved entry is encountered, push back some data (or the whole header block). The advantage of using the stream for this is that the amount of data in the stream is limited by that stream’s maximum as well as the connection’s overall maximum.

    The first downside of this approach is that unreading may not always be possible, as the application must take off data from streams so that the connection can proceed.

    When it is possible, this strategy effectively exchanges a memory exhaustion attack for processor exhaustion attack. One can imagine an attacker now switching to feeding the decoder resolved entries and new data with unresolved entries, forcing it to read, decode, and push back the data.

    In addition, it is unclear whether the QUIC standard will require the transport layer to provide such functionality. (Consider, for instance, the implications of deferring sending a WINDOW_UPDATE frame while waiting for the application to “commit” to a read.)

    No Way to Detect An Attack

    None of the mitigation strategies above help the decoder to detect an attack in time. An odd (for some value of “odd”) sequence of incoming streams, header blocks, and dynamic table updates may be a perfectly valid use case. An attack detection mechanism built into the decoder must be sure that it is not going to break applications. Thus, one implementation may do it well and another may do it poorly. Chances are good that it is the protocol that will take the blame. One could add: for a good reason.

    What This Means

    Section 7: Security Considerations of RFC 7541 (HPACK) is five pages long — a quarter of the whole text! (Sans preamble, table of contents, and appendices). Obviously, the security of the header compression mechanism has been addressed thoroughly in the past.

    It is apparent that the compression mechanism that we (the Design Team) eventually present to the Working Group must either preclude this type of attack at the protocol level or offer a robust attack detection and mitigation that can pass a security review.

    There are two ways to address this:

      1. Not allow head-of-line blocking in the final proposal.
      2. Agree that the final compression proposal
        • limit HoL blocking in a quantifiable fashion and/or
        • include a robust attack detection mechanism.

    Limiting HoL blocking in a quantifiable fashion means that the compression mechanism guarantees that the amount of data that has to be queued at the decoder does not exceed some threshold.

    A robust attack-detection mechanism implies that it is possible to implement using standard programming techniques. It would be unreasonable to require that every decoder implement a sophisticated attack detection logic. (This would also be against the QUIC WG mandate that the decoder be simple.) In addition, the detection code must be relatively inexpensive (memory, CPU) to operate as part of the decoder.

    Potential Solution: Defer Reading

    One potential solution to this is to prefix header block data with information that would tell the decoder whether the header block could be processed in one shot given current decoder state. For example:

    Head-of-Line Blocking Allows Attacks: Potential Solution

    If the Update #X has not yet arrived, the decoder does not read any more from this stream. This leaves the headers in the transport. (This takes Strategy 5 one step further.) Such approach limits the amount of memory required by the decoder.

    The downside to this approach is that not draining the streams promptly may prevent the transport from operating efficiently.

    Summary

    Allowing HoL blocking and requiring the decoder to queue data and wait until it can be decoded is a denial-of-service attack vector. The simplest way to prevent such attack is to not allow HoL blocking at all. Deferring reading from affected streams is likely feasible but requires further analysis. GitHub issue #1011 was opened to track this.

  • Developer’s Corner: HoL Blocking and Priority Inversion

    Developer’s Corner: HoL Blocking and Priority Inversion

    Developer's Corner: HoL Blocking and Priority Inversion

    Background

    Producing a native header compression mechanism for QUIC is one of the goals of the IETF QUIC Working Group. The approach used in the Google QUIC (gQUIC) suffers from head-of-line blocking (HoLB) and is thus suboptimal. I had been interested in header compression for some time and, in November of 2017, I added my own proposal (QMIN) to the other two proposals already under consideration. The Working Group had empaneled the Compression Design Team and tasked it with coming up with a single proposal. Our team has six members:

    • Alan Frindell, the author of proxygen;
    • Charles “Buck” Krasic, the author of the QCRAM compression proposal;
    • Dmitri Tikhonov, the author of the QMIN compression proposal.
    • Martin Thomson, the co-editor of the QUIC Internet Draft;
    • Mike Bishop, the author of the QPACK compression proposal; and
    • Roberto Peon, the co-author of HPACK (RFC 7541).

    There are many design decisions that go into producing a compression mechanism. The resulting proposal (Internet Draft) will hopefully become a standard (RFC) one day. The rationale behind many aspects of a standard usually does not get included into RFCs: this is not what the RFCs are for. In this article — which may become first in a series of several — I will describe an interesting problem that could impact the choices the Compression Design Team makes.

    Introduction

    QUIC streams have priorities which the application layer can set. HTTP/2 and, consequently, HTTP/QUIC use priorities to improve UX. Usually, priorities are assigned by content type: HTML has higher priority than CSS, which in turn has higher priority than images. In general, an application using the protocol may assign any priorities to suit its needs.

    Problem Statement

    In gQUIC, the header blocks are delivered on a separate, high-priority (higher than all other priorities on the connection save the HANDSHAKE stream), unbounded HEADERS stream. The HTTP payload-bearing streams’ priorities are used to select which HTTP message to process. Lost or late packets on the HEADERS stream may cause other streams to wait. (This is the head-of-line blocking problem that the Design Team is trying to solve.) The HEADERS stream itself does not depend on other streams and it is always processed first.

    In the current IETF HTTP/QUIC draft, on the other hand, the header blocks are part of the request/response stream itself. In the case where the header compression protocol mandates that the decoder be able to wait on unresolved entries (this is the decoder HoL blocking), the compression protocol and the QUIC protocol can actively hinder each other in the following manner:

    1. HoL blocking can cause priority inversion; and
    2. Priority inversion can cause HoL blocking.

    HoL Blocking Causes Priority Inversion

    This situation can occur when a server sends two responses (let’s call them A and B) where the header block of a higher-priority response (for instance, A) references entries first inserted in the header block of the lower-priority response.

    Example:

    HoL Blocking Causes Priority Inversion

    Here, the server does the correct thing — since it got the B request first and the A request has not yet arrived, it encodes and sends the response, even though a higher-priority request is coming.

    The client, too, does everything correctly: after receiving the responses, it processes the higher-priority A response first.

    Stream Priorities Cause HoL Blocking

    Priority-induced HoL blocking can happen whenever there is packet loss. If a high-priority response A depends — via its header block compression — on a low-priority response B which gets lost, the server will choose to send the higher-priority data on stream A before retransmitting the lost B response. The client will have to buffer the whole A response or fill the A stream buffer before it receives the required B response and can proceed.

    The example is a variation of the above when the B response gets lost:

    Stream Priority causes HoL Blocking

    The server’s choice to send higher-priority stream data is in accordance with the QUIC recommendation. It does everything correctly.

    This scenario is worse than the first, because the client cannot use the high-priority response (say, render an HTML page or compile JavaScript) for as long as it takes to fill the stream buffer.

    Attention: This is worse than the original gQUIC HoL blocking problem, for the gQUIC server would choose to send the missing header block first.

    More Potential Troubles

    Above, only static priorities are considered. QUIC allows stream priorities to be adjusted dynamically. An implementation that changes stream priorities based on some performance metrics — for example, as an indirect result of priority inversion — may only make the problem worse.

    Summary

    Adding stream dependencies in the form of header block dependencies in the decoder introduces a conflict with the QUIC stream priorities whenever there is packet loss or reordering. This conflict can cause HoL blocking, resulting in a markedly degraded user experience. Since both packet loss and packet reordering happen constantly (the former is how congestion control works), the problem will be ubiquitous.

    These issues can be solved by designing the protocol so that either

    • Response or request headers can be processed immediately; or
    • Operations that modify the table state are sent on a different, special-purpose stream (or streams).

    Text by: Dmitri Tikhonov
    Graphics by: Mark Zou

  • LiteSpeed Powers Most QUIC Sites!

    LiteSpeed Powers Most QUIC Sites!

    LiteSpeed Powers Most QUIC Sites

    Back in July, we announced that we would be supporting the QUIC internet protocol in our web server products. Today, a mere five months later, LiteSpeed powers most QUIC sites: more than 97% of them, to be exact!

    According to W3Techs:

    LiteSpeed Powers Most QUIC Sites Tweet via W3Techs

    Wow!

    As of this writing, 0.5% of the web is currently QUIC-enabled, and most of those sites are running a LiteSpeed server!

    We love seeing statistics like this. It means our energy is well-spent, and our efforts to champion widespread adoption of QUIC so far have not been in vain. We will continue to help QUIC usage climb in 2018!

    This kind of thing is in our blood. We deliver cutting-edge technologies and work towards seeing them widely adopted. We did it with HTTP/2, and before that, it was SPDY. It’s what we do: Internet. Accelerated.

    So how can you get in on the QUIC action if you haven’t already? Get yourself a trial license, and Install LiteSpeed Web Server. QUIC will be enabled by default. All you need to do is open UDP port 443. It doesn’t get much easier than that.

    We’ve been writing a lot about QUIC lately, so be sure to check out some of the other articles here on the blog, if you’d like to know more.

  • 2017: The Year in Review

    2017: The Year in Review

    As the year draws to a close, we thought we’d take a moment to look back on our most memorable accomplishments of 2017. It was a year of innovation and growth, and we’re so happy to have had you along for the ride!

    QUIC

    In 2017, LiteSpeed released the first production-grade mass-market QUIC implementation available for the public.

    QUIC is the next generation Internet protocol, and is poised to replace HTTP/2. We introduced QUIC support in LiteSpeed Web Server and LiteSpeed Web ADC in the middle of the summer, and it has been a popular feature among our customers.

    We believe in this technology and so it has been a pleasure to publicly release our open source QUIC Client Library as a way to spearhead widespread adoption of QUIC. Going forward, we are participating in the QUIC standardization process alongside Google, Microsoft, Facebook, and others. Being a part of Internet history is a humbling experience, and we are honored to have a seat at the table.

    If you missed all of the excitement at the time, you can get the facts about QUIC on our website.

    Cache Plugins

    Our popular LSCache module for LiteSpeed Web Server and LiteSpeed Web ADC can be configured through rewrite rules. But the easiest approach is through LSCache plugins that are designed specifically for your web app.

    This year we added the LSCache Module for PrestaShop to our cache plugin family, thereby giving simple cache-management capabilities to LiteSpeed-powered PrestaShops everywhere.

    Additionally, there’s the so-new-it-hasn’t-yet-been-announced LSCache for MediaWiki! Look for more information about that soon.

    It’s always exciting to launch a new cache plugin, but we’ve also been having a blast enhancing one of our existing plugins as well: LiteSpeed Cache for WordPress. Over the course of 2017, this plugin has grown beyond cache management to become an all-in-one WordPress optimization solution. Some users are reporting PageSpeed scores of 100%! The reviews have been overwhelmingly positive, and we thank you for that.

    We’re planning more cache plugins for additional web apps in 2018, so stay tuned for that.

    LiteSpeed Web ADC

    Our Web ADC load balancer features High Scalability, High Availability IP failover, Cross Datacenter Replication, Cache Data Synchronization and out-of-the box acceleration for Magento and WordPress. And this year, we added more bells and whistles, including support for QUIC, BoringSSL, TCP_FastOPN, IP2Location, and SecRemoteRules.

    Additionally, the new ZeroConfig API means you can automate direct third-party management of your Web ADC’s configuration. You’ll be able to replace manual configuration of back-ends and domains using our automated message based interface.

    If you haven’t given our Web ADC a chance, why not get a trial license and play with it for a few weeks?

    CyberPanel

    This year OpenLiteSpeed users got a treat in the form of a shiny new control panel. CyberPanel is the only control panel built specifically for OpenLiteSpeed, and it’s free and Open Source, just like OpenLiteSpeed.

    Web Presence

    Our website got a complete overhaul in April, and we continue to make improvements to it.

    Around the same time, we added two more social media accounts to our online presence – you can now like and follow us on Facebook and Instagram. We share informational links and behind-the-scenes glimpses of our New Jersey office. In just under one year, we have already reached almost 2k followers on Facebook, and we are so thrilled. A huge thank you to all the LiteSpeeders out there. Keep interacting with us and inspiring us! In turn, we’ll continue to post interesting content.

    Speaking of interesting content, 2017 was the year we breathed new life into this blog. Since the introduction of WordPress Wednesday in May, we’ve published more than 30 tutorials and explored key caching concepts in detail. Our Developer’s Corner series has provided an opportunity for our developers to write about their projects from a technical point-of-view. This fall, we kicked off a new series, Notes from the Road, which we used to give you a peek into the QUIC Working Group Meeting in Seattle and the cPanel Convention in Florida.

    We’re loving these ways of communicating with our customers, so look for additional interesting blog and social media content in 2018!

    New Team Members

    This year, our team saw impressive growth. Say hello to 2017’s new faces: Tishu, Wuhua, Usman, Bob, Eric, Hai, Kacey, and Lisa (that one’s me… hi there!).

    All of the members of the LiteSpeed family – those who have been here for many years and those who are relative newbies – are happy to be here, working together towards the goal of an accelerated internet!

    Coming in 2018

    If you know LiteSpeed, then you know we’re never content to rest on our laurels. We’ve got so many more exciting developments to come, including:

    • New LiteSpeed Cache plugins for other popular web apps.
    • An embedded PHP module for OpenLiteSpeed, which will make OLS the fastest PHP server platform!
    • CRIU (Checkpoint Restore In User mode) support for PHP

    And that’s just the beginning! Stick with us in 2018 and beyond and see what’s next!

    From our family to yours: wishing you a happy and healthy New Year!

  • NFtR: QUIC Working Group Day Three

    NFtR: QUIC Working Group Day Three

    Thursday, October 5th. Seattle, WA.

    This morning, I arrived at 351 Elliott Ave around 8:40 am, which was about 20 minutes too early. I plopped down in the lobby and chatted a bit with someone whom I took for a manager of some sort. He was in charge of a large model of the new F5 Networks building. The base of the model had some chips in it that needed to be repaired and two repairmen came to take care of it. The actual building is currently under construction and should be ready by 2019. Boasting 44 floors and standing 660 ft. tall, the new F5 Networks tower is a bona fide skyscraper! F5 is growing and Seattle is growing with it.

    The meeting began at 9:33. After a few short preliminaries (note well, etc), Mark Nottingham (Fastly) — the working group’s co-chair — announced that Jeff Pinner (Lyft) and Roberto Peon (Facebook) have been nominated to lead a closed design team to come up with a QUIC API document.

    Then Lars Eggert (NetApp) — the other co-chair — departed from his usual MO to deliver a warning to the participants:

    There are fifty people in this room and half of you haven’t said a thing in two days! This is not good. The committee keeps on arranging venues that can accommodate this many people, relying on people like Martin [Duke (F5 Networks)] to have their companies host us.

    It is hard not to agree with Lars, even though he sounded a bit apologetic in the end: Is there a good case for mute participants? Since they do not participate, are they even participants? Perhaps they participate during breaks? But those aren’t an official part of the conference. Are they?

    It turns out, the breaks are a crucial part of moving the standardization process forward. People use the breaks at conferences like this one to discuss things face-to-face and to mingle. In our case, however, the discussions during breaks were officially sanctioned by the chairs for people to hash out their technical issues. There are two problems with this:

    1. The working group’s discussion is supposed to be recorded. There are three official ways to discuss the IETF QUIC drafts:
      1. Mailing list;
      2. GitHub artifacts — issues, PRs, etc; and
      3. Conferences/meetings

      The first two are easy: the medium is the record. The meetings have a scribe who is to write everything down. These are not empty words: yesterday’s meeting was stalled while we waited for someone to volunteer to be the scribe.

      Yet these rules are suspended for discussions during breaks: the discussions are not recorded.

    2. The remote participants cannot participate. Already second-class citizens, they have no ability to take part in discussions during the breaks: Even if the microphone stays on, there are so many groups of people talking, that it is just a din to those listening online.

    On the other hand, these break-based discussions are quite productive. I do not know what, or whether, we are to do anything about this; I am just stating the facts.

    Mark Nottingham then noted that there is a different dynamic when there are twenty people in the room versus fifty people:

    This is not to say that fifty is bad, but you got to participate… In addition, I must note that this group is not very diverse, especially with regards to gender. I would love to see that change.

    Speaking of representation: today, when the sign-in sheet was being passed around, I had the presence of mind to glance over the preceding entries. There were names of several companies that I had not heard mentioned at the meeting. Below I publish the list of attending companies and organizations that I have collected:

    • F5 Networks
    • ACLU
    • Adobe
    • Akamai
    • Apple
    • AT&T
    • BBC
    • Cloudflare
    • Deutsche Telekom
    • Facebook
    • Fastly
    • Google
    • Huawei
    • LiteSpeed Technologies
    • Lyft
    • Microsoft
    • Mozilla
    • NetApp
    • Symantec
    • Twitter
    • Verizon

    Around 9:45 am, Ian Swett (Google) began his ACKs and Recovery presentation. The first slide had five QUIC ACK Principles which Ian introduced as something that we can all agree upon. Predictably, disagreement instantly ensued. After some dispute regarding the ACK Principles, we got to the meat of the ACK discussion. Ian recounted how some ACK (mis)behaviors only manifest themselves when the network experiences “ridiculously” high packet loss — ca. 30%.

    With regard to the ACK frame structure, it was decided to remove the timestamps section from the ACK until we understand better how we want to aid the congestion control. In addition, deciding which congestion control a connection is to employ should be part of connection negotiation. A separate working group is to make a proposal regarding the use of timestamps and ECN for congestion control.

    Martin Duke raised an issue with the term “timestamp,” since it is not the common definition of “timestamp.” As for the ACK delay time format, Jeff had the following comment to offer (here I am, unfortunately, paraphrasing — the original wording was better):

    The biggest problem with the float format is that it claims to be something that it isn’t, the spec is wrong.

    This elicited a couple of boos (I am assuming from the authors of the format).

    Around 11:20, Mike Bishop (Microsoft) discussed the pros and cons of QPACK, of which he is the author, and QCRAM proposed by Buck Krasic (Google). The discussion went on for some time, as both QPACK and QCRAM have some features that are desirable and others that are not — it is just that these sets are flipped in each: like the yin and yang. Jeff, always quick with a simile, posited that what we wanted was a unicorn of a compression mechanism. I asked Buck whether it is valuable to base the new algorithm on HPACK, for the latter is so simple, it can just be thrown out and a new one can be written. Buck replied that that was a secondary consideration: the primary reason for basing QCRAM on HPACK is to keep all the decision making in the encoder, which is one of the desirable features, and here the consensus was near unanimous. (There were many more questions and observations offered by the members — I am only listing mine because I am partial.)

    Have you ever hummed? What, do you mean like a tune? – you may ask. No, “hum” as in going “HUMMMM…” Sort of like singing a mantra, but instead of OHMMM… you go HUMMM… You haven’t? I have! This is how (apparently!) IETF working groups vote for a motion. When Mike Bishop posed the first question to be hummed, I was so surprised that I missed the gist of the question completely. However, the second humming (hummer? humster? hummedura?) was stated, approximately, as follows: “Hum if you are in favor of saying that it’s OK to abandon any and all HPACK compatibility or design principles when coming up with the new HTTP/QUIC header compression mechanism.” I hummed ‘yes!’ I am a hamster! Hear me HUM! This hum was judged to be in the affirmative.

    During the last break of the day, I talked with Alan Frindell (Facebook) about compression. He had made several insightful comments during the preceding discussion and the opportunity to pick his brain was too good to pass up. Turns out, they have been running modified HPACK code (part of proxygen) in production that supports QCRAM and QPACK! It’s hard to be better prepared than that!

    Alan described Roberto’s two-stream framing proposal to me. I replied that yes, it is good, but we are digging into the transport! As long as we are digging into the transport, we could do the same with one stream: specify a byte sequence to be message separators and parse the messages out. Then you do not have to put them into the same packet. Further, I went on, the fact that QPACK uses extra streams is generally considered a strike against it. This is because we do not want to run out of streams. But why are there limitations to begin with? Why is the number of streams limited? (This is related to issue #796.) Had we an unlimited number of streams, the question of special framing for messages would not exist! Of course, lifting those restrictions would dig even deeper into QUIC…

    Buck discussed the benefits of reduced HoL blocking as measured in Google’s A/B testing early this summer. Reducing head-of-line blocking is definitely something to strive for.

    The meeting wrapped up at 3 pm and I caught Bus #24 to downtown. It was my plan all along to visit the Seattle Art Museum before going to the airport: SAM is open until 9 pm on Thursdays. Walking among works of art, I managed to forget QUIC for a little while. Centuries of civilization were speaking to me.

    I only began to reflect upon the events of the past three days while definitely not enjoying the unappetizing dinner served at an airport restaurant. (It seems at the SeaTac airport they threw off all pretense: “Give us your money! Now, eat this nondescript mystery meat with some lettuce on it!”) The broiled crypto-chicken could not spoil my mood: I was happy.

    The cast of characters in the wonderful play that is the QUIC standardization process is no longer just a bunch of email addresses and GitHub handles for me: I met Eric Rescorla, I argued with Buck Krasic, I shook Martin Thomson’s hand, I exchanged stories of QUIC’s deployment pitfalls with Jana Iyengar, I picked Alan Frindell’s brain. Now I know these (and other!) guys and, what’s more, I like them.

    I gained valuable insight listening to the participants. Observations by Jeff Pinner, Martin Thomson (Mozilla), Roberto Peon, Alan Frindell, and Ian Swett offered me a new perspective on things. It is in human nature to cooperate (the very QUIC standardization process is a good example of this): people will share painfully learned lessons, ideas, problems, solutions — for free! One only has to listen. What a great deal!

  • NFtR: QUIC Working Group Day Two

    NFtR: QUIC Working Group Day Two

    Wednesday, October 4th. Seattle, WA.

    Whereas during yesterday’s early morning sally I braved the 48-degree weather to reach the southern end of Lake Union, today I explored the Queen Anne district in a different direction. From my hotel, situated at the corner of 5th and Roy, I walked briskly south toward the Space Needle. The morning was bright and gentle, the air fresh, and the sights of the friendly city entertained my eyes. My mind searched, involuntarily, for some European city — perhaps even a city from my childhood — that Seattle reminded me of. In a daydream, I arrived at the foot of the Space Needle and snapped a picture (the sun was hitting it perfectly). From there, I walked west and down toward the Elliott Bay. From the Olympic Sculpture Park, I headed north along the shore toward the F5 Network towers (this is where the working group meets). After a pleasant (sans dodging one kamikaze cyclist) ten-minute walk I arrived at my destination at 9:06 am.

    The attendance was higher than the day before. Very few seats remained empty, as almost fifty people were in the room. During the rushed introductions — I wish people would take their time so that I could see them and write down their and their employers’ names — I heard two more large companies not mentioned in my previous blog post: BBC and Symantec. QUIC is gathering a lot of attention.

    Jana Iyengar’s (Google) Connection Termination presentation was first. A mere eight slides, it engendered three hours of debates:

    • What is the difference between application close and immediate close?
    • Which two purposes was the PING frame originally meant to serve?
    • Are we using transport mechanisms to solve application problems?
    • And so on…

    Detailed explanations of the above are beyond the scope of this post. Suffice it to say, there are enough intricacies here to nourish anyone’s inner pedant. Nevertheless, I felt that a lot of the discussion was centered on figuring out what the terms actually mean rather than the exposition of the problems and their possible solutions. It may be useful to have a glossary of terms to go along with a presentation such as this one. The glossary would be learned beforehand by the participants. That would save a lot of time.

    At the peak of the Connection Termination debates, the queue that Mark Nottingham — who, along with Lars Eggert, chairs the working group — maintained on the whiteboard at times grew to eight or nine entries! That’s nine people who are waiting in line to speak, be it to ask a new question or to address a previous point.

    As the arguments dragged on, Mark treated us to some comic relief. The talk was about what happens to a connection’s buffer queues when it is terminated: Do these queues get drained? If yes, when? The number of people who wanted to speak was large — and so was the queue on the whiteboard. Now, the job of the chair is to keep the meeting focused and on time. To that effect, Mark quipped: “Let’s drain this queue and then continue the [Connection Termination] discussion.” Ha!

    I found myself nodding several times when Praveen Balasubramanian (Microsoft) contrasted QUIC behavior with that of TCP. During one of the breaks I chatted with him and Nick Banks (Microsoft) about TCP and QUIC. It is a wonderful sensation to converse with people who understand you half way before you finish your sentence.

    We continued to talk about Connection Termination some more after lunch, until about 1:30 pm, at which time the conference was nudged to switch to the next topic: streams.

    Now, I don’t know what the heart of QUIC is, but streams are its soul. Without streams, QUIC is as inanimate as a browned, day-old banana peel. First, Mike Bishop (Microsoft) in his presentation argued that we should “more or less keep streams as they are:” that is, bidirectional with a relatively rich set of frames to specify which end should stop sending. Then, Eric Rescorla (Mozilla) — whom most people at the conference address by his nom de guerre, EKR (pronounced Ecker) — reported on unidirectional streams. EKR reimplemented the bidirectional streams of Minq as a pair of unidirectional streams. He reported on some of the gotchas and the apparent pros and cons of each approach.

    The discourse then veered into an almost surreal talk of unidirectional streams that are unpaired, paired, and paired to more than one stream. In other words, having no arity, having 1:1 arity, and having 1:N arity, respectively. Our brains went into overdrive and I could see that people were struggling (or, at least, I hope that it was not just me alone) to grasp all the implications of having this arity buffet available to the application.

    There were many interesting idea exchanges and back-and-forth arguments. I tried to jot down things I did not know about, so that I can research them later. This author even piped in two or three times and, I dare to say, contributed to the discussion in a meaningful way.

    * * *

    It has been a long day and it has been a long post. Tomorrow is the final day of the conference. Good night.

    P. S. I had the good fortune to be seated next to Alan Frindell (Facebook). Having found out that he was a Seattleite, I hurried to express the way I felt about his city during one of the breaks. I told him about the friendly people, the natural beauty of the place, the bike lanes. To top it all off, I said: “And you have a bookstore, man! A bookstore!” Alan looked at me and asked: “Which one do you mean? We have several.” O, Alan! I don’t like Seattle anymore: I love it.

  • NFtR: QUIC Working Group Day One

    NFtR: QUIC Working Group Day One

    Today, October 3rd, was the interop day, allocated for the different IETF QUIC implementations to test interoperability: that is, whether they can talk to each other using the QUIC protocol. …But let me take a step back and start at the beginning.

    I came to the IETF QUIC Working Group (WG) Interim Meeting in Seattle, WA to participate in discussions to iron out the details of the IETF version of the QUIC protocol, which is to become the standard. The drafts under consideration — QUIC Transport, HTTP over QUIC, QUIC Crypto, and the two compression proposals to replace HPACK — QPACK and QCRAM — differ significantly from the current QUIC specifications. Or, rather, the current gQUIC specifications (let’s be precise!) — g is for Google. QUIC has evolved from being simply a transport to better support SPDY to being a generic transport protocol — the next transport protocol for the Internet.

    That sounds somewhat grandiose, but if anyone can pull it off, this group of people can. The interest in QUIC is growing, as evidenced by the attendees: F5 Networks (the conference host); Akamai; Apple; AT&T; Facebook; Google; Microsoft; and several smaller organizations, among which I certainly count ourselves, LiteSpeed Technologies.

    Our own LiteSpeed QUIC does not yet support IETF QUIC. Hence, I spent my time building and reading other projects. There are already a few, to borrow a term, inchoate IETF QUIC implementations, and that is very good.

    It was great to meet, and talk shop with, Marten Seemann (he of the quic-go project) and Jana Iyengar (Chromium), whose code I’ve studied and used to test our own code. I also met Eric Rescorla, whose SSL book I first read fifteen years ago. (If you did programming fifteen years ago, you’ve read his book). I haven’t caught the names of all the people in attendance, but I hope to rectify that over the next two days, when the protocol is to be debated.

    Now it is getting late and it is time to turn down for the night. Perhaps I will re-read a few pages of the new drafts before shutting my eyes. I will dream of QUIC.

    P. S. For lunch, a few of us went across the street to get Thai food from a food truck! Of course, it tasted like one would expect food truck Thai food to taste. You can’t win them all.

  • Developer’s Corner: Why Use LiteSpeed QUIC Library

    Developer’s Corner: Why Use LiteSpeed QUIC Library

    Projects and individuals have expressed interest in having a standalone QUIC library. The newly-released LiteSpeed Client Library is a good choice for many applications.

    When it comes to selecting a working QUIC library, one has few choices:

    • lsquic — standalone QUIC client library;
    • proto-quic — standalone QUIC client and server library; and
    • quic-go — standalone client and server library.

    quic-go may be inconvenient to incorporate if you do not use the Go programming language and I will not comment upon this library further in this post.

    Since the time it was first released in April of last year, proto-quic has been utilized in some projects. Now that Google no longer maintains proto-quic, these projects have a choice to make: maintain proto-quic, or their derivative thereof, themselves or switch to the newly-released LiteSpeed Client Library. For those that have not yet decided which QUIC library they want to use, I list the arguments in favor of the LiteSpeed implementation below:

    LSQUIC Is Actively Maintained

    The LSQUIC Client Library is maintained, whereas proto-quic is not. Integrating Chromium’s QUIC code into your program requires extracting the relevant bits from Chromium and updating them as new QUIC versions appear. On the other hand, the LSQUIC Client Library is a standalone component that we plan to maintain going forward.

    LSQUIC Is Future-Proof

    We use this code ourselves in our own products. We will continue to support the current line of QUIC versions (Google QUIC) and add support for the upcoming IETF versions of QUIC. We are not abandoning this code.

    LSQUIC Is C, proto-quic is C++

    LSQUIC is written in C99, proto-quic in C++11. The LSQUIC Client Library is easy to integrate into both C and C++ projects.

    LSQUIC Offers Versatile APIs

    Not tied to an event loop

    Our QUIC library is not tied to any specific event loop. In fact, it is not tied to an event loop at all — you do not have to use an event loop to drive the library.

    BYO networking code

    LSQUIC does not do its own networking. Instead, it provides a simple “packets in / packets out” interface. This makes the library quite flexible. And portable, too.

    LSQUIC Consumes Fewer Resources

    proto-quic consumes more CPU and memory than the LSQUIC Client Library. This is mainly due to two factors:

    1. proto-quic is part of Chromium, the market-leading browser. As a user application, its job is to provide features to the user (usually just one user on the machine); resource use is a secondary consideration. The LSQUIC Client Library, on the other hand, is born from LiteSpeed’s implementation of QUIC on the server side. We designed the library with scalability in mind.
    2. Pioneering — and experimental — work on QUIC implementation takes place in Chromium. proto-quic code is full of special cases for various experiments and options that are not used in production. The LSQUIC Client Library implements features and options strictly as required by the protocol.

    LSQUIC Codebase Is Small

    The LSQUIC Client Library is approximately 74,000 lines of code (with the core functionality only about 36,000 lines), as counted by wc(1), while Chromium’s QUIC code size is 156,000 lines of code.

    I hope this was convincing. All that’s left is to do this:

    git clone https://github.com/litespeedtech/lsquic-client.git

    From the cutting edge, until next time,

    LiteSpeed QUIC Team.

  • LiteSpeed Open-Sources QUIC Client

    LiteSpeed Open-Sources QUIC Client

    Open-Source QUIC Client

    LiteSpeed Technologies is pleased to announce the release of the LiteSpeed QUIC Client Library under an open-source license. This library supports all of the QUIC versions released in the Chrome browser in the past year — v35, v37, and v39. Support for new QUIC versions, including the upcoming IETF standard, will be added in a timely manner.

    The LSQUIC Client Library is a fully functional QUIC implementation in the C programming language. It has been tested on Linux, FreeBSD, and Mac OS. A working client program is included in the distribution.

    We believe that LiteSpeed’s Open-Source QUIC Client Library is free of major issues, for most of the QUIC code in it is already being used in our own products, LiteSpeed Web Server and Web ADC. Nevertheless, do not hesitate to report any bugs back to us.

    Open-sourcing our QUIC code is a way for LiteSpeed to contribute back to the community and to facilitate the adoption of QUIC.

  • Developer’s Corner: QUIC v39 Added

    Developer’s Corner: QUIC v39 Added

    LiteSpeed is glad to announce support for QUIC1 v39. This is the QUIC version used in Chrome 62, currently available in the Chrome Dev Release Channel.

    The switch from little-endian to big-endian representation in the packet and frame formats was the biggest change with regard to the amount of code that had to be modified. Because we need to support both little-endian (such as QUIC v37 used in Chrome 60) and big-endian QUIC versions, we could not simply replace all instances of the former with the latter. Some modules had to be reorganized and new interfaces were added. While this is a lot of work, I like this sort of refactoring: One is forced to think more clearly about module responsibilities and relationships, and the end result is better code.

    On the protocol side, QUIC v39 introduces a couple of improvements in the way packets are acknowledged, making QUIC more efficient.

    When the next Chrome release becomes stable, our customers will be ready to serve the next version of QUIC.

    From the cutting edge, until next time,

    LiteSpeed QUIC Team.

    —
    1. Technically, the correct way to write it now is Google QUIC, or gQUIC. This differentiates it from IETF QUIC. The IETF QUIC is to become a standard, at which point it will be referred to simply as QUIC.