.\" $Header: /aolnet/dev/src/CVS/sgml/docbook-to-man/cmd/docbook-to-man.sh,v 1.1.1.1 1998/11/13 21:31:59 db3l Exp $ .\" .\" transcript compatibility for postscript use. .\" .\" synopsis: .P! .\" .de P! .fl \!!1 setgray .fl \\&.\" .fl \!!0 setgray .fl \" force out current output buffer \!!save /psv exch def currentpoint translate 0 0 moveto \!!/showpage{}def .fl \" prolog .sy sed -e 's/^/!/' \\$1\" bring in postscript file \!!psv restore . .de pF .ie \\*(f1 .ds f1 \\n(.f .el .ie \\*(f2 .ds f2 \\n(.f .el .ie \\*(f3 .ds f3 \\n(.f .el .ie \\*(f4 .ds f4 \\n(.f .el .tm ? font overflow .ft \\$1 .. .de fP .ie !\\*(f4 \{\ . ft \\*(f4 . ds f4\" ' br \} .el .ie !\\*(f3 \{\ . ft \\*(f3 . ds f3\" ' br \} .el .ie !\\*(f2 \{\ . ft \\*(f2 . ds f2\" ' br \} .el .ie !\\*(f1 \{\ . ft \\*(f1 . ds f1\" ' br \} .el .tm ? font underflow .. .ds f1\" .ds f2\" .ds f3\" .ds f4\" '\" t .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "IPRELAY" "1" .SH "NAME" iprelay \(em A user-space bandwidth shaping TCP proxy daemon .SH "SYNOPSIS" .PP \fBiprelay\fR [ [-d ] [-b \fIn\fR ] [proxyspec ] ] .SH "DESCRIPTION" .PP This manual page briefly documents the \fBiprelay\fR command. It was written for the \fBDebian GNU/Linux\fP distribution because the original program does not have a manual page. .SS "Overview" .PP \fBiprelay\fR can shape the TCP traffic forwarded through it to a specified bandwidth and allow this bandwidth to be changed on-the-fly. Multiple data streams to different sockets may be shaped to the same total bandwidth, much like a traffic shaping router would. However, this application runs in user space, and works by acting as a TCP proxy. .SS "Usage" .PP The \fIproxyspec\fR argument can be used to setup an initial proxy (the author calls them forwarders). \fBiprelay\fR can theoretically handle more forwarders than you'd ever need, but only one can be set up initially. It will be forwarder #99 in interactive mode. The format is the same as, e.g. ssh uses for port forwarding: .PP \ \ \fIlocal_port\fR:\fIremote_host\fR:\fIremote_port\fR .PP For every defined forwarder, \fBiprelay\fR will bind to the specified \fIlocal_port\fR and forward any connections to the \fIremote_port\fR of the \fIremote_host\fR (which may be specified by name or IP, as usual). Only root may bind to ports 1023 and under. See the \fBEXAMPLES\fP section for a quick introduction. .PP Without the \fB-d\fP option, \fBiprelay\fR will go into interactive mode (see \fB/usr/share/doc/iprelay/README.gz\fP for a detailed explanation of the powers of interactive mode). If \fIproxyspec\fR is specified, it will setup the initial forwarders before presenting the prompt. At the prompt, you may then adjust and/or modify your initial forwarder (e.g. adjusting the bandwidth limit), add and remove forwarders, and display various useful and not-so-useful information about the forwarder(s). Use ctrl-c () to quit interactive mode. .PP The \fB-d\fP option daemonises \fBiprelay\fR. If specified, \fBiprelay\fR will run non-interactively and fork into the background. You will loose all logging and diagnostic messages, as well as the ability to reconfigure \fBiprelay\fR at runtime. Therefore you need to specify \fIproxyspec\fR to tell \fBiprelay\fR about the one (and only) forwarder it's supposed to establish. You may, of course, spawn several instances of \fBiprelay\fR to handle your personal proxying needs. .PP The \fB-b\fP option allows the specification of a maximum bandwidth in bytes/second. Any connection proxied by \fBiprelay\fR will not shove more bytes over the wire per second than specified with this option. This limit can be adjusted at runtime, as described in \fB/usr/share/doc/iprelay/README.gz\fP. This option is only valid when the \fIproxyspec\fR argument is given (contrary to intuition, it can't (yet) be used to setup a default bandwidth for proxies you create interactively). .PP \fBiprelay\fR was written in Perl. .SH "OPTIONS" .IP "\fB-b \fIn\fR\fP" 10 Desired maximum bandwidth, where \fIn\fR is in bytes/second. Only valid when \fIproxyspec\fR is also specified. .IP "\fB-d\fP" 10 Daemon mode, go straight into the background. (you loose all logging, console access, and runtime bandwidth adjustment features). Only valid when \fIproxyspec\fR is also specified. .IP "\fIproxyspec\fR" 10 The proxy (forwarder) definition in the form of the following triple (c.f. ssh port forwarding): \fIlocal_port\fR:\fIremote_host\fR:\fIremote_port\fR .SH "EXAMPLES" .SS "A simple forwarder" .PP Let's say you are moving POP3 service from one server to another, but you're waiting for the DNS caches around the world to get updated. Thus pop3.myserver.net might point to the new machine for some users, but to the old machine for another set of users. To bridge the time until all users are directed to the new machine via pop3.myserver.net, you could simply set up a forwarder as follows on the old machine (1.2.3.4 is the new machine's IP): .PP \ \ iprelay -d 110:1.2.3.4:110 .PP Now any request for POP3 that happens to arrive at the old machine still will simply be proxied to the new machine by this daemonised forwarder, and your users are not even going to know ;>. Note that you have to be root the install this forwarder, as it binds to the local port 110, which is a privileged ports on any sensible operating system. .SS "A simple bandwidth-shaping forwarder" .PP In another example, to ensure that your HTTP connection to www.microsoft.com never exceeds 512 bytes per second, you could setup the following single line, backgrounded TCP shaper: .PP \ \ iprelay -d -b 512 10080:www.microsoft.com:80 .PP With this in the background, any connection to localhost:10080 will be proxied to www.microsoft.com, and you can be sure not to waste any bandwidth beyond the 512 bytes/second. Feel free to provide this service to your colleagues, who simply have to connect to your.hostname.net:10080 to employ your forwarder. Note that \fIall\fP connections to the same forwarder share the total bandwidth limit, so two simultaneous connections are going to get 256 bytes/second each in the ideal case. .SS "Customized sharing of bandwidth between multiple channels" .PP You want more? Let's make this a little more complicated. Say that you would like to provide a total shaped bandwidth of 3072 bytes/second with a "subchannel" with at most 1024 bytes/second \fIwithin\fP the 3072 bytes/second limit: .PP .nf .ta 8n 16n 24n 32n 40n 48n 56n 64n 72n \ \ iprelay -d -b 1024 10110:localhost:10001 \ \ iprelay -b 3072 10001:pop3.somewhere.net:110 then, at the interactive prompt: \ \ > set forwarder 1 8080:www.somewhere.net:80 .fi .PP and you can connect to localhost:10110 to get POP3 from pop3.somewhere.net at 1024 bytes/second, you can connect to localhost:8080 to get HTTP from www.somewhere.net at a maximum of 3072 bytes/second, but both together are not going to use more than 3072 bytes/second; the HTTP forwarder delegates up to 1024 bytes/second to the POP3 forwarder if necessary. .PP Please consult /usr/share/doc/iprelay/README.gz for more examples, and specifically for examples on how to harness the complete power of the interactive prompt. .SH "NOTES" .PP iprelay's author named the software ip_relay, and had the Perl script be called ip_relay.pl. In accordance with Debian policy, the underscore had to leave, and I (Martin) removed the ".pl" suffix for aesthetic reasons. .SH "BUGS" .PP Let us know if you find any... .SH "AUTHOR" .PP Gavin Stewart This manual page was written by Martin F. Krafft for the \fBDebian GNU/Linux\fP system (but may be used by others [if you promise to consider looking at \fBDebian GNU/Linux\fP sometime!]). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. .SH "SEE ALSO" .IP "" 10 /usr/share/doc/iprelay/README.gz .IP "" 10 /usr/share/doc/iprelay/FAQ.gz .IP "" 10 http://www.stewart.com.au/ip_relay/ .\" created by instant / docbook-to-man, Sat 28 Aug 2004, 10:59