Store
 

Why are my VPN connections disconnected when my computer ... - KH2105

Frequently Asked Questions

Why are my VPN connections disconnected when my computer goes to sleep?
 

VPN Tracker does not maintain VPN connections when the computer goes to sleep for the following reasons:

  1. Immediately after waking up, the system may have different network settings than when it went to sleep, e.g. because the network cable was replugged while the computer was asleep, or the computer was moved to another location where a different WLAN is available, or a DHCP lease has expired and the DHCP server has to assign a new IP address to the computer after waking up because it has already given the old one to someone else, or the network interface no longer exists, e.g. if a USB network adapter was unplugged. In these cases, not only would the connection immediately stop working after waking up, VPN Tracker would also no longer be able to log off correctly from the remote peer.

    VPN Tracker would also not be directly aware of some of these events, as applications do not receive network events while the system is asleep and would therefore have to compare all network configurations after waking up with those before sleeping and decide whether the connection could still work or not, because with some VPN protocols there is no way to actively test this, with others only if certain options are used (e.g. DPD). A misjudgement leads to a tunnel being kept up that can actually no longer work and the user would then have to restart it manually before it works again.

  2. NAT gateways remember in a table how they map private IP addresses to public ones and how they rewrite ports for a limited time only. Depending on the protocol, this time span can be in the range of seconds or minutes (some gateways only remember this for 20 seconds with UDP). If such a table entry is lost, this does not result in an error, but a new entry is created for the next packet, which often results in a different mapping, which the remote station cannot cope with, because it now looks to them as if someone else is trying to hijack the connection, as the packets are suddenly coming from a different sender. VPN Tracker cannot know or check when it wakes up whether the previous table entry still exists or has already been lost and will not receive an error from the NAT gateway in the latter case, but the connection will still no longer work, which leads to the same problems as in the first case. It does not matter whether a local NAT gateway is used (as in most home routers or modems) or a carrier grade NAT gateway, which is located at the ISP and via which several customers can share a single public IPv4 address. The latter is increasingly the case, as there are no longer any free IPv4 addresses and therefore not every customer can get an own one.

  3. VPN protocols that use some form of Dead Peer Detection (DPD) expect regular data traffic from the other side. If this fails to occur, they send DPD packets and expect these DPD requests to be answered. If they are not answered, the other side considers the connection to be dead and deletes it. VPN Tracker is also unaware of this while the computer is asleep and cannot respond to these requests. After waking up, the connection would again no longer be functional, but even with DPD in use, this would often only be noticed after about a minute and until then the system would try to continue using this connection without the slightest chance of success, so that various applications would run into errors or disconnects.

  4. If a VPN connection is disconnected without the client logging off from the VPN gateway and without the gateway being aware of this, the client may not be able to re-establish this connection immediately or a connection error may occur the first time it is established. In the worst case, the client may even be locked out for a few minutes. This can occur in the first two cases if the network settings have changed after the sleep phase or if a NAT table entry has been lost.

To prevent all these problems, VPN Tracker immediately terminates all VPN connections as soon as the system reports that it wants to go to sleep, and also logs off correctly from the remote peer. As soon as the system wakes up and reports that the network is fully operational again, VPN Tracker immediately re-establishes all these connections. This avoids all the problems mentioned above and normal applications have no network access while the system is asleep and are also used to the fact that no network is available for a short time after waking up, because this is also the case without VPN, especially if something has changed on the network.