# Unable to utilize large TCP windows?



## npforce (Oct 8, 2022)

Hi,

I have an old laptop dual booting Debian and FreeBSD. I observed lower iperf3 performance with FreeBSD than Debian (400 vs 600 mbps) when connecting from the same client, so I captured packets under both OS (on the iperf3 server side).

On Debian I saw the TCP window covering 5~6 packets, i.e., the client sent 5~6 packets and then received ACKs for them.

On FreeBSD, however, I saw two sent packets and then an ACK, and then repeat.

Could that explain the difference, and why wasn't FreeBSD able to utilize the large window and allow more packets in flight?

Really appreciate it if someone could help me take a look and tell me which direction to look.

# uname -a
FreeBSD router 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64


----------



## npforce (Oct 8, 2022)

/etc/pf.conf is below in case it matters:


```
ext_if = "em0.2"
int_if = "em0.1"

localnet = $int_if:network

nat on $ext_if from $localnet to any -> ($ext_if)

pass in quick on $int_if inet all keep state
pass out quick on $int_if inet all keep state

block in on $ext_if all
pass out on $ext_if all
```


----------



## SirDice (Oct 10, 2022)

npforce said:


> On Debian I saw the TCP window covering 5~6 packets, i.e., the client sent 5~6 packets and then received ACKs for them.
> 
> On FreeBSD, however, I saw two sent packets and then an ACK, and then repeat.
> 
> Could that explain the difference, and why wasn't FreeBSD able to utilize the large window and allow more packets in flight?


Has nothing to do with the firewall.






						TCP delayed acknowledgment - Wikipedia
					






					en.wikipedia.org


----------

