Skip to content

feat(network): Add IPv6 support - #2724

Merged
mkroening merged 1 commit into
hermit-os:mainfrom
Gelbpunkt:ipv6
Sep 23, 2026
Merged

mkroening merged 1 commit into
hermit-os:mainfrom
Gelbpunkt:ipv6

Conversation

@Gelbpunkt

Copy link
Copy Markdown
Member

This adds support for specifying IPv6 addresses in the ip= parameter and wires it up to the interface configuration. With these changes, we can reach a Hermit VM over IPv6. However, since our test setup is currently based on the assumption that many of the tests only perform e.g. a single HTTP request, test coverage is quite lackluster. The loopback example can trivially be adjusted to test both IPv4 and IPv6.

Loopback example change: hermit-os/hermit-rs#1089

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 425751b Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 90.96 s 80.34 s 1.13
startup_benchmark File Size 0.79 MB 0.80 MB 1.00
Startup Time - 1 core 0.77 s (±0.02 s) 0.75 s (±0.02 s) 1.03
Startup Time - 2 cores 0.78 s (±0.02 s) 0.74 s (±0.02 s) 1.06
Startup Time - 4 cores 0.77 s (±0.02 s) 0.74 s (±0.02 s) 1.04
multithreaded_benchmark Build Time 90.50 s 82.11 s 1.10
multithreaded_benchmark File Size 0.85 MB 0.86 MB 0.99
Multithreaded Pi Efficiency - 2 Threads 89.84 % (±9.07 %) 85.89 % (±6.61 %) 1.05
Multithreaded Pi Efficiency - 4 Threads 44.83 % (±3.83 %) 43.43 % (±2.56 %) 1.03
Multithreaded Pi Efficiency - 8 Threads 25.63 % (±1.61 %) 25.76 % (±1.53 %) 1.00
micro_benchmarks Build Time 85.99 s 80.40 s 1.07
micro_benchmarks File Size 0.86 MB 0.86 MB 0.99
Scheduling time - 1 thread 65.27 ticks (±2.38 ticks) 62.65 ticks (±4.06 ticks) 1.04
Scheduling time - 2 threads 38.72 ticks (±6.23 ticks) 34.08 ticks (±4.10 ticks) 1.14
Micro - Time for syscall (getpid) 3.49 ticks (±0.60 ticks) 3.45 ticks (±0.58 ticks) 1.01
Memcpy speed - (built_in) block size 4096 78560.89 MByte/s (±54475.04 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 0.95
Memcpy speed - (built_in) block size 1048576 29535.48 MByte/s (±23947.48 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 0.97
Memcpy speed - (built_in) block size 16777216 27708.67 MByte/s (±22803.81 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 1.05
Memset speed - (built_in) block size 4096 78364.91 MByte/s (±54333.43 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 0.95
Memset speed - (built_in) block size 1048576 30268.37 MByte/s (±24377.94 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 0.97
Memset speed - (built_in) block size 16777216 28448.61 MByte/s (±23235.99 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 1.05
Memcpy speed - (rust) block size 4096 70860.40 MByte/s (±49618.40 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 0.96
Memcpy speed - (rust) block size 1048576 29398.54 MByte/s (±23936.41 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 0.97
Memcpy speed - (rust) block size 16777216 27403.97 MByte/s (±22541.39 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 0.99
Memset speed - (rust) block size 4096 71187.57 MByte/s (±49876.35 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 0.96
Memset speed - (rust) block size 1048576 30115.73 MByte/s (±24355.58 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 0.97
Memset speed - (rust) block size 16777216 28130.17 MByte/s (±22964.31 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 0.99
alloc_benchmarks Build Time 86.18 s 74.76 s 1.15
alloc_benchmarks File Size 0.87 MB 0.87 MB 1.00
Allocations - Allocation success 91.38 % 91.31 % 1.00
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.60 % 61.44 % 1.00
Allocations - Average Allocation time 11753.34 Ticks (±209.06 Ticks) 5860.58 Ticks (±98.43 Ticks) 2.01
Allocations - Average Allocation time (no fail) 12324.33 Ticks (±286.27 Ticks) 6554.81 Ticks (±92.86 Ticks) 1.88
Allocations - Average Deallocation time 3278.98 Ticks (±905.62 Ticks) 1805.01 Ticks (±250.35 Ticks) 1.82
mutex_benchmark Build Time 83.87 s 79.82 s 1.05
mutex_benchmark File Size 0.86 MB 0.86 MB 0.99
Mutex Stress Test Average Time per Iteration - 1 Threads 12.82 ns (±0.52 ns) 12.10 ns (±0.41 ns) 1.06
Mutex Stress Test Average Time per Iteration - 2 Threads 87.70 ns (±3.26 ns) 40.26 ns (±1.68 ns) 2.18

This comment was automatically generated by workflow using github-action-benchmark.

@mkroening mkroening left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is great! :)

Comment thread src/syscalls/socket/addrinfo.rs Outdated
Comment thread xtask/hermit-ifup
# Usage: .. -netdev tap,script=hermit-ifup,..

ip address add dev "$1" local 10.0.5.1/24 broadcast 10.0.5.255
ip address add dev "$1" local fdfb:5494:2d56::1/48

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this address come from? Is this derived from the default MAC address? We should specify in a comment how to change this if a different MAC address is set via the QEMU cmdline.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the first subnet that https://www.unique-local-ipv6.com/ output for me :D

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. So this is the same address that is also hardcoded in xtask. How does this address relate to the Hermit-generated link-local address? :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a ULA (unique local address) in the fc00::/7 subnet which is destined for addresses only reachable in private networks. It's kind of the IPv6 equivalent to the IPv4 private networks like 10.0.0.0/8, which was being used for IPv4.

The link-local addresses are in the subnet of fe80::/10 and only reachable on a local link (and also ignored by routers).

This adds support for specifying IPv6 addresses in the ip= parameter and
wires it up to the interface configuration. With these changes, we can
reach a Hermit VM over IPv6. However, since our test setup is currently
based on the assumption that many of the tests only perform e.g. a
single HTTP request, test coverage is quite lackluster. The loopback
example can trivially be adjusted to test both IPv4 and IPv6.
@mkroening

Copy link
Copy Markdown
Member

Thanks you so much! :)

@mkroening
mkroening added this pull request to the merge queue Sep 23, 2026
@mkroening
mkroening removed this pull request from the merge queue due to a manual request Sep 23, 2026
@mkroening
mkroening added this pull request to the merge queue Sep 23, 2026
@mkroening

Copy link
Copy Markdown
Member

I merged hermit-os/hermit-rs#1089 first, to test it here.

Merged via the queue into hermit-os:main with commit 7760f95 Sep 23, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants