Repository navigation
feat(flow-export): path-mtu sizes datagrams for a tunnel to the collectors - #353
Merged
Merged
Conversation
…ctors Datagrams were a fixed 1,400 bytes: right for a 1500-byte path, too big for the tunnel the production collectors will most likely sit behind. Tailscale's MTU is 1280, so every full datagram would leave fragmented, and losing either fragment loses the datagram: whole batches of samples, or IPFIX records the cache has already let go. `path-mtu <bytes>` makes each datagram that MTU less 48 (IPv6 and UDP headers, so either family fits). It is one value for the section rather than per collector: the sFlow exporter encodes each datagram once for every sFlow collector under one agent sequence, and IPFIX once per privacy profile, and the collectors one router reaches share a path. Unset, nothing changes. 576 is the floor because it still holds a sample of the most header-bytes allows in sFlow's expanded encoding with an IPv6 agent, and the IPFIX announcement with its records. It is hot: each tick encodes with the configuration in place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ddaf967e34
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ends A tick took a fixed 8,192 records from the flow cache, sized for 1,400-byte messages: 16 IPv6 records each, 512 messages, exactly the per-collector send budget. With path-mtu 1280 a message holds 14, so a full take needs about 586 messages, and the budget dropped the rest after their records had left the cache. A rate change makes a full take certain: it queues every flow at once. In the test, 20,000 IPv6 flows at 1,232-byte datagrams lost 148 messages. At 1,400 the old take had no room for the announcement either. The take is now derived from the datagram size: what the budget's messages carry of the largest record any template sends (85 bytes, IPv6), keeping 64 messages back for announcements and the part-filled message each domain, template and rate change ends a tick with. At 1,400 that is 7,168 records a tick, still 71,680 a second. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
flow-export's datagrams are a fixed 1,400 bytes. That fits a 1500-byte path, but not the tunnel the production collectors will most likely sit behind: Tailscale's MTU is 1280.
What changes
path-mtu <bytes>inmodule flow-export.path-mtu 1280sends 1,232-byte datagrams.header-bytesallows (256) in sFlow's expanded encoding with an IPv6 agent.sflow_out::MAX_DATAGRAM, so a reload applies from the next tick.path-mtuover a tunnel" note.source-addresson Tailscale addresses, tailnet ACLs for the UDP ports, and Docker's default port publishing so the exporter's address survives.example.confand the CHANGELOG are updated.Testing
path-mtuparses; values outside 576–9000 and duplicates are refused.path-mtu 1280becomes 1,232-byte datagrams, unset 1,400.cargo fmt; clippy on the host and both Linux targets (--workspace --all-targets --all-features -D warnings); hostcargo test --workspace.🤖 Generated with Claude Code