1 PLIP: The Parallel Line Internet Protocol Device
3 Donald Becker (becker@super.org)
4 I.D.A. Supercomputing Research Center, Bowie MD 20715
6 At some point T. Thorn will probably contribute text,
7 Tommy Thorn (tthorn@daimi.aau.dk)
12 This document describes the parallel port packet pusher for Net/LGX.
13 This device interface allows a point-to-point connection between two
14 parallel ports to appear as a IP network interface.
19 PLIP is Parallel Line IP, that is, the transportation of IP packages
20 over a parallel port. In the case of a PC, the obvious choice is the
21 printer port. PLIP is a non-standard, but [can use] uses the standard
22 LapLink null-printer cable [can also work in turbo mode, with a PLIP
23 cable]. [The protocol used to pack IP packages, is a simple one
29 It's cheap, it's available everywhere, and it's easy.
31 The PLIP cable is all that's needed to connect two Linux boxes, and it
32 can be built for very few bucks.
34 Connecting two Linux boxes takes only a second's decision and a few
35 minutes' work, no need to search for a [supported] netcard. This might
36 even be especially important in the case of notebooks, where netcards
37 are not easily available.
39 Not requiring a netcard also means that apart from connecting the
40 cables, everything else is software configuration [which in principle
41 could be made very easy.]
46 Doesn't work over a modem, like SLIP and PPP. Limited range, 15 m.
47 Can only be used to connect three (?) Linux boxes. Doesn't connect to
48 an existing Ethernet. Isn't standard (not even de facto standard, like
54 PLIP easily outperforms Ethernet cards....(ups, I was dreaming, but
55 it *is* getting late. EOB)
60 The Linux PLIP driver is an implementation of the original Crynwr protocol,
61 that uses the parallel port subsystem of the kernel in order to properly
62 share parallel ports between PLIP and other services.
64 IRQs and trigger timeouts
65 =========================
67 When a parallel port used for a PLIP driver has an IRQ configured to it, the
68 PLIP driver is signaled whenever data is sent to it via the cable, such that
69 when no data is available, the driver isn't being used.
71 However, on some machines it is hard, if not impossible, to configure an IRQ
72 to a certain parallel port, mainly because it is used by some other device.
73 On these machines, the PLIP driver can be used in IRQ-less mode, where
74 the PLIP driver would constantly poll the parallel port for data waiting,
75 and if such data is available, process it. This mode is less efficient than
76 the IRQ mode, because the driver has to check the parallel port many times
77 per second, even when no data at all is sent. Some rough measurements
78 indicate that there isn't a noticeable performance drop when using IRQ-less
79 mode as compared to IRQ mode as far as the data transfer speed is involved.
80 There is a performance drop on the machine hosting the driver.
82 When the PLIP driver is used in IRQ mode, the timeout used for triggering a
83 data transfer (the maximal time the PLIP driver would allow the other side
84 before announcing a timeout, when trying to handshake a transfer of some
85 data) is, by default, 500usec. As IRQ delivery is more or less immediate,
86 this timeout is quite sufficient.
88 When in IRQ-less mode, the PLIP driver polls the parallel port HZ times
89 per second (where HZ is typically 100 on most platforms, and 1024 on an
90 Alpha, as of this writing). Between two such polls, there are 10^6/HZ usecs.
91 On an i386, for example, 10^6/100 = 10000usec. It is easy to see that it is
92 quite possible for the trigger timeout to expire between two such polls, as
93 the timeout is only 500usec long. As a result, it is required to change the
94 trigger timeout on the *other* side of a PLIP connection, to about
95 10^6/HZ usecs. If both sides of a PLIP connection are used in IRQ-less mode,
96 this timeout is required on both sides.
98 It appears that in practice, the trigger timeout can be shorter than in the
99 above calculation. It isn't an important issue, unless the wire is faulty,
100 in which case a long timeout would stall the machine when, for whatever
101 reason, bits are dropped.
103 A utility that can perform this change in Linux is plipconfig, which is part
104 of the net-tools package (its location can be found in the
105 Documentation/Changes file). An example command would be
106 'plipconfig plipX trigger 10000', where plipX is the appropriate
109 PLIP hardware interconnection
110 -----------------------------
112 PLIP uses several different data transfer methods. The first (and the
113 only one implemented in the early version of the code) uses a standard
114 printer "null" cable to transfer data four bits at a time using
115 data bit outputs connected to status bit inputs.
117 The second data transfer method relies on both machines having
118 bi-directional parallel ports, rather than output-only ``printer''
119 ports. This allows byte-wide transfers and avoids reconstructing
120 nibbles into bytes, leading to much faster transfers.
122 Parallel Transfer Mode 0 Cable
123 ==============================
125 The cable for the first transfer mode is a standard
126 printer "null" cable which transfers data four bits at a time using
127 data bit outputs of the first port (machine T) connected to the
128 status bit inputs of the second port (machine R). There are five
129 status inputs, and they are used as four data inputs and a clock (data
130 strobe) input, arranged so that the data input bits appear as contiguous
131 bits with standard status register implementation.
133 A cable that implements this protocol is available commercially as a
134 "Null Printer" or "Turbo Laplink" cable. It can be constructed with
135 two DB-25 male connectors symmetrically connected as follows:
138 D0->ERROR 2 - 15 15 - 2
139 D1->SLCT 3 - 13 13 - 3
140 D2->PAPOUT 4 - 12 12 - 4
141 D3->ACK 5 - 10 10 - 5
142 D4->BUSY 6 - 11 11 - 6
143 D5,D6,D7 are 7*, 8*, 9*
147 extra grounds are 18*,19*,20*,21*,22*,23*,24*
149 * Do not connect these pins on either end
151 If the cable you are using has a metallic shield it should be
152 connected to the metallic DB-25 shell at one end only.
154 Parallel Transfer Mode 1
155 ========================
157 The second data transfer method relies on both machines having
158 bi-directional parallel ports, rather than output-only ``printer''
159 ports. This allows byte-wide transfers, and avoids reconstructing
160 nibbles into bytes. This cable should not be used on unidirectional
161 ``printer'' (as opposed to ``parallel'') ports or when the machine
162 isn't configured for PLIP, as it will result in output driver
163 conflicts and the (unlikely) possibility of damage.
165 The cable for this transfer mode should be constructed as follows:
177 AUTOFD->PAPOUT 14 - 12
180 extra grounds are 19*,20*,21*,22*,23*,24*
182 * Do not connect these pins on either end
184 Once again, if the cable you are using has a metallic shield it should
185 be connected to the metallic DB-25 shell at one end only.
187 PLIP Mode 0 transfer protocol
188 =============================
190 The PLIP driver is compatible with the "Crynwr" parallel port transfer
191 standard in Mode 0. That standard specifies the following protocol:
193 send header nibble '0x8'
199 Each octet is sent as
200 <wait for rx. '0x1?'> <send 0x10+(octet&0x0F)>
201 <wait for rx. '0x0?'> <send 0x00+((octet>>4)&0x0F)>
203 To start a transfer the transmitting machine outputs a nibble 0x08.
204 That raises the ACK line, triggering an interrupt in the receiving
205 machine. The receiving machine disables interrupts and raises its own ACK
210 (OUT is bit 0-4, OUT.j is bit j from OUT. IN likewise)
212 OUT := low nibble, OUT.4 := 1
214 OUT := high nibble, OUT.4 := 0