> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/cn/elastic-compute/ddos-protection/03-cleaning-deep-dive.md).

# 流量清洗工作原理

本页提供 DDoS 流量清洗流水线的详细介绍。如需高层概述，请参阅 [DDoS 防护](/welcome/cn/elastic-compute/ddos-protection/02-ddos-protection.md)。

## 清洗流水线

当分析系统判定某个 EIP 正在遭受攻击时，以下流程将自动运行。

### 第一步：持续监控与检测

分析系统近实时地监控每个受保护 EIP 的流量，追踪三项入站指标：BPS（每秒比特数）、PPS（每秒数据包数）和 InCPS（每秒入站连接数）。每个 EIP 都有这些指标的阈值——系统默认值，或您自定义配置的值。当任何指标超过其阈值时，清洗将自动开始。

有关每项指标的完整说明及攻击场景示例，请参阅[流量指标](/welcome/cn/elastic-compute/ddos-protection/05-traffic-metrics.md)。

### 第二步：BGP 路由转发

一旦确认攻击，发往受影响 EIP 的流量将在数秒内自动重新路由至清洗中心。无需进行 DNS 更改或手动干预。

### 第三步：流量清洗

清洗中心分两个阶段处理转发的流量。

首先，硬件级别的流量整形在软件处理之前丢弃超过速率阈值的流量——以线速处理最大规模的攻击。

其次，深度数据包检测引擎应用您配置的策略：协议过滤、指纹匹配、地理规则和 IP 允许/拦截列表。匹配丢弃规则的流量将被丢弃；匹配速率限制规则的流量将被限速；其余流量标记为干净并转发至您的实例。

### 第四步：干净流量重新注入

清洗完成后，干净的流量通过正常路由路径转发回您的实例。在此阶段执行带宽计量，以确保重新注入的流量保持在您订阅的带宽限制之内。

### 第五步：清洗结束与升级

系统在整个清洗期间持续监控流量。当攻击流量减弱且指标恢复到阈值以下时，BGP 转发路由将被撤回，流量恢复至正常路径。如果攻击强度超过清洗中心的处理能力，系统将作为最后手段升级至完全封禁路由。

每个阶段您都会收到通知：清洗开始时、清洗结束时，以及升级至封禁路由时。状态定义请参阅 [DDoS 防护——清洗事件生命周期](/welcome/cn/elastic-compute/ddos-protection/02-ddos-protection.md#cleaning-event-lifecycle)。

## 架构图

下图展示了完整的流量清洗流水线，从初始检测到 BGP 转发、清洗和重新注入的全过程。

**关键流向：**

* **绿色（实线）：** 干净或正常流量沿标准转发路径流动。
* **红色（虚线）：** 攻击流量通过 BGP 转发至清洗中心。
* **橙色（虚线）：** 控制平面与上游路由器之间的 BGP 控制信号。

**清洗中心组件：**

* **硬件加速：** 可编程交换机以线速执行 BPS/PPS 流量整形，在软件处理之前处理最大规模的攻击。
* **清洗设备：** 深度数据包检测引擎，应用协议过滤、指纹匹配、端口范围过滤和地理规则。
* **策略引擎：** 应用客户配置的策略——IP 允许/拦截列表、速率限制、会话限制和地理拦截规则。
* **转发层：** 通过封装隧道将干净流量重新注入至源端，并执行带宽计量。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/cn/elastic-compute/ddos-protection/03-cleaning-deep-dive.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
