应对包长与时序检测

Open
#7,536 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
go
Domain
networking

Research direction

Start by reading the XHTTP and XTLS-Vision transport implementations and the transport/internet layer mentioned in the proposal. The issue asks whether a traffic-shaping middleware belongs there or above XHTTP, but does not identify files, tests, or a settled design. Done would require an agreed scope and architecture for reframing, pacing, and optional cover traffic.

Written by the indexing model from the issue text.

Description

背景与观测

目前外层协议伪装(REALITY + uTLS)已基本解决静态协议特征与主动探测问题,但近期的被动 DPI 对抗重心正明显向**侧信道流量分析(Traffic Analysis)**转移,重点关注以下三类元特征:

  1. 包长序列(Packet Length Sequence):内层流量边界直接透传至外层加密流导致的特征包长。
  2. 方向切换与交互节奏(Turn-taking & RTT):代理中转引入的额外静默窗口与双层握手节奏。
  3. 包间到达时间(IAT)与宏观看板:上下行比例、突发形态与外层伪装目标站点业务画像不匹配。
现有机制的局限
  • XTLS-Vision:有效消除了 TLS-in-TLS 握手初期的标志性包长,但进入 direct copy 后,外层与内层恢复 1:1 映射。一旦内层承载非 TLS 交互流(如 SSH 小包)或长连接内的二次握手,包长与时序特征仍会直接暴露。
  • XHTTP (SplitHTTP):通过多路复用与 x_padding 极大稀释了单流特征,方向上非常正确。但目前发送行为仍以内层事件驱动为主,缺乏对发包节拍(Pacing)和静默期覆盖流量的主动调度。
建议探讨的演进方向

既然完全消除侧信道特征存在“带宽—延迟—CPU”的不可能三角,建议不强绑定于单一协议,而是探讨在 Xray-core 中引入可选、分级的流量整形机制:

  1. 打破 1:1 映射的全周期重分帧(Re-framing)
    在传输层引入可控缓冲队列,彻底切断内层 Write() 与外层 Record 边界的因果关系;Padding 长度从简单的均匀随机转向支持拟合真实业务包长分布(可参数化 Seed,避免统一指纹)。
  2. 时序整形与静默期覆盖(Pacing & Chaffing)
    针对代理等待目标站建连/响应时的特征性 RTT 空窗,探索按目标 IAT 模型调度发包,或在静默期注入轻量级覆盖流量(如 H2 填充帧),抹平代理中转带来的时序阶梯。
  3. 独立 Shaper 中间件与分级 Profile
    在 transport/internet 层之上抽象独立的整形包装层,允许用户按需选择:
    • 默认/高性能模式:保持现有 Vision / XHTTP 策略,保留零拷贝与低延迟优势。
    • 强对抗模式:显式牺牲部分带宽与延迟,开启全周期重分帧、Pacing 与哑流量注入。
期望讨论

想请教社区与核心开发者:

  1. Xray-core 后续是否有计划在 XHTTP 之上或独立传输中间件中,补齐时序(IAT)与全周期包长分布维度的对抗?
  2. 如果社区尝试提交相关 PoC(例如基于包长分布拟合的分帧器),核心架构上更倾向于放在 transport 的哪一层?
Dominant language
Go
Stars
43.3k
Forks
6.2k
Avg merge
2d 11h
Merged PRs (30d)
55

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from XTLS/Xray-core

All issues in XTLS/Xray-core

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.