Implement Prop#324 Flow Control
There's enough pieces of Flow Control that need to be done to get it merge-ready that a checklist and ticket seem wise at this point.
Here's stuff I will do:
-
Improve monotime checks to export a global monotime status -
Remove mobile xon/xoff limits -
Advertise the average and max edge conn drain rates in XON (after first XOFF, or if above a "low watermark" queue length) -
Low watermark params to send advisory XON before XOFF -
Send periodic XONs if the drain rate changes significantly -
Perform checks for semantically valid XON/XOFF and call circuit_read_valid_data() -
Turn CELL_QUEUE_HIGHWATER_SIZE (and others?) into consensus params -
Implement ways to restrict when advisory XONs can be sent, to reduce side channels from exits -
Alter half-open edge connection checks to work with XON/XOFF wrt valid data -
Fix edge case where XON/XOFF can arrive after stream close (depends on half-open fix) -
Additional consensus parameter for CircEWMA's EWMA_TICK_LEN and edge ratelimit low/high change -
Preliminary tuning of new consensus params over onion svcs -
Misc XXX's -
Update Prop#324 spec with above -
Debug log removal and other log message cleanups/improvements -
Squash branch for review
Here's stuff @dgoulet can do:
-
Preliminary code review -
Rate limit packaging data on edge connection's circuits (or reading on edge source sockets?) to match the advertised rate using token buckets -
Improve oomkiller/circuit closing wrt total edge connection outbuf lengths on circs -
Determine if we can use any kernel info from KIST to improve buffer length calls (there's some XXX's to note where in the flow control code this may help) -
Spotcheck existing oomkiller, KIST, and CircEWMA code to see if we should parameterize or tighten anything else for congestion control generally -
Determine if we should parameterize any other buffer lengths inside channel handling, cell handling, and the circuitmux dragon -
Help me figure out why flow_control_decide_xon() is almost always only called when the outbuf is 0, where the data is going to, and what we should do about it (KIST, ask the socket if it wouldblock?) -
Test out the flow control branch on some rate limited onions for weirdness. Help decide some tuning parameter values.
Cc: @dgoulet
Edited by Mike Perry