This is not the MTU you are looking for.

These days it’s not too often you have those moments of “I SOLVED IT!

My day job as it is – it is – things not working just-so when I get home – well, it is sub optimal.

Having moved from ADSL to VDSL and FTTC recently I also switched to using my newer router and modem. The BT one suffering with the usual wonders that BT ones do. Imagine my DEEP joy when it became apparent that I could not send email via my Desktop or Laptop, and my PS4 console was struggling to do some things. This became increasingly urksome when I had got so wound up trying to figure out why SMTP STARTTLS was not working when I could reach the port just fine, and as far as the server was concerned the issue was client side…. so “screw this I am off to play games” … to find

So – having rules out things like wireless or cable consistency, or the service itself – there seemed to be a pattern – encryption or sustained transfers.

– PS4 unable to log in;
– PS4 taking a long time to relicense titles;
– PS4 as primary console was taking ages / forever / not working;
– PS4 Newly downloaded titles were unable to be licensed;
– Thunderbird not sending as TLS/SSL;
– Thunderbird not sending via STARTTLS;
– SCP file transfer starts, then stalls.

The latter was the one that really gave it away.

The MTU and MRU had not been changed since this was a last working setup – this was not something I had considered. MTU set to automatic. The usual 1492 not flying either.

Having experienced this wonder before – I found a script that would figure this out for me:

 

#!/bin/bash

export PATH=$PATH:”/usr/sbin:/bin:/usr/bin:/sbin”

MTU=”32″
STEP=”750″
STROKES_LIMIT=”30″
PACKETS_HEADER=”28″
HOST_1=”www.grc.com” #Hosts MUSTN’T reply packets greater than effective MTU so not all hosts are GOOD for test…
HOST_2=”dns.it.net”
HOST_3=”www.libero.it”
HOST_EXT=”$1″

probe() { #ping host with one icmp-echo packet of variable size: the output is passed through various shell filters
if [ “$HOST” != “” ]; then #avoid processing NULL, if exthost is not given
echo “Sending $MTU bytes to $HOST”
ping -s $MTU -c “1” $HOST > /dev/null 2>&1
RESULT=$?
#recursive output message
if [ “$RESULT” = “0” ]; then
echo “—-> Contiguous”
else
echo “—-> Fragmented”
fi
echo
fi
}

answer() {
echo
echo “It’s reasonable to say that $MTU_LASTGOOD bytes is the largest contiguous packet size ($MTU includes $PACKETS_HEADER ICMP/IP Headers)”
echo
echo “MTU should be set to $MTU”
echo
}

#Let’s start testing, with a small echo-packet, if the host is at least reachable
for HOST in “$HOST_EXT” “$HOST_1” “$HOST_2” “$HOST_3”
do
probe
if [ “$RESULT” = “0” ]; then #If the 1st host fails, try the others
HOSTGOOD=”1″
break
else
HOSTGOOD=”0″
fi
done

#No valid hosts founded: exit…
if [ “$HOSTGOOD” != “1” ]; then
echo “No reachable hosts”
exit 1
fi

#The host is pingable, so let’s go on with larger packets….
MTU=”$STEP”
STROKES=”0″
while [ “$STROKES” -lt “$STROKES_LIMIT” ]
do
STEP=`expr “$STEP” / 2 + “$STEP” % 2`
probe
if [ “$RESULT” = “0” ]; then
if [ “$MTU” = “$MTU_LASTGOOD” ]; then
break
else
MTU_LASTGOOD=”$MTU”
MTU=`expr “$MTU” + “$STEP”`
fi
else
MTU=`expr “$MTU” – “$STEP”`
fi
STROKES=`expr “$STROKES” + 1` #limit the max loop retries in case of successive host failures
done

#Maximum retries value reached: exit…
if [ “$STROKES” = “$STROKES_LIMIT” ]; then
echo
echo “Test limit exceeded”
exit 2
fi

#Add ICMP default header to the found value
MTU=`expr “$MTU” + “$PACKETS_HEADER”`
answer

1454 appeared to be the largest transmittable packet… so allowing for ICMP / IP headers that works out as 1482.

So MTU for VDSL FTTC for Enta for me 1482.

Making this change resulted in being able to log into PSN Playstation Network, able to send emails with encryption, SSL pages not be quite so “odd” from time to time, and most vitally – scp actually working as opposed to pushing files for about 5 seconds (apparently) before being marked -stalled- .

Small thing. Large feeling of success. Enough to want to share should you befall the same fate… as I was drawing blanks with search engines.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this:
Skip to toolbar