Choosing VPN server based on server response times
Hello all,
I am using the VPN provider Private Internet Access.
I am using the Raspberry Pi 4 with 4GB of RAM, performance on this upgraded board is great.
Anyways I am connecting to its service using systemd's openvpn-client @ US_New_York_City.service
I wonder if I can create a bash script to get a list of its servers, ping them for response times and choose the server with the lowest response times.
Here is a draft of a script I've created so far:
I've also tried to append all the firewall rules used to help secure the Raspberry Pi. Seeing as its a somewhat more mobile desktop in this case, I've added entries for all the different IPv4 private network schemes. As well as ssh access from my home LAN.
Is there a way I can get the script to ping all these servers and add it to a dataset at startup, then have it choose the lowest server. This seems to be my only snag at this point.
Location: Asia Pacific, Cyberspace, in the Dark Dystopia
Posts: 19,118
Thanks Given: 2,351
Thanked 3,359 Times in 1,878 Posts
Seems like a lot of unnecessary work to me.
Network response times can change from minute to minute, based on network conditions you have no control over.
You are better off to pick the "best" access point geographically close to you (initially), measured by the number of hops normally (and maybe bandwidth / delay), and not try to over optimize, in my opinion.
Sorry, not to be more encouraging.
Of course, if you want to "over optimize", go for it.
I should have remembered that, my networking and telecommunications skills are a bit rusty.
Come to think of it the private internet access vpn app for android and arch x86_64 has the functionality I'm trying to mirror. Perhaps I can take a look at the relevent code in the arch package and try to port some of its functionality to this.
Trying to get this idea working for raspberry pi which uses the arm cpu architecture. I also noticed that sometimes webpages would load slower based on server congestion. Example New_York_City could have 35ms one moment then at 11:00PM could have 530ms, even though its relatively closer. I thought perhaps I could socket the services similar to how dnscrypt-proxy could be socketed.
Location: Asia Pacific, Cyberspace, in the Dark Dystopia
Posts: 19,118
Thanks Given: 2,351
Thanked 3,359 Times in 1,878 Posts
Network conditions change constantly.
If you create an algorithm to select the fastest VPN host at time = T0, it is highly possible a few minutes later that same selection, which appeared optimal at time = T0, will be much slower than it was before at time = T0 + "not too many seconds later"; especially when you are on a public network shared by many people.
You have no control over when someone else who shares the same host decides to upload or download a huge file. You have no control over others who might also be trying to "optimize" like you, on a shared public network.
The architecture, android, arch x86_64, etc are not relevant because the issue is not under the control of your architecture on shared public networks.
Sounds like you have not done much network management or Internet system design work before.....
Just configuring wireless access points, and a few related devices.
Cant find anything right now in my area (or state) so I daylight at a store. Would jump ship in a heartbeat though, but only have associates degree.
Designing networks, and coming up with network topology. Didn't do much work with that, just configuration of device interfaces, routing protocols. Its been so long, that its cobwebs in my brain now.
HaloSlayer255
This User Gave Thanks to haloslayer255 For This Post:
First of all, hello.
I have a problem installing a vpn server and client.
My server is a computer running windows 7, and windows, running a virtual machine running debian.
In the debian system, I've the vpn server installed (SoftEther VPN Server)
The problems come when I try to connect to... (1 Reply)
Hi there,
Believe it or not, the word VPN doesn't give any search result in the forum.
I'm trying to get started with VPN.
I'm currently in the process of setting up a server.
I found a lot of howtos on the web.
There's still one thing that I'm not sure of.
My plan is to setup the VPN... (4 Replies)
Hi,
I have a task requested by my boss to create a script to enable a server to connect to a vpn network and then to connect to another server to upload some data...
How can I connect to a vpn network from AIX server? via telnet? ssh?
I have tried to google but mostly the answers are... (1 Reply)
I have gotten a gig to teach someone how to use a VPN client for a UNIX server on a MAC os. The problem is I have never used UNIX, dont mess with VPN's (my dad has a VPN that I have used a couple of times). I'm currently taking a crash course on UNIX but I was wondering if anyone could help me with... (0 Replies)
Hi,
I have a SCO Unix Openserver V6 server which is hosting a website with Apache V1.3 as the http server. The web site has an initial login screen which re-directs to another page once the user name and password has been verified.
When connecting to the website and trying to login, it times... (0 Replies)
I would like to setup my solaris 10 x86 system as a vpn server. I can't seem to find any good links on setting it up. Do you guys have some links that could walk me thru on setting up the vpn server so that windows clients can connect to it? (4 Replies)
I am trying to write a korn shell script which posts commands to a server and read the response back from the server.
Any idea how I can read the servers response?
I have tried doing the following:
(
LOGIN:xxxxx
command to server
read ANSWER
echo $ANSWER >file1... (4 Replies)