Introduction ------------ PLIP means Parallel Line Internet Protocol, that allows you to comunicate two machines via a printer port cable. The comunication speed is very high, over the 200Kbps, compare with normal SLIP/PPP comunications running at 38400/57600 or maximum 115200 bauds. Maximum PLIP speed is rated arround 1Mbps, depending basically in the hardware for processing (cpu, port, etc). Also speed depends in the cable, and length. Normal cables are a 2 to 5 meters long. The interesting feature of plip is that it is very cheap and simple for connecting 2 machines in a network. This package implements PLIP for Minix 2.0.2 and 2.0.4. You can not use this driver for Minix-VMD. This version have good performance and uses less memory than previous driver. The driver can control only 1 printer port. The driver usage is excluyent, you can not use plip with a printer connected, and also you can not print if you want to use plip. You can stop the plip driver, connect the printer, and print, without other modifications, but not both at the same time. It uses a user program to connect the plip kernel driver with the inet code, via pseudo ip devices. The user program makes simple protocol convertions and some checks. A command program allows you to configure some parameters into the kernel part of the code. The code works under 32 and 16 bits, but still it need to be optimized to use less memory, if you like to use it under XT configurations. Remember that the driver is under development yet, but it is stable. >>>>>>>>>>>>>>>>>>>>>>>>>>> VERY IMPORTANT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< I recomend you to be familiar with kernel recompilation, to avoid problems. I do not explain the specific steps to reconfigure the kernel. I assume that you have some experience with it, if there are some problems. Version 2.0.3 is mentioned but is not supported and no tested. Under 2.0.4 16 bits you can have compilations errors. >>>>>>>>>>>>>>>>>>>>>>>>>>> VERY IMPORTANT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Instalation ----------- Before any work, you need to compile your kernel at all with network code enabled, and you should boot your new kernel to verify that it works. To have networking enabled, you need to modify /usr/include/minix/config.h to enable the network code defining ENABLE_NETWORKING to 1. In 2.0.4 you need to enable DP8390 support and PRINTER. Once you verify that your enviroment can compile a new kernel with network code, and you can boot succesfully, you can try to install the plip code. The only change is about installing the new printer.c source file in each machine, recompile and boot the new kernels. 1. make a copy for the printer.c code in /usr/src/kernel and copy the new printer.c source. You can add statistics support if you patch the keyboard.c file. Use the keyboard.cdiff to patch, or the keyboard.c file, but first make a copy of the original keyboard.c . This patch is not obligatory, but is interesting to have some idea if the driver is working. With the patch you press F5 and have the plip interface statistics. Recompile kernel and reboot. 2. make sure you have a plip cable, normally used as Laplink cable the connections are: D0 2 ----- 15 Error D1 3 ----- 13 Select D2 4 ----- 12 Paper Out D3 5 ----- 10 ACK D4 6 ----- 11 Busy GND 25 ----- 25 Ground ERROR 15 ----- 2 D0 SLCT 13 ----- 3 D1 P.OUT 12 ----- 4 D2 ACK 10 ----- 5 D3 BUSY 11 ----- 6 D4 3. configure default ps network in both machines if them have no other interfaces (like ethernet card). If you have ppp installed, you do not need this step, so you should done it before. # netdefault psip2 in 2.0.4 you need to configure the /etc/inet.conf file like psip2 { default; }; psip3; here psip2 is the default network, psip3 will be a secondary net. in out examples we are configuring psip2 as the comunication between machines. 4. configure ip address with ifconfig for the interface to be used like # ifconfig -h 10.1.1.1 -n 255.255.255.0 ==> this for machine A # ifconfig -h 10.1.1.2 -n 255.255.255.0 ==> this for machine B 5. declare the other system into /etc/hosts like 10.1.1.1 spock A 10.1.1.2 deimos B these are my prefered node names. Remember that nonamed must be running because the inet code needs to resolve the names from /etc/hosts. Also check that /etc/resolv.conf have no references to any external IP node. You need to check that nonamed is running, it is the DNS daemon so you need it for name resolution, or you will need to use plain IP address for comunication. 6. if you use linux in the other side you can start plip like rmmod lp (a) insmod plip1 (b) ifconfig plip1 spock pointopoint deimos up (c) route add deimos dev plip1 (d) (a) this command removes lp driver. It is loaded by default by Linux, but it can be disabled in /etc/rc.d/rc.modules if you like. (b) this loads the plip driver as plip1, but depends of your hardware configuration, so it can be loaded a plip0 or plip2. Also it can be loaded in /etc/rc.d/rc.modules, but you need to comment the lp load. (c) here you configure peer information (here is node deimos) and comments to local plip driver the local ip (here is spock). Both nodes need to be declared in /etc/hosts. (d) here we add a route to indicate the ip code where is deimos. do not enable arp into the plip line. Current Minix plip does not support it if you have 2 Minix machines, configure them like step 5, using different IP and node names. 7. If you are using PicoBSD or some variant, you can configure the peer node as # ifconfig lp0 10.1.1.1 netmask 255.255.255.0 10.1.1.2 -arp link0 up where 10.1.1.1 is the BSD machine, 10.1.1.2 is the minix machine, -arp disable ARP code at BSD, and link0 states to use the ethernet frame that Minix plip understand. 8. compile the plip.drv driver and plipctrl command with make, in the directory where you open the tar file. You need to install the driver after compilation. Both steps are # make install <== first compile driver, after install it in /usr/local/bin and also installs plip man page. Also the plipctrl command. 9. create a plip device with mknod /dev/plip c 6 128 10. connect cable between machines 11. configure and start plip with # plipctrl -l local-name -r remote-name -e # plip.drv & in my example, I have machine named "spock" and "deimos" spock> plipctrl -l spock -r deimos -e spock> plip.drv & deimos> plipctrl -l deimos -r spock -e deimos> plip.drv & if every is ok, you will see from plip.drv the message plip: ready. if you do not see the message, check for /etc/hosts, nonamed and /etc/resolv.conf configuration in previous steps. Use F1 to get the status of the plip.drv process or use 'ps' Remember that you can start the plip driver without the cable connected, but you can have some timeout message from plip driver. It is no a problem. plip.drv without any flag use psip2 as the default network. 12. use the conection with telnet, ftp, lynx, etc. Check with F5 the packet and memory usage (if you patch keyboard.c) 13. you can stop the plip driver with a kill command. You will have 2 process one for transmition and other for reception. You need to kill the smaller pid process number, like # ps PID TTY TIME CMD 49 co 0:00 -ash 50 c1 0:00 getty 51 c2 0:00 getty 52 c3 0:00 getty 75 co 0:00 plip.drv 76 co 0:00 plip.drv 77 co 0:00 ps # kill 75 # plip: ended. [1] 75 Exit 0 plip.drv Comments/Tips/Troubleshooting/Tuning ------------------------------------ The code is under development and not optimized. Please let me know any problem you have using the code, modifications, suggestions, etc. Also be carefull with your instalation, try to do backups for your files, have a booteable diskette, etc. The plip.drv have debuging code, you should hand edit the config.h file and uncomment the DEBUG define and recompile. If you have problems, try using the -d and -v flags, and redirect any information to a file like # plip.drv -d -v 2> plip.log & In config.h also you can uncomment DEBUGPKT so when you use -v and -d it prints hexa dumps of the packets. It is a second stage of troubleshooting and must be used when strange errors are arround. It is like looking the bits in the cable, and have some headache. The printer.c code also have a DEBUG flag that you need to uncomment, recompile the kernel, reboot and test. The kernel messages can be captured with screendump command. Remember that these messages are only printed at console. There are also some DEBUG0 and DEBUGn that I used for development, and adds a lot of message that it is better for you do not make any define. The tests were done using Minix/Minix, Minix/Linux and Minix/BSD, it seems to work, with some timeouts, but with good performance, so the timeouts can be because different hardware speed in my configuration. One of my machines is a 350Mhz CPU, the other is a DX 50Mhz CPU, so processing power is basic for plip, and you can have similar problems like me. Basic communication using ftp and tests with ttcp shows me a performance of 28Kbytes/sec average (224kbps), versus 35Kbytes/sec (280kpbs) using Linux in the same hardware. Windows parallel connections have lower speed. Some tests between Minix versus Linux via plip have throughtput of 40Kbytes/sec better than some Minix-Minix tests. Current buffer size is 16 Kbytes for 16 bits and 32K for 32 bit. The variable PLIP_BUFFER into printer.c controls it. I tried using smaller values, they are good for telnet or small packets communications, but ftp use large windows. When I transfer from the small machine (50Mhz) to the big (350Mhz) buffer usage is small and I can reduce the buffer as low as 4Kbytes, so the big machine process quickly the buffers. In the reverse (big->slow) I have problem, some missing packets and the solution was to use a big buffer. The only problem with small buffers are timeouts, so the inet code needs to retransmit, and this is a performance problem. You can always check with F5 the buffer usage. If you notice some timeout message, check buffer statistics. You will have a display similar to # dp8390 port 0 is in sink mode dp8390 port 1 is in sink mode plip: RX: 1947 packets, 0 errors, 8 over, 10 alloc TX: 1962 packets, 0 errors, 0 over Pool size : 16384 Free : 16384 Slots : 16 < 256b : 2060 256-511b : 4 512-767b : 1 768-1023b : 1 1024-1279b : 2 1280-1535b : 1841 Min alloc : 60 Max alloc : 1414 Min free : 687 The Min free variable shows the minimum value that the local plip buffer arrives. With ftp I had some lower values as 600 Bytes, and ftp tries to use big packets (over 1Kbyte) and some timeouts appear. The buffer is used for transmition and reception. The allocation is using the packet size, and the maximum packet size for transmition is 1500 bytes. The minimum packet transfered is 60 bytes, because PLIP use an ethernet frame as transport. In the example you can see that Min free is 687 bytes. If you check in the RX line, you see 8 packets over, it means that 8 packets where overrided because I had small buffers. In this communication I transfered via ftp a file arround 1.2 Mbytes. I have some errors, but performance was good. The important counters are for override, generally for reception packets, and for errors, like timeouts. May be some tx and rx under normal usage. for delay to answer while writting to disk, etc. Normal actions using the counters are RX over : increment the PLIP_BUFFER value, you are slow in slots, so you have a lot of packets received, you have pool area, but you have no slots. Slots are calculated as PLIP_BUFFER/1024 and it is fixed into driver. Also the problem is that reception machine is too slow than the other machine. RX error: check for timeouts, the other machine may be slow. or cable. TX over : one condition is about buffer full of receive packets, you will see a message in console indicating this problem. In this case you need to increment PLIP_BUFFER. The other condition is normal so there is a receive packet in progress while we are trying to send, but this is not a problem because the driver retry. No message is displayed, and do not increment nothing. TX error: timeouts, slow peer node, check cable. alloc: here is that memory pool is low. Try using the double of PLIP_BUFFER and retrying tests. In 16 bits machine the limit may be 30 to 32K but in 32 bits you can use 128Kb or more if you need. Be carefull to using very long cables. I used a 2 meters cable between machines, but longer cables can be used. Also the power to send the bytes over the link is done by the hardware, so the software uses it. Very long cable can present more errors than usual. I believe that a cable more than 5 meters is too large for any configuration. Remember that you can not use both printer and plip in the same moment. If are using plip and need to print, stop the plip driver like step 13, connect your printer and print as always. The printer code is the same as original Minix printer code. To return to plip, reconnect the plip cable, and start again plip.drv. You can disable the plip link using plipctrl -d . A common problem is that you enable plip with plipctrl, but forget to configure the local and remote MAC address. You need to configure them so the driver can build the right headers. Minix discards them, but Linux needs them. So if you connect Minix to Linux and have no response, check with F5 the local and remote MAC. If them are ff:ff:ff:ff:ff:ff you forget to configure them, and the link is using multicast MAC address. A last configuration issue is using plipctrl with -D flag. It configures the delay loop for reception and transmition. Default is a value of 5 but I used a value of 1 and I have no errors. It can help to step a bit more of performance. If power between machines are very different, you can use it to tune the link to avoid errors. Check counters with F5. It also shows you the delay value. Bigger values makes link slower. Finally, the man page have some configuration examples and tips. It can be accesed with "man plip" command.