Incorrect MTU value on Windows
Good day I accidentally discovered that I2Pd incorrectly determines MTU values for IPv4 interface on my system. This is probably due that there are IPv4 and IPv6 network interfaces on the same L2 interface (VLAN) simultaneously and they have different MTU values.
Use PowerShell cmdlet Get-NetIPInterface to get MTU:
> Get-NetIPInterface | Format-Table
ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore
------- -------------- ------------- ------------ --------------- ---- --------------- -----------
23 BitTorrent IPv6 1480 25 Disabled Connected ActiveStore
23 BitTorrent IPv4 1500 25 Disabled Connected ActiveStore
IPv6 interface have lower MTU because IPv6 connection Implemented via IPv6 tunnel broker (e.g. 6to4).
But in the
i2pd log
[14/Feb/2023:23:30:12 +0300]@471/info - Log: Logging level set to debug
[14/Feb/2023:23:30:12 +0300]@471/none - i2pd v2.45.1 (0.9.57) starting...
[14/Feb/2023:23:30:12 +0300]@471/info - AESNI enabled
[14/Feb/2023:23:30:12 +0300]@471/info - AVX enabled
[14/Feb/2023:23:30:12 +0300]@471/info - Transports: Accepting incoming connections at port 45301
[14/Feb/2023:23:30:12 +0300]@471/info - Daemon: Router configured as floodfill
[14/Feb/2023:23:30:12 +0300]@471/debug - I2NP: Max number of transit tunnels set to 20000
[14/Feb/2023:23:30:12 +0300]@471/info - Daemon: Bandwidth set to 1000000KBps
[14/Feb/2023:23:30:12 +0300]@471/debug - Daemon: running as service
[14/Feb/2023:23:30:12 +0300]@656/info - Win32Service: in OnStart (4)
[14/Feb/2023:23:30:12 +0300]@656/info - NetState: Trying to subscribe to NetworkListManagerEvents
[14/Feb/2023:23:30:12 +0300]@656/info - NetState: Current state: connected
[14/Feb/2023:23:30:12 +0300]@656/info - NetState: Successfully subscribed to NetworkListManagerEvent messages
[14/Feb/2023:23:30:12 +0300]@656/info - Daemon: Starting NetDB
[14/Feb/2023:23:30:12 +0300]@656/info - Family: 6 certificates loaded
[14/Feb/2023:23:30:13 +0300]@656/info - NetDb: 15516 routers loaded (1391 floodfils)
[14/Feb/2023:23:30:13 +0300]@656/info - Daemon: Starting Transports
[14/Feb/2023:23:30:13 +0300]@411/warn - Transports: 15 ephemeral keys generated at the time
[14/Feb/2023:23:30:13 +0300]@656/info - NetIface: GetMTU: Using 1480 bytes for IPv4 address xxx.xxx.xxx.2
[14/Feb/2023:23:30:13 +0300]@656/debug - Router: MTU for ipv4 address xxx.xxx.xxx.227 is set to 1480
[14/Feb/2023:23:30:13 +0300]@656/info - NetIface: GetMTU: Using 1480 bytes for IPv6 address xxx:xxx:xxx:xxx::101
[14/Feb/2023:23:30:13 +0300]@656/debug - Router: MTU for ipv6 address xxx:xxx:xxx:xxx::101 is set to 1480
At the same time, I discovered(by Wireshark) that all TCP incoming and outgoing TCP connections establishing with correct MSS values, both for IPv4 and IPv6:
IPv4: 1460 = 1500 - 20 (IPv4) - 20 (TCP) IPv6: 1420 = 1500 - 20 (IPv4 / 6to4) - 40 (IPv6) - 20 (TCP)
But it will be extremely difficult to reliably verify MTU for UDP.
OS: Windows 10 Enterprise LTSC x64 / Version 1809 (OS Build 17763.3770)
Override them manually. ssu2.mtu4 and ssu2.mtu6 in config
ssu2.mtu4 and ssu2.mtu6 in config
Thanks for info!