ekr / minq

A simple Go implementation of QUIC
MIT License
98 stars 16 forks source link

Congestion control #28

Open pietdevaere opened 7 years ago

pietdevaere commented 7 years ago

I'm currently working on congestion control & loss dection. I'm basing my work on draft-ietf-quic-recovery-06 [1]. Progress can be somewhat followed in [2].

[1] https://tools.ietf.org/html/draft-ietf-quic-recovery-06 [2] https://github.com/pietdevaere/minq/tree/congestion_control

pietdevaere commented 7 years ago

@ekr, what do you think of the idea to split up the outputClearQ and the outputProtectedQ in to two queues each: outputClearQ and outstandingClearQ. When frames are handed off by the stream to the connection, they are placed in outputClearQ. When they are transmitted, they are moved to outstandingClearQ. When the loss detector considers them lost, they are moved back to outputClearQ, and when they are acked they are removed from both queues. That way sendQueuedFrames() (which I splitted of from queueStreamFrames) does not have to iterate through the output queue to find packets that it can transmit. It can just take the top ones from outputClearQ.

To make things more efficient we could maybe also add a map[pn][]*frame kind of structure tracking which frames a packet contains. That way the loss detector & ack handler don't have to do lengthy linear searches to find the frames corresponding to a packet. We could then also remove that info from the frame struct.