NSIO 开发日报

8月27日 / 周四

2026-08-27 开发日报:完成子网路由核心功能、支持混版 Node 升级、改进 relay 网关自动注册机制

24
项合入
3
个模块
4
项需注意
4
位提交者
← 全部日报

今日要点

01
Subnet Routing 特性完成feature
ns、nsd、nsgw 三个组件完成子网路由功能实现,包括 DNS 作用域优化、LAN 出口状态暴露、控制面计划、HA 身份管理、消费者 L3 路由提案等,形成完整的网络路由能力
02
支持混版 Node 滚动升级upgrade
access-grants 新增支持混版 Node 环境,保持运行时 L3 元数据认证,允许节点分阶段升级而不中断服务,显著降低升级风险
03
Relay 网关自动注册机制reliability
ns 现在支持新 relay 网关发布时立即自动注册连接,同步改进了 relay client-key 集合的投影和分发能力

分模块详情

NS ns · 7 项

应用运行时状态管理、子网路由、relay 网关交互等核心功能增强,支持 FFI 主机生命周期管理

做了什么
  • app-runtime-status-ipc:处理前台关闭、FFI 主机生命周期、防止客户端阻塞
  • subnet-routing:关闭路由计划、澄清 DNS 解析器作用域、暴露子网 LAN 出口状态
  • relay:新网关发布时立即自动注册连接
  • control:从投影字段读取 relay client-key 集合
  • 修复:移除冗余 ICMP 校验码、macOS 文件描述符导入、DNS 服务解析器作用域
怎么验证
  • 验证前台应用关闭事件传播:启动应用、前台终止,检查 FFI 状态回调是否触发
  • 查询子网 LAN 出口状态:curl http://localhost:8080/api/subnet/lan-egress-status,验证返回有效出口信息
  • 验证 relay 网关自动注册:部署新网关后检查 ns 日志中的 'relay gateway registered' 事件,确认注册延迟 < 5s
  • 验证 DNS 作用域移除:检查日志不出现 'service resolver scope' 相关条目
重点关注
  • app-runtime-status-ipc 跨平台验证待补充(iOS/Android)
  • Relay 网关自动注册的网络延迟和故障恢复待实机验证
  • macOS fd import 修改需在 macOS 13+ 环境验证是否正常工作
NSD nsd · 16 项

控制面策略、访问控制、分布式网关配置、子网路由控制面实现等管理功能完善

做了什么
  • policies:外源 Node 的策略命名支持,关联所属 Space 信息
  • access-grants:保持运行时 L3 元数据、支持混版 Node 滚动升级
  • subnet-routing:完成控制面计划、暴露 HA 身份、暴露待机网关列表、交付消费者 L3 路由提案
  • distribute:排序 wg_config 对等体保证不变性、拒绝跨 realm 的 relay pair、投影 relay client-key、对网关 relay 配额进行分片
  • 文档完善:修复 rustdoc 链接、发布 OpenAPI subnet 路由文档
  • CI 优化:SQLite 后端测试替代 --all-features
怎么验证
  • 混版 Node 权限认证测试:运行 cargo test -p nsd-access-grants,验证 L3 信息在新旧版本间保留
  • 管理员 UI 查看 HA 身份:访问 https://admin.example.com/subnet/ha-identities,验证列表包含所有活跃网关和 HA 身份
  • 验证待机网关暴露:查询 API GET /api/gateways?filter=standby,确认返回备用网关列表
  • relay pair 跨 realm 拒绝测试:尝试在跨 realm 节点间创建 relay pair,应返回 HTTP 400 with 'realm mismatch' 错误
  • wg_config 不变性测试:生成两个相同 realm 配置,对比二进制输出应完全相同
重点关注
  • 混版 Node 支持(v1.x 到 v2.x)的兼容性边界需在生产灰度中验证
  • relay allowance sharding 在大规模网关场景下的性能待基准测试
  • policy Space 命名在跨租户场景下的隔离性待安全审查
NSGW nsgw · 1 项

数据网关运行时优化,完善子网路由的流量处理能力

做了什么
  • subnet-routing:解耦不透明 relay 方向、按机器 ID 匹配出口所有者
怎么验证
  • relay 方向解耦验证:nsgw 配置中禁用单向 relay,验证双向流量正确传递,日志中无 'direction mismatch' 错误
  • 机器 ID 匹配验证:部署多个网关,验证 egress traffic 路由到正确机器 ID,查询 nsgw metrics 中 'egress_owner_machine_id' 的匹配率应为 100%
重点关注
  • relay 方向解耦在高吞吐场景下的延迟影响待性能测试
  • 机器 ID 匹配失败的降级策略需文档明确

风险与待办

多组件子网路由集成风险:subnet-routing 涉及 ns/nsd/nsgw 三个核心组件,各组件单独完成但跨组件端到端数据流、故障恢复、DNS 作用域移除与 LAN 出口状态同步需在测试网络中完整验证
混版 Node 升级兼容性风险:access-grants 支持混版但元数据 L3 保持细节(序列化格式、向后兼容性)在多版本共存场景下待验证,建议在金丝雀环境中验证 v1 和 v2 节点的权限互通
Relay 自动注册机制风险:新网关自动注册缺少明确 SLA 定义和故障恢复策略,高可用场景下网关发布和注册的最终一致性需要压力测试验证
distribute peer ordering 幂等性风险:wg_config 对等体排序必须保证不变性,Go 版本或依赖库版本变化都可能破坏幂等性,需要在 CI 中锁定上游库版本

原始合入记录

展开全部 24 项(脚本采集,未经研判)

NS(ns)(7 项)

  • feat/app-runtime-status-ipc — silex
    • feat(ffi): handle foreground shutdown
    • docs(ffi): align host validation scope
    • feat(ffi): add app-style host lifecycle
    • docs(status): define ffi host lifecycle
    • fix(status): prevent stalled clients blocking status
  • feat/subnet-routing — silex
    • docs(subnet): close routing plan
    • docs(dns): clarify stable resolver scopes
    • fix(dns): remove service resolver scopes
    • docs(subnet): document lan egress status
    • feat(ffi): expose subnet lan egress status
  • docs(task): record PERF-002, the Gateway Egress loss investigation — eleven
  • fix(ns): remove dead icmp checksum helper — silex
  • fix(ns-ffi-host): gate macOS fd import — silex
  • feat(control): read the relay client-key set from a projected field — Claude
  • feat(relay): register with a new relay gateway as soon as it is published — Claude

控制面(nsd)(16 项)

  • feat(policies): name the owning Space on a foreign source Node — eleven
    • feat(policies): name the owning Space on a foreign source Node
  • fix(access-grants): preserve runtime L3 on metadata auth — clark
    • fix(access-grants): preserve runtime L3 on metadata auth
  • feat/subnet-routing — silex
    • docs(subnet): close control plane plan
    • fix(subnet): advance mapping projections reliably
    • feat(subnet): expose HA identities to admins
    • feat(subnet): expose standby gateways in list
    • feat(subnet): deliver consumer L3 route proposals
  • fix(access-grants): support mixed-version Node rollout — clark
    • fix(access-grants): support mixed-version Node rollout
  • docs(distribute): fix intra-doc links that cannot resolve under rustdoc — eleven
  • docs(api): publish the subnet mapping routes in the OpenAPI document — eleven
  • ci: run the test suite on the SQLite backend instead of --all-features — eleven
  • docs(plan): record the device-rebuild blast radius investigation — Claude
  • fix(distribute): order wg_config peers so an unchanged realm projects unchanged bytes — Claude
  • fix(distribute): refuse to place a relay pair whose ends span realms — Claude
  • feat(distribute): project the relay client-key set to capable connectors — Claude
  • docs(plan): close D4's confirm-before-switch item as not applicable — Claude
  • docs(plan): record what D4's two halves close and what remains — Claude
  • feat(distribute): keep a re-placed pair's allowance on its previous carrier — Claude
  • docs(plan): record S2 findings, the migration window, and the D3 correction — Claude
  • feat(distribute): shard the gateway relay allowance table by placement — Claude

数据网关(nsgw)(1 项)

  • feat/subnet-routing — silex
    • fix(wss): decouple opaque relay directions
    • fix(runtime): match egress owner by machine id