APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Losing data over VPN


Sometimes change is good, sometimes it's bad, and sometimes it's a mixed bag. Such was the case recently when a customer switched a remote office from a 56K line to using a Kerio VPN over Internet connections. The 56K line was slow and expensive, so the switch had immediate benefits. Unfortunately a problem also appeared immediately: an Okidata printer couldn't print more than six or seven pages at a time.

The printer was set up as a shared printer hanging off a PC. As they had a spare HPJetDirect printserver hanging about, my first thought was to throw that in, but nothing changed: after six or seven pages, the printer would still stop.

My next thought was that this might be a MTU problem. I've seen that now and then with VPN's and also with printers, so it was worth a shot. As there were other branch offices not experiencing this problem, I felt the problem had to be at the office with the troublesome printer, so I went there to experiment.

You can set the MTU of a Windows NIC with a registry key: it's down under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces. The MTU key may not be there, but you can add it to the correct card under interfaces. An easier way is to download "DR TCP" from DSLReports Tests and Tools and use that to make your tweaks (thanks to Jeff Wadlow from Kerio for pointing that out). I started experimenting, but nothing changed: the printer would still stop when sent a large enough job.

However, while experimenting, I noticed a curious thing: if I pressed the Select button on the printer to set it off-line, and then pressed it again to set it back on-line, printing would immediately resume with no loss of data. This told me that there was nothing wrong with data flowing through the VPN, and indeed the Kerio logs had already confirmed that: the VPN logs showed no dropped packets whatsoever.

The Okidata printer has a 128K buffer. That's more than six or seven pages, but it might be close to its high water mark: the flow control signal gets sent before the buffer is absolutely full to avoid lost data. So what it now looked like to me was that the printer was sending a flow control "stop" signal but the other end was never seeing a "start" after the buffer was bled down. When I cycled the Select switch, a "start" was being sent, and the printing would resume. Probably the 56K connection was slow enough that the buffer never would fill up, so this was never observed before now.

Now the question is "whose fault is it?". It's most likely the printer, but it could be the print server. As having a spare printer isn't a bad idea, I suggested trying that first. They've ordered one, so we'll know soon.

The other complaint at this office was that telnet connections would disconnect after ten or fifteen minutes of inactivity. My suspicion there was a low timeout setting in their emulation software because TCP timeouts would ordinarily be much longer than that. However, I wasn't able to observe this behavior on site: I waited 45 minutes and there was no problem. I noticed that their app displays the current time in its menus; I asked the people on site to note what it says as they walk up to the machine: that will tell me how long it actually takes to lose the connection and may give a clue as to what is actually happening.

Turns out it was about 40 minutes; I must have noted the time wrong and been just under. The 40 minutes is expected, Kerio says: "WinRoute will discard TCP packets after forty minutes of inactivity. If this is the problem then this problem might be solved by either increasing the TCP timeout or by activating a keep alive feature in the telnet client so that the inactivity timeout is repeatedly reset."

Kerio support provided this:

1. Stop the WinRoute engine
2. Go to C:\Program Files\Kerio\WinRoute Firewall
3. Edit the winroute.cfg file with notepad
4. Search for DefaultTcpTimeout
5. Set DefaultTcpTimeout to a higher value
6. Save the winroute.cfg file
7. Restart the WinRoute engine

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> -> Losing data over VPN


More Articles by

Find me on Google+

© Anthony Lawrence

Fri Nov 17 21:07:04 2006: 2629   rbailin

Nevery rely on software flow control (ctrl-s/ctrl-q; XON/XOFF) for throttling serial devices, especially printers, for the very reasons mentioned in the article. Hardware flow control (DTR) takes a bit more time to setup, but it always works, especially if the printer loses power.


Fri Nov 17 21:17:01 2006: 2630   TonyLawrence

This isn't a serial printer.. it's parallel on a print server..

Fri Jun 22 13:49:14 2007: 3043   AndrewL

Why don't you backup your files to an external media? So you can easily restore damaged files. I'm using Online Backup to do so. I think it's more secure than optical media or flash drives (speaking from bad experiences ;) ).

Here are the current most reliable ones reviewed:




Fri Jun 22 13:53:52 2007: 3044   TonyLawrence

While backup is always a good idea, this article had nothing to do with that :-)

Mon Apr 27 15:50:11 2009: 6265   Chief

I have the EXACT same issue.. what did you find out? Its definately flow control, but how do fix this booger?

Mon Apr 27 16:26:46 2009: 6266   TonyLawrence

It was the print server. We replaced it, problem disappeared.

Mon Apr 27 16:33:36 2009: 6267   Chief

I have a very similar setup, an HP 170x jet direct print server and parallel cable to okidata 321 turbo. Sending large print job and it stops after 4th page and we have to reset the printer to get it to continue.

Without replacing hardware is there anything I can do?


Mon Apr 27 16:37:53 2009: 6268   TonyLawrence

I think you need to nail down where the problem is - easiest thing is to start with swapping hardware.

Mon Apr 27 18:47:16 2009: 6269   Chief

Hello, I have swapped hardware with same result. It appears the print server does not have flow control for the okidata.

All print jobs print until the buffer is full and then it stops. You have to keep pressing select to take offline and bring back online until the job is complete.

Can you help recommend a flow control option for the print server? After telnet in and configuring there is no option for xon/xoff, dtrflow, ctsflow, etc.


Mon Apr 27 18:53:34 2009: 6270   TonyLawrence

It's a parallel printer. There are no user settings.

Replace the cable. Replace the printer. Check the network. Take it step by step.

Mon May 11 19:18:10 2009: 6352   TonyLawrence

He reports:

This was a flow control issue with the HP 170X print server. No flow control option setting from telnet. Had to use HP web Jetadmin software to change the device settings for parallel flow control. Changed parallel protocol from busy to ack and busy and also set parallel mode to centronics.

This resolved the issue with okidata 321 turbo printer stopping during large print jobs.

Kerio Connect Mailserver

Kerio Samepage

Kerio Control Firewall

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Being the richest man in the cemetery doesn't matter to me … Going to bed at night saying we've done something wonderful... that's what matters to me. (Steve Jobs)

Unfortunately, people are not rebelling against Microsoft. They don’t know any better. (Steve Jobs)

This post tagged: