The tcptty FAQ

Frequently Asked Questions About tcptty

Before reporting any bug, please read G3 for advice on how to include diagnostic information that will get your bug fixed as quickly as possible.

If you have a question or answer you think ought to be added to this FAQ list, mail it to tcptty's maintainer, Stuart C. Eichert, at tcptty@copera.com.

General questions:

G1. What is tcptty and why should I bother?
G2. Where do I find the latest FAQ and tcptty sources?
G3. I think I've found a bug. Will you fix it?
G4. I have this idea for a neat feature. Will you add it?
G5. Is there a mailing list for exchanging tips?
G6. So, what's this I hear about a tcptty paper?
G7. What is the best pppd to use with tcptty?
G8. Is any special configuration needed to use a dynamic IP address?
G9. Is any special configuration needed to use firewalls?
G10. Is tcptty Y2K-compliant?
G11. How will tcptty perform under heavy loads?

Build-time problems:

B1. Make coughs and dies when building on FreeBSD.

Configuration questions:

C1. What are some example configurations?

How to set up well-known security and authentication methods:

K1. How can I get tcptty to work with ssh?
K2. How can I use tcptty with SSL?

Runtime fatal errors:

R1. Running tcptty in daemon mode doesn't work.
R2. tcptty hangs when used with pppd.
R3. tcptty randomly dies with socket errors.
R4. tcptty running as root stopped working after an OS upgrade

Other problems:

O1. The --logfile option doesn't work if the logfile doesn't exist.
O2. I'm using pppd. Specifying the baud rate does nothing?

Answers:


G1. What is tcptty and why should I bother?

tcptty is a one-stop solution for connecting two programs via a TCP connection, when they expect to be using a terminal. I use tcptty on my Linux box to create a virtual LAN for many instances of the Palm OS Emulator. I can more easily simulate a network environment where many Palm OS devices are on the same LAN.

tcptty is open-source software. It is hoped that other developers find this tool useful and provide comments and enhancements.

tcptty is licensed under the FreeBSD license. You can read this license in individual source files.

If you found this FAQ in the distribution, see the README for tcptty's full feature list.


G2. Where do I find the latest FAQ and tcptty sources?

The latest HTML FAQ is available alongside the latest tcptty sources at the tcptty home page: http://www.copera.com/tcptty.

A text dump of this FAQ is included in the tcptty distribution. Because it freezes at distribution release time, it may not be completely current.


G3. I think I've found a bug. Will you fix it?

Yes I will, provided you include enough diagnostic information for me to go on. Send bugs to tcptty-bugs. When reporting bugs, please include the following:

  1. Your operating system.
  2. Your compiler version, if you built from source; otherwise, the name and origin of the RPM or other binary package you installed.
  3. Any command-line options you used.
  4. The output of tcptty -V called with whatever other command-line options you used.

Often, the first thing I will do when you report a bug is tell you to upgrade to the newest version of tcptty, and then see if the problem reproduces. So you'll probably save us both time if you upgrade and test with the latest version before sending in a bug report.

If your bug is something that used to work but stopped working when you upgraded, then you can help pin the bug down by trying intermediate versions of tcptty until you identify the revision that broke your feature. The smart way to do this is by binary search on the version sequence. First, try the version halfway between your last good one and the current one. If it works, the failure was introduced in the upper half of the sequence; if it doesn't, the failure was introduced in the lower half. Now bisect that half in the same way. In a very few tries, you should be able to identify the exact adjacent pair of versions between which your bug was introduced -- and with information like that, I can usually come up with a fix very quickly.

A transcript of the failed session with -v -v (yes, that's two -v options, enabling debug mode) will almost always be useful.

If you upgraded your tcptty and something broke, you should include session transcripts with -v -v of both the working and failing versions. Very often, the source of the problem can instantly identified by looking at the differences.

Any bug I can reproduce will usually get fixed very quickly, often within 168 hours. Bugs I can't reproduce are difficult to fix.


G4. I have this idea for a neat feature. Will you add it?

Probably. This project is very new and I am sure there are better ways to do things.


G5. Is there a mailing list for exchanging tips?

Not at this time.


G6. So, what's this I hear about a tcptty paper?

There is no specific paper on tcptty, but at www.copera.com you can find plenty of information on developing network applications for the Palm OS.


G7. What is the best pppd to use with tcptty?

The short answer: The one I tested with (as of right now 2.4.1)

Here's a longer answer:

Read over Copera's tutorial on setting up a virtual LAN with POSE, tcptty, and pppd. It explains how to setup pppd for this purpose with tcptty.


G8. Is any special configuration needed to use a dynamic IP address?

By default tcptty listens for connections on INADDR_ANY. If you have specified a specific IP address to listen on (say 192.168.1.55) then this IP address must remain valid during the life of tcptty.


G9. Is any special configuration needed to use firewalls?

Yes. Clients must be able to initiate connections to the specified ip address and port. If you are not running a firewall this should not be a problem. tcptty is usually run behind the firewall for clients who are also behind the same firewall.


G10. Is tcptty Y2K-compliant?

Probably. There should be no date dependent code in tcptty.

G11. How will tcptty perform under heavy loads?

It is more likely that the program tcptty runs for each connection will overload the system, than tcptty itself.

B1. Make coughs and dies when building on FreeBSD.

The vendor-supplied make on FreeBSD systems can only be used within FreeBSD's "scope", e.g. the ports collection. Type "gmake" to run GNU make and better things will happen.

C1. What are some example configurations?

An easy way to run pppd for POSE sessions would be:
tcptty -i eth0 /usr/sbin/pppd
Assuming you have the right options in /etc/ppp this should just work.

K1. How can I get tcptty to work with ssh?

Good question. More data to come later.


K2. How can I use tcptty with SSL?

At this time tcptty does NOT support SSL.


R1. Running tcptty in daemon mode doesn't work.

This is probably due to an incompatibility in daemon.c. Take a look at it and see if you find anything odd for your platform.


R2. tcptty hangs when used with pppd.

tcptty fork a separate process for executing the command specified (in this case pppd). tcptty should continue to execute regardless of what pppd does. The problem is likely somewhere else.

R3. tcptty randomly dies with socket errors.

Some platforms take time to cleanup TCP connections. Wait a while and try again. Also remember not to kill tcptty with kill -9, but rather kill -TERM, kill -INT, or kill -HUP. tcptty catches these signals and tries to close sockets and pseudo terminals in an orderly manner. More work should be done on this code.


R4. tcptty running as root stopped working after an OS upgrade

Try recompiling.


O1. The --logfile option doesn't work if the logfile doesn't exist.

This is a feature, not a bug. It's in line with normal practice for system daemons and allows you to suppress logging by removing the log, without hacking potentially fragile startup scripts. To get around it, just touch(1) the logfile before you run tcptty (this will have no effect on the contents of the logfile if it already exists).


O2. I'm using pppd. Specifying the baud rate does nothing?

In this case pppd is running over a pseudo terminal, not a real terminal and thus the baud rate setting will do nothing. To speed up or slow down the transmission and reception of data between pppd and its client specify a different value for bufsize and/or interval. To test the effect of these new values, try pinging the ppp client and take a look at round trip times. Then try other tests that send different sizes of data. Simulating a real terminal device with tcptty is not currently possible (at least on Linux or on any other non real time O/S).


Stuart C. Eichert <tcptty@copera.com>
all rights reserved
copyright © copera 1999-2008