1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
.TH FROMTO 1 "30 January 1994" "Linux" "User Reference"
.SH NAME
fromport \- read data from a TCP/IP data stream
.br
toport \- write data to a TCP/IP data stream
.SH SYNOPSIS
.B fromport [-v] port
.br
.B toport [-b blocksize] [-p] [-t] [-v] host port
.SH DESCRIPTION
.B 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
.B toport
which does the reverse: it reads data from a program, device or file
and sends it to a network connection.
.LP
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:
.sp 1
.ti +0.5i
.nf
.I hosta# tar cfv - * | toport hostB 30205
.fi
and
.ti +0.5i
.nf
.I hostb# fromport 30205 | tar xfv -
.fi
.sp 1
on two TCP/IP connected hosts. The
.B fromport
commandline on machine
.B hostb
creates a network connection that is listening to port number
.B 30205
on that host, with the incoming data on that connection being sent
to the
.B tar
program for further processing. The
.B toport
commandline on machine
.B hosta
causes a
.B 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
.B 30205
on the
.B hostb
machine.
.LP
Alternatively, by selecting port
.B discard
(9) or
.B 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
.B -t
option (see below) sets up a very raw TCP I/O perforance measurement
tool. A sample commandline would look like this:
.sp 1
.ti +0.5i
.nf
.I hosta# cat /dev/dsk/hda1 | toport -t hostb 9
.fi
.sp 1
to test the performance to host
.B hostb
on the local network.
.SH OPTIONS
.TP
.B \-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
.B 1024
bytes. For large data transfers, increasing this value to
.B 8192
,
.B 32768
or even
.B 65536
can drastically reduce network and system load caused by the programs.
.TP
.B \-n
Print the debugged values in IP
.B dotted-decimal
style, rather than the corresponding host names.
.TP
.B \-t
Enable the printing of some transfer statistics. This can be very
useful for checking out the raw network TCP performance.
.TP
.B \-v
Enter verbose mode, most useful for debugging things.
.SH BUGS
None so far. What can you expect with a program this size?
.SH AUTHORS
Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
.br
Danny ter haar, <dth@cistron.nl>
|