SD-WAN 与 NNSR 路线图
Status: Current NNSR direction
Last reviewed: 2026-06-23
方向结论
NexusNet SD-WAN 只按 NNSR 主线维护。公网节点之间的每一跳都使用受保护的 underlay session;NNSR label 只在本跳解密后的 agent 内部可见。
目标数据面:
text
IP packet
-> ingress agent matches SD-WAN policy
-> ingress pushes NNSR-C label
-> hop-by-hop QUIC REALITY or BoringTun WireGuard underlay
-> transit agent decrypts local underlay
-> transit swaps/pops NNSR-C label
-> transit re-encrypts to next-hop underlay
-> egress agent pops NNSR-C and executes egress action硬性边界:
- 生产 SD-WAN 只承载 NNSR-C over QUIC REALITY 或 NNSR-C over BoringTun WireGuard。
- NNSR 是内部转发标签,不暴露为公网可见 header。
- 每个 transit hop 都会做本跳 underlay decrypt 和下一跳 underlay encrypt。
- Backend 是控制面,不参与逐包数据面转发。
- SD-WAN role 不拥有端口;端口只属于底层 transport endpoint。
- Backend 离线后,agent 继续使用已安装 route generation,直到新配置下发或本地策略失效。
当前基础
| 区域 | 当前状态 |
|---|---|
| Backend SD-WAN domain | 已有 policy、PCE、runtime config、install state 和 /api/sdwan/*。 |
| Frontend SD-WAN console | 已有 Overview、Policies、NNSR Paths、Topology、Simulator、Egress Targets、Underlay Sessions。 |
| Agent userspace dataplane | 已有 TUN、ingress、transit、egress、runtime table、path/policy/drop counters。 |
| Underlay sessions | QUIC REALITY 和 BoringTun WireGuard 可作为 NNSR protected underlay。 |
| Runtime reporting | Agent heartbeat 上报 route version、installed counts、path/policy counters、drop counters、underlay session counters。 |
用户心智模型
text
流量匹配 -> SD-WAN 选路策略 -> NNSR 路径 -> 出口动作典型策略:
text
0.0.0.0/0 from user-group-cn
path: HK -> JP -> US
egress: US node NAT
8.8.8.8/32
path: HK -> SG
egress: SG node NAT
10.0.0.0/8
path: private mesh
egress: remote TUN运维人员需要看到 route generation、policy match、NNSR path、node short ID、local label、forward action、underlay session、MTU budget、install state、runtime counter 和 fallback 状态。用户不应该配置 “SD-WAN port”。
Runtime Contract
Agent 接收的 SD-WAN runtime config 只表达这些概念:
text
sdwan
route_version
local_node_short_id
runtime
tun_name
tun_mtu
tun_ipv4 / tun_ipv6
ingress_enabled
batch_size
policies
paths
forward_entries
underlay_sessions
egress_actionsForward entry 只引用:
local_labelaction:swap/pop/dropnext_labelnext_node_idnext_node_short_idunderlay_session_idegress_action_id
Agent 要求
Agent 的 SD-WAN dataplane 收敛为 transport-agnostic NNSR pump:
text
SdwanUserspaceDataplane
-> TunDevice
-> NnsrCodec
-> SdwanUnderlayTransport trait
-> QuicRealityNnsrTransport
-> BoringTunWireGuardNnsrTransport运行要求:
- NNSR-C encode/decode 和 policy/forward table 与 underlay 解耦。
- QUIC/WireGuard adapter 对外只暴露 decrypted NNSR datagram。
- Transit 逻辑不关心底层 transport 类型。
- Runtime listener 上报必须显示真实 underlay mode、安全层和 transport endpoint。
- Heartbeat 必须上报 per-underlay-session rx/tx/error counters。
WebUI 要求
SD-WAN 页面按人类逻辑表达完整产品能力:
text
Route Policy
-> Match traffic
-> Choose ingress scope
-> Choose NNSR path intent
-> Choose egress target
-> Deploy route generation| Tab | 含义 |
|---|---|
| Overview | Route generation、安装状态、degraded path、runtime health。 |
| Route Policies | 用户意图:匹配条件、ingress scope、路径约束、出口动作。 |
| NNSR Paths | 逻辑路径、节点顺序、NNSR labels、forward actions、MTU budget。 |
| Egress Targets | NAT、remote TUN、local route、service upstream、drop。 |
| Underlay Sessions | SD-WAN 消费的 QUIC REALITY / BoringTun WireGuard underlay session。 |
| Topology | 节点、链路指标、underlay session、健康状态和排障动作。 |
| Route Simulator | 给定源/目的/协议/用户组,解释命中的 policy 和路径。 |
UI 规则:
- 不出现 “SD-WAN port” 字段。
- Ingress 表单只选择接入范围和类型:Site/LAN、Host/Endpoint、User/Identity、Service。
- 不出现 Cloud/VPC ingress 类型。
- Transit 在普通 UI 中只显示为路径节点,不暴露业务配置项。
- Egress 表单只选择交付动作:NAT、Remote TUN、Local Route、Service Upstream、Drop。
- Underlay session 和 transport endpoint 只在 Topology、Underlay Sessions 或 Diagnostics 中作为高级运行态信息展示。
- i18n 只维护英文和简体中文。
Roadmap
Phase 1:合同面收敛
- [x] Runtime config 下发 underlay session refs。
- [x] Forward entry 使用
underlay_session_id。 - [x] Protobuf 保留 SD-WAN runtime 的 NNSR path、forward entry、underlay session。
- [x] Backend runtime builder 生成 QUIC REALITY / BoringTun WireGuard underlay sessions。
- [x] Frontend 使用 “NNSR Paths” 和 “Underlay Sessions” 命名。
- [x] i18n 收敛到
en/zh-CN。
Phase 2:Session Runtime Health
- [x] Agent runtime counters 增加 per-underlay-session rx/tx/error。
- [x] Heartbeat 上报 underlay session counters。
- [x] Backend 持久化
sdwan_underlay_session_runtime。 - [x] Overview 合并 link telemetry 与 agent runtime error。
- [x] Underlay Sessions 列表显示 session id、rx/tx、error、last report。
Phase 3:NNSR-C label table
- [ ] Backend 生成 route-generation scoped node-local labels。
- [ ] Backend 生成
swap、pop、dropforward actions。 - [ ] Agent 支持 compact label lookup、TTL decrement、swap/pop/drop。
- [ ] Userspace tests 覆盖 ingress、swap、pop、TTL expiry、missing label、route generation replacement。
- [ ] Frontend path inspector 同时展示逻辑路径和 label table。
Phase 4:NNSR over QUIC REALITY / BoringTun WireGuard
- [ ] QUIC REALITY adapter 承载 NNSR-C datagram。
- [ ] BoringTun WireGuard adapter 承载 NNSR-C datagram。
- [ ] Transit receive path:underlay decap -> NNSR lookup -> next-hop underlay send。
- [ ] Runtime listener 上报
outer=quic/outer=wireguard、安全层和 NNSR payload。 - [ ] Integration test:三节点公网多跳 NNSR。
Phase 5:完整 SD-WAN 功能
- [ ] NAT/source rewrite 和公网出口 IP pool。
- [ ]
remote_tun、local_route、service_upstream完整数据面。 - [ ] Flow stickiness 和 fallback route generation。
- [ ] Topology telemetry 驱动自动 recompute。
- [ ] Per-path MTU budget、MSS clamp/fragment avoidance。
- [ ] Underlay session health、peer drain、节点维护和自动恢复。
Phase 6:性能优化
- [ ] TUN/datagram batch path。
- [ ] QUIC DATAGRAM send/recv batching。
- [ ] BoringTun worker/session reuse。
- [ ] Counter flush batching。
- [ ] Post-decap label lookup hot path 优化。
- [ ] Kernel DCO/offload 评估,不阻塞完整功能 SD-WAN。
验收标准
完整功能 SD-WAN 至少满足:
- 创建 policy 后可以 deploy route generation。
- 三节点公网链路可用 QUIC REALITY 或 BoringTun WireGuard 承载 internal NNSR 多跳。
- Transit 每跳做 underlay decrypt/encrypt,且公网抓包不可见 NNSR label。
- Backend 停止后,已安装 route generation 继续转发。
- UI 能解释 policy -> NNSR path -> label action -> egress action。
- UI 不要求用户配置 SD-WAN port。
- UI 不提供 Cloud/VPC ingress 类型。
- 节点/链路降级后可以 recompute 或切换 fallback。
- 新 runtime config 不包含 SD-WAN 自有监听端口。
术语
| 术语 | 定义 |
|---|---|
| SD-WAN | 按策略控制入口、路径、出口动作的 overlay routing 产品能力。 |
| NNSR | NexusNet Segment Routing;agent 内部 label forwarding 机制。 |
| NNSR-C | 4-byte compact NNSR label header。 |
| Route generation | Backend PCE 计算出的某一版 paths、labels 和 forward entries。 |
| Underlay session | 一条 SD-WAN 可消费的 QUIC REALITY 或 BoringTun WireGuard protected session。 |
| Egress target | 出口动作配置:NAT、Remote TUN、Local Route、Service Upstream、Drop。 |