# Increase Bandwidth



## mbzadegan (Jan 16, 2017)

Hi everybody,
I run FreeBSD on VirtualBox and run Iperf3 as (Server/Client).
When I Measure FreeBSD throughput by iperf3 from HOST it shows 700 Mbits/s But while I measure from another VM(Win10), it shows 3.5Gbits/s!
How can I increase the default FreeBSD bandwidth?

Note: Both VMs have same MTU (1500)!
Note2: I run VirtualBox on Ubuntu 16.04

Thanks.


----------



## SirDice (Jan 16, 2017)

What interface does FreeBSD have? Did you use virtio?


----------



## mbzadegan (Jan 17, 2017)

SirDice said:


> What interface does FreeBSD have? Did you use virtio?



No, I used just `if_igb_load="YES"` on /boot/loader.conf


----------



## mbzadegan (Jan 18, 2017)

SirDice said:


> What interface does FreeBSD have? Did you use virtio?


We test both bridge and hostonly interfaces.


----------



## freezebee (Jan 29, 2017)

Hi

I'm a bit late for this post but let me share what works fine for me:

/boot/loader.conf


```
cc_htcp_load="YES" # more agressive (exponential) than reno (linear)
## ifqmaxlen:
## In the wild more is not always better, up to 2k
net.link.ifqmaxlen=50 # def 50
```

/etc/sysctl.conf


```
net.inet.tcp.tso=0
net.inet.tcp.cc.algorithm=htcp  # def newreno
net.inet.tcp.cc.htcp.adaptive_backoff=1 # def 0 disabled
net.inet.tcp.cc.htcp.rtt_scaling=1 # def 0 disabled
## minmms:
## 1) https://github.com/freebsd/freebsd/blob/master/sys/netinet/tcp.h
## The default value is fine for TCP across the Internet's smallest official
## link MTU (256 bytes for AX.25 packet radio).  However, a connection is very
## unlikely to come across such low MTU interfaces these days (anno domini 2003).
## #define TCP_MINMSS 216
## 2) https://github.com/torvalds/linux/blob/master/include/uapi/linux/tcp.h
## #define TCP_MSS_DEFAULT    536U    /* IPv4 (RFC1122, RFC2581) */
net.inet.tcp.minmss=536 # def 216, up to 1300 ok
net.inet.tcp.mssdflt=1460 # def 536
net.inet.tcp.rfc1323=1 # def 1
## abc_l_var:
## imho Windows goes for 6 or 12 MTUs
net.inet.tcp.abc_l_var=44 # for full 64k, def 2
```

/etc/sysctl.conf for tuning and adapt to server resources:


```
net.inet.tcp.recvspace=262144 # def 64k, higher and higher
net.inet.tcp.recvbuf_inc=65536 # def 16k, higher and higher
net.inet.tcp.sendspace=262144 # def 32k, higher and higher
net.inet.tcp.sendbuf_inc=32768 # def 8k, higher and higher
```

Cheers


----------

