Solved Ping time to NATed Bhyve VM

Is this normal ping times for NATed Linux VM running on Bhyve/FreeBSD 14.1-RELEASE?
Those numbers seem a bit on the high-end to me.

Code:
$ ping 10.0.0.76
PING 10.0.0.76 (10.0.0.76): 56 data bytes
64 bytes from 10.0.0.76: icmp_seq=0 ttl=64 time=0.750 ms
64 bytes from 10.0.0.76: icmp_seq=1 ttl=64 time=0.663 ms
64 bytes from 10.0.0.76: icmp_seq=2 ttl=64 time=0.684 ms
64 bytes from 10.0.0.76: icmp_seq=3 ttl=64 time=0.724 ms
64 bytes from 10.0.0.76: icmp_seq=4 ttl=64 time=0.704 ms
^C
--- 10.0.0.76 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.663/0.705/0.750/0.030 ms

And the pf.conf:
Code:
ext_if = "em0"
vm_if = "vm-private"

set skip on lo0
scrub in all fragment reassemble

# NAT
nat on $ext_if from { 10.0.0.0/24 } to any -> ($ext_if)

pass in quick on $vm_if

block in all
pass out all keep state

# ICMP
pass in on $ext_if inet proto icmp icmp-type echoreq
 
Compare with ping localhost.
ping localhost averages around 0.273 ms. I'm rather interested if there isn't anything slowing down the NATed interaction because I need the lowest latency possible for some reason.
 
Routing in and of itself will add a bit of latency. Translating packets (NAT) adds another bit of latency. There's no escaping this. Packets have to be processed, this takes time.
 
Back
Top