Differences Between Stream and LPD Print Protocols


This document explains the differences between the LPD (Line Printer Daemon) and Stream printer protocols and what it means to your network and your connection to a remote host.

LPD Protocol

LPD protocol is the standard printing protocol on UNIX systems. There are two parts to the protocol: a client and a server.

There are two parts involved in the transfer of a print file itself: the data file and the control file. The data file (DF) contains the data to be printed. The control file (CF) is the file that tells the remote host or remote printer how to print the file. The data file is sent to the printer first, followed by the control file.

Configuring an LPD Server

For an inbound request to be successful, the following must be true:

Note: These are not recommendations, but the way the LPD protocol functions.

To confirm these settings, follow these steps:

  1. Enter:
      $ multinet configure/server
      server-config> sh /full LPD
      Service "LPD":
              TCP socket (AF_INET,SOCK_STREAM), Port 515
              Socket Options =  SO_KEEPALIVE
              INIT() =  TCP_Init
              LISTEN() =  TCP_Listen
              CONNECTED() = TCP_Connected
              SERVICE() = Run_Program
              Program = "MULTINET:SERVER_LPD.EXE"
              Accept Hosts = IP-127.0.0.1
              Accept Nets  = IP-192.41.225.0 , IP-161.44.0.0
              Reject by default all other hosts and nets
              Reject Message = "Your host does not have line printer access"
    

    In this example, this LPD server will accept requests from itself, and any host that is on the 192.41.225.0 and the 161.44.0.0 subnets.

    If a host is on a different subnet, 161.50.10.0 for instance, the reject message text will be returned.

  2. Enter:
      $ show log *lpd*
    
     (LNM$SYSTEM_TABLE)
    
      "MULTINET_LPD_DEFAULT_USERNAME" =  "DEFAULT"
    
    where "DEFAULT" is a UAF entry on the server system.

    Define this logical to allow a user who does not have a VMS account on this system to print as the default user.

    Note: The username "DEFAULT" must exist on the server system. It does not need to have any privileges and it can be disabled, but it must exist.

  3. Enter:
      $ show queue 'queue name'
    

    If the queue is not there, even a user who has an account cannot print.

Configuring LPD Client

When a printer gets an LPD print job, it must buffer the entire data file and wait for the control file to be delivered before it can complete the print request. With a large print job, this may cause problems. If the card runs out of memory trying to store the DF, the print job could cancel. If you are printing extremely large files, we recommend using Stream rather than LPD.

When setting up an LPD print queue that points directly to a printer, then you must supply a remote-queue-name that the remote printer's Ethernet card knows about. You may actually have to configure a print queue on the card. The HP JetDirect cards that come with most HP printers have three predefined queues for the LPD protocol:

Sample LPD Client Config

  $ mu config/print
  MultiNet Remote Printer Configuration Utility V3.5(23)
  [Reading in configuration from MULTINET:REMOTE-PRINTER-QUEUES.COM]
  PRINTER-CONFIG>
  PRINTER-CONFIG>add HOBBES_LPD_HP5_PS
  Destination IP Address: [161.44.195.8]
  Protocol Type: [LPD]
  Remote Queue Name: [post]
  [HOBBES_LPD_HP5_PS =3D> 161.44.195.8, post]
  PRINTER-CONFIG>exit
  $

Stream Protocol (Reverse Telnet)

With Stream printing, there are no network overhead issues and no control files or Protocol-layer communications. Stream simply opens a socket to the remote IP address and sends data to it. The printer receives the data and starts printing. There is no buffering.

Advantages of Stream

What are some of the advantages of Stream ?

Configuring a Stream Print Queue

There are several things you need to know to configure a Stream print queue.

Before you begin, you need to know the following:

If you need to confirm this information is correct, do the following:

  1. Use MultiNet to ping the destination printer's IP address. This confirms that you can communicate to the IP address.

  2. Telnet to IP address'/port= 'listener port number. This confirms that you can connect to the listener port number. You must be able to connect to the listener port number before you can print successfully.

Usually if you cannot do either step 1 or 2, your print queue will stall.

Sample Stream Protocol Config

  $ mu config/print
  MultiNet Remote Printer Configuration Utility V3.5(23)
  [Reading in configuration from MULTINET:REMOTE-PRINTER-QUEUES.COM]
  PRINTER-CONFIG>add HOBB_TK_TEST
  Destination IP Address: [161.44.193.8]
  Protocol Type: [STREAM]
  TCP Port Number: [9100]
  [HOBB_TK_TEST =3D> 161.44.193.8, TCP port 9100]
  PRINTER-CONFIG>exit
  $

When to Use Stream versus LPD

Use the LPD protocol if one of the following applies:

For example, if you want to print to a remote HP-UX system (not an HP printer, necessarily) or to an NT system, then use LPD as the protocol on the queue. UNIX does not support Stream.

Note: People often use LPD to print to HP printers, but we recommend using Stream.

Use Stream protocol when you are printing to printers directly or to terminal servers.