Windows – VNC connections constantly drop but only when using laptop on battery power

vncvpnwindows 10wireless-networking

I have a somewhat strange (to me) problem and I'm unsure of how to precisely pinpoint the issue.

I have a laptop (Dell XPS 13 2-in-1 that I recently bought new) which I use when working from home, and occasionally while at work as well. I only use it over a Wi-Fi connection When I'm working from home, I'll connect to our work's VPN (PPTP) via Windows 10's built-in VPN support (no extra software used). Then from there, I'll connect to a TigerVNC server on my Linux interactive machine and do my work through that. When my laptop is on battery power, my VNC session will suddenly drop seemingly randomly, even if I'm currently active (I could be typing something when all of a sudden the screen stops updating and the VNC connection eventually drops). My VPN connection may or may not drop as well, though VNC is the one that goes more often than VPN. Sometimes they may drop out together. If VPN is still up, I'll still be able to access intranet pages and shared network drives. When the VNC session disconnects, I can usually reconnect immediately.

If the laptop is plugged into the wall, I rarely, if ever, get these disconnects.

I have a feeling that the VPN connection is unstable though I've tried multiple VPN servers into work, and I get the same behavior no matter to which I connect. If the VNC session disconnects, the VPN connection usually remains connected, and I can access intranet pages and shared network folders just fine. It may be that the VNC viewer disconnects more readily than Windows' VPN subsystem when there's a momentary interruption in the link. However, such interruptions shouldn't be occurring so frequently. My coworkers haven't reported anything like this going on for them, either.

Ordinarily I would suspect the Wi-Fi card on my laptop is underperforming while trying to save power, and this may be a piece of the puzzle, but I'm currently using it at the office, over the same VPN connection and VNC session, and have not experienced any connection issues whatsoever, despite being on battery power here as well. I looked at its settings in Device Manager and haven't seen anything that jumps out at me. It's all set to its OEM default settings, anyway.

So the only other thing in the link that's different is my router at home. The thing is, though, I've used VNC and VPN over Wi-Fi with different Windows devices (Windows 8.1 laptop and Windows 10 Surface Pro 4) and never experienced this behavior. Both had Intel Wireless LAN chips, as does my current laptop.

Perhaps there's something unique about my current laptop's hardware combined with something that my router at home is using that is causing an issue when combined together? What should I look into?

I did see a RealVNC thread about VNC over VPN causing the MTU to get reduced. However, I did check the MTU and it is set to 1500. I don't know what it is over VPN, but I can't really increase the MTU any further than that.

Equipment and software involved:

Dell XPS 13 2-in-1 (2017) running Windows 10 equipped with an Intel Dual Band Wireless-AC 8265 card, running Windows 10 Home version 1703

Router at home: Netgear Nighthawk AC1900 cable modem router (C7000)

VNC Server at work: Xvnc TigerVNC 1.3.0 server

VNC Viewer on laptop: TigerVNC Viewer 32-bit 1.8.0

UPDATE 9/14/2017

I tried decreasing the MTU of the VPN adapter but it didn't improve things. The VPN adapter's MTU is set to 1400. I decreased it after following the steps outlined here and it didn't make any difference.

Here they recommend checking the connection quality, so I'm running the ping command to the VNC server while connected via VPN and I am seeing occasional timeouts.

I'm now thinking that perhaps I should start looking into the quality of my wireless network? Perhaps it doesn't occur when plugged in because maybe the Wi-Fi adapter's transmit power is increased when plugged in, improving signal quality?

I've run inSSIDer 4 in the past but there are a lot of Wi-Fi networks that overlap with me. I'll go that route next.

UPDATE 9/20/2017

I tested my laptop at my parents' house last night. They also have Comcast for their Internet service (albeit a slower package) and I connected over their Wi-Fi to my work VPN and VNC session. They have a Netgear router as well (though a different model, and it doesn't double as a modem like mine does). The connection was perfectly stable. I had no dropouts or slowdowns. So it seems that it's unique to my network.

Given we both have Netgear routers and Comcast for our ISPs, I think that generally rules out those. My house is in a slightly more populated area than my parents', so there are less Wi-Fi networks in range, there. I wonder if congestion in the Wi-Fi network channels could be causing interference with my connection? And if I'm plugged in, my laptop's Wi-Fi antenna gets a power boost so my connection is stronger? My wireless adapter's advanced settings has the "Transmit Power" setting on 5 (Highest). Are there other settings in here that would affect that? Since there's no Power Management tab, could it be a firmware setting? Or perhaps in the BIOS/UEFI settings?

I'll do what I said above and try different channels. If it is truly just interference, then that should help. Currently my router has the channel setting on "automatic". It's still curious, though, that it only happens when on battery power on my laptop, and I would like to know why.

UPDATE 9/23/2017

I have more data that may be useful. It turns out that this behavior only seems to occur when I'm connected at home to my 802.11ac (5GHz) access point. On the 2.4GHz access point, I do not experience these disconnects.

My router is transmitting on both bands simultaneously, but I do tend to primarily connect to the 5GHz one if my device can see it. I enabled Airtime Fairness on both bands but it didn't do anything to help.

Best Answer

I did see a RealVNC thread about VNC over VPN causing the MTU to get reduced. However, I did check the MTU and it is set to 1500. I don't know what it is over VPN, but I can't really increase the MTU any further than that.

I suspect you were on the right trail with this comment but misinterpreted it a bit. You should REDUCE the MTU of traffic going into your VPN to account for the overhead of encapsulation. I'd suggest tuning the MTU of the VPN adapter down to something like 1400 (1450-ish would probably work too, but I'd start at 1400 and then adjust as needed from there).

Related Question