mirror of
https://github.com/XTLS/Xray-docs-next.git
synced 2025-01-19 01:01:41 +03:00
添加MTU计算方法
This commit is contained in:
parent
c97a00dcd8
commit
a066238953
@ -46,6 +46,24 @@ Wireguard 会在本地开启虚拟网卡 tun。使用一个或多个 IP 地址
|
||||
|
||||
Wireguard 底层 tun 的分片大小。
|
||||
|
||||
<details>
|
||||
<summary>MTU的计算方法</summary>
|
||||
|
||||
一个wireguard数据包的结构如下
|
||||
|
||||
```
|
||||
- 20-byte IPv4 header or 40 byte IPv6 header
|
||||
- 8-byte UDP header
|
||||
- 4-byte type
|
||||
- 4-byte key index
|
||||
- 8-byte nonce
|
||||
- N-byte encrypted data
|
||||
- 16-byte authentication tag
|
||||
```
|
||||
|
||||
```N-byte encrypted data```即为我们需要的MTU的值,根据endpoint是IPv4还是IPv6,具体的值可以是1440(IPv4)或者1420(IPv6),如果处于特殊环境下再额外减掉即可(如家宽PPPoE额外-8)。
|
||||
</details>
|
||||
|
||||
> `reserved` \[ number \]
|
||||
|
||||
Wireguard 保留字节。
|
||||
|
Loading…
x
Reference in New Issue
Block a user