Bad TCP performance with Wireless over long distance

Yeah, I'm looking at my network here and only see that many retries when the signal level is below -83 dBm and it looks like you've got a good 6-10 dB over that. (Some TP-Link IoT switches in the detached garage that have "roamed over" to the house AP as the one for the garage is sitting in front of me being re-flashed.)

Yes, I am in a very noisy environment, but I do not think it is enough to have such poor and erratic performance in TCP traffic. I am currently connected to an AP on channel 1, my ISP has several APs on the same channel.

Question for you regarding the two Yagi antennas. Are they fixed and mounted on some kind of bracket that's been designed by some antenna person, or are they separate and physically placed by you?

The two antennas will interact with each other, and so they should be mounted in such a way as to maximize the received signal strength of the AP and block-out signal of other APs. I haven't read my ARRL antenna book recently :wink: but I'd start by orienting them so the elements are aligned vertically and adjust their spacing in the range of about 12.5cm which is 1 wavelength at 2.4Ghz, start with that and bring them together or farther apart until your your signal strength maximizes, then sweep them back and forth until you're pointed right at the AP and again maximize signal strength. Then fine tune the separation again to maximize received signal. In this config you should be able to "ignore" the other APs unless they're basically in the same direction as the one you're connecting to.

EDIT: 1/4 wavelength is the closest I'd get them, so that's 12.5/3 = 4cm and I wouldn't put them more than 2 wavelengths apart so that's 25cm. Most likely your best performance will be around 4 or 8 cm separation just guessing (the point is to allow the signals to interfere constructively and that's likely to happen when you're closer than 1 wavelength but farther than 1/4)

I do not understand, you should not place the antennas one in vertical position and the other in horizontal position. Anyway, I have placed the two antennas in horizantal position, since both are of horizontal polarity.

The usual thing I'd expect is that the AP you're connecting to has a vertically polarized antenna. This allows people to connect from any direction. So, both your Yagi antennas should also have their elements vertically polarized, so you should turn your Yagi so that the elements stick out vertically, both of them.

Then the next thing is, it's a directional antenna so you want it pointing at the direction of the AP... and then the final thing is... you probably want these Yagis near to each other, both pointing in the same direction, but how near I'm not sure, best way to figure it out is by looking at received signal strength and adjusting how near they are in the range 4cm to 12cm.

In the end you will have something that looks a little like this:

Okay. After several minutes connected with the RTS / CTS threshold set to 100 byte, I have achieved an improvement in TCP connections, only in the stability, since until now I only got the "TCP Connection Reset" error once. Yes, the speed is extremely low for what my ISP offers, but it's a good start.

The AR9287 has a dual-chain radio, so the spatial beamforming should happen in the chipset, right? If so, as long as the antennas are a "reasonable" distance apart all should be good.

Station xx:xx:xx:xx:xx:xx (on wlan0)
inactive time: 0 ms
rx bytes: 87436029
rx packets: 95874
tx bytes: 10822376
tx packets: 63641
tx retries: 46421
tx failed: 1173
beacon loss: 30
beacon rx: 11401
rx drop misc: 8188
signal: -76 [-78, -81] dBm
signal avg: -76 [-79, -80] dBm
beacon signal avg: 180 dBm
tx bitrate: 5.5 MBit/s
rx bitrate: 5.5 MBit/s
expected throughput: 2.197Mbps
authorized: yes
authenticated: yes
associated: yes
preamble: long
WMM/WME: yes
MFP: no
TDLS peer: no
DTIM period: 1
beacon interval:100
short preamble: yes
short slot time:yes
connected time: 1968 seconds

You're probably right, the beamforming will make fine-tuning the distance less important, so probably just start with them say 8cm apart.

On the other hand, if the AP really does have vertical polarized antenna (and it seems very likely because the AP will want to be omni-directional usually) it's really important to reorient the Yagi so you have vertical polarization.

Right now I can not change the polarity of Yagi antennas because then I would have to disconnect from the network, and there are other people in the house working right now. As soon as I try it, I upload the results. Although if I have observed something strange, that none of the two antennas ever get values higher than -78 each, that is, when one gets a good signal then the other reports a low signal.

Another thing, is, because in the output of iw phy phy0 info tells me that it only supports a single Stream, when the card is 2x2 MIMO?

Not sure why that is, but it suggests that you should really adjust the spacing while looking at the received signal strength. Note you should set up the spacing, and then get your body away from the antenna, and then look at the signal strength, the presence of your body will alter the signal... then adjust it, try again, etc until you get an optimized signal strength.... and of course if all this makes things worse then go back to horizontal, but you should probably still have a "stack" like the image I linked.

Puzzling, as says

The AR9287 integrates a multi-protocol
MAC, baseband processor, analog to digital and digital to analog (ADC/DAC)
converters, 2x2 MIMO radio transceiver, and PCI Express interface in an allCMOS
device for low power and small form factor applications.

But remember, these problems come from before using a card with the two yagis antennas, before using a USB TP-Link card with a single yagi antenna.

A question. Is it really necessary to specify the distance using for example iw ph phy0 set distance or via UCI?

Yes it seems the problems probably come from rf noise in the environment, tuning the performance of the two yagis should let you focus more on just the AP signal and reject the noise.

Specifying distance might help, probably won't hurt. Keep the RTS CTS low too. I expect that to help. You might also try using a different AP and reaiming the antenna, perhaps there is one with less interference

Also try channel 6 or 11.

I would also recommend Lizard Systems free WiFi Scanner to see what wireless traffic in your area looks like…

Well, the problems in the connection reappeared, exactly "Connection Reset".

Could be related to TCP zero windows...

Yes, I have tried changing channels, but the problem persists. I've also tried net.netfilter.nf_conntrack_tcp_be_liberal = 1 but the problem persists.

And in the event that it is a problem related to TCP zero windows then why does not it happen when I use a VPN connection? And if so, then some kind of solution?