- [API] Drop support for Q039.
- Improve ACK-queuing logic. Send an ACK once in a while if
peer keeps on sending non-ack-eliciting packets.
- Improve Alt-Svc string: Q050 and later are not included in
the old-style "quic" string.
- Send stateless resets if connection could not be promoted.
- Schedule MAX_DATA if needed when DATA_BLOCKED is received.
- Use ls-qpack 0.11.2 -- needed for server push optimization.
- Code cleanup: handle some error cases, improve logging.
- [BUGFIX] Use ls-qpack 0.11.1
- [OPTIMIZATION] Generate random bytes in batches.
- Change loss_bits transport parameter ID to 0x1057 following latest
draft.
- Randomize period with which PINGs are sent to elicit ACKs.
- Some refactoring and code cleanup.
- [BUGFIX] Invalid read when parsing IETF transport parameters
(this was benign).
- [OPTIMIZATION] Frame bundling when using buffered packets in
IETF QUIC: a) flush QPACK decoder stream and b) include ACKs
in opportunistic fashion.
- Fix HTTP/3 framing unit test.
- Code cleanup.
- [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.
- [HTTP3] Verify number of bytes in incoming DATA frames against
content-length.
- [HTTP3] Stop issuing streams credits if peer stops opening QPACK
decoder window. This addresses a potential attack whereby client
can cause the server to keep allocating memory. See Security
Considerations in the QPACK draft.
- [BUGFIX] Mini conn: don't shorten max packet size for Q050 and later.
- [BUGFIX] Init IETF connection flow controller using correct setting.
- Code cleanup and minor fixes.
- [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.
- [FEATURE] Add support for Q050.
- [OPTIMIZATION] Reduce mallocs in gQUIC handshake.
- [BUGFIX] Disable redo of failed STREAM frame insertion with debug
logging.
- [DEBUG] Further dedup next advisory tick messages when reason is
the same.
- [BUGFIX] Update size of `a` array in TP struct. Fixes (benign)
GitHub bug #94.
- Use Cubic by default again instead of BBR, as it delivers more
consistent performance.
- [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.
- [BUGFIX] client: don't call ignore_init() in middle of batch send.
ignore_init() makes an assumption that the send controller has access
to all outgoing packets. This change wraps a few IETF full connection
methods to delay calling ignore_init() until the engine returns all
outgoing packets that were batched.
- [BUGFIX] set errno to EAGAIN if sendmmsg() can't send all of them.
This needs to be done because the value of errno may be lost on
some platforms.
- [BUGFIX] Typo that set all bits in sm_qflags lead to crashes.
- [BUGFIX] Do not cancel header block processing after failure, as
QPACK releases the reference in that case.
- [CLEANUP] IETF encrypt: replace assert(0) with a warning.
- Several small improvements to the test server.
- [API, FEATURE] Close connection immediately when ea_packets_out()
fails with errno != EAGAIN. The API change is that errno is now
examined. Make sure to set it if using something other than
sendmsg() to send packets.
- [CLEANUP] Immediate close logic in IETF full conn.
- [CLEANUP] Fix bogus warning about uninitialized `pair' variable.
- [BUGFIX] set retry token on all resubmitted packets.
- Event log: log sent packet flags. In particular, this allows one
to see whether token was sent.
- Don't migrate client if es_allow_migration is false.
- [BUGFIX] Fix double-free when emptying a packet number space.
- [BUGFIX] http_server: fix md5sum handler: handle EOF correctly.
- [BUGFIX] Use random values in bits 4 and 5 of the first byte of
verneg packets (regression introduced in 2.5.0).
- [OPTIMIZATION] Don't compile in expensive attq checks by default.
- [OPTIMIZATION] http_server: compile regexes only once.
- [API] lsquic_engine_connect() can now be passed QUIC version to use.
- [OPTIMIZATION] Queue opportunistic ACKs if there is data to be sent.
- [BUGFIX] Don't evict streams from priority iterator if there is
only one queue.
- [OPTIMIZATION, BUGFIX] Several other optimizations and bug fixes.
- Use ls-qpack v0.10.7.
- [BUGFIX] IETF QUIC server: fix uninitialized variable use.
- [BUGFIX] make sure TLSv1.3 is not disabled in SSL object.
- [BUGFIX] Use issuer name and serial number to cache certs (SKID
values are not unique).
- [BUGFIX] Always set the idle alarm in IETF connection so that it
can time out.
- 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.
- Minor code cleanup and logging improvements.
- Server and client programs: include library version (e.g. 2.4.6)
into `server' and `user-agent' headers.
- [OPTIMIZATION]: flush encoder stream only when necessary.
- [BUGFIX] Use ls-qpack v0.10.2 for new API -- and for a bug fix.
- [BUGFIX] Typo in IETF conn SETTINGS writer.
- Use latest BoringSSL.
- [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.
- Add GQUIC versions to the list of h3 ALPNs for Alt-Svc header.
For example, h3-Q043. Chrome will switch to using this format at
some point in the future.
- [BUGFIX] Send correct value in max_streams_uni transport param
- [SPEC] Abort IETF QUIC connection if max_early_data_size is not set
to 0xFFFFFFFF
- [BUGFIX] H3 framing: fix zero-byte write when space is available
- [BUGFIX] Don't send STREAM frame when incoming unidirectgional stream
is closed
- [BUGFIX] Cancel all pending writes by stream reset by a GOAWAY
- [BUGFIX] Fix use-after-free in IETF full conn
- [OPTIMIZATION] Wait for session tickets for two seconds and then drop
SSL object and crypto streams.
- [BUGFIX] If FIN or RST not received, don't delay stream destruction.
- [OPTIMIZATION] Speed up HPACK encoder by using same hash value to
search static and dynamic tables.
- [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.
- [BUGFIX] Use correct public key from PUBS based on KEXS index.
- [BUGFIX] Check flags before dispatching writes, avoiding assert.
- [BUGFIX] Set :scheme to "https" (instead of "HTTP").
- [BUGFIX] Check buffer bounds when looking up version in 0-RTT blob.
- [BUGFIX] http_client: don't fetch 0-rtt info if handshake failed.
- Log number of pacer calls at DEBUG, rather than NOTICE, level.
- [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.
- [FEATURE, API Change] 0-RTT support. Add function to export 0-RTT
information; it can be supplied to a subsequent connect() call.
- [FEATURE] Add -0 flag to http_client to exercise 0-RTT support.
- [BUGFIX] Resuscitate the Windows build.
- [BUGFIX] Send HTTP settings (max header list size) if necessary.
- [BUGFIX] Buffered packets can contain ACK frames.
- [BUGFIX] Make packet writeable once all STREAM frames are elided.
- [BUGFIX] Fix potential null dereference when realloc fails.
- cmake: simplify build configuration.
- [API Change] Can specify clock granularity in engine settings.
- [BUGFIX] Pacer uses fixed clock granularity. Since the change on
2018-04-09, it is not necessary to try to approximate the next tick
time in the pacer: it can use fix clock granularity specified by
the user.
- [BUGFIX] Do not tick constantly before handshake is done.
- [BUGFIX] Do not exit tick prematurely: reuse packet with ACK. Even
if we cannot allocate *more* packets, we could still be able to write
to one already allocated.
- [BUGFIX] Do not schedule pacer if there are no lost packets.
- [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.
- [FEATURE] http_client can now collect stats: time to connect, TTFB,
time to download, requests per seconds, and bandwidth. See -t flag.
- [BUGFIX] http_client: -B, -K, and -r can be used at the same time.
- [BUGFIX] http_client: do not display cert chain before each request.
Now this is only done once per connection, if the handshake is
successful and -a option is given.
- [BUGFIX] Do not wait to dispatch on_close() after reading. If a
stream is scheduled to be closed after on_read() callback returns,
close it immediately instead of waiting until the end of the tick.
If client creates new request from on_close() event, they will be
processed in the same tick instead of waiting for the next one.
- [BUGFIX] HEADERS stream is critical: always treat it with highest
priority.
- Add failsafe: resume sending packets after some time
The change puts a 1-second limit on the amount of time the engine
will not send packets after some packets are delayed. This makes
the library robust in case the user does not unblock the engine
explicitly using lsquic_engine_send_unsent_packets() call.
- [BUGFIX] Handle corner cases in send controller when packets are
a) delayed or b) dropped during repackaging.
- [BUGFIX] Memory leak: destroy buffered packets during controller
cleanup.
- [BUGFIX] Memory leak in test_frame_rw unit test.
- [BUGFIX] Parsing packets with short IETF header: do not overwrite
flags. (Only a problem in unit tests -- benign otherwise.)
- [API Change] Packet out Memory Interface (PMI) update:
- Split PMI pool return into pmi_release and pmi_return
- PMI callbacks take peer_ctx and is_ipv6 arguments
- [BUGFIX] Fix use-after-free when certificate is updated
- Silence gcc warning in optimized mode by performing useless
initialization
- cmake: use the standard variable CMAKE_BUILD_TYPE instead of
DEVEL_MODE
- [BUGFIX] Do not abort conn on STREAM frame for a reset stream
- [BUGFIX] Drop packets that would become empty due to repackaging.
Packets on the scheduled queue may be marked for repackaging.
Frames such as ACK frame that are never resent are removed from
repackaged packets. We must check that the newly repackaged packet
would not be empty. If it would be, it is destroyed instead and
the next packet on the scheduled queue is used. Note that this
change only affects the logic to return the next packet to be sent.
Lost packets that are being rescheduled are already processed in
this fashion.
- Byteswap CID before logging it - this makes it match Chrome CIDs.
(Except Q035, which is the last little-endian GQUIC version we
support.)
- [API Change] Disable packet sending if full batch cannot be sent
If lsquic_packets_out_f() cannot send the whole batch, disable
packet sending until lsquic_engine_send_unsent_packets() is called.
- [BUGFIX] Handle case when STREAM frame does not fit.
- [BUGFIX] Always allow incoming STREAM frames to overlap. Peers
may send overlapping STREAM frames even if using versions older
than Q043.
- Custom header set fixes:
- set "FIN reached" flag when custom header with FIN flag is
claimed;
- do not return custom header set for a reset stream.
Add ability to create custom header set objects via callbacks.
This avoids reading and re-parsing headers from the stream.
See test/http_client.c for example implementation. (Use -B flag
to turn it on).
- 1.10.1
- [BUGFIX] process connections after each batch of packets is read
This avoids a problem of accumulating a very large list of packets
(possible when speeds are high and socket's receive buffer is large)
and processing it all at once.
- If glibc is older than 2.17, link with rt. This is necessary for
clock_getres(2).
- Add version macros to lsquic.h; remove unnecessary includes.
Use the original method of tracking connections by CIDs by default.
If zero-sized CID support is turned on, connections are tracked by
the address. A new connection is not created if another connection
is using the same network address.
- Remove comment: MSPC is obsolete (no code changes)
- Prog: use lsquic_str2ver() when processing -o version flag
- Remove unused CTIM and SRBF transport parameters
- Disable QUIC versions Q037 and Q038 by default
- Fix Windows compilation by including compat header file in lshpack.c
- Address warnings produced by newer versions of gcc
- Future-proof: turn off -Werror
- 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.
- Fix busy loop: tickable must make progress. When connection is
self-reporting as tickable, it must make progress when ticked. There
are two issues:
1. If there are buffered packets, the connection is only tickable if
they can be sent out.
2. A connection is tickable if there are streams on the servicing
queue. When the tick occurs, we must service the stream
independent of whether any packets are sent.
- Fix assertion in pacer which can be incorrect under some
conditions.
- cmake: do not turn on address sanitizer if in Travis.
- [BUGFIX] Add connection to Tickable Queue on stream write
- cmake: use MSVC variable instead of trying to detect
- engine: improve connection incref/decref logging
- stream: don't ignore errors that may occur on triggered flush
- connection: remove obsolete method
- engine: indicate connection as tickable if previous call went
over threshold
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.
- [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()
- [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.
- [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.
- Do not send RST_STREAM when stream is closed for reading
- Raise maximum header size from 4K to 64K
- Check header name and value lengths against maximum imposed by HPACK
- Fix NULL dereference in stream flow controller
- Hide handshake implementation behind a set of function pointers
- Use monotonically increasing clock
- Make sure that retx delay is not larger than the max of 60 seconds