MIME-Version: 1.0 Date: Wed, 11 May 2016 17:41:19 +0200 Message-ID: From: Paul Garnier Content-Type: multipart/alternative; boundary=001a11393e907dde95053292dff5 Subject: [Openvpn-devel] Need help for adding feature: Selecting remote servers by best latency List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: openvpn-devel --001a11393e907dde95053292dff5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I=E2=80=99m actually trying to add an option in openvpn which will allow th= e client to connect to the server with the lowest latency in his remote list. For now there are only two options to choose between servers : =E2=80=9C *--remote-random*=E2=80=9D which randomize the order of the address list, = the default one which will try the hosts in the order of the config file, and I want to add a 3rd one. To start I want to do it for udp and unix servers and clients. I=E2=80=99m a beginner in things like this so I started very simply : I wr= ote a little program in C to ping a host:port using udp but I can=E2=80=99t get a= n answer from an openvpn server. The only way I found to get an answer was to make the packet I send look like the start of a TLS transaction, but because of the TLS processing I can only get the first ping right, after it takes way too long to come back to be accurate. So I started digging in the source code to find where my packet is thrown away and why I don=E2=80=99t get any answer (even an error message would be enough). I=E2=80=99ve found how a =E2=80=9Cnormal=E2=80=9D packet is sent b= ut what I want is the latency with the server, not in the tunnel. I don=E2=80=99t want to establ= ish a connection to test my link with each server and, how I understand it, if I want use function like *encrypt_sign*() so my packet is recognized I need to have a tunnel set. I can=E2=80=99t replicate how the existing *ping *and *occ *packets are sent. What I would like to know is : - where my packet is processed and rejected ? - why I don't get any answer at all nor an error message on my server ? - is there a major issue making what I want to do impossible ? Kind regards, Paul Garnier --001a11393e907dde95053292dff5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hello,


I=E2=80=99m actually trying to add an option in open= vpn which will allow the client to connect to the server with the lowest latency in his re= mote list. For now there are only two options to choose between servers : =E2=80= =9C--remote-random=E2=80= =9D=C2=A0 which randomize the order of the address list, the default one which will try the hosts in the order of the config file, and I want to add=C2=A0 a 3rd one. To start I w= ant to do it for udp and unix servers and clients.

<= span style=3D"mso-bidi-font-weight:bold">

I=E2=80=99= m a beginner in things like this so I started=C2=A0 very s= imply : I wrote a little program in C to ping a host:port using udp but I can=E2=80= =99t get an answer from an openvpn server. The only way I found to get an answer was to make the packet I send look like the start of a TLS transaction, but becaus= e of the TLS processing I can only get the first ping right, after it takes way = too long to come back to be accurate.


So I start= ed digging=C2=A0 in the source code to= find where my packet is thrown away and why I don=E2=80=99t get any answer (even an er= ror message would be enough). I=E2=80=99ve found how a =E2=80=9Cnormal=E2=80=9D packet = is sent but what I want is the latency with the server, not in the tunnel. =C2=A0I don=E2=80=99t want to establish a connection to test my link with each server and, how I understand it, if I want use function l= ike encrypt_sign() so my packet is recognized I need to have a tunnel set. I can=E2=80=99t replicate how the existing p= ing and occ packets are sent.


What I wou= ld like to know is :=C2=A0


- where my = packet is processed and rejected ?

= = - why I don't get any answer at all nor an error message on my server ?=

- is there a major issue making wh= at I want to do impossible ?
<= /span>


Kind regards,


Paul Garni= er

--001a11393e907dde95053292dff5--