File: XPIPE.TXT                                Last Modified 31/1/03

		    XPIPE v1.0 by Paula Dowie G8PZT

     Full Duplex SLIP Pipe for Xrouter / Xserv EXTERNAL Interface


XPIPE is a small TSR which allows two XROUTERs, two XSERVs, or one of
each, located on a single Windows machine, to route TCP/IP traffic to
each other.


Why was Xpipe written?

If you wish to run XServ as a BPQ-style "application", with XRouter
providing the AX25, Netrom and TCP/IP communication layers, the
PZTHOST.EXE TSR already meets the requirement.  PZTHOST can support
many applications of different types simultaneously.  There is however
a big disadvantage inherent in the BPQ Host API, namely the fact that
if XRouter is re-started, certain types of application (which is the
majority of them) *must* be re-started too.

If XServ is the *only* application being supported by XRouter, a far
better method is to forget about the outdated BPQ API.  XServ
has a complete TCP/IP stack of its own, thus you can use TCP/IP
to interconnect XRouter and XServ, using a pair of Ethernet cards or
two COM ports and a null modem.  By using proxies, XRouter can still
provide all the AX25 and NetRom services for XServ, via the TCP/IP
link.  The big advantage with this method is that if either program
is re-started, the other one is not affected.  It saves the memory
which PZTHOST would have occupied, but the Ethernet drivers require
memory.

You may however be unable or unwilling to fit 3 Ethernet cards in your
machine (one for XRouter, one for XServ and one for Windows), or to
reserve two COM ports for the purpose, so this is where XPipe provides
the solution.

XPipe provides the software equivalent of a pair of linked Ethernet
cards and all their drivers.  Like ETHDRV.EXE it is interfaced to
XRouter and XServ using the EXTERNAL interface type, but the PROTOCOL
is set to "SLIP" instead of HDLC or ETHERNET.  Since there are only
two hosts using the pipe, there is no need for "hardware addresses",
hence the overhead of ISO Layer 2 (AX25 / Ethernet) is not required.
XPipe is full duplex, and can buffer up to 20 frames of 335 bytes.
This should be more than adequate for most purposes, but I am willing
to review the buffer sizes and queue lengths in future.  I have not
managed to overload it yet, and the odd lost frame is of no consequence
anyhow.


Using XPipe

With XRouter:

XRouter and XServ communicate with XPipe using software interrupts,
in exactly the same way as they do with ETHDRV.  XPipe responds to
two consecutive software interrupts, one for each end of the pipe,
e.g. interrupts 99 and 100 or 120 and 121.  The pipe is completely
symmetrical, so it doesn't matter which host uses which end of the
pipe.

As with ETHDRV or PZTHOST, XPIPE *must* be loaded before Windows is
started, preferably by putting it in AUTOEXEC.BAT.  The program
takes one argument, namely the lower of the two software interrupts
in decimal. For example, "XPIPE 120" loads XPipe onto interrupts 120
and 121.  The argument must be between 96 and 254 inclusive.  The
XPIPE.COM version occupies around 6k of memory, most of which is
buffer space, whilst XPIPE.EXE occupies 15k.  I can see no advantage
in using the .EXE version.

To use XPipe, XRouter needs an INTERFACE with TYPE=EXTERNAL,
PROTOCOL=SLIP, MTU=256 (335 max.), and INTNUM set to one of the two
software interrupts which XPipe has been configured to use.

   INTERFACE=1
	TYPE=EXTERNAL
	INTNUM=120
	PROTOCOL=SLIP
	MTU=256
   ENDINTERFACE

A PORT attached to this interface will support TCP/IP.  However, if
you are linking two XRouters, you also have the option of using HDLC
protocol instead of SLIP, allowing them to talk AX25 to each other.
Either way, the interface will support AX25, Netrom and TCP/IP. If
you choose SLIP as the link protocol, AX25 can be supported by
encapsulating it as AXIP or AXUDP.  If you choose HDLC as the link
protocol, TCP/IP can be supported by encasulating it in AX25.


With XServ:

To use XPipe with XServ, the corresponding statement in PORTS.SYS is
similar to this:

   #IFACE EXTERNAL <intnum> <mode> <mtu> <label>
   #--------------------------------------------
   iface  external   121     slip   256   slip1
   

Note that XServ is basically a TCP/IP *server*, and does not therefore
include AX25 functionality.  Thus you cannot use HDLC mode with XServ.


Notes:

XPipe may be unloaded from memory by adding the second argument 'U' to
the interrupt number, e.g. "XPIPE 120 U" will unload an XPIPE which was
previously installed on interrupts 120 and 121.

You may run several copies of XPipe, providing all the interrupt numbers
are different.

XPipe and this document are copyright (c) Paula Dowie G8PZT 2003

g8pzt@blueyonder.co.uk
