1PLIP: The Parallel Line Internet Protocol Device
   3Donald Becker (
   4I.D.A. Supercomputing Research Center, Bowie MD 20715
   6At some point T. Thorn will probably contribute text,
   7Tommy Thorn (
   9PLIP Introduction
  12This document describes the parallel port packet pusher for Net/LGX.
  13This device interface allows a point-to-point connection between two
  14parallel ports to appear as a IP network interface.
  16What is PLIP?
  19PLIP is Parallel Line IP, that is, the transportation of IP packages
  20over a parallel port. In the case of a PC, the obvious choice is the
  21printer port.  PLIP is a non-standard, but [can use] uses the standard
  22LapLink null-printer cable [can also work in turbo mode, with a PLIP
  23cable]. [The protocol used to pack IP packages, is a simple one
  24initiated by Crynwr.]
  26Advantages of PLIP
  29It's cheap, it's available everywhere, and it's easy.
  31The PLIP cable is all that's needed to connect two Linux boxes, and it
  32can be built for very few bucks.
  34Connecting two Linux boxes takes only a second's decision and a few
  35minutes' work, no need to search for a [supported] netcard. This might
  36even be especially important in the case of notebooks, where netcards
  37are not easily available.
  39Not requiring a netcard also means that apart from connecting the
  40cables, everything else is software configuration [which in principle
  41could be made very easy.]
  43Disadvantages of PLIP
  46Doesn't work over a modem, like SLIP and PPP. Limited range, 15 m.
  47Can only be used to connect three (?) Linux boxes. Doesn't connect to
  48an existing Ethernet. Isn't standard (not even de facto standard, like
  54PLIP easily outperforms Ethernet cards....(ups, I was dreaming, but
  55it *is* getting late. EOB)
  57PLIP driver details
  60The Linux PLIP driver is an implementation of the original Crynwr protocol,
  61that uses the parallel port subsystem of the kernel in order to properly
  62share parallel ports between PLIP and other services.
  64IRQs and trigger timeouts
  67When a parallel port used for a PLIP driver has an IRQ configured to it, the
  68PLIP driver is signaled whenever data is sent to it via the cable, such that
  69when no data is available, the driver isn't being used.
  71However, on some machines it is hard, if not impossible, to configure an IRQ
  72to a certain parallel port, mainly because it is used by some other device.
  73On these machines, the PLIP driver can be used in IRQ-less mode, where
  74the PLIP driver would constantly poll the parallel port for data waiting,
  75and if such data is available, process it. This mode is less efficient than
  76the IRQ mode, because the driver has to check the parallel port many times
  77per second, even when no data at all is sent. Some rough measurements
  78indicate that there isn't a noticeable performance drop when using IRQ-less
  79mode as compared to IRQ mode as far as the data transfer speed is involved.
  80There is a performance drop on the machine hosting the driver.
  82When the PLIP driver is used in IRQ mode, the timeout used for triggering a
  83data transfer (the maximal time the PLIP driver would allow the other side
  84before announcing a timeout, when trying to handshake a transfer of some
  85data) is, by default, 500usec. As IRQ delivery is more or less immediate,
  86this timeout is quite sufficient. 
  88When in IRQ-less mode, the PLIP driver polls the parallel port HZ times
  89per second (where HZ is typically 100 on most platforms, and 1024 on an
  90Alpha, as of this writing). Between two such polls, there are 10^6/HZ usecs.
  91On an i386, for example, 10^6/100 = 10000usec. It is easy to see that it is
  92quite possible for the trigger timeout to expire between two such polls, as
  93the timeout is only 500usec long. As a result, it is required to change the
  94trigger timeout on the *other* side of a PLIP connection, to about
  9510^6/HZ usecs. If both sides of a PLIP connection are used in IRQ-less mode,
  96this timeout is required on both sides.
  98It appears that in practice, the trigger timeout can be shorter than in the
  99above calculation. It isn't an important issue, unless the wire is faulty,
 100in which case a long timeout would stall the machine when, for whatever
 101reason, bits are dropped.
 103A utility that can perform this change in Linux is plipconfig, which is part
 104of the net-tools package (its location can be found in the
 105Documentation/Changes file). An example command would be
 106'plipconfig plipX trigger 10000', where plipX is the appropriate
 107PLIP device.
 109PLIP hardware interconnection
 112PLIP uses several different data transfer methods.  The first (and the
 113only one implemented in the early version of the code) uses a standard
 114printer "null" cable to transfer data four bits at a time using
 115data bit outputs connected to status bit inputs.
 117The second data transfer method relies on both machines having
 118bi-directional parallel ports, rather than output-only ``printer''
 119ports.  This allows byte-wide transfers and avoids reconstructing
 120nibbles into bytes, leading to much faster transfers.
 122Parallel Transfer Mode 0 Cable
 125The cable for the first transfer mode is a standard
 126printer "null" cable which transfers data four bits at a time using
 127data bit outputs of the first port (machine T) connected to the
 128status bit inputs of the second port (machine R).  There are five
 129status inputs, and they are used as four data inputs and a clock (data
 130strobe) input, arranged so that the data input bits appear as contiguou>