不同提供商具有相同的 MTU 时具有不同的 TCP MSS 值

不同提供商具有相同的 MTU 时具有不同的 TCP MSS 值

我在与特定 DSL 提供商的互联网连接方面遇到了问题,经过大量研究后,问题归结为以下几点。

假设有两个提供商 A 和 B 通过 PPPoE 连接(在 Ubuntu 14.04 上,相同的配置选项,相同的标准 MTU 1492)

提供者:A

ppp0      Link encap:Point-to-Point Protocol
          inet addr:192.168.100.1  P-t-P:192.168.100.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:422406 errors:0 dropped:0 overruns:0 frame:0
          TX packets:383588 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:410702336 (410.7 MB)  TX bytes:76099873 (76.0 MB)

提供者:B

ppp0      Link encap:Point-to-Point Protocol
          inet addr:192.168.200.1  P-t-P:192.168.200.2  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:3519252 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2547278 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:4506505131 (4.5 GB)  TX bytes:337199879 (337.1 MB)

以下是来自两个提供商的 tcpdump 摘录:

提供者:A (成功的IMAP 连接尝试)

10:58:33.085863 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [SEW], seq 3899194038, win 8192, options [**mss 1452**,nop,wscale 8,nop,nop,sackOK], length 0
10:58:33.133981 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [S.E], seq 2576858288, ack 3899194039, win 29200, options [mss 1452,nop,nop,sackOK,nop,wscale 9], length 0
10:58:33.134472 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [.], ack 1, win 516, length 0
10:58:33.134989 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [P.], seq 1:156, ack 1, win 516, length 155
10:58:33.244366 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [.], ack 156, win 60, length 0
10:58:33.252382 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [.], seq 1:1453, ack 156, win 60, length 1452
10:58:33.253614 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [.], seq 1453:2905, ack 156, win 60, length 1452
10:58:33.254268 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [.], ack 2905, win 516, length 0
10:58:33.255073 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [.], seq 2905:4357, ack 156, win 60, length 1452
10:58:33.255392 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [P.], seq 4357:4996, ack 156, win 60, length 639
10:58:33.255778 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [.], ack 4996, win 516, length 0
10:58:33.277521 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [P.], seq 156:282, ack 4996, win 516, length 126
10:58:33.344742 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [P.], seq 4357:4996, ack 156, win 60, length 639
10:58:33.345176 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [.], ack 4996, win 516, options [nop,nop,sack 1 {4357:4996}], length 0
10:58:33.392306 IP imap.example.net.imaps > provider-1.example.com.56892: Flags [P.], seq 4996:5047, ack 282, win 60, length 51
10:58:33.425148 IP provider-1.example.com.56892 > imap.example.net.imaps: Flags [.], ack 5047, win 515, length 0

提供者:B(不成功IMAP 连接尝试)

10:11:45.242953 IP provider-2.example.com.44741 > imap.example.net.imaps: Flags [SEW], seq 3877989337, win 8192, options [**mss 1460**,nop,wscale 8,nop,nop,sackOK], length 0
10:11:45.264231 IP imap.example.net.imaps > provider-2.example.com.44741: Flags [S.], seq 3355386868, ack 3877989338, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 9], length 0
10:11:45.264962 IP provider-2.example.com.44741 > imap.example.net.imaps: Flags [.], ack 1, win 513, length 0
10:11:45.271981 IP provider-2.example.com.44741 > imap.example.net.imaps: Flags [P.], seq 1:156, ack 1, win 513, length 155
10:11:45.294039 IP imap.example.net.imaps > provider-2.example.com.44741: Flags [.], ack 156, win 60, length 0
10:11:45.300146 IP imap.example.net.imaps > provider-2.example.com.44741: Flags [P.], seq 4381:4996, ack 156, win 60, length 615
10:11:45.300727 IP provider-2.example.com.44741 > imap.example.net.imaps: Flags [.], ack 1, win 513, options [nop,nop,sack 1 {4381:4996}], length 0
10:11:55.293705 IP imap.example.net.imaps > provider-2.example.com.44741: Flags [F.], seq 4996, ack 156, win 60, length 0
10:11:55.294414 IP provider-2.example.com.44741 > imap.example.net.imaps: Flags [.], ack 1, win 513, options [nop,nop,sack 1 {4381:4996}], length 0

我发现,如果我手动将 TCP MSS 的值设置为 1452,则使用mss 截断在提供商 B 的 Linux Box 上(在 tcpdump 输出中可以看到其端口为 1460),则连接建立成功。

我的问题是,为什么一个提供商的 tcp 将 mss 值设置为 1452(对于 MTU 为 1492 的 PPPoE 来说,这似乎也是正确的),而另一个提供商的 tcp 值却没有设置为 1452。这些机器完全相同,并且来自同一个映像,具有相同的内核和操作系统版本。据我所知,一切都完全相同。提供商可以控制这一点吗?或者我应该在哪里查看?

我真的很想知道在手动更改之前我是否已经尝试了所有方法。

相关内容