dpd: Want a better API for bulk NAT entry operations
Maintainer thường phản hồi trong vòng 2 ngày
@nicolaskagami đang làm issue này rồi.
Từ ngày 8/7/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
As a part of https://github.com/oxidecomputer/omicron/issues/10167, sled-agent running on each scrimlet wants to ensure the NAT entries for all Omicron services are correct on its switch zone's dpd. The information it has is a generation-numbered-guarded declarative set of "entries that should exist".
The existing dpd API makes it easy to ensure each of those entries does exist, but I don't think there's an easy way for sled-agent to remove stale Omicron service NAT entries that shouldn't exist. It doesn't know what entries might have existed in the past; only what should exist now.
I have a prototype branch that makes this work, but it's pretty gnarly: it reads all current NAT entries from dpd across a series of API calls:
- For each IP returned by looping over all pages of
nat_ipv4_addresses_list, fetch all NAT entries associated with that IP vianat_ipv4_list. - For each IP returned by looping over all pages of
nat_ipv6_addresses_list, fetch all NAT entries associated with that IP vianat_ipv6_list.
As a heuristic for "what entries exist that shouldn't", it filters all the returned NAT entries down to just those with a VNI matching the Omicron services VNI. Now it can diff locally and decide whether any entries exist that shouldn't, and delete those.
This issue is similar in spirit to #209. In this specific case we don't necessarily need a generation number on the dpd side for correctness, since there is only one client (the local sled-agent) and it already guards changes via a generation number of its own. But I could imagine wanting a similar kind of "bulk" API if we wanted to invert the Nexus <-> dpd NAT syncing path (which we do at some point - this is #83), and it would be easy for us to pass through the generation number we do have if needed.
I'm not sure exactly what shape this should be. The features I'd like are:
- Some way of identifying an entire set of related NAT entries. I'm using VNI to do this now - maybe that's fine / correct? Or there could be some metadata that described a group of "all Omicron service entries".
- Either:
- A single "ensure" API that takes a generation-guarded, identified-by-group set of NAT entries, and then
dpdinternally removes any stale entries that are in the same group but not in the new request, and adds/updates all entries that are in the new request. (I believe this is similar to the way BGP is configured inmgd- there's a singlebgp_apply()endpoint that takes the config that should exist, then internally does whatever it needs to do to make that happen.) - A bulk "get" API (presumably paginated) that returns all the current entries in a group. This would be more similar to the prototype branch I have, but the filter-down-to-a-group would happen on the
dpdside instead of the client needing to fetch all NAT entries. Given this, the client can do its own diffing and then use the existing add/remove APIs to make updates as needed.
- A single "ensure" API that takes a generation-guarded, identified-by-group set of NAT entries, and then
I think the first of those options is more generally useful - the second is only useful if there's a single client that can't race with others, since it opens an obvious TOCTOU between the "bulk get" and the "local diff then apply changes". But either would be a big improvement for the current project, and I assume (perhaps naively) that the second would be a smaller lift.
- Ngôn ngữ chính
- Rust
- Star
- 22
- Fork
- 3
- Merge trung bình
- 4 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của oxidecomputer/dendrite
-
L3 router drops never increment relevant countersCó thể đã có người làm @FelixMcFelix đã nhận 9 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
oxidecomputer/dendrite#404 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
oxidecomputer/dendrite#402 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
oxidecomputer/dendrite#384 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
oxidecomputer/dendrite#375 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
oxidecomputer/dendrite#369 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của oxidecomputer/dendrite
Issue tương tự
-
bug easy good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
lacs-project/sysknife#659 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
E_FIT_INPUT_MISSING (mixture overrides): the message says ferx-r bundles lack mixture_overridesĐang mởP3
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Document multi-value claims with rowBoundaries operator:in (and their per-record application)Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
registrystack/registry-stack#2431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
contribution
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
farion1231/cc-switch#8863 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày