VPS被封. 现有排查问题:

  1. ping 能通, ping为应用层的命令
  2. ICMP也正常(ICMP 协议:网络层(L3),这是 ping 实际使用的核心协议)

ping在ICMP的上层

你执行:ping 8.8.8.8
          ↓
      ping 程序
          ↓
   ICMP Echo Request
          ↓
       IPv4 / IPv6
          ↓
        网络传输
          ↓
   ICMP Echo Reply
          ↓
      ping 程序显示结

ping命令的常见参数.

ping -n 6 YOURIP
Link to original

  • ping:发送 ICMP Echo Request。
  • -n 6:发送 6 次请求。
  • YOURIP:目标 IP 地址或域名。

没有指定 -4 或 -6:由系统选择 IP 协议版本。

ping -4 -n 4 YOURI
  • -4:强制使用 IPv4。
  • -n 4:发送 4 次请求

TTL

TTL = Time To Live
Time to live (TTL) or hop limit is a mechanism which limits the lifespan or lifetime of data in a computer or network.

Under the Internet Protocol, TTL is an 8-bit field. In the IPv4 header, TTL is the 9th octet of 20.

在windows终端里ping IPv6看不到ttl, 在IPv6中不存在ttl → 对应的是 hop limit

比如:

ping -n 6 www.baidu.com
 
Pinging www.a.shifen.com [240e:e9:6002:1ac:0:ff:b07e:36c5] with 32 bytes of data:
Reply from 240e:e9:6002:1ac:0:ff:b07e:36c5: time=332ms
Reply from 240e:e9:6002:1ac:0:ff:b07e:36c5: time=141ms
Reply from 240e:e9:6002:1ac:0:ff:b07e:36c5: time=65ms
Reply from 240e:e9:6002:1ac:0:ff:b07e:36c5: time=94ms
Reply from 240e:e9:6002:1ac:0:ff:b07e:36c5: time=160ms
Reply from 240e:e9:6002:1ac:0:ff:b07e:36c5: time=69ms
 
Ping statistics for 240e:e9:6002:1ac:0:ff:b07e:36c5:
    Packets: Sent = 6, Received = 6, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 65ms, Maximum = 332ms, Average = 143ms

另一个例子:

ping -6 -n 4 2607:8700:5501:9799::2
 
Pinging 2607:8700:5501:9799::2 with 32 bytes of data:
Request timed out.
Reply from 2607:8700:5501:9799::2: time=229ms
Reply from 2607:8700:5501:9799::2: time=213ms
Request timed out.
 
Ping statistics for 2607:8700:5501:9799::2:
    Packets: Sent = 4, Received = 2, Lost = 2 (50% loss),
Approximate round trip times in milli-seconds:
    Minimum = 213ms, Maximum = 229ms, Average = 221ms

ipv4中就有

ping -4 -n 4 8.8.8.8
 
Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=215ms TTL=105
Reply from 8.8.8.8: bytes=32 time=192ms TTL=105
Reply from 8.8.8.8: bytes=32 time=181ms TTL=105
Reply from 8.8.8.8: bytes=32 time=184ms TTL=105
 
Ping statistics for 8.8.8.8:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 181ms, Maximum = 215ms, Average = 193ms

L7 应用层 Application

HTTP、HTTPS、DNS、SSH、FTP、VLESS、VMess、Shadowsocks

L6 表示层 Presentation

数据编码、加密、压缩;TLS 常被概念性地放在这一层

L5 会话层 Session

会话建立、维护与管理;现代 TCP/IP 协议栈通常不单独划分这一层

L4 传输层 Transport

TCP、UDP、QUIC(QUIC 通常也被视作传输层协议)

L3 网络层 Network

IPv4、IPv6、ICMP、IPsec

VPS更换IPv6在这一层,即避开了传输层的审查.

L2 数据链路层 Data Link

Ethernet、Wi-Fi(802.11)、PPP、VLAN

L1 物理层 Physical

网线、光纤、无线电信号、网卡电气信号