feat: add DSCP rule for Tproxy UDP packets #996
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
为 Tproxy 模式下的 UDP 包增加 DSCP 规则,使得 UDP 可以根据其 IP 报文头部的 DSCP 进行分流。
在 Windows 下,可以设置 QoS 策略,此策略可以根据进程修改 IP 报文的 DSCP;在 Linux 下,可以通过 iptables 等用户态工具为应用或用户修改 IP 报文的 DSCP。从而,在开启 Tproxy 的透明代理模式下,通过 DSCP 规则进行 UDP 分流可以等效地实现针对代理下客户端的分应用 UDP 分流或分用户 UDP 分流。