Skip to content

QUIC ACK Manager, Statistics Manager and Congestion Control API#18676

Closed
hlandau wants to merge 11 commits intoopenssl:masterfrom
hlandau:quic-loss-detector-final
Closed

QUIC ACK Manager, Statistics Manager and Congestion Control API#18676
hlandau wants to merge 11 commits intoopenssl:masterfrom
hlandau:quic-loss-detector-final

Conversation

@hlandau
Copy link
Member

@hlandau hlandau commented Jun 28, 2022

🎉

This is the initial implementation of the ACK Manager for OpenSSL's QUIC support, with supporting design documentation and tests.

Because the ACK Manager also depends on the Statistics Manager, it is also implemented here. The Statistics Manager is quite simple, so this does not amount to a large amount of extra code.

Because the ACK Manager depends on a congestion controller, it adds a no-op congestion controller, which uses the previously workshopped congestion control API.

@hlandau hlandau added branch: master Applies to master branch approval: review pending This pull request needs review by a committer approval: otc review pending triaged: feature The issue/pr requests/adds a feature labels Jun 28, 2022
@hlandau hlandau requested review from paulidale and t8m June 28, 2022 18:46
@hlandau hlandau self-assigned this Jun 28, 2022
@hlandau hlandau force-pushed the quic-loss-detector-final branch 3 times, most recently from f23b13d to 8383bf8 Compare June 28, 2022 19:07
@hlandau
Copy link
Member Author

hlandau commented Jul 14, 2022

Updated, minor changes. Rebased. @paulidale

@hlandau hlandau force-pushed the quic-loss-detector-final branch from 9d2884e to a00dc9c Compare July 14, 2022 18:06
@hlandau hlandau force-pushed the quic-loss-detector-final branch from a00dc9c to da292d6 Compare July 25, 2022 08:22
@hlandau
Copy link
Member Author

hlandau commented Jul 25, 2022

Rebased on top of frame encoding PR. Reviews invited.

@github-actions github-actions bot added the severity: fips change The pull request changes FIPS provider sources label Jul 25, 2022
Comment on lines +78 to +87
/* Callback called if frames in this packet are lost. arg is cb_arg. */
void (*on_lost)(void *arg);
/* Callback called if frames in this packet are acked. arg is cb_arg. */
void (*on_acked)(void *arg);
/*
* Callback called if frames in this packet are neither acked nor lost. arg
* is cb_arg.
*/
void (*on_discarded)(void *arg);
void *cb_arg;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to have per-packet callbacks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There may be no particular need. We could have the function pointer be set when the ACKM is created but cb_arg still kept here. Though it seems a little unusual to separate the two.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would save the 3 pointers, setting them on each packet, etc. Also should the callback have a pointer to the actual packet as an argument?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another possibility is to have one callback with an int outcome parameter (LOST, ACKED or DISCARDED), which would probably make more sense

Comment on lines +436 to +449
*/
struct pn_set_item_st {
struct pn_set_item_st *prev, *next;
OSSL_QUIC_ACK_RANGE range;
};

struct pn_set_st {
struct pn_set_item_st *head, *tail;

/* Number of ranges (not PNs) in the set. */
size_t num_ranges;
};

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect analysis!

Food for thought. Could we use a BIGNUM as a bit set instead to represent the PNs in the set? As we remove only by raising the watermark and removing ranges below the watermark - this could be a simple BN_shift(). We insert PN by PN - so this is just a BN_set_bit() operation. The most expensive operation would then be the conversion of the bits set to OSSL_QUIC_ACK_RANGEs to be sent in ACK frames. I still think it should not be too expensive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting possibility. Interested to hear @paulidale's thoughts

@t8m
Copy link
Member

t8m commented Jul 26, 2022

I'll continue reviewing this tomorrow.

Copy link
Member

@t8m t8m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work! I did not finish reviewing yet.

@hlandau
Copy link
Member Author

hlandau commented Jul 29, 2022

Rebased and updated.

@hlandau hlandau force-pushed the quic-loss-detector-final branch from da292d6 to e449fbe Compare July 29, 2022 09:08
@github-actions github-actions bot removed the severity: fips change The pull request changes FIPS provider sources label Jul 29, 2022
@t8m
Copy link
Member

t8m commented Jul 29, 2022

Great work!

Copy link
Member

@mattcaswell mattcaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still going through this. But here are some comments so far.

*/
unsigned int pkt_space :2;

/* 1 if the packet is in flight. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what this means in this context. Won't this always be set if we are calling ossl_ack_on_tx_packet - because we just transmitted the packet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is straight from the RFC pseudocode, curiously. I'm not actually sure what it's for and can't find it modelled in the other implementations I've looked at. So we may be able to remove it.

@hlandau hlandau force-pushed the quic-loss-detector-final branch from 7aad00a to 4bc6e51 Compare August 15, 2022 15:45
@hlandau
Copy link
Member Author

hlandau commented Aug 15, 2022

Rebased on top of @paulidale's OSSL_TIME changes and updated accordingly.

@levitte levitte added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Aug 23, 2022
@openssl-machine openssl-machine removed the approval: done This pull request has the required number of approvals label Aug 24, 2022
@openssl-machine
Copy link
Collaborator

This pull request is ready to merge

@openssl-machine openssl-machine added the approval: ready to merge The 24 hour grace period has passed, ready to merge label Aug 24, 2022
@hlandau
Copy link
Member Author

hlandau commented Aug 24, 2022

Merged to master.

@hlandau hlandau closed this Aug 24, 2022
openssl-machine pushed a commit that referenced this pull request Aug 24, 2022
This is the initial implementation of the ACK Manager for OpenSSL's QUIC
support, with supporting design documentation and tests.

Because the ACK Manager also depends on the Statistics Manager, it is
also implemented here. The Statistics Manager is quite simple, so this
does not amount to a large amount of extra code.

Because the ACK Manager depends on a congestion controller, it adds a
no-op congestion controller, which uses the previously workshopped
congestion control API.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from #18676)
openssl-machine pushed a commit that referenced this pull request Aug 24, 2022
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from #18676)
sftcd pushed a commit to sftcd/openssl that referenced this pull request Sep 24, 2022
This is the initial implementation of the ACK Manager for OpenSSL's QUIC
support, with supporting design documentation and tests.

Because the ACK Manager also depends on the Statistics Manager, it is
also implemented here. The Statistics Manager is quite simple, so this
does not amount to a large amount of extra code.

Because the ACK Manager depends on a congestion controller, it adds a
no-op congestion controller, which uses the previously workshopped
congestion control API.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from openssl#18676)
sftcd pushed a commit to sftcd/openssl that referenced this pull request Sep 24, 2022
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from openssl#18676)
beldmit pushed a commit to beldmit/openssl that referenced this pull request Dec 26, 2022
This is the initial implementation of the ACK Manager for OpenSSL's QUIC
support, with supporting design documentation and tests.

Because the ACK Manager also depends on the Statistics Manager, it is
also implemented here. The Statistics Manager is quite simple, so this
does not amount to a large amount of extra code.

Because the ACK Manager depends on a congestion controller, it adds a
no-op congestion controller, which uses the previously workshopped
congestion control API.

Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from openssl#18676)
beldmit pushed a commit to beldmit/openssl that referenced this pull request Dec 26, 2022
Reviewed-by: Tomas Mraz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from openssl#18676)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Applies to master branch triaged: feature The issue/pr requests/adds a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants