May 11, 2015, 3:25 p.m.
IT

PPP drops whilst copying large files

I tried to copy some large files (500MB+) from a remote location... In fact, it is very remote - exactly on the other side of the world. Using standard pppd in Ubuntu, I established a PPTP VPN connection to the server. However every time I tried copying the file it would randomly stall at 2% - 30% and then the PPP connection would drop. Errors such as these showed up:

May 11 15:25:16 waldopcl pptp[2354]: anon log[decaps_gre:pptp_gre.c:414]: buffering packet 1423724 (expecting 1423723, lost or reordered)
May 11 15:25:25 waldopcl pptp[2354]: anon log[decaps_gre:pptp_gre.c:414]: buffering packet 1426544 (expecting 1426543, lost or reordered)
May 11 15:25:31 waldopcl pptp[2354]: anon log[decaps_gre:pptp_gre.c:414]: buffering packet 1428269 (expecting 1428268, lost or reordered)
May 11 15:25:40 waldopcl pptp[2354]: anon log[decaps_gre:pptp_gre.c:414]: buffering packet 1431253 (expecting 1431252, lost or reordered)
...

It is clear to me that the link for some reason did not support the speed at which the sending side thought it could send packets. Somewhere the MTU or window size was incorrectly negotiated. I tried lowering MTU but it made no difference. In the end, what worked for me was to notice the transfer rate it was trying to send packets at, and then forcefully lowering it. It still produced dropped packets, however since the rate of transmission is slower it seems to keep up - I have been copying 2GB of files without a disconnect so far:

 rsync --partial --timeout 60 --progress --bwlimit=400K user@targetip:/backup/file ./