CHANGELOG revision ccd74161
12018-07-10 2 3 - 1.10.1 4 - [BUGFIX] process connections after each batch of packets is read 5 This avoids a problem of accumulating a very large list of packets 6 (possible when speeds are high and socket's receive buffer is large) 7 and processing it all at once. 8 - If glibc is older than 2.17, link with rt. This is necessary for 9 clock_getres(2). 10 - Add version macros to lsquic.h; remove unnecessary includes. 11 122018-06-13 13 14 - [BUGFIX] allow multiple parallel connections by default 15 16 Use the original method of tracking connections by CIDs by default. 17 If zero-sized CID support is turned on, connections are tracked by 18 the address. A new connection is not created if another connection 19 is using the same network address 20 212018-05-30 22 23 - [FEATURE, API CHANGE] Support zero-sized CIDs in received packets 24 252018-05-24 26 27 - Close connection properly when packet encryption fails 28 292018-05-23 30 31 - [BUGFIX] Do not produce packet sequence gaps due to delayed packets 32 332018-05-21 34 35 - [API Change] Add optional callback to call when handshake is done 36 - [API Change, BUGFIX] After send failure, wait until transport available 37 382018-05-18 39 40 - [API] Expose useful lsquic_ver2str[] in lsquic.h 41 - [BUGFIX] Do not produce packet sequence gaps due to STREAM frame elision 42 - Improve checks of number of incoming streams limit and associated 43 error reporting. 44 - [BUGFIX] Command-line option `-6` now works correctly. 45 462018-05-16 47 48 - [FEATURE] DNS resolution 49 - [BUGFIX] Frame insertion mis-ID as overlap instead of dup 50 - http_client: fix priority range generated by -E flag 51 522018-05-09 53 54 - [FEATURE] Add support for Q043. 55 - Support for versions Q037, Q038, Q041, and Q042 has been removed. 56 - Fix typo in debug message. 57 - Fix code indentation. 58 - Add /* fallthru */ comment to stop newer gcc from complaining. 59 - Logger: fix compilation of optimized Windows build. 60 612018-05-04 62 63 - [FEATURE] Add support for Q042. 64 - Remove comment: MSPC is obsolete (no code changes) 65 - Prog: use lsquic_str2ver() when processing -o version flag 66 - Remove unused CTIM and SRBF transport parameters 67 - Disable QUIC versions Q037 and Q038 by default 68 - Fix Windows compilation by including compat header file in 69 lshpack.c 70 - Address warnings produced by newer versions of gcc 71 - Future-proof: turn off -Werror 72 732018-05-02 74 75 - [BUGFIX] Make lsquic_conn_quic_version() available 76 - Switch to using ls-hpack 1.1 77 - [BUGFIX] Do not ignore stream resets after receiving FIN 78 792018-04-27 80 81 - HPACK: do not allow header block to end with table size update. 82 832018-04-25 84 85 - [BUGFIX] Do not create gap in sent packnos when squeezing delayed 86 packets. 87 - [BUGFIX] sendctl checks for all unacked bytes, not just retx bytes. 88 - [BUGFIX] connections with blocked scheduled packets are not tickable 89 for sending. 90 - [BUGFIX] Conn is tickable if it wants to send a connection-level 91 frame. 92 932018-04-23 94 95 - Fix busy loop: tickable must make progress. When connection is 96 self-reporting as tickable, it must make progress when ticked. There 97 are two issues: 98 1. If there are buffered packets, the connection is only tickable if 99 they can be sent out. 100 2. A connection is tickable if there are streams on the servicing 101 queue. When the tick occurs, we must service the stream 102 independent of whether any packets are sent. 103 - Fix assertion in pacer which can be incorrect under some 104 conditions. 105 - cmake: do not turn on address sanitizer if in Travis. 106 1072018-04-20 108 109 - [BUGFIX] Fix bug in lsquic_engine_connect() exposed by yesterday's 110 changes. 111 1122018-04-19 113 114 - [BUGFIX] Add connection to Tickable Queue on stream write 115 - cmake: use MSVC variable instead of trying to detect 116 - engine: improve connection incref/decref logging 117 - stream: don't ignore errors that may occur on triggered flush 118 - connection: remove obsolete method 119 - engine: indicate connection as tickable if previous call went 120 over threshold 121 1222018-04-09 123 124 [API Change, OPTIMIZATION] Only process conns that need to be processed 125 126 The API is simplified: do not expose the user code to several 127 queues. A "connection queue" is now an internal concept. 128 The user processes connections using the single function 129 lsquic_engine_process_conns(). When this function is called, 130 only those connections are processed that need to be processed. 131 A connection needs to be processed when: 132 133 1. New incoming packets have been fed to the connection. 134 2. User wants to read from a stream that is readable. 135 3. User wants to write to a stream that is writeable. 136 4. There are buffered packets that can be sent out. (This 137 means that the user wrote to a stream outside of the 138 lsquic library callback.) 139 5. A control frame (such as BLOCKED) needs to be sent out. 140 6. A stream needs to be serviced or delayed stream needs to 141 be created. 142 7. An alarm rings. 143 8. Pacer timer expires. 144 145 To achieve this, the library places the connections into two 146 priority queues (min heaps): 147 148 1. Tickable Queue; and 149 2. Advisory Tick Time queue (ATTQ). 150 151 Each time lsquic_engine_process_conns() is called, the Tickable 152 Queue is emptied. After the connections have been ticked, they are 153 queried again: if a connection is not being closed, it is placed 154 either in the Tickable Queue if it is ready to be ticked again or 155 it is placed in the Advisory Tick Time Queue. It is assumed that 156 a connection always has at least one timer set (the idle alarm). 157 158 The connections in the Tickable Queue are arranged in the least 159 recently ticked order. This lets connections that have been quiet 160 longer to get their packets scheduled first. 161 162 This change means that the library no longer needs to be ticked 163 periodically. The user code can query the library when is the 164 next tick event and schedule it exactly. When connections are 165 processed, only the tickable connections are processed, not *all* 166 the connections. When there are no tick events, it means that no 167 timer event is necessary -- only the file descriptor READ event 168 is active. 169 170 The following are improvements and simplifications that have 171 been triggered: 172 173 - Queue of connections with incoming packets is gone. 174 - "Pending Read/Write Events" Queue is gone (along with its 175 history and progress checks). This queue has become the 176 Tickable Queue. 177 - The connection hash no longer needs to track the connection 178 insertion order. 179 1802018-04-02 181 182 - [FEATURE] Windows support 183 184 - Reduce stack use -- outgoing packet batch is now allocated on the heap. 185 1862018-03-09 187 188 - [OPTIMIZATION] Merge series of ACKs if possible 189 190 Parsed single-range ACK frames (that is the majority of frames) are 191 saved in the connection and their processing is deferred until the 192 connection is ticked. If several ACKs come in a series between 193 adjacent ticks, we check whether the latest ACK is a strict superset 194 of the saved ACK. If it is, the older ACK is not processed. 195 196 If ACK frames can be merged, they are merged and only one of them is 197 either processed or saved. 198 199 - [OPTIMIZATION] Speed up ACK verification by simplifying send history. 200 201 Never generate a gap in the sent packet number sequence. This reduces 202 the send history to a single number instead of potentially a series of 203 packet ranges and thereby speeds up ACK verification. 204 205 By default, detecting a gap in the send history is not fatal: only a 206 single warning is generated per connection. The connection can continue 207 to operate even if the ACK verification code is not able to detect some 208 inconsistencies. 209 210 - [OPTIMIZATION] Rearrange the lsquic_send_ctl struct 211 212 The first part of struct lsquic_send_ctl now consists of members that 213 are used in lsquic_send_ctl_got_ack() (in the absense of packet loss, 214 which is the normal case). To speed up reads and writes, we no longer 215 try to save space by using 8- and 16-bit integers. Use regular integer 216 width for everything. 217 218 - [OPTIMIZATION] Cache size of sent packet. 219 220 - [OPTIMIZATION] Keep track of the largest ACKed in packet_out 221 222 Instead of parsing our own ACK frames when packet has been acked, 223 use the value saved in the packet_out structure when the ACK frame 224 was generated. 225 226 - [OPTIMIZATION] Take RTT sampling conditional out of ACK loop 227 228 - [OPTIMIZATION] ACK processing: only call clock_gettime() if needed 229 230 - [OPTIMIZATION] Several code-level optimizations to ACK processing. 231 232 - Fix: http_client: fix -I flag; switch assert() to abort() 233 2342018-02-26 235 - [API Change] lsquic_engine_connect() returns pointer to the connection 236 object. 237 - [API Change] Add lsquic_conn_get_engine() to get engine object from 238 connection object. 239 - [API Change] Add lsquic_conn_status() to query connection status. 240 - [API Change] Add add lsquic_conn_set_ctx(). 241 - [API Change] Add new timestamp format, e.g. 2017-03-21 13:43:46.671345 242 - [OPTIMIZATION] Process handshake STREAM frames as soon as packet 243 arrives. 244 - [OPTIMIZATION] Do not compile expensive send controller sanity check 245 by default. 246 - [OPTIMIZATION] Add fast path to gquic_be_gen_reg_pkt_header. 247 - [OPTIMIZATION] Only make squeeze function call if necessary. 248 - [OPTIMIZATION] Speed up Q039 ACK frame parsing. 249 - [OPTIMIZATION] Fit most used elements of packet_out into first 64 bytes. 250 - [OPTIMIZATION] Keep track of scheduled bytes instead of calculating. 251 - [OPTIMIZATION] Prefetch next unacked packet when processing ACK. 252 - [OPTIMIZATION] Leverage fact that ACK ranges and unacked list are. 253 ordered. 254 - [OPTIMIZATION] Reduce function pointer use for STREAM frame generation 255 - Fix: reset incoming streams that arrive after we send GOAWAY. 256 - Fix: delay client on_new_conn() call until connection is fully set up. 257 - Fixes to buffered packets logic: splitting, STREAM frame elision. 258 - Fix: do not dispatch on_write callback if no packets are available. 259 - Fix WINDOW_UPDATE send and resend logic. 260 - Fix STREAM frame extension code. 261 - Fix: Drop unflushed data when stream is reset. 262 - Switch to tracking CWND using bytes rather than packets. 263 - Fix TCP friendly adjustment in cubic. 264 - Fix: do not generate invalid STOP_WAITING frames during high packet 265 loss. 266 - Pacer fixes. 267 2682017-12-18 269 270 - Fix: better follow cubic curve after idle period 271 - Fix: add missing parts to outgoing packet splitting code 272 - Fix: compilation using gcc 4.8.4 273 2742017-10-31 275 276 - Add APIs.txt -- describes LSQUIC APIs 277 2782017-10-31 279 280 - [API Change] Sendfile-like functionality is gone. The stream no 281 longer opens files and deals with file descriptors. (Among other 282 things, this makes the code more portable.) Three writing functions 283 are provided: 284 285 lsquic_stream_write 286 lsquic_stream_writev 287 lsquic_stream_writef (NEW) 288 289 lsquic_stream_writef() is given an abstract reader that has function 290 pointers for size() and read() functions which the user can implement. 291 This is the most flexible way. lsquic_stream_write() and 292 lsquic_stream_writev() are now both implemented as wrappers around 293 lsquic_stream_writef(). 294 295 - [OPTIMIZATION] When writing to stream, be it within or without the 296 on_write() callback, place data directly into packet buffer, 297 bypassing auxiliary data structures. This reduces amount of memory 298 required, for the amount of data that can be written is limited 299 by the congestion window. 300 301 To support writes outside the on_write() callback, we keep N 302 outgoing packet buffers per connection which can be written to 303 by any stream. One half of these are reserved for the highest 304 priority stream(s), the other half for all other streams. This way, 305 low-priority streams cannot write instead of high-priority streams 306 and, on the other hand, low-priority streams get a chance to send 307 their packets out. 308 309 The algorithm is as follows: 310 311 - When user writes to stream outside of the callback: 312 - If this is the highest priority stream, place it onto the 313 reserved N/2 queue or fail. 314 (The actual size of this queue is dynamic -- MAX(N/2, CWND) -- 315 rather than N/2, allowing high-priority streams to write as 316 much as can be sent.) 317 - If the stream is not the highest priority, try to place the 318 data onto the reserved N/2 queue or fail. 319 - When tick occurs *and* more packets can be scheduled: 320 - Transfer packets from the high N/2 queue to the scheduled 321 queue. 322 - If more scheduling is allowed: 323 - Call on_write callbacks for highest-priority streams, 324 placing resulting packets directly onto the scheduled queue. 325 - If more scheduling is allowed: 326 - Transfer packets from the low N/2 queue to the scheduled 327 queue. 328 - If more scheduling is allowed: 329 - Call on_write callbacks for non-highest-priority streams, 330 placing resulting packets directly onto the scheduled queue 331 332 The number N is currently 20, but it could be varied based on 333 resource usage. 334 335 - If stream is created due to incoming headers, make headers readable 336 from on_new. 337 338 - Outgoing packets are no longer marked non-writeable to prevent placing 339 more than one STREAM frame from the same stream into a single packet. 340 This property is maintained via code flow and an explicit check. 341 Packets for stream data are allocated using a special function. 342 343 - STREAM frame elision is cheaper, as we only perform it if a reset 344 stream has outgoing packets referencing it. 345 346 - lsquic_packet_out_t is smaller, as stream_rec elements are now 347 inside a union. 348 3492017-10-12 350 351 - Do not send RST_STREAM when stream is closed for reading 352 - Raise maximum header size from 4K to 64K 353 - Check header name and value lengths against maximum imposed by HPACK 354 - Fix NULL dereference in stream flow controller 355 3562017-10-09 357 358 - Hide handshake implementation behind a set of function pointers 359 - Use monotonically increasing clock 360 - Make sure that retx delay is not larger than the max of 60 seconds 361 3622017-09-29 363 364 - A few fixes to code and README 365 3662017-09-28 367 368 - Add support for Q041; drop support for Q040 369 3702017-09-27 371 372 - Fix CMakeLists.txt: BoringSSL include and lib was mixed up 373 3742017-09-26 375 376 - Add support for Mac OS 377 - Add support for Raspberry Pi 378 - Fix BoringSSL compilation: include <openssl/hmac.h> explicitly 379 3802017-09-22 381 382 - Initial release 383