CHANGELOG revision 881272bb
12018-05-02 2 3 - [BUGFIX] Make lsquic_conn_quic_version() available 4 - Switch to using ls-hpack 1.1 5 - [BUGFIX] Do not ignore stream resets after receiving FIN 6 72018-04-27 8 9 - HPACK: do not allow header block to end with table size update. 10 112018-04-25 12 13 - [BUGFIX] Do not create gap in sent packnos when squeezing delayed 14 packets. 15 - [BUGFIX] sendctl checks for all unacked bytes, not just retx bytes. 16 - [BUGFIX] connections with blocked scheduled packets are not tickable 17 for sending. 18 - [BUGFIX] Conn is tickable if it wants to send a connection-level 19 frame. 20 212018-04-23 22 23 - Fix busy loop: tickable must make progress. When connection is 24 self-reporting as tickable, it must make progress when ticked. There 25 are two issues: 26 1. If there are buffered packets, the connection is only tickable if 27 they can be sent out. 28 2. A connection is tickable if there are streams on the servicing 29 queue. When the tick occurs, we must service the stream 30 independent of whether any packets are sent. 31 - Fix assertion in pacer which can be incorrect under some 32 conditions. 33 - cmake: do not turn on address sanitizer if in Travis. 34 352018-04-20 36 37 - [BUGFIX] Fix bug in lsquic_engine_connect() exposed by yesterday's 38 changes. 39 402018-04-19 41 42 - [BUGFIX] Add connection to Tickable Queue on stream write 43 - cmake: use MSVC variable instead of trying to detect 44 - engine: improve connection incref/decref logging 45 - stream: don't ignore errors that may occur on triggered flush 46 - connection: remove obsolete method 47 - engine: indicate connection as tickable if previous call went 48 over threshold 49 502018-04-09 51 52 [API Change, OPTIMIZATION] Only process conns that need to be processed 53 54 The API is simplified: do not expose the user code to several 55 queues. A "connection queue" is now an internal concept. 56 The user processes connections using the single function 57 lsquic_engine_process_conns(). When this function is called, 58 only those connections are processed that need to be processed. 59 A connection needs to be processed when: 60 61 1. New incoming packets have been fed to the connection. 62 2. User wants to read from a stream that is readable. 63 3. User wants to write to a stream that is writeable. 64 4. There are buffered packets that can be sent out. (This 65 means that the user wrote to a stream outside of the 66 lsquic library callback.) 67 5. A control frame (such as BLOCKED) needs to be sent out. 68 6. A stream needs to be serviced or delayed stream needs to 69 be created. 70 7. An alarm rings. 71 8. Pacer timer expires. 72 73 To achieve this, the library places the connections into two 74 priority queues (min heaps): 75 76 1. Tickable Queue; and 77 2. Advisory Tick Time queue (ATTQ). 78 79 Each time lsquic_engine_process_conns() is called, the Tickable 80 Queue is emptied. After the connections have been ticked, they are 81 queried again: if a connection is not being closed, it is placed 82 either in the Tickable Queue if it is ready to be ticked again or 83 it is placed in the Advisory Tick Time Queue. It is assumed that 84 a connection always has at least one timer set (the idle alarm). 85 86 The connections in the Tickable Queue are arranged in the least 87 recently ticked order. This lets connections that have been quiet 88 longer to get their packets scheduled first. 89 90 This change means that the library no longer needs to be ticked 91 periodically. The user code can query the library when is the 92 next tick event and schedule it exactly. When connections are 93 processed, only the tickable connections are processed, not *all* 94 the connections. When there are no tick events, it means that no 95 timer event is necessary -- only the file descriptor READ event 96 is active. 97 98 The following are improvements and simplifications that have 99 been triggered: 100 101 - Queue of connections with incoming packets is gone. 102 - "Pending Read/Write Events" Queue is gone (along with its 103 history and progress checks). This queue has become the 104 Tickable Queue. 105 - The connection hash no longer needs to track the connection 106 insertion order. 107 1082018-04-02 109 110 - [FEATURE] Windows support 111 112 - Reduce stack use -- outgoing packet batch is now allocated on the heap. 113 1142018-03-09 115 116 - [OPTIMIZATION] Merge series of ACKs if possible 117 118 Parsed single-range ACK frames (that is the majority of frames) are 119 saved in the connection and their processing is deferred until the 120 connection is ticked. If several ACKs come in a series between 121 adjacent ticks, we check whether the latest ACK is a strict superset 122 of the saved ACK. If it is, the older ACK is not processed. 123 124 If ACK frames can be merged, they are merged and only one of them is 125 either processed or saved. 126 127 - [OPTIMIZATION] Speed up ACK verification by simplifying send history. 128 129 Never generate a gap in the sent packet number sequence. This reduces 130 the send history to a single number instead of potentially a series of 131 packet ranges and thereby speeds up ACK verification. 132 133 By default, detecting a gap in the send history is not fatal: only a 134 single warning is generated per connection. The connection can continue 135 to operate even if the ACK verification code is not able to detect some 136 inconsistencies. 137 138 - [OPTIMIZATION] Rearrange the lsquic_send_ctl struct 139 140 The first part of struct lsquic_send_ctl now consists of members that 141 are used in lsquic_send_ctl_got_ack() (in the absense of packet loss, 142 which is the normal case). To speed up reads and writes, we no longer 143 try to save space by using 8- and 16-bit integers. Use regular integer 144 width for everything. 145 146 - [OPTIMIZATION] Cache size of sent packet. 147 148 - [OPTIMIZATION] Keep track of the largest ACKed in packet_out 149 150 Instead of parsing our own ACK frames when packet has been acked, 151 use the value saved in the packet_out structure when the ACK frame 152 was generated. 153 154 - [OPTIMIZATION] Take RTT sampling conditional out of ACK loop 155 156 - [OPTIMIZATION] ACK processing: only call clock_gettime() if needed 157 158 - [OPTIMIZATION] Several code-level optimizations to ACK processing. 159 160 - Fix: http_client: fix -I flag; switch assert() to abort() 161 1622018-02-26 163 - [API Change] lsquic_engine_connect() returns pointer to the connection 164 object. 165 - [API Change] Add lsquic_conn_get_engine() to get engine object from 166 connection object. 167 - [API Change] Add lsquic_conn_status() to query connection status. 168 - [API Change] Add add lsquic_conn_set_ctx(). 169 - [API Change] Add new timestamp format, e.g. 2017-03-21 13:43:46.671345 170 - [OPTIMIZATION] Process handshake STREAM frames as soon as packet 171 arrives. 172 - [OPTIMIZATION] Do not compile expensive send controller sanity check 173 by default. 174 - [OPTIMIZATION] Add fast path to gquic_be_gen_reg_pkt_header. 175 - [OPTIMIZATION] Only make squeeze function call if necessary. 176 - [OPTIMIZATION] Speed up Q039 ACK frame parsing. 177 - [OPTIMIZATION] Fit most used elements of packet_out into first 64 bytes. 178 - [OPTIMIZATION] Keep track of scheduled bytes instead of calculating. 179 - [OPTIMIZATION] Prefetch next unacked packet when processing ACK. 180 - [OPTIMIZATION] Leverage fact that ACK ranges and unacked list are. 181 ordered. 182 - [OPTIMIZATION] Reduce function pointer use for STREAM frame generation 183 - Fix: reset incoming streams that arrive after we send GOAWAY. 184 - Fix: delay client on_new_conn() call until connection is fully set up. 185 - Fixes to buffered packets logic: splitting, STREAM frame elision. 186 - Fix: do not dispatch on_write callback if no packets are available. 187 - Fix WINDOW_UPDATE send and resend logic. 188 - Fix STREAM frame extension code. 189 - Fix: Drop unflushed data when stream is reset. 190 - Switch to tracking CWND using bytes rather than packets. 191 - Fix TCP friendly adjustment in cubic. 192 - Fix: do not generate invalid STOP_WAITING frames during high packet 193 loss. 194 - Pacer fixes. 195 1962017-12-18 197 198 - Fix: better follow cubic curve after idle period 199 - Fix: add missing parts to outgoing packet splitting code 200 - Fix: compilation using gcc 4.8.4 201 2022017-10-31 203 204 - Add APIs.txt -- describes LSQUIC APIs 205 2062017-10-31 207 208 - [API Change] Sendfile-like functionality is gone. The stream no 209 longer opens files and deals with file descriptors. (Among other 210 things, this makes the code more portable.) Three writing functions 211 are provided: 212 213 lsquic_stream_write 214 lsquic_stream_writev 215 lsquic_stream_writef (NEW) 216 217 lsquic_stream_writef() is given an abstract reader that has function 218 pointers for size() and read() functions which the user can implement. 219 This is the most flexible way. lsquic_stream_write() and 220 lsquic_stream_writev() are now both implemented as wrappers around 221 lsquic_stream_writef(). 222 223 - [OPTIMIZATION] When writing to stream, be it within or without the 224 on_write() callback, place data directly into packet buffer, 225 bypassing auxiliary data structures. This reduces amount of memory 226 required, for the amount of data that can be written is limited 227 by the congestion window. 228 229 To support writes outside the on_write() callback, we keep N 230 outgoing packet buffers per connection which can be written to 231 by any stream. One half of these are reserved for the highest 232 priority stream(s), the other half for all other streams. This way, 233 low-priority streams cannot write instead of high-priority streams 234 and, on the other hand, low-priority streams get a chance to send 235 their packets out. 236 237 The algorithm is as follows: 238 239 - When user writes to stream outside of the callback: 240 - If this is the highest priority stream, place it onto the 241 reserved N/2 queue or fail. 242 (The actual size of this queue is dynamic -- MAX(N/2, CWND) -- 243 rather than N/2, allowing high-priority streams to write as 244 much as can be sent.) 245 - If the stream is not the highest priority, try to place the 246 data onto the reserved N/2 queue or fail. 247 - When tick occurs *and* more packets can be scheduled: 248 - Transfer packets from the high N/2 queue to the scheduled 249 queue. 250 - If more scheduling is allowed: 251 - Call on_write callbacks for highest-priority streams, 252 placing resulting packets directly onto the scheduled queue. 253 - If more scheduling is allowed: 254 - Transfer packets from the low N/2 queue to the scheduled 255 queue. 256 - If more scheduling is allowed: 257 - Call on_write callbacks for non-highest-priority streams, 258 placing resulting packets directly onto the scheduled queue 259 260 The number N is currently 20, but it could be varied based on 261 resource usage. 262 263 - If stream is created due to incoming headers, make headers readable 264 from on_new. 265 266 - Outgoing packets are no longer marked non-writeable to prevent placing 267 more than one STREAM frame from the same stream into a single packet. 268 This property is maintained via code flow and an explicit check. 269 Packets for stream data are allocated using a special function. 270 271 - STREAM frame elision is cheaper, as we only perform it if a reset 272 stream has outgoing packets referencing it. 273 274 - lsquic_packet_out_t is smaller, as stream_rec elements are now 275 inside a union. 276 2772017-10-12 278 279 - Do not send RST_STREAM when stream is closed for reading 280 - Raise maximum header size from 4K to 64K 281 - Check header name and value lengths against maximum imposed by HPACK 282 - Fix NULL dereference in stream flow controller 283 2842017-10-09 285 286 - Hide handshake implementation behind a set of function pointers 287 - Use monotonically increasing clock 288 - Make sure that retx delay is not larger than the max of 60 seconds 289 2902017-09-29 291 292 - A few fixes to code and README 293 2942017-09-28 295 296 - Add support for Q041; drop support for Q040 297 2982017-09-27 299 300 - Fix CMakeLists.txt: BoringSSL include and lib was mixed up 301 3022017-09-26 303 304 - Add support for Mac OS 305 - Add support for Raspberry Pi 306 - Fix BoringSSL compilation: include <openssl/hmac.h> explicitly 307 3082017-09-22 309 310 - Initial release 311