noq-udp: allow setting DSCP (the per-datagram ECN cmsg overwrites the socket's TOS byte)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- networking
Research direction
Start in noq-udp/src/unix.rs where the per-datagram ECN cmsg sets IP_TOS and IPV6_TCLASS, then check the matching code in apple_fast.rs and the UdpSocketState struct. The issue proposes a set_dscp(u8) setter whose value is ORed into the high six bits of that cmsg, with a default of 0 so behavior is unchanged. Done means a test that reads the TOS byte back via recvmsg for both IPv4 and IPv6. The API shape is still open, so confirm it with the maintainers before writing code.
Written by the indexing model from the issue text.
Description
On Linux/macOS, noq-udp puts an IP_TOS / IPV6_TCLASS cmsg on every datagram carrying only the ECN bits (noq-udp/src/unix.rs ~L676/L681, apple_fast.rs). That cmsg sets the whole TOS byte for the packet, so a DSCP set on the socket with setsockopt(IP_TOS) is overwritten with 0 on every send.
We'd like to mark game traffic as Non-Queue-Building (RFC 9956, DSCP 45) next to ECT(1) for L4S, and right now there's no way to do that through noq-udp.
Proposal: a small UdpSocketState::set_dscp(u8) (stored next to the existing state) that ORs the DSCP into the high six bits of the cmsg value; default 0, so nothing changes for anyone who doesn't call it. We have it working in a vendored copy with a test that reads the TOS byte back via recvmsg for v4 and v6.
Would you take a PR for this? Happy to adjust the API shape.
- Dominant language
- Rust
- Stars
- 454
- Forks
- 98
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from n0-computer/noq
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
n0-computer/noq#892 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
n0-computer/noq#873 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
n0-computer/noq#872 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
n0-computer/noq#904 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 68/100
n0-computer/noq#895 ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Wait for the IDS correction dialog to settle in the stale-audit testPossibly taken @louistrue claimed this today. Openready
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
dutchman-cad/dutchman#874 ·
Maintainers usually reply within 1 day
-
bug good first issue ready
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MartinPTielemans/ilo#3840 ·
Maintainers usually reply within 1 day
-
bug file-compat priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
storytold/wordcraft#7248 · 1 comment ·
Maintainers usually reply within 4 days