Commit Graph

38 Commits

Author SHA1 Message Date
Dmitri Tikhonov 71eb4000ac Release 2.26.1
- [BUGFIX] Migration corner cases: drop or pad over path challenge
  and response frames when necessary.
- Fix stream unit test.
2020-12-17 14:39:51 -05:00
Dmitri Tikhonov fcbdf653b6 Release 2.26.0
- [OPTIMIZATION] Adjust packet reordering threshold when spurious losses
  are detected.
- [API] Pass pointer to local sockaddr to ea_get_ssl_ctx() callback.
2020-12-09 09:11:03 -05:00
Dmitri Tikhonov f38b395a31 Release 2.24.5
- [FEATURE] Improve Delayed ACKs extension and turn it on by default.
- Limit receive history to a finite amount of memory.
2020-11-24 08:51:36 -05:00
Dmitri Tikhonov 2ed07212e5 Release 2.24.3
- [BUGFIX] Get rough RTT estimate on receipt of Handshake packet.
  This prevents BBR on the client from miscalculating pacing rate,
  slowing down sending of ACK packets.
- [BUGFIX] Packets sent during handshake are app-limited.
- [BUGFIX] Bandwidth sampler starts in app-limited mode.
- [BUGFIX] Memory leak: free QPACK handler context in stream dtor.
- Logging improvements.
2020-11-11 07:50:03 -05:00
Dmitri Tikhonov 04f8f447b2 Release 2.23.0
- [FEATURE] IETF Client 0-RTT support.
- [BUGFIX] Do not schedule MTU probe on first tick.
- [BUGFIX] Parsing DATAGRAM frame.
- [BUGFIX] If push promise fails, do not invoke hset destructor.
- [BUGFIX] Client: When connections are IDed by port number, check DCID.
  Fixes issue #176.
- Revert the 2.22.1 lsquic_is_valid_hs_packet change.  All that was
  necessary is a change to the way we call it in lsquic_engine.  No
  change to the function itself is required.
2020-10-13 08:20:25 -04:00
Dmitri Tikhonov fbc6cc0413 Release 2.22.0
- [FEATURE] Extensible HTTP Priorities (HTTP/3 only).
- [FEATURE] Add conn context to packet-out memory interface (PR #175).
- [BUGFIX] gQUIC proof generation: allocate buffer big enough for
  signature (issue #173).
- [BUGFIX] Make library thread-safe: drop use of global variables
  (issue #133, issue #167).
- [BUGFIX] Deactivate only *recent* HQ frame, not any HQ frame.
- [BUGFIX] gQUIC server: associate compressed cert with SSL_CTX,
  instead of keeping them in a separate hash, potentially leading
  to mismatches.
- [BUGFIX] Stream data discard infinite loop: break on FIN.
- cmake: add install target via -DCMAKE_INSTALL_PREFIX (PR #171).
- Support randomized packet number to begin a connection.
- Mini and full IETF connection size optimization.
- http_client: specify HTTP priorities based on stream conditions.
2020-10-07 09:41:26 -04:00
Dmitri Tikhonov b1a7c3f944 Release 2.20.0
- [FEATURE] QUIC and HTTP/3 Internet Draft 30 support.
- [FEATURE] Unreliable Datagram Extension support.
- [FEATURE] Adaptive congestion controller.
- [BUGFIX] Do not send MAX_STREAM_DATA frames on crypto streams.
- [BUGFIX] Fail with CRYPTO_BUFFER_EXCEEDED when too much CRYPTO
  data comes in.
- [BUFFIX] Spin bit is now strictly per path; value is reset on
  DCID change.
- [BUGFIX] Check that max value of max_streams_uni and
  max_streams_bidi TPs is 2^60.
- [BUGFIX] Close IETF mini conn immediately if crypto session
  cannot be initialized.
- Deprecate ID-28 (no browser uses it): it's no longer in the
  default versions list.
- New programs duck_server and duck_client that implement the
  experimental siduck-00 protocol.  They quack!
- IETF crypto streams: don't limit ourselves from sending.
- Command-line programs: turn off QL loss bits if -G is used, as
  Wireshark cannot decrypt QUIC packets when this extension is used.
- Turn all h3 framing unit tests back on.
- Fix malo initialization when compiled in no-pool mode.
2020-09-15 16:42:13 -04:00
Dmitri Tikhonov 2f2f436324 Release 2.19.9
- [FEATURE] Add lsquic_stream_pwritev().  This function allows one to
  reduce the number of system calls required to read a file from disk
  by using lsquic_stream_pwritev() together with preadv(2).
- [BUGFIX] When stream is reset, it is writeable -- let user collect
  the error.
- [BUGFIX] Calculate correct conn flow control if reading ends early.
- [BUGFIX] Remove stream from read and write queues on internal
  shutdown.  This is a regression introduced in 2.19.7.
- [BUGFIX] Swapped arguments in IETF RESET_FRAME generation.
- Turn off mini conn history when compiling with Visual Studio; this
  allows the project to compile on Windows again.
- http_client: Add -3 flag to stop reading from streams early; code
  cleanup.
- Don't use -Werror.
2020-09-08 11:43:03 -04:00
Dmitri Tikhonov 49f1f4f620 Release 2.19.8
- [FEATURE] Update the timestamp extension to latest version.
- [FEATURE] Cope with appearance of ECN blackholes.
- [OPTIMIZATION] return packno offset and size when header is generated.
- [BUGFIX] ignore old ACK frames in mini conns.
- [BUGFIX] Mark initial server path as initialized.
- [BUGFIX] Do not merge ACK if ECN counts do not match.
- Turn incoming packet number history in mini conn back on.
- Record mini conn event history again when compiled in debug mode.
- IETF mini conn: log when ACK is queued.
- Clean up and refactor code in several places.
2020-09-02 09:03:19 -04:00
Dmitri Tikhonov 93e1e886ef Release 2.19.6
- Don't process incoming ECN marks if ECN is not enabled.
- Schedule ACK when incoming packet is marked with CE.
2020-08-20 14:02:51 -04:00
Dmitri Tikhonov b8fa619567 Release 2.19.0
- [FEATURE] DPLPMTUD support.  IETF connections now search for the
  maximum packet size, improving throughput.
- [DEBUG] Record event in stream history when on_close() is called
  in dtor.
2020-07-29 11:33:52 -04:00
Dmitri Tikhonov 4051ae3a1a Release 2.17.0
- [FEATURE] QUIC and HTTP/3 Internet Draft 29 support.
- [BUGFIX] Check that scheduled packets are also sendable when
  calculating a connection's "tickable" property.
- [BUGFIX] Don't count scheduled packets as in-flight when pacer is
  checked on tick.
- gQUIC: delay calling on_new for pushed stream until headers are
  available.
- Allow nested calls to lsquic_engine_connect().
2020-06-18 09:45:44 -04:00
Dmitri Tikhonov b55a5117d9 Release 2.14.6
- [BUGFIX] Fix amplification mitigation in 0-RTT case.
- [BUGFIX] IETF mini connection should not tickable if cannot send
  a packet due to amplification.
- [BUGFIX] Fail if active_connection_id_limit TP is smaller than 2.
- [BUGFIX] Qlog server certificates for IETF QUIC connections.
- [BUGFIX] Uninitialized struct padding usage in tokgen (benign).
- [BUGFIX] Incorrect argument to shi_lookup() (benign).
2020-05-06 09:38:32 -04:00
Dmitri Tikhonov a5fa05f958 Release 2.13.0
- [API] Use lsxpack_header structure to process incoming headers.
- [BUGFIX] Fix assertion when zero-padding Initial packet.
- [BUGFIX] Use idle timeout before we learn of peer's value.
- Use ls-hpack 2.0.0 -- has lsxpack_header changes.
- Use ls-qpack 0.14.0 -- new, common with ls-hpack, XXH seed (not used yet).
- Code cleanup: prefix exported functions with "lsquic_".
2020-03-12 09:02:56 -04:00
Dmitri Tikhonov feca77f50d Add experimental support for delayed ACKs extension 2020-02-21 14:26:25 -05:00
Dmitri Tikhonov 8c1565cb1c Release 2.10.2
- [BUGFIX] Do not delay ACKs for Initial and Handshake packets.
- [BUGFIX] Send PATH_CHALLENGE if path changed before mini conn promotion.
- Logging improvements.
- http_client: discard data faster.
2020-01-30 17:12:47 -05:00
Dmitri Tikhonov 7d09751dbb Release 2.8.7
- [BUGFIX] Initial packet size check for IETF mini conn applies to
  UDP payload, not QUIC packet.
- Support old and new school loss_bits transport parameter.
- Use Q run length of 64 as suggested in the loss bits Draft.
- Undo square wave count when packet is delayed.
- Code cleanup; minor fixes.
2020-01-09 11:52:25 -05:00
Dmitri Tikhonov de46bf2f1f Release 2.8.1
- [FEATURE] Use occasional packet number gaps to detect optimistic
  ACK attacks.
- [BUGFIX] Q050 client: all packet numbers are in the App PNS.
- [OPTIMIZATION] Merge multi-range ACK frames, not just single-range
  ACK frames.
- IETF QUIC: use RTT estimate in ack timeout calculation.
- IETF handshake: abort conn when unexpected errors occur.
- Use PING rather than MAX_DATA frames to elicit ACKs from peer.
- Server: enforce 1200 byte Initial minimum packet size.
- [CLEANUP] Remove code to disable gQUIC crypto.
- [CLEANUP] Remove n_timestamps from ACK info struct.
- Optimize driver: reuse previous ancillary message when possible.
2019-12-30 11:29:05 -05:00
Dmitri Tikhonov a137764bf2 Release 2.7.2
- [BUGFIX] Send controller: update scheduled bytes when DCID length
  changes (IETF client).
- [BUGFIX] Drop alarm check from sanity test.  It no longer works now
  that we use loss chains.
- [PORTABILITY] Fix build on Alpine Linux.
- [PORTABILITY] Fix build using XCode.
- Client initial DCID length: use RAND_bytes() instead of rand(3).
- Add unit tests for connection min heap.
- [DEBUG] Log CID in gQUIC handshake module
- [DEBUG] Turn on extra checks for IETF client send controller.
- [DEBUG] Dedup next advisory tick messages when reason is IDLE timer.
- [DEBUG] QPACK decoder handler: log header error code.
2019-12-11 09:38:58 -05:00
Dmitri Tikhonov 02b6086dba Release 2.6.7
- [FEATURE] Implement the QL extension (offered by default).
- [BUGFIX] Abort when encountering unexpected HTTP/3 frames.
- [BUGFIX] Acknowledge (QPACK) HTTP/3 trailers correctly.
- [DEBUG] Turn on debug message for next advisory tick.
2019-11-22 00:40:05 -05:00
Dmitri Tikhonov 03e6b668ec Release 2.6.0
- [FEATURE] QUIC and HTTP/3 Internet Draft 24 support
2019-11-07 16:19:03 -05:00
Dmitri Tikhonov 0adf085acf Release 2.4.7
- Add echo client and server to the distibution.
- Add MD5 client and server to the distibution.
- Fix http_client: check command-line arguments better, prevent crash.
- Fix IETF conn: can_write_ack() should only care about APP PNS.
- Client: delay stream creation until handshake succeds.
- Reset HTTP stream whose write end is closed prematurely.
- Fix tickable(): mirror behavior of tick() wrt buffered packets.
- Log reason why engine is tickable.
2019-10-15 17:04:14 -04:00
Dmitri Tikhonov 662de5e197 Release 2.4.4
- [API] Add lsquic_alpn2ver() to aid parsing Alt-Svc header.
- [BUGFIX] NULL dereference when H3 frame header would be split.
- [BUGFIX] Do not close fixed-size H3 frame prematurely.
- [BUGFIX] Allow PING frames in IETF mini conn.
- [BUGFIX] Mini conns: don't send any packets after receiving
  CONNECTION_CLOSE.
- [BUGFIX] Client migration: reserve slot for DCID from transport params.
- [BUGFIX] Allow max_early_data_size=0 -- early_data might not be there.
- [BUGFIX] Use an invalid stream number to reset BPT cache (zero is now a
  valid stream number).
- [SPEC] Use FINAL_SIZE_ERROR when FIN mismatch is detected.
- [OPTIMIZATION] Closed connection only gets one chance to send packets.
- [OPTIMIZATION] Flush headers stream before packetizing stream data.
- [OPTIMIZATION] process QPACK encoder STREAM frames immediately.
- Update ls-qpack to v0.10.1.
2019-10-08 08:36:49 -04:00
Dmitri Tikhonov 92f6e17bdc Release 2.4.0
[FEATURE] QUIC and HTTP/3 Internet Draft 23 support
2019-09-18 11:22:20 -04:00
Dmitri Tikhonov cca2541523 Release 2.3.0
- [FEATURE] BBR congestion control is on by default
- [BUGFIX] BBR app-limited logic
- [BUGFIX] Fix uninitialized warnings in IETF
- [BUGFIX] Update ls-qpack to v0.9.14
- [CLEANUP] Code cleanup
2019-09-12 14:39:50 -04:00
LiteSpeed Tech 5392f7a3b0
Release 2.2.0: server included, ID-22 supported (#76) 2019-09-11 11:27:58 -04:00
Dmitri Tikhonov c7d81ce135 Release 1.20.0
[FEATURE] Add support for Q046.
2019-04-01 11:41:55 -04:00
Dmitri Tikhonov 428530e38e Release 1.19.6
- [BUGFIX] Ensure that Largest Observed does not decrease in ACKs we
  send.  ACK frames placed in packets in buffered queues (optimization
  introduced in 1.17.15) can be preceded by an ACK frame generated later.
  In this case, the older ACK frame should not be sent out, as Chromium-
  based servers flags decrease in the ACK frame's Largest Observed value
  as an error.
2019-03-19 16:23:50 -04:00
Dmitri Tikhonov 9c4445241e Release 1.19.3
- [BUGFIX] Q044: don't encode packet number in 6 bytes.  Six-byte
  packet number encoding does not exist in Q044.  This fixes a
  regression introduced in '[BUGFIX] Buffered packets can contain
  ACK frames' -- we need to keep QUIC version in mind when selecting
  the longest possible packet number encoding used for the buffered
  packet that carries the ACK.
- [BUGFIX] Do not increase CWND when timeout occurs.
- http_client: support setting handshake timeout on command line.
  Use -o handshake_to=timeout.
- http_client: use -k to connect UDP socket to pick up ICMP errors.
- http_client: allow pathless mode, when only handshake is performed
  without issuing any requests.  This can be done by simply not
  specifying a -p flag on the command line.
2019-02-18 08:40:51 -05:00
Dmitri Tikhonov 4d83f5bd45 Release 1.17.15
- [BUGFIX] http_client: make sure only one read per on_read() callback
  is performed in the header conversion bypass (-B) mode.
- http_client: with -E, assign random priority when stream is created.
- [OPTIMIZATION] On immediate write, place an ACK frame into the first
  buffered packet if an ACK is queued.  This reduces the number of
  standalone ACK packets.
- [OPTIMIZATION] Allow placing more than one STREAM frame from the same
  stream into an outgoing packet.  This change minimizes the number of
  buffered packets required to store several small HTTP messages by
  virtue of allowing more than one STREAM frame from HEADERS stream in
  the same packet.
- [OPTIMIZATION] Flush headers when writing to buffered packets.  This
  causes the headers to be written to the same buffered packet queue,
  thereby improving packet utilization, especially for small HTTP
  messages.
2019-01-21 09:07:02 -05:00
Dmitri Tikhonov 229fce07a3 Release 1.17.11
Fix strict aliasing warning in when compiling with optimizations
2019-01-03 11:48:45 -05:00
Dmitri Tikhonov aa0d8cfff0 Latest changes
- Do not create gap in sent packnos when squeezing delayed
  packets.
- sendctl checks for all unacked bytes, not just retx bytes.
- connections with blocked scheduled packets are not tickable
  for sending.
2018-04-25 10:58:55 -04:00
Dmitri Tikhonov e8bd737db4 [API Change, OPTIMIZATION] Only process conns that need to be processed
The API is simplified: do not expose the user code to several
queues.  A "connection queue" is now an internal concept.
The user processes connections using the single function
lsquic_engine_process_conns().  When this function is called,
only those connections are processed that need to be processed.
A connection needs to be processed when:

    1. New incoming packets have been fed to the connection.
    2. User wants to read from a stream that is readable.
    3. User wants to write to a stream that is writeable.
    4. There are buffered packets that can be sent out.  (This
       means that the user wrote to a stream outside of the
       lsquic library callback.)
    5. A control frame (such as BLOCKED) needs to be sent out.
    6. A stream needs to be serviced or delayed stream needs to
       be created.
    7. An alarm rings.
    8. Pacer timer expires.

To achieve this, the library places the connections into two
priority queues (min heaps):

    1. Tickable Queue; and
    2. Advisory Tick Time queue (ATTQ).

Each time lsquic_engine_process_conns() is called, the Tickable
Queue is emptied.  After the connections have been ticked, they are
queried again: if a connection is not being closed, it is placed
either in the Tickable Queue if it is ready to be ticked again or
it is placed in the Advisory Tick Time Queue.  It is assumed that
a connection always has at least one timer set (the idle alarm).

The connections in the Tickable Queue are arranged in the least
recently ticked order.  This lets connections that have been quiet
longer to get their packets scheduled first.

This change means that the library no longer needs to be ticked
periodically.  The user code can query the library when is the
next tick event and schedule it exactly.  When connections are
processed, only the tickable connections are processed, not *all*
the connections.  When there are no tick events, it means that no
timer event is necessary -- only the file descriptor READ event
is active.

The following are improvements and simplifications that have
been triggered:

    - Queue of connections with incoming packets is gone.
    - "Pending Read/Write Events" Queue is gone (along with its
      history and progress checks).  This queue has become the
      Tickable Queue.
    - The connection hash no longer needs to track the connection
      insertion order.
2018-04-09 09:39:38 -04:00
Dmitri Tikhonov 10c492f0b6 Update copyright year; add CONTRIBUTORS.txt 2018-04-02 15:17:56 -04:00
Dmitri Tikhonov 16a9b66aaa Latest changes
- [OPTIMIZATION] Merge series of ACKs if possible

  Parsed single-range ACK frames (that is the majority of frames) are
  saved in the connection and their processing is deferred until the
  connection is ticked.  If several ACKs come in a series between
  adjacent ticks, we check whether the latest ACK is a strict superset
  of the saved ACK.  If it is, the older ACK is not processed.

  If ACK frames can be merged, they are merged and only one of them is
  either processed or saved.

- [OPTIMIZATION] Speed up ACK verification by simplifying send history.

  Never generate a gap in the sent packet number sequence.  This reduces
  the send history to a single number instead of potentially a series of
  packet ranges and thereby speeds up ACK verification.

  By default, detecting a gap in the send history is not fatal: only a
  single warning is generated per connection.  The connection can continue
  to operate even if the ACK verification code is not able to detect some
  inconsistencies.

- [OPTIMIZATION] Rearrange the lsquic_send_ctl struct

  The first part of struct lsquic_send_ctl now consists of members that
  are used in lsquic_send_ctl_got_ack() (in the absense of packet loss,
  which is the normal case).  To speed up reads and writes, we no longer
  try to save space by using 8- and 16-bit integers.  Use regular integer
  width for everything.

- [OPTIMIZATION] Cache size of sent packet.

- [OPTIMIZATION] Keep track of the largest ACKed in packet_out

  Instead of parsing our own ACK frames when packet has been acked,
  use the value saved in the packet_out structure when the ACK frame
  was generated.

- [OPTIMIZATION] Take RTT sampling conditional out of ACK loop

- [OPTIMIZATION] ACK processing: only call clock_gettime() if needed

- [OPTIMIZATION] Several code-level optimizations to ACK processing.

- Fix: http_client: fix -I flag; switch assert() to abort()
2018-03-09 14:17:39 -05:00
Dmitri Tikhonov bfc7bfd842 Latest changes
- [API Change] lsquic_engine_connect() returns pointer to the connection
  object.
- [API Change] Add lsquic_conn_get_engine() to get engine object from
  connection object.
- [API Change] Add lsquic_conn_status() to query connection status.
- [API Change] Add add lsquic_conn_set_ctx().
- [API Change] Add new timestamp format, e.g. 2017-03-21 13:43:46.671345
- [OPTIMIZATION] Process handshake STREAM frames as soon as packet
  arrives.
- [OPTIMIZATION] Do not compile expensive send controller sanity check
  by default.
- [OPTIMIZATION] Add fast path to gquic_be_gen_reg_pkt_header.
- [OPTIMIZATION] Only make squeeze function call if necessary.
- [OPTIMIZATION] Speed up Q039 ACK frame parsing.
- [OPTIMIZATION] Fit most used elements of packet_out into first 64 bytes.
- [OPTIMIZATION] Keep track of scheduled bytes instead of calculating.
- [OPTIMIZATION] Prefetch next unacked packet when processing ACK.
- [OPTIMIZATION] Leverage fact that ACK ranges and unacked list are.
  ordered.
- [OPTIMIZATION] Reduce function pointer use for STREAM frame generation
- Fix: reset incoming streams that arrive after we send GOAWAY.
- Fix: delay client on_new_conn() call until connection is fully set up.
- Fixes to buffered packets logic: splitting, STREAM frame elision.
- Fix: do not dispatch on_write callback if no packets are available.
- Fix WINDOW_UPDATE send and resend logic.
- Fix STREAM frame extension code.
- Fix: Drop unflushed data when stream is reset.
- Switch to tracking CWND using bytes rather than packets.
- Fix TCP friendly adjustment in cubic.
- Fix: do not generate invalid STOP_WAITING frames during high packet
  loss.
- Pacer fixes.
2018-02-26 16:01:16 -05:00
Dmitri Tikhonov c51ce3387f Latest changes
- [API Change] Sendfile-like functionality is gone.  The stream no
  longer opens files and deals with file descriptors.  (Among other
  things, this makes the code more portable.)  Three writing functions
  are provided:

    lsquic_stream_write
    lsquic_stream_writev
    lsquic_stream_writef    (NEW)

  lsquic_stream_writef() is given an abstract reader that has function
  pointers for size() and read() functions which the user can implement.
  This is the most flexible way.  lsquic_stream_write() and
  lsquic_stream_writev() are now both implemented as wrappers around
  lsquic_stream_writef().

- [OPTIMIZATION] When writing to stream, be it within or without the
  on_write() callback, place data directly into packet buffer,
  bypassing auxiliary data structures.  This reduces amount of memory
  required, for the amount of data that can be written is limited
  by the congestion window.

  To support writes outside the on_write() callback, we keep N
  outgoing packet buffers per connection which can be written to
  by any stream.  One half of these are reserved for the highest
  priority stream(s), the other half for all other streams.  This way,
  low-priority streams cannot write instead of high-priority streams
  and, on the other hand, low-priority streams get a chance to send
  their packets out.

  The algorithm is as follows:

  - When user writes to stream outside of the callback:
    - If this is the highest priority stream, place it onto the
      reserved N/2 queue or fail.
        (The actual size of this queue is dynamic -- MAX(N/2, CWND) --
         rather than N/2, allowing high-priority streams to write as
         much as can be sent.)
    - If the stream is not the highest priority, try to place the
      data onto the reserved N/2 queue or fail.
  - When tick occurs *and* more packets can be scheduled:
    - Transfer packets from the high N/2 queue to the scheduled
      queue.
    - If more scheduling is allowed:
      - Call on_write callbacks for highest-priority streams,
        placing resulting packets directly onto the scheduled queue.
    - If more scheduling is allowed:
      - Transfer packets from the low N/2 queue to the scheduled
        queue.
    - If more scheduling is allowed:
      - Call on_write callbacks for non-highest-priority streams,
        placing resulting packets directly onto the scheduled queue

  The number N is currently 20, but it could be varied based on
  resource usage.

- If stream is created due to incoming headers, make headers readable
  from on_new.

- Outgoing packets are no longer marked non-writeable to prevent placing
  more than one STREAM frame from the same stream into a single packet.
  This property is maintained via code flow and an explicit check.
  Packets for stream data are allocated using a special function.

- STREAM frame elision is cheaper, as we only perform it if a reset
  stream has outgoing packets referencing it.

- lsquic_packet_out_t is smaller, as stream_rec elements are now
  inside a union.
2017-10-31 09:35:58 -04:00
Dmitri Tikhonov 50aadb33c7 LSQUIC Client: Initial release 2017-09-22 17:00:03 -04:00