Zoxc / crusader

A network throughput and latency tester.
Apache License 2.0
108 stars 8 forks source link

Add option to force the use of IPv6 or IPv4 #83

Open mcuee opened 6 days ago

mcuee commented 6 days ago

For my ISP (Singtel Fibre 5Gbps plan), IPv6 routing sometimes can be a bit worse than IPv4 (or vice versa, depending on servers). Crusader will rely on the OS to choose which one to go. Windows usually prefer IPv6 but it may prefer IPv4 if the IPv6 latency is high.

It would be good to add the option to force the use of IPv6 or IPv4.

The following test is using wireless (Asus RT-AX86U router, Acer Windows 11 2021 model with Intel AX201 WiFi 6 adapter, 3m away).

PS C:\work\speedtest\crusader_bin\v0.3.1> ping -4 Dallas.starlink.taht.net

Pinging Dallas.starlink.taht.net [72.14.183.212] with 32 bytes of data:
Reply from 72.14.183.212: bytes=32 time=254ms TTL=44
Reply from 72.14.183.212: bytes=32 time=269ms TTL=44
Reply from 72.14.183.212: bytes=32 time=238ms TTL=44
Reply from 72.14.183.212: bytes=32 time=209ms TTL=44

Ping statistics for 72.14.183.212:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 209ms, Maximum = 269ms, Average = 242ms

PS C:\work\speedtest\crusader_bin\v0.3.1> ping -6 Dallas.starlink.taht.net

Pinging Dallas.starlink.taht.net [2600:3c00::f03c:92ff:fe44:a9ab] with 32 bytes of data:
Reply from 2600:3c00::f03c:92ff:fe44:a9ab: time=305ms
Reply from 2600:3c00::f03c:92ff:fe44:a9ab: time=307ms
Reply from 2600:3c00::f03c:92ff:fe44:a9ab: time=215ms
Reply from 2600:3c00::f03c:92ff:fe44:a9ab: time=225ms

Ping statistics for 2600:3c00::f03c:92ff:fe44:a9ab:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 215ms, Maximum = 307ms, Average = 263ms

PS C:\work\speedtest\crusader_bin\v0.3.1> .\crusader.exe test Dallas.starlink.taht.net --download
[2024-10-01 16:23:31] Client version 0.3.1 running
[2024-10-01 16:23:32] Connected to server 72.14.183.212:35481
[2024-10-01 16:23:34] Idle latency to server 213.90 ms
[2024-10-01 16:23:38] Testing download...

-- Download test --
          Throughput: 213.12 Mbps
             Latency: 215.0 ms (106.3 ms down, 108.7 ms up)
         Packet loss: 0%

[2024-10-01 16:23:53] Writing data...
[2024-10-01 16:23:53] Saved raw data as crusader-results\crusader-results\test 2024-10-01 16.23.53.crr
[2024-10-01 16:23:53] Saved plot as crusader-results\test 2024-10-01 16.23.53.png

test 2024-10-01 16 23 53

mcuee commented 3 days ago

The work-around now is to use the IPv4 address or IPv6 address of the server to force the use of IPv4 or IPv6.