Schedule keep-alive PINGs from the negotiated idle timeout instead of a fixed interval

Open
#810 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
networking

Research direction

Start by tracing noq's keep-alive-interval handling and where the peer's negotiated max_idle_timeout becomes available. Compare the current fixed re-arming behavior with the proposed RTT-aware deadline, then define tests showing that PINGs are scheduled from the negotiated timeout without spamming active connections.

Written by the indexing model from the issue text.

Description

This is an old Quinn behavior that I imagine hasn't been fixed yet. Low priority, just something that annoyed me about Quinn when I was brainstorming improvements.

We want fairly aggressive keep-alives in MoQ. But we also don't want to spam a shitload of PING packets. The keep-alive-interval knob in Quinn/noq is a fixed interval re-armed on every received packet (so ACKed STREAM traffic does hold it off), but it is blind to the peer's max_idle_timeout.

IMO keep-alives should only be sent when needed, and based on the time until the connection will close. Like if the peer says the max_idle_timeout (in setup) is 30s then we should PING based on how close we are to that deadline. The current setting is blind to what the peer wants, so you might configure an interval of 10s keep-alive pings and if the peer says max_idle_timeout is 8s, then you might get very unlucky.

So yeah, I almost feel like keep-alives should be built into noq based. Send PING packets some multiples of RTT close to max_idle_timeout.

Dominant language
Rust
Stars
454
Forks
98
Avg merge
2d 8h
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from n0-computer/noq

All issues in n0-computer/noq

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.