# bhyve, vtnet with taps and low local speed traffic



## IPTRACE (Aug 21, 2018)

Hello!

I've found the issue on my virtual infrastracture.
The speed descreases after moving between virtual machines.

Hypervisor:
OS: FreeBSD 11.2
Application: bhyve
Network: bridge+tap

Guests:
OS: FreeBSD 11.2
Network: vtnet
media: Ethernet 10Gbase-T <full-duplex>

Traffic flow:
INTERNET <->hypervisor<->FW (vm guest)<->server (vm guest)

I set MTU to 4070 (max) and to 1500 as default standard, no difference.
All PF filters allowed without logging. After speed testing it looks like this.


```
hypervisor:~ % speedtest-cli --server 5134
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by NETIA S.A. (Warsaw) [10.25 km]: 2.415 ms
Testing download speed................................................................................
Download: 1458.58 Mbit/s
Testing upload speed................................................................................................
Upload: 617.50 Mbit/s
```


```
FW:~ % speedtest-cli --server 5134
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by NETIA S.A. (Warsaw) [252.37 km]: 1.944 ms
Testing download speed................................................................................
Download: 1135.09 Mbit/s
Testing upload speed................................................................................................
Upload: 561.99 Mbit/s
```


```
server:~ % speedtest-cli --server 5134
Retrieving speedtest.net configuration...
Retrieving speedtest.net server list...
Retrieving information for the selected server...
Hosted by NETIA S.A. (Warsaw) [252.37 km]: 2.324 ms
Testing download speed................................................................................
Download: 626.66 Mbit/s
Testing upload speed................................................................................................
Upload: 574.15 Mbit/s
```

Has got someone any idea how I can get rid of the issue?


----------



## IPTRACE (Aug 22, 2018)

I found the following helper.
https://wiki.freebsd.org/NetworkPerformanceTuning




> if_bridge(4), specially bridge_input() uses lot's of LOCK: Avoid to use it. It will reduce by about 50-60% forwarding speed.


https://github.com/ocochard/netbenc...0-CR/bridge/results/fbsd11.1-yandex/README.md


Do you think it's the issue?


----------

