增加cache restart和cache shutdown
This commit is contained in:
@@ -7,7 +7,7 @@ RTR 用于把 RP/Cache 已完成密码学验证的 RPKI 数据下发给路由器
|
||||
本文按以下规范整理:
|
||||
- RFC 6810(RTR v0)
|
||||
- RFC 8210(RTR v1,更新 RFC 6810)
|
||||
- draft-ietf-sidrops-8210bis-25(RTR v2,草案)
|
||||
- draft-ietf-sidrops-8210bis-26(RTR v2,草案)
|
||||
|
||||
## 11.2 协议演进
|
||||
|
||||
@@ -35,7 +35,7 @@ RTR 用于把 RP/Cache 已完成密码学验证的 RPKI 数据下发给路由器
|
||||
|
||||
PDU 类型(按规范注册表):
|
||||
|
||||
| PDU Type | 名称 | v0 (RFC6810) | v1 (RFC8210) | v2 (8210bis-25) |
|
||||
| PDU Type | 名称 | v0 (RFC6810) | v1 (RFC8210) | v2 (8210bis-26) |
|
||||
|---|---|---|---|---|
|
||||
| 0 | Serial Notify | 支持 | 支持 | 支持 |
|
||||
| 1 | Serial Query | 支持 | 支持 | 支持 |
|
||||
@@ -105,6 +105,12 @@ PDU 类型(按规范注册表):
|
||||
2. Cache 若可增量,返回变化并以 `End of Data` 收尾。
|
||||
3. 若不可增量,返回 `Cache Reset`;Router 退回 Full Sync。
|
||||
|
||||
### 11.5.3 Cache Restart / Cache Shutdown(v2)
|
||||
|
||||
- `Cache Restart`:Cache 即将对已连接客户端不可用,但预计会在客户端达到 Expire Interval 前恢复;v2 session 应发送 `Error Report` code 12,随后关闭连接。
|
||||
- `Cache Shutdown`:Cache 即将有意下线,并希望客户端 flush 从该 cache 学到的数据;v2 session 应发送 `Error Report` code 13,随后关闭连接。
|
||||
- 这两个错误码只属于 v2。v0/v1 session 不得发送 code 12/13,只能关闭连接。
|
||||
|
||||
## 11.6 版本协商与降级
|
||||
|
||||
- Router 每次新连接必须由 `Reset Query` 或 `Serial Query` 启动,携带其协议版本。
|
||||
@@ -138,6 +144,21 @@ PDU 类型(按规范注册表):
|
||||
- 对 Cache 输出 payload 的顺序提出约束。
|
||||
- 建议 Router 使用“事务式应用”(例如接收到完整响应后再切换生效)降低中间态影响。
|
||||
|
||||
### 11.8.3 Error Code 版本范围
|
||||
|
||||
- v0(RFC6810):0..7。
|
||||
- v1(RFC8210):继承 v0,并新增 8 `Unexpected Protocol Version`。
|
||||
- v2(8210bis-26):继承 v1,并新增 9 `ASPA Provider List Error`、10 `Transport Failure`、11 `Ordering Error`、12 `Cache Restart`、13 `Cache Shutdown`。
|
||||
- 实现发送 Error Report 时,只能发送当前 session 协议版本定义过的错误码。
|
||||
|
||||
### 11.8.4 本实现的生命周期控制
|
||||
|
||||
- `RPKI_RTR_STOP_REASON=cache-restart|cache-shutdown|close-only` 控制进程收到 Ctrl-C 后的服务停止语义,默认 `cache-restart`。
|
||||
- Admin API:
|
||||
- `POST /admin/rtr/lifecycle/restart`:向 v2 established clients 发送 `Cache Restart`,然后走进程退出路径;实际重新拉起由 systemd/Docker/Kubernetes/Windows Service 等 supervisor 完成。若没有外部机制在客户端 `Expire Interval` 到期前恢复服务,不应使用该接口。
|
||||
- `POST /admin/rtr/lifecycle/shutdown`:向 v2 established clients 发送 `Cache Shutdown`,然后退出进程。
|
||||
- v0/v1 或尚未完成版本协商的连接不会收到 code 12/13。
|
||||
|
||||
## 11.9 传输与安全
|
||||
|
||||
规范定义可承载于多种传输:
|
||||
@@ -155,4 +176,4 @@ PDU 类型(按规范注册表):
|
||||
|
||||
- RFC 6810: https://www.rfc-editor.org/rfc/rfc6810.html
|
||||
- RFC 8210: https://www.rfc-editor.org/rfc/rfc8210.html
|
||||
- draft-ietf-sidrops-8210bis-25: https://www.ietf.org/archive/id/draft-ietf-sidrops-8210bis-25.html
|
||||
- draft-ietf-sidrops-8210bis-26: https://www.ietf.org/archive/id/draft-ietf-sidrops-8210bis-26.html
|
||||
|
||||
Reference in New Issue
Block a user