Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QUIC - RTT handling code, improved packet expiry #3975

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nbridge-jump
Copy link
Contributor

In normal running the client keeps sending us streams, and we send acks. Because acks aren't "mandatory ack" we don't get an RTT from them. So also added code to periodically (once per minute) throw in a ping.
Calculates smoothed_rtt and var_rtt (rttvar) according to spec. Uses these to set expiry on packets.

Follow up could include an implementation of the PTO (Probe Time Out) algorithms from the spec.

@nbridge-jump nbridge-jump force-pushed the nbridge/quic-rtt branch 2 times, most recently from bf90165 to 0e1304e Compare January 17, 2025 17:17
src/waltz/quic/fd_quic_conn.h Outdated Show resolved Hide resolved
src/waltz/quic/tests/test_quic_bw.c Outdated Show resolved Hide resolved
src/waltz/quic/fd_quic.c Outdated Show resolved Hide resolved
src/waltz/quic/fd_quic.c Outdated Show resolved Hide resolved
src/waltz/quic/fd_quic.c Show resolved Hide resolved
src/waltz/quic/fd_quic_pkt_meta.h Outdated Show resolved Hide resolved
src/waltz/quic/fd_quic.c Outdated Show resolved Hide resolved
src/waltz/quic/fd_quic_enum.h Show resolved Hide resolved
src/waltz/quic/fd_quic_pkt_meta.h Outdated Show resolved Hide resolved
fd_quic_range_t range; /* CRYPTO data range; FIXME use pkt_meta var instead */
ulong stream_id; /* if this contains stream data,
the stream id, else zero */

ulong expiry; /* time pkt_meta expires... this is the time the
ack is expected by */
ulong tx_time; /* transmit time */
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make sense to have separate tx_time and expiry?
Can we not just have a conn-wide expiry timer that adjusts simultaneously for all outgoing packets?
(Maybe something for a future PR)

And expiry = pkt->tx_time + conn->expiry_duration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's basically what the PTO does in the spec. I'll consider adding it in this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

The new logic is complex enough that it's worth adding regression tests with simulated inputs, IMO.

(e.g. take a pcap of a real QUIC exchange over a lossy link, export the ACK delay samples to a C table, feed into the algo, assert that the derived RTT and expiry timeouts are in a reasonable range)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@ripatel-fd ripatel-fd added the quic RFC 9000: QUIC label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
quic RFC 9000: QUIC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants