それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

wireguardのパケットサイズとMTUの値。

MTUの値

wireguard のMTUの値を調べた。

1420 = ip6 to ip6 で wireguardしたとき
1440 = ip4 to ip4 で wireguardしたとき

パケットはこんな感じになりますね。

f:id:takuya_1st:20211222173918p:plain

wireguardのパケットについては

IP以外に、40バイトを使います。

https://lists.zx2c4.com/pipermail/wireguard/2017-December/002201.htmlによれば

The overhead of WireGuard breaks down as follows:
- 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

ということです。

フレッツPPPoE経由でwireguardやったとき

フレッツPPPoEは、MTU1454 です。20+8+16+2=46バイト切り詰めです。
残った1454からwireguard が使う40バイトとip4の20バイトを切り詰めです。
ってことは、1394かな。

f:id:takuya_1st:20211222175831p:plain

ds-liteの場合や、ybb/sb のipip の場合はどうなるんだろう。

参考サイト