I have a ZTE MF281 with LTE.
If the connection is very busy, checkuplink often incorrectly recognizes the tunnel as dead and reconnects.
If the connection is heavily utilized, the latency of the client connections increases significantly.
Measured client ping RTT values through the tunnel of 800-1500ms on average, peak values up to 5000ms and occasional packet loss.
(LTE ping RTT from gluon without tunnel increases to approx. 350ms; no packetloss, stagnates there stably)
Checkuplink often incorrectly recognizes the tunnel as dead and reconnects. (Tunnel is not dead, just high latency!)
My Idea:
Increase the timeouts. (helps, but not enough)
+
Repeat the tests. If 3/3 fail --> dead.
(+ some high.latency.mode option for enable/disable the extended tests)
Code might look like this.
I'm testing this at the moment, looks promising.
retry_wget() {
local url="$1"
local max_attempts=3
local attempt=1
local delay=1
local ret=0
while [ $attempt -le $max_attempts ];
do
wget "$url" --timeout=10 -O/dev/null -q && return 0 || ret=$?
logger -p warn -t checkuplink "wget attempt $attempt failed with code $ret, retrying in $delay seconds..."
sleep $delay
attempt=$((attempt + 1))
delay=$((delay * 2))
done
return $ret
}
retry_batctl_ping() {
local gwmac="$1"
local max_attempts=3
local attempt=1
local delay=1
while [ $attempt -le $max_attempts ];
do
if batctl ping -c 7 -t 10 -i 1 "$gwmac" > /dev/null 2>&1; then
return 0
fi
logger -p warn -t checkuplink "batctl ping attempt $attempt failed, retrying in $delay seconds..."
sleep $delay
attempt=$((attempt + 1))
delay=$((delay * 2))
done
return 1
}
is_connected() {
if retry_wget "http://[$(wg|grep fe80|awk '{split($3,A,"/")};{print A[1]}')%$MESH_VPN_IFACE]/";
then
GWMAC=$(batctl gwl|awk '/[*]/{print $2}')
if retry_batctl_ping "$GWMAC";
then
return 0
fi
fi
return 1
}
I have a ZTE MF281 with LTE.
If the connection is very busy, checkuplink often incorrectly recognizes the tunnel as dead and reconnects.
If the connection is heavily utilized, the latency of the client connections increases significantly.
Measured client ping RTT values through the tunnel of 800-1500ms on average, peak values up to 5000ms and occasional packet loss.
(LTE ping RTT from gluon without tunnel increases to approx. 350ms; no packetloss, stagnates there stably)
Checkuplink often incorrectly recognizes the tunnel as dead and reconnects. (Tunnel is not dead, just high latency!)
My Idea:
Increase the timeouts. (helps, but not enough)
+
Repeat the tests. If 3/3 fail --> dead.
(+ some high.latency.mode option for enable/disable the extended tests)
Code might look like this.
I'm testing this at the moment, looks promising.