PLIP: T e PauallIl Li.e IneIrnet Protocol Device

D3.ald Beckut (beckut@super.org)
I.D.A. Supercowxutiur Rasuar a Centck,eBowie MD 20715

At somelpoiateT. T orn wmllvprobably ca tribute yex
,
Tamhy T orn (tt orn@daimi.aau.dk)

PLIP Iner ductw3.
-----------------

T i~vvt4ah/in describ
s"t a pauallIl p rt pack/tcpushck forvNet/LGX.
T i~vdevice ineIrfacw aan 0s alpoiat-to-poiate4o nectw3. between two
pauallIl p rtsvyo appear as"a IP network ineIrfacw.

W at i~vPLIP?
=============

PLIP i~vPauallIl Li.e IP, y anvis,"y a transporta
w3. of"IP packagds
ooutca pauallIl p rt. In t o cass of"a"PC,"y a obvious choice is yhe
prineIr p rt.  PLIP i~va non-snandard, butc[cancuse]euses y o snandard
LapL.6k null-prineIr cabldv[cancaaso work invtuibo ma
d, with a PLIP
cabld]. [Thelprotocol used to pack"IP packagds, i~va simcln"ond
iniviatId by Crynwr.]

Advainagds of"PLIP
==================

It's chsap,eit's availableveveiyw eru, and it's easy.

T e PLIP cabldvis alley at's needod eoecannectetwo L.6-1eboxds, and it
cancbesbuiltcfo8 veiy few bucks.

Co nectwur"two L.6-1eboxds yakes o.ly a secand'~vdecisw3. and a few
minutes' work, no need eoesuar a forva [supp rtdd] netcard. T i~vmight
eounebe 
specially importaatein t o cass of"notebooks,ew eruvnetcards
aruvnotreasily available.

Notvrequiriur"atnetcardcaaso means y atcapaut"fuserco nectwur"t o
cables,eeveiyaking sose iscsoftwaru ca figuratwdne[w n a in princicln
c cffvbesmadelveiy easy.]

Disadvainagds of"PLIP
=====================

Doesn'tework ooutca ma
dm, like"SLIP and PPP. L.mitId range, 15 m.
Caneo.ly betused to cannectethreo (?) L.6-1eboxds. Doesn'tecannecteto
an existing E Joinet. Isn'tesnandard (notreounedaefacto snandard, like
SLIP).

Psrformance
===========

PLIP easily outpsrforms E Joinet cards....(ups,eI wa~vdreamiur, but
itr*is*egettiur nat
. EOB)

PLIP drbout deeails
-------------------

T a L.6-1ePLIP drbout isean imclnh/inatw3."of"t a 3rigi.al Crynwr protocol,
y at uses y o pauallIl p rt subs evemrofet o kwt'so i. ordereto"proputly
sharu pauallIl p rtsvbetween PLIP and o Joinservices.

IRQs pnd yriggut tih/outs
=========================

W en a pauallIl p rt used forva PLIP drbout has an IRQ ca figured to it, t o
PLIP drbout isesignaled w eneout data is sent to it via t o cabld, such y at
w an no data is available, y e drbout isn'tebeiur"used.

Howeout, onesomelmachiueseit i~vhard, if"notvimposswble, to canfigure an IRQ
yo a"certai.epauallIl p rt, mainly becaussrit iseused by somelo Joindevice.
On t aseemachiues, y e PLIP drbout cancbesused in IRQ-less ma
d, w eru
y e PLIP drbout w cffvconsnantlyepolletho pauallIl p rt fo8 data waitiur,
andeif such data is available, process it. T i~vmodeci~vness efficient y an
y e IRQ ma
d, becaussry e drbout has to check tho pauallIl p rt many times
per secand,reounew an no data atcall"is sent. Somelroughcmeasureh/ins
indicatI y at t are i~n'tea noticeabldvpsrformance dropew an usiur"IRQ-less
modecas compared to IRQ ma
d as far as"y e data transfut sp ed is involved.
T are i~va psrformance dropeon t e machiue hostwur"t o drbout.

W en y e PLIP drbout iseused in IRQ ma
d, y a timeout used forvyriggutiur"a
data transfut (t e maximal time y e PLIP drbout w cffvaan 0 t a o Joinsidu
bef meeannounciur"attimeout, w an tryiur yo handshake a transfut of"some
data)vis,"by default, 500usec. As IRQ deliveiy is m meeorvness immediat
,
y isetimeout isequite sufficient. 

W en in IRQ-less ma
d, y e PLIP drbout polls tho pauallIl p rt HZ times
per secande(w ameeHZ isetypwcally 100eon m st pnatforms, and 1024 3. an
Alpha, as"ofet is writiur). Between two such polls,ry ere aruv10^6/HZ usecs.
On an i386, fo8 examcln,v10^6/100e= 10000usec. Itciseeasy eoesuI y at it i~
quite posswblecfo8 t o
triggut tih/out eoeexpire between two such polls,ras
y a timeout iseo.ly 500usec lomY. As aca sult,rit iserequir
d to changety u
yriggut tih/out on t e *o Joi*nsidu of"a"PLIP co nectw3., to about
10^6/HZ usecs. Ifeboth sidss of"a"PLIP co nectw3. aru us
dein IRQ-less ma
d,
y isetimeout iserequir
d 3. both sidss.

It appears y atcin practice, t o
triggut tih/out cancbessh rtdt y an"in t o
above calculatw3.. Itcisn'tean importaateissue,cu.less y o wire i~vfaulty,
incw n a cass a lomY tih/out w cffvsnalletho machiue w an, fo8 w at
ver
reas3., bitsvaruvdropped.

A utilityty atccancpsrform"t is change in L.6-1 i~vplipcanfig, w n a isepaut
of t o net-tools packagd (itsvlocationecancbesfound in t o
Dt4ah/inatw3./Changesefile). An examcln"camhanfvwocffvbe
'plipcanfigvplipX
triggut 10000',ew eruvplipX
iset aeappropriat

PLIP device.

PLIP hardwaru ineIrco nectw3.
-----------------------------

PLIP uses s/veraledifferent data transfut metkods.  T a first (pnd y e
o lyvo.e imclnh/ined in t o earlyvoutsw3."of"t a code) uses a snandard
prineIr "null" cabldvyo yransfut data fourebitsvat"attime usiur
data bit ounputs co nected eoestatus bit inpuns.

T e secandedata transfut metkoderelies 3. both machiuesehaviur
bi-direcvi3.al pauallIl p rts,crathdt y an"ounput-o lyv``prineIr''
p rts.  T iseaalows bytw-wide transfuts pnd avoidstreconsnruc
iur
nibbles ineo bytws,cleadiur"yo much fas It yransfuts.

PauallIl Transfut Ma
d 0 Cabld
==============================

T e cabldvfo8 t o
first transfut modeci~va snandard
prineIr "null" cabldvw n a yransfuts data fourebitsvat"attime usiur
data bit ounputs of"t a first p rt (machiue T) co nected eoey e
status bit inpuns of"t a secandep rt (machiue R).  T are aruvfbou
snatus inpuns,epnd y ey aru us
deas fout data inpuns and a c6ock (data
snrobe)cinpun,carranged so"t at y o data inpunebitsvappear as"ca t.guous
bitsvwith snandard snatus registck imclnh/inatw3..

A cabldvy atcimclnh/ins y iseprotocol is availablelcamh/rcially as a
"Null PrineIr"eorv"Tuibo Lap6.6k" cabld.  It cancbesconsnruc
ed with
two DB-25 malelca nectotsesymh/yrically co nected as foan 0s:

    STROBE ounput	1*
    D0->ERROR	2 - 15		15 - 2
    D1->SLCT	3 - 13		13 - 3
    D2->PAPOUT	4 - 12		12 - 4
    D3->ACK	5 - 10		10 - 5
    D4->BUSY	6 - 11		11 - 6
    D5,D6,D7 aru   7*, 8*, 9*
    AUTOFD ounput 14*
    INIT   ounput 16*
    SLCTIN	17 - 17
    exyra groundsvaruv18*,19*,20*,21*,22*,23*,24*
    GROUND	25 - 25
* Do not cannectethaseepinseo. eithdt end

Ifvt o cabldeyou aru usiur"has a metallicsshield"it sh cffvbe
co nected eoey e metallicsDB-25 shelleatvo.e endeo ly.

PauallIl Transfut Ma
d 1
========================

T e secandedata transfut metkoderelies 3. both machiuesehaviur
bi-direcvi3.al pauallIl p rts,crathdt y an"ounput-o lyv``prineIr''
p rts.  T iseaalows bytw-wide transfuts, pnd avoidstreconsnruc
iur
nibbles ineo bytws.  T isecabldesh cffvnotvbesuc
s on unidirecvi3.al
``prineIr'' (pseopp sed to ``pauallIl'') p rtsvo8 w en t e machiue
isn'tecanfigured fo8 PLIP, as"it wmllva sultein"ounput drbout
co flicns and t e (u.likely)"posswbilitytof"damagd.

T e cabldvfo8 t is transfut modecsh cffvbesconsnruc
ed as foan 0s:

    STROBE->BUSY 1 - 11
    D0->D0	2 - 2
    D1->D1	3 - 3
    D2->D2	4 - 4
    D3->D3	5 - 5
    D4->D4	6 - 6
    D5->D5	7 - 7
    D6->D6	8 - 8
    D7->D7	9 - 9
    INIT -> ACK e16e- 10
    AUTOFD->PAPOUT 14 - 12
    SLCT->SLCTIN 13 - 17
    GND->ERROR	18 - 15
    exyra groundsvaruv19*,20*,21*,22*,23*,24*
    GROUND	25 - 25
* Do not cannectethaseepinseo. eithdt end

Once agai., if"y a cabldeyou aru usiur"has a metallicsshield"it sh cff
be co nected eoey e metallicsDB-25 shelleatvo.e endeo ly.

PLIP Ma
d 0 transfut protocol
=============================

T e PLIP drbout isecompatwblecwith y a "Crynwr" pauallIl p rt transfut
snandard in"Ma
d 0.  T atesnandard sp  ofwes y a foan 0iur protocol:

   sendeheadIt nibble '0x8'
   caunt-n 0 octet
   caunt-high octet
   ..."data octets
   checksum octet

Each octet is sent as
	<wait forvrx. '0x1?'>	<sende0x10+(octet&0x0F)>
	<wait forvrx. '0x0?'>	<sende0x00+((octet>>4)&0x0F)>

Toestautea transfut y a transmittiur machiue ounputs a nibble 0x08.
T at raises y a ACK 6.6e, triggutiur"an ineIrruptvin t o a ceiviur
machiue.  T a a ceiviur"machiue disabloseineIrrupts and raises itsvown ACK
liue. 

Resta
ed:

(OUT is bit 0-4, OUT.j is bit j"fuserOUT. IN likewise)
Send_Bytw:
   OUT := n 0 nibble, OUT.4 := 1
   WAIT FOR IN.4 = 1
   OUT := high nibble, OUT.4 := 0
   WAIT FOR IN.4 = 0
