Skip to content

feat: add the icmp-echo-reply feature - #2616

Open
stlankes wants to merge 2 commits into
hermit-os:mainfrom
stlankes:ping
Open

feat: add the icmp-echo-reply feature#2616
stlankes wants to merge 2 commits into
hermit-os:mainfrom
stlankes:ping

Conversation

@stlankes

@stlankes stlankes commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

smoltcp answers ICMP echo requests by itself once auto-icmp-echo-reply is set, for IPv4 as well as IPv6, so making a Hermit guest respond to ping needs nothing beyond the feature flag.

I tested the configuration on macOS as follows:

$ cargo build --release -Zbuild-std=std,panic_abort --target=aarch64-unknown-hermit -p httpd --features hermit/echo-reply,hermit/pci,hermit/virtio-net,hermit/dhcpv4
$ sudo qemu-system-aarch64 -display none -serial stdio \
  -machine virt,gic-version=3 \
  -cpu max,lpa2=off  \
  -smp 1 -m 1024M \
  -global virtio-mmio.force-legacy=off \
  -kernel hermit-loader-aarch64 \
  -device guest-loader,addr=0x48000000,initrd=target/aarch64-unknown-hermit/release/httpd \
  -netdev vmnet-shared,id=net0,start-address=192.168.68.2,end-address=192.168.68.254,subnet-mask=255.255.255.0 \
  -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:56,disable-legacy=on,packed=on,mq=on
$ ping -c 5 192.168.68.3
PING 192.168.68.3 (192.168.68.3): 56 data bytes
64 bytes from 192.168.68.3: icmp_seq=0 ttl=64 time=2.790 ms
64 bytes from 192.168.68.3: icmp_seq=1 ttl=64 time=0.485 ms
64 bytes from 192.168.68.3: icmp_seq=2 ttl=64 time=0.724 ms
64 bytes from 192.168.68.3: icmp_seq=3 ttl=64 time=0.621 ms
64 bytes from 192.168.68.3: icmp_seq=4 ttl=64 time=0.855 ms

close #2608

@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: fc53e38 Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 91.37 s 80.34 s 1.14
startup_benchmark File Size 0.79 MB 0.80 MB 0.99
Startup Time - 1 core 0.70 s (±0.01 s) 0.75 s (±0.02 s) 0.94
Startup Time - 2 cores 0.71 s (±0.01 s) 0.74 s (±0.02 s) 0.97
Startup Time - 4 cores 0.71 s (±0.01 s) 0.74 s (±0.02 s) 0.96
multithreaded_benchmark Build Time 89.74 s 82.11 s 1.09
multithreaded_benchmark File Size 0.84 MB 0.86 MB 0.98
Multithreaded Pi Efficiency - 2 Threads 66.79 % (±4.99 %) 85.89 % (±6.61 %) 0.78
Multithreaded Pi Efficiency - 4 Threads 41.22 % (±3.29 %) 43.43 % (±2.56 %) 0.95
Multithreaded Pi Efficiency - 8 Threads 20.52 % (±1.75 %) 25.76 % (±1.53 %) 0.80
micro_benchmarks Build Time 223.08 s 80.40 s 2.77
micro_benchmarks File Size 0.84 MB 0.86 MB 0.98
Scheduling time - 1 thread 148.06 ticks (±29.30 ticks) 62.65 ticks (±4.06 ticks) 2.36
Scheduling time - 2 threads 89.19 ticks (±22.96 ticks) 34.08 ticks (±4.10 ticks) 2.62
Micro - Time for syscall (getpid) 9.22 ticks (±5.59 ticks) 3.45 ticks (±0.58 ticks) 2.67
Memcpy speed - (built_in) block size 4096 60702.61 MByte/s (±43101.14 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 0.74
Memcpy speed - (built_in) block size 1048576 16441.42 MByte/s (±14149.25 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 0.54
Memcpy speed - (built_in) block size 16777216 12999.38 MByte/s (±10991.43 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 0.49
Memset speed - (built_in) block size 4096 61284.49 MByte/s (±43494.20 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 0.74
Memset speed - (built_in) block size 1048576 16891.17 MByte/s (±14393.80 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 0.54
Memset speed - (built_in) block size 16777216 13364.21 MByte/s (±11211.11 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 0.49
Memcpy speed - (rust) block size 4096 52876.99 MByte/s (±38563.21 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 0.71
Memcpy speed - (rust) block size 1048576 15549.03 MByte/s (±12478.44 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 0.51
Memcpy speed - (rust) block size 16777216 12892.17 MByte/s (±10642.24 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 0.47
Memset speed - (rust) block size 4096 53536.33 MByte/s (±38994.13 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 0.72
Memset speed - (rust) block size 1048576 15638.53 MByte/s (±12522.93 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 0.50
Memset speed - (rust) block size 16777216 13134.09 MByte/s (±10754.64 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 0.46
alloc_benchmarks Build Time 211.34 s 74.76 s 2.83
alloc_benchmarks File Size 0.86 MB 0.87 MB 0.99
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 26624.67 Ticks (±1668.45 Ticks) 5860.58 Ticks (±98.43 Ticks) 4.54
Allocations - Average Allocation time (no fail) 27505.70 Ticks (±1911.75 Ticks) 6554.81 Ticks (±92.86 Ticks) 4.20
Allocations - Average Deallocation time 6081.42 Ticks (±1429.98 Ticks) 1805.01 Ticks (±250.35 Ticks) 3.37
mutex_benchmark Build Time 207.73 s 79.82 s 2.60
mutex_benchmark File Size 0.84 MB 0.86 MB 0.98
Mutex Stress Test Average Time per Iteration - 1 Threads 34.22 ns (±7.22 ns) 12.10 ns (±0.41 ns) 2.83
Mutex Stress Test Average Time per Iteration - 2 Threads 31.16 ns (±9.38 ns) 40.26 ns (±1.68 ns) 0.77

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

@stlankes
stlankes enabled auto-merge August 10, 2026 15:38
@stlankes
stlankes added this pull request to the merge queue Aug 10, 2026
@mkroening
mkroening removed this pull request from the merge queue due to a manual request Aug 10, 2026
@mkroening mkroening changed the title feat(net): add the echo-reply feature feat: add the icmp-echo-reply feature Aug 10, 2026

@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.

Great! :)

smoltcp answers ICMP echo requests by itself once auto-icmp-echo-reply
is set, for IPv4 as well as IPv6, so making a Hermit guest respond to
ping needs nothing beyond the feature flag.

@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.

Actually, since this requires no kernel changes, it might make sense to only add this in the wrapper crate, then.

Users that directly build the kernel can already enable smoltcp/auto-icmp-echo-reply. hermit-os/hermit-rs#1060 adds a forward as smoltcp-auto-icmp-echo-reply similar to what we do for compile-time log levels.

@stlankes

Copy link
Copy Markdown
Contributor Author

Actually, since this requires no kernel changes, it might make sense to only add this in the wrapper crate, then.

Users that directly build the kernel can already enable smoltcp/auto-icmp-echo-reply. hermit-os/hermit-rs#1060 adds a forward as smoltcp-auto-icmp-echo-reply similar to what we do for compile-time log levels.

It is for me not clear, why this is the better way. But I am fine with it.

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.

Missing support for ICMP pings

2 participants