strp

偶然发现挂着透明代理时的 MSS 不太对劲

  •  
  •   strp · Apr 27, 2023 · 4667 views
    This topic created in 1292 days ago, the information mentioned may be changed or developed.

    https://www.speedguide.net/analyzer.php

    路由器挂着透明代理:

    enter image description here

    Maximum useful data in each packet = 1448, which is less than MSS because of Timestamps, or other TCP/IP options used.

    直连:

    enter image description here

    某家机场就更离谱:

    enter image description here

    因为它提到了 Timestamps 所以我想是不是 Linux 的问题,难道 Linux 默认访问网络都会给 TCP 连接带上时间戳吗?我测了几台服务器都是这样,评论区懂得大佬可以说一下。

    解决方法: 在你的服务器 nano /etc/sysctl.conf 最后加上 net.ipv4.tcp_timestamps = 0 保存 然后 sysctl -p

    结果:

    enter image description here

    enter image description here

    17 replies  •  2023-04-27 22:31:35 +08:00
    piku
    piku
    Apr 27, 2023 via Android
    1
    感谢分享,一直觉得家里的网 mtu 有问题,但是查来查去又找不到原因
    piku
    piku
    Apr 27, 2023 via Android
    2
    我是说,我直连就有问题
    UXha45veSNpWCwZR
    UXha45veSNpWCwZR
    Apr 27, 2023 via iPhone
    3
    完全看不明白
    GGC4
    GGC4
    Apr 27, 2023
    4
    不懂 我用的测着和你一样 低了会发生什么
    titanium98118
    titanium98118
    Apr 27, 2023 via iPhone
    5
    我跟你一样 mss 1460 ,这有什么影响?不太懂
    datou
    datou
    Apr 27, 2023
    6
    电信把这网站墙了,尴尬
    Archeb
    Archeb
    Apr 27, 2023
    7
    广州电信游戏宽带的 CN2 出口的 MTU 竟然是 1440……不知道 NAT 网关是怎么搞的,有点离谱

    测试了普通 163 (公网)、联通(公网)和移动( NAT )都是正常的 1492
    ryd994
    ryd994
    Apr 27, 2023 via Android
    8
    如果这家机场用的是 azure 的话那就正常。azure 的 mss 就是 1400
    Archeb
    Archeb
    Apr 27, 2023
    9
    1440 的 MTU 应该是采用了某种隧道或者 VPN 技术导致的( IPSec Transport Mode 或者 WireGuard ),这也许说明这个游戏宽带并不是直接把 CN2 IP 分配到 BRAS 上然后 NAT ,而是 BRAS 与另一处的 CN2 网关打了隧道再把用户流量路由过去。

    楼主的这个机场可能也是路径上有隧道。
    YGBlvcAK
    YGBlvcAK
    Apr 27, 2023
    10
    自己的 vps ,也是这样:
    MTU = 1500
    MTU is fully optimized for broadband.
    MSS = 1460
    Maximum useful data in each packet = 1448, which is less than MSS because of Timestamps, or other TCP/IP options used.

    想问下有什么影响吗? net.ipv4.tcp_timestamps=0 会带来什么提升呢?
    v2gba
    v2gba
    Apr 27, 2023
    11
    MTU = 1460
    MSS = 1420

    企业专线🐶

    我觉得需要更多的背景知识才能下结论,有专业的人解释下么。
    v2gba
    v2gba
    Apr 27, 2023
    12
    #11

    研究了下 GCP 的默认 MTU 就是 1460
    > We recommend a value of 1460 bytes because that matches the default MTU setting for Google Cloud virtual machine (VM) instances.


    > The effective MTU for peer systems and Google Cloud VMs is typically lower than the MTU of your VPN gateway:

    > For TCP traffic, MSS clamping rewrites the SYN packet of the initial TCP handshake. This action lets systems dynamically adjust maximum segment size (MSS) to accommodate encapsulation.

    > For UDP traffic, if your firewall rule permits ICMP traffic, then Path MTU Discovery (PMTUD) can negotiate smaller MTU sizes under certain circumstances.We recommend a value of 1460 bytes because that matches the default MTU setting for Google Cloud virtual machine (VM) instances.

    结论:云商服务器的 MTU 低于家庭内部常见的 1500 很正常, 感觉强行调大没准有副作用。
    mmdsun
    mmdsun
    Apr 27, 2023 via iPhone
    13
    MTU 不一样对速度影响大吗?
    totoro625
    totoro625
    Apr 27, 2023
    14
    移动企业专线:
    MTU = 1500 + MSS = 1460
    梯子:
    MTU = 1440 + MSS = 1400
    MTU = 1500 + MSS = 1460
    MTU = 9000 + MSS = 9860
    XIU2
    XIU2
    Apr 27, 2023
    15
    我直连就是这样,咋回事?。。。
    MTU = 1440
    MSS = 1400
    oIMOo
    oIMOo
    Apr 27, 2023
    16
    手机网络直连,出现你图三的离谱场景……
    cosmain
    cosmain
    Apr 27, 2023
    17
    “Maximum useful data in each packet = 1448, which is less than MSS because of Timestamps, or other TCP/IP options used.”

    这个是说 MSS 里,timestamps 等 tcp/ip 选项占用了一些字节,你禁用完全没有问题,不禁用也有好处,比如网络设备之间确认 RTT

    MTU 不是 1500 也没有关系,并不会对你的通信有啥影响,而且很多时候在翻墙的网络下还不容易出问题。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4552 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 09:02 · PVG 17:02 · LAX 01:02 · JFK 04:02
    ♥ Do have faith in what you're doing.