optimize(mtu): Set lowest MTU among bound interfaces to dae0/dae0peer #827
Draft
jschwinger233 wants to merge 2 commits intodaeuniverse:mainfrom
Draft
optimize(mtu): Set lowest MTU among bound interfaces to dae0/dae0peer #827jschwinger233 wants to merge 2 commits intodaeuniverse:mainfrom
jschwinger233 wants to merge 2 commits intodaeuniverse:mainfrom
Conversation
Member
Author
|
要做 newlinkCallback 动态更新 mtu 😟 先 draft 之后再改 |
|
求更新 |
2 similar comments
|
求更新 |
Contributor
|
求更新 |
Note The following content has been translated from its original language using an automated process powered by a proprietary API. Segments originally written in English have been preserved, while non-English portions have been machine-translated for readability. Please be aware that minor inaccuracies may exist due to the automated nature of the translation. The input text has been translated from Chinese to English: Update needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
0.5 -> 0.6 引入 dae0 有个被忽视的变化——mtu 可能被缩小了,因为 dae0/dae0peer mtu 被硬编码为 1500. 这可能导致了 #509.
考虑 0.5 的 lan 劫持流量场景,假如 lan interface mtu 是 9000,那么被劫持流量的 tcp 握手协商 mss 为 9000 (9000-tcphdr-iphdr, 不要在意细节),最终能有 9000 大包到达 lan;但是 0.6 由于 dae0peer mtu 1500,导致握手 mss 协商为 1500,最终 tcp 会拆成小包抵达 lan。这不仅导致性能有所下降,而且触发了 tls 嗅探的 bug (#555).
这个 pr 尝试修复这种现象,让 dae0/dae0peer mtu 设置到 min(lan_interfaces..., wan_interfaces...) ,这样保底 1500,但允许 >1500 的 mtu。
理论上 wan 代理不受 dae0/dae0peer mtu 影响,因为有 gso。
扩大 mtu 是一件容易崩坏的事情,多测测再合并。
Checklist
Full Changelogs
Issue Reference
Closes #509
Test Result