fromport1
Read data from a tcp/ip data stream toport - write data to a tcp/ip data stream
Usage
fromport [-v]
port
toport [-b
blocksize]
[-p]
[-t]
[-v]
host
port
Overview
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
1024bytes. For large data transfers, increasing this value to8192,32768or even65536can drastically reduce network and system load caused by the programs.
-
-n -
Print the debugged values in IP
dotted-decimalstyle, 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.
Releases
Unchanged in 5 releases since Debian 1.1 (Buzz).