chadsr / NordVPN-NetworkManager

A CLI tool for automating the importing, securing and usage of NordVPN (and in the future, more) OpenVPN servers through NetworkManager.
https://pypi.org/project/nordnm/
GNU General Public License v3.0
123 stars 28 forks source link

Improve Server Scoring Function #32

Open chadsr opened 7 years ago

chadsr commented 7 years ago

The current scoring function: 1 / log(load + rtt)

This gives us a score where lower values of load and rtt (latency) produce a higher score.

Just summing the values doesn't give the best representation in the score, since load is a discrete percentage (0-100) and rtt is just a continuous time in seconds.

I'm open for suggestions/discussion on what the weighting of load and rtt could be, or for a completely new scoring function proposal.

chadsr commented 6 years ago

I have modified the scoring function slightly in #53.

1 / exp(load/100 * rtt)

This gives a better spread and since load is now a fraction, rtt has a much higher influence on the end score than it used to.

dapolinario commented 6 years ago

I do not know if it will help you get the list of best servers, but I did an investigation to find out how the NordVPN site detects the best server for my location and found out that it runs an ajax. Based on this, let the queries for each type of connection (standard tor, P2P, etc.). If you remove the part of the filter, it returns to the limit, but the other categories do not appear.

If the link does not return anything, it did not detect a good server for your region.

Double VPN group 1 Onion Over VPN group 3 Anti DDoS group 7 Dedicated IP group 9 Standard VPN group 11 P2P group 15 Obfuscated group 17

chadsr commented 6 years ago

This is indeed an interesting endpoint you've spotted here. I had not come across it before.

I will be attempting a little reverse engineering to see if I can derive what kind of function they are using to produce those server scores.

Since pinging isn't a hugely reliable measure of latency, it is an option to switch to a distance estimate like they seem to be doing. The question would then be whether I should just utilise this endpoint as is, or attempt to re-write its functionality for greater transparency.