FROMTO(1)

NAME
fromport - read data from a TCP/IP data stream
toport - write data to a TCP/IP data stream

SYNOPSIS
fromport [-v] port
toport [-b blocksize] [-p] [-t] [-v] host port

DESCRIPTION
Fromport is a tiny little program that can be used to act as the "reader" end of a TCP/IP based network pipe between two processes. It usually reads this data from a stream generated by the companion program called toport which does the reverse: it reads data from a program, device or file and sends it to a network connection.

The various options of these programs determine the way they can be used, but it will be clear that the probable use is that of a remote pipe between two copy processes, like with the commands:

hosta# tar cfv - * | toport hostB 30205
and
hostb# fromport 30205 | tar xfv -

on two TCP/IP connected hosts. The fromport commandline on machine hostb creates a network connection that is listening to port number 30205 on that host, with the incoming data on that connection being sent to the tar program for further processing. The toport commandline on machine hosta causes a tar-style archive to be created of the files and directories in and under the current directory, which is then sent onto the network connection to port 30205 on the hostb machine.

Alternatively, by selecting port discard (9) or echo (10) on the selected host, you can instruct the other side to either ignore our data, or to just echo it back. This, combined with the -t option (see below) sets up a very raw TCP I/O perforance measurement tool. A sample commandline would look like this:

hosta# cat /dev/dsk/hda1 | toport -t hostb 9

to test the performance to host hostb on the local network.

OPTIONS

-b blocksize
    Set the size of the I/O buffers used by the programs. On most systems it pays off to use a larger buffer size than the default one of 1024 bytes. For large data transfers, increasing this value to 8192 , 32768 or even 65536 can drastically reduce network and system load caused by the programs.

-n  Print the debugged values in IP dotted-decimal style, rather than the corresponding host names.

-t  Enable the printing of some transfer statistics. This can be very useful for checking out the raw network TCP performance.

-v  Enter verbose mode, most useful for debugging things.

BUGS
None so far. What can you expect with a program this size?

AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
Danny ter haar, <dth@cistron.nl>