Novell is now a part of Micro Focus

An Inside Look at SPX Communications between RPRINTER/ NPRINTER and the NetWare Print Server

Articles and Tips: article

VIRGIL TELFORD
Product Support Engineer
Novell Technical Services

EDWARD LIEBING
Research Engineer
Novell Systems Research

01 Dec 1995


This Application Note examines the SPX communication packets sent between the remote printer support module (RPRINTER or NPRINTER) and the print server, as seen by a protocol analyzer placed on the connection. An analysis of these packets provides an inside look at the information that is exchanged when the remote printer module initially connects to the print server, when a print job is sent to the print server, and when the print services connection is in an idle state. This information is geared toward advanced technicians who are using a protocol analyzer to troubleshoot network printing problems.

RELATED APPNOTES Sep 93 "Optimizing Printing with NetWare 4.x and 3.1x" Jun 92 "Dealing with LAN Printing Problem Areas" May 92 "Understanding and Troubleshooting Novell's Print Services"

Introduction

When troubleshooting problems with remote printers using NetWare's print services, it is helpful to understand the communications that take place between the NetWare print server (PSERVER.NLM) and the remote printer support module (RPRINTER.EXE in NetWare 3, NPRINTER.EXE in NetWare 4). To assist in this understanding, this Application Note presents an analysis of the data packets exchanged between these two entities. Since they communicate using Novell's Sequenced Packet Exchange (SPX) protocol, we'll focus on the SPX packets involved.

After a brief overview of the process involved in getting a print job from the print server to a remote printer, we'll look at the information that is exchanged during four stages of this process:

  • When RPRINTER/NPRINTER makes an initial, temporary SPX connection to the print server

  • When RPRINTER/NPRINTER establishes another SPX connection through a remote socket, after the initial connection is made

  • When the print server sends a print job to the remote printer via RPRINTER/NPRINTER

  • When the print services SPX connection is in an idle state

After we look at the packets involved in these four stages, we'll cover the pertinent IPX/SPX NET.CFG parameters that can affect the connection between the NPRINTER workstation and the print server.

This information is primarily geared toward advanced trouble-shooters who are using a protocol analyzer (such as Novell's LANalyzer) to troubleshoot network printing problems. For those who may be unfamiliar with this troubleshooting technique, we also explain how to set up the LANalyzer with an SPX packet filter, and how to interpret the information contained in an SPX packet.

Overview of the Remote Printing Process

NetWare's print services allow print queues to be serviced from printers that are attached to file servers or to workstations. In NetWare 3 and 4, the NetWare Print Server software can be installed on a file server by loading PSERVER.NLM. (In NetWare 3, you have the option of running PSERVER.EXE on a DOS workstation to create a dedicated print server.) To use printers attached to user workstations as network printers, you load a terminate-and-stay-resident (TSR) program on those workstations. This program is called NPRINTER.EXE in NetWare 4 and RPRINTER.EXE in NetWare 3.

The discussion in this AppNote is based on a NetWare 4.1 file server running PSERVER.NLM and a DOS workstation running NPRINTER.EXE. The server and the workstation are attached to a single LAN segment, and the printer is hooked up to the LPT1 port of the workstation. Since NPRINTER.EXE and RPRINTER.EXE are functionally the same, what we say about NPRINTER applies equally to RPRINTER unless noted otherwise.

Print Server Initialization

When you load PSERVER.NLM on a NetWare server, the PSERVER software initializes itself based on configuration information stored in its Print Server ID directory (NetWare 3) or in the defined attributes of its Print Server object (NetWare 4). After logically attaching to the appropriate file servers, PSERVER builds a list of the printers it will service and associates the print queues with their designated printers.

To have PSERVER service a remote printer, you need to have defined the printer via the PCONSOLE utility. This is where you specify the printer number, the type of connection (parallel, serial, or other/unknown), whether NPRINTER will use interrupts or polled mode to communicate with the printer, the size of the "pass- along" buffers, and the serial communication parameters (if applicable).

NPRINTER Initialization

The NPRINTER software is loaded by typing the following command at the workstation with the printer attached:

NPRINTER PrintServerName PrinterNumber<Enter<

For example, to load NPRINTER so that the attached printer (defined as Printer 0) can be serviced by print server PS1, you would type "NPRINTER PS1 0 <Enter<."


Note: To avoid typing errors, it's a good idea to load NPRINTER from the workstation's AUTOEXEC.BAT file.

As NPRINTER loads, it establishes an initial SPX client connection with the print server. It then requests certain information for the printer number specified on the command line. This information includes LPT or COM port number, buffer size (which both NPRINTER and PSERVER use as their "pass- along" buffer size), printer type, interrupts used, and so forth. PSERVER responds by sending this information to the NPRINTER station.

After this initial dialogue takes place, NPRINTER tears down the SPX client connection and sets up a more permanent remote printer socket connection that will be used for the duration of the printing session. Once this is done, NPRINTER is ready for PSERVER to start sending print jobs.

PSERVER begins polling the print queue(s) that the remote printer services. When it finds a job that is ready to print, PSERVER checks the NPRINTER status to make sure the printer is ready to receive a print job. If so, PSERVER fills its "pass- along" buffer with the first part of the print job file. When the buffer is full, it passes this data to NPRINTER's buffer. Since the print server and NPRINTER communicate in 512-byte SPX packets, the buffers for both PSERVER and NPRINTER are divided into 512-byte chunks.

Once NPRINTER has data in its buffers, it checks the status of the printer port to see if the printer can receive data. If so, NPRINTER begins sending data to the printer a byte at a time, receiving an acknowledgement from the printer after each byte. When the printer's print buffer is full, it signals NPRINTER to stop sending bytes. As NPRINTER's buffers are emptied, NPRINTER sends a status message to the PSERVER indicating that it has free buffers. This signals PSERVER to send more data. The print server then sends the next portion of the print job file to fill NPRINTER's empty buffers. Meanwhile, PSERVER obtains more data from the print queue when its buffers are empty. This process continues until all of the print job data has been sent to the printer.

Throughout this process, NPRINTER sends its status information to the print server, indicating how many empty buffers it has available. When another print job is ready to print, the whole process starts over. The overall process is illustrated in Figure 1.

Figure 1: PSERVER passes print job data to NPRINTER, which sends it to the remote printer.

A number of communications procedures between the print server and NPRINTER deserve attention. These are the distinct phases we will analyze in our packet traces:

  • First is the transaction that takes place during the initial SPX connection as NPRINTER establishes communications through the client socket with the print server. Through this connection, NPRINTER gathers the necessary configuration information about its attached printer(s).

  • After the initial communication and connection takes place through the client socket, NPRINTER makes another connection through the remote socket, which is the actual SPX connection that is maintained throughout the printing session.

  • Once the "official" SPX connection is established, the print job data can be transferred from the print queue to the printer. Certain communications occur both ways during the transfer to enable the print job to continue.

  • Even when no print jobs are being sent, SPX packets are sent between the print server and NPRINTER to maintain the connection. We call this the "idle" or "quiescent" state.

Before we look at the packets involved in these four phases, we'll explain how we set up our protocol analyzer to obtain the traces.

Setting Up the LANalyzer

In preparing this AppNote, we set up the LANalyzer to capture packets sent between the workstation running NPRINTER.EXE and the server running PSERVER.NLM. The traces were filtered to show only SPX packets.

Here are the steps we followed to do this. You must know the network node address of the workstation running NPRINTER and the node address of the server running the print server software. Also, the print server must be up and running on the file server.

  1. Install and bring up the LANalyzer.

  2. Choose "Capture" from the menu bar.

  3. Select "Filter" from the Capture drop-down menu bar.

  4. In the Stations box, type the node address ofthe workstation running NPRINTER and the node address of the fileserver running the print server.

  5. Choose OK.

  6. Activate the Start button.

  7. When the capture is finished, select the View button to display the trace on-screen. (You do not need to select the Stop button first, as selecting View stops the capture process.)

  8. Choose the Decode option from the menu bar.

  9. Select the Filter option.

  10. Double-click on the [NetWare] entry located in the "Available" box in the Protocol section.

  11. Double-click on SPX (or highlight SPX and select the Add button).

  12. Select OK. You should now see "[NetWare..] spx" in the selected box in the Protocol section. Your trace will be filtered to view only SPX protocol communication packets.

The above procedure yielded a rather large packet trace, even afterfiltering out all but the SPX packets. We won't cover the NCP packets involved in the initial loading of NPRINTER.EXE and the Unicode files at the workstation. We'll start our analysis by looking at the SPX packets exchanged between the print server and NPRINTER after NPRINTER.EXE is loaded.

Deciphering an SPXPacket

For those who may not be familiar with LANalyzer packet traces, we'll look at the first captured SPX packet in detail. The information captured to a file through the LANalyzer is shown in Figure 2.

Figure 2: Contents of an SPX packet, as captured by the LANalyzer.

Packet Number : 832         10:09:37 AM
Length : 64 bytes
802.3: =================== IEEE 802.3 Datalink Layer ===================
       Station: 00- 00- 1B- 1E- 31- 28 - - - - > 00- 00- 1B- 02- 16- 97
       Length: 45
       
802.2: ================ IEEE 802.2 Logical Link Control ================
       SSAP: NetWare     DSAP: NetWare
       Unnumbered Command: Unnumbered Information (UI)
       
  ipx: ================== Internetwork Packet Exchange =================
       Checksum: 0xFFFF
       Length: 42
       Hop Count:  0  
       Packet Type: 5(SPX/SPXII)
       Network: 01 01 03 80        - - - >  01 01 03 C2
       Node:    00- 00- 1B- 1E- 31- 28  - - - >  00- 00- 00- 00- 00- 01
       Socket:  0x4010             - - - >  Print Server     
       
  spx: =========== NetWare Sequenced Packet Exchange Protocol ==========
       Connection Control: 0xC0 (System Packet; Send ACK; )
       Datastream Type: 0 
       Source Connection ID: 17849
       Destination Connection ID: 65535
       Sequence Number: 0
       Acknowledge Number: 0
       Allocation Number: 0

Following is a brief explanation of each line or field in this sample SPX packet.

Packet Number : 832 10:09:37 AM

The first line identifies which packet in this trace you are looking at, as well as the time at which the packet was captured.

Length : 64 bytes

This indicates the number of bytes in the packet, minus packet header information.

802.3: =================== IEEE 802.3 Datalink Layer ===================
      Station: 00- 00- 1B- 1E- 31- 28 - - - - > 00- 00- 1B- 02- 16- 97>
      Length: 45
      
802.2: ================ IEEE 802.2 Logical Link Control ================
      SSAP: NetWare     DSAP: NetWare
      Unnumbered Command: Unnumbered Information (UI)

The Ethernet_802.2 frame type is considered IEEE-compliant because it contains both IEEE 802.3 (datalink layer) and 802.2 (logical link control) headers. The Station entry under the 802.3 header shows the network board (node) address of the workstation running NPRINTER (00001B1E3128) and of the file server running PSERVER (00001B021697).


Note: In our test scenario, these two nodes were on the same networksegment. If they were on different segments, the node addressesdisplayed would not be those of the stations running NPRINTERand PSERVER, but rather those of the stations passing the packets.

The information contained in the rest of the fields in these headers is irrelevant to our discussion.

ipx: ================== Internetwork Packet Exchange =================
      Checksum: 0xFFFF
      Length: 42
      Hop Count:  0  
      Packet Type: 5(SPX/SPXII)
      Network: 01 01 03 80        - - - >  01 01 03 C2>
      Node:    00- 00- 1B- 1E- 31- 28  - - - >  00- 00- 00- 00- 00- 01>
      Socket:  0x4010             - - - >  Print Server     >

Under the IPX heading is the information that pertains to IPX in this packet. Each of these fields is explained below.

Checksum. Not used; the numbers are simply fillers.

Length. Indicates the length of the packet, including the IPX header and any included data, but not the Ethernet frame fields.

Hop Count. Shows how many routers are involved in getting the packets from source to destination. The hop count of 0 means this packet has crossed no routers.

Packet Type. Indicates the type of packet according to the following list:


0 or 4

IPX packets

5

SPX or SPX II packets

17

NCP communications

Network. Shows the four-byte network address portion of the network/node/socket addresses used by IPX to find the correct source and destination stations.

Node. Shows the six-byte node address of the source and destination nodes. If the packet is a broadcast, you will see 0xFF- FF-FF-FF-FF-FF. If you are sending to services within the server for NetWare 3 and NetWare 4, the destination node address will be 0x00-00-00-00-00-01, which is the node address of the internal IPX network number.

Socket. Shows the two-byte socket address of the source and destination nodes. In this example, NPRINTER (with socket address 40-10) is sending to the Print Server client socket (which is always 0x8060). Other common sockets numbers include:


0x0451

NetWare core protocol (NCP)

0x0452

Service AdvertisingProtocol (SAP)

0x0453

Routing Information Protocol (RIP)

0x0455

NetBIOS packet

0x0456

Diagnostic packet

0x0457

Serialization packet

spx: =========== NetWare Sequenced Packet Exchange Protocol ==========
      Connection Control: 0xC0 (System Packet; Send ACK; )
      Datastream Type: 0 
      Source Connection ID: 17849
      Destination Connection ID: 65535
      Sequence Number: 0
      Acknowledge Number: 0
      Allocation Number: 0

Under the SPX heading is the information that pertains to SPX in this packet. Since we are looking mostly at SPX information, we'll focus on the entries under this heading.

Connection Control. The information seen here depends on which type of control packet is being sent. There are in essence three types: System Packet, Acknowledgement Required, and End of Message. These can appear in different forms, some of which are listed below:

0x80 (System Packet)

Used internally by SPX to ensure that the connection is still in place and as an acknowledgement packet. This is SPX's "I'm still here" packet.

0x40 (Send ACK; )

Data was sent and an acknowledgement is required.

0x10 (End of Message; )

Sent when the client wants to signal an "end-of-message" to the partner. This is not an end of connection request, but is used to signal an end of a certain data exchange.

0xC0 (System Packet; Send ACK; )

Used internally by SPX to ensure that the connection is still in place by requiring an acknowledgement (ACK) from the communications partner. This is the "Are you still there?" packet. The number is a combination of 0x80 and 0x40, which equals 0xC0.

0x50 (Send ACK, End of Message; )

SPX desires an acknowledgement of the data sent and, once it is received, sets the flag to signal an "end-of-message" to the partner. The number is the combination of 0x40 and 0x10, which equals 0x50.

Datastream Type. The remote printer Datastream types are sent from the print server to the remote printer software, and include the following:


0

The data portion of the packet contains information that needs to be printed.

1

Stop printing and clear all buffers.

2

Stop printing, keep current data, and wait for new instructions.

3

Restart printing from the data buffers.

4

Stop printing from the data buffers and start printing the data that is registered in the sideband. The sideband data field consists of threeactivities: 1 - count; 2 - character to print; 3 - end character.

5

Start new print job packet.

6

Hands control of remote printer to a process other thana print server (local mode or DOS).

7

Reclaims remote printer back for the print server to use.

8

End of job. Also signal from NetWare 4 print servers thatall data has been transmitted.

The last two types are SPX calls, not remote printer calls, but they can appear in the Datastream Type field:


254

End of Connection. This is generally sent when the client socket SPX connection is terminated so the remote printer can re-establish a connection to the print server on the remote printer socket. You will also see this number when theremote printer socket SPX connection is terminated.

255

End of Connection Acknowledgement. This is generally sent by the print server when the client socket SPX connection is being terminated so the remote printer can re-establish a connection to the print server on the remote printer socket. You will also see this number when the remote printersocket SPX connection is terminated.

Data stream types 0x09 through 0xFD are client-defined and are therefore ignored by SPX.

Source Connection ID. This field contains a two-byte SPX connection number that is assigned by the source SPX station and is used to keep track of the different virtual SPX connections that a socket can support. This number will appear in the Destination Connection ID when packets are coming in from the connection partner to this station.

Destination Connection ID. This field contains a two-byte SPX connection number that is assigned to the destination SPX station. This is used to keep track of the different virtual SPX connections that a socket can support. This number will appear in the Source Connection ID when packets sent out to from connection partner.

Sequence Number. SPX assigns a sequence number to each data packet sent to the connection partner. This number is incremented when the data packet is acknowledged. This ensures a sequenced packet transmission from the Source Connection partner to the Destination Connection partner. This field is not incremented for packets that do not contain data (system packets).

Acknowledgement Number. This is the expected sequence number for the next data packet from the Destination Connection partner. This field is not incremented for packets that do not contain data (system packets).

Allocation Number. This number is used to calculate how many buffers are available to receive packets sent from the Destination Connection. This number corresponds to the sequence number of the packet that is being prepared to be sent but has not yet been sent. The Source Connection cannot exceed the allocation number. As the Source Connection generates a listen ECB (Event Control Block), SPX increments the allocation number. This field is not incremented for packets that do not contain data (system packets).

Data. The Data entry (if there is one) contains any data or codes that are being sent to and from NPRINTER and the print server. We'll go into more detail as they are used.

Analyzing the Packet Traces

Now that we've described the first SPX packet in detail, the remainder of the packets presented in this AppNote will simply show the fields that are pertinent to our discussion.

Stage 1: Initial SPX Connection

This first trace will look at SPX packets from number 832 to 894. Together, these packets will describe how NPRINTER initially attaches to the print server - first through the client socket, and then through the remote socket.

The first two packets are SPX system packets used to establish the SPX connection between the workstation running NPRINTER and the file server running PSERVER.

Packets 832 and 834 show the initial exchange that takes place when the SPX connection is being established.

___________
Packet Number : 832
Socket: 0x4010            ---> Print Server (0x8060)>
Connection Control: 0xC0 (System Packet; Send ACK; )
Source Connection ID: 17849
Destination Connection ID: 65535

The Socket field indicates an SPX packet being sent from the NPRINTER station to the print server. The print server's client socket is 8060. The packet also contains some pertinent SPX data for connection purposes. The Connection Control entry under the SPX header shows code C0h, meaning the packet is a system packet that requires an acknowledgement from the Print Server station as it is received.

The Source Connection is a connection number that is arbitrarily set up by NPRINTER as the source connection. The Destination Connection number is FFFF (the hexadecimal equivalent of 65525). This number means "I don't know what connection number you are going to be until one is assigned." The assigned number will come in the acknowledgement to this packet.


Note: Packet 833 was not an SPX packet and therefore did not appearin this SPX-filtered packet trace.

__________
Packet Number : 834
Socket: Print Server        --->  0x4010>
Connection Control: 0x80 (System Packet; ) 
Source Connection ID: 3456
Destination Connection ID: 17849

This system packet comes from the print server to NPRINTER and is an acknowledgement packet (type 0x80) to packet 832. Notice that the print server has picked a connection number (3456) to use for this connection.

___________
Packet Number : 835
Socket: 0x4010         ---> Print Server>
Connection Control: 0x50 (Send ACK; End of Message; )
Data:   0: 80 FF  |..

This data packet is being sent from NPRINTER to the print server and contains two messages within the Connection Control field: Send ACK and End of Message. The combination of the two codes (0x40 and 0x10) equals the number you see in the Connection Control entry (0x50). The Send ACK signifies that data was sent and an acknowledgement is requested. The End of Message signals the end of this data exchange.

The Data contained in this packet is an actual API call associated with the remote printer being set up on the client socket. The Data area has two bytes in it: the first byte, 80, identifies the type of request (NWPSComGetNextRemotePrinter); the second byte gives the printer number to begin the search for the next available printer that has been defined as a remote printer. For example, if the second byte were 04, the search for an available printer number would start at 05 and continue with 06, 07, and so on. If you included a specific printer number to load in the NPRINTER command, the value of the second byte will be the number prior to the printer number that you chose. For example, if you typed NPRINTER PS1 5 <Enter<, you would see "80 04" in this Data field. The next available printer after printer number 04 - printer 05 - would be used.

Remote printers are defined a little differently in NetWare 4 than they are in NetWare 3. In NetWare 3.1x, you defined a printer specifically as a remote printer. In NetWare 4.x, any printer not already in use can be requested as the remote printer. This is why the second byte in the Data field is FF in packet 835. FF means look for the next available printer that has been created, starting at the top of the list. This is also what you'll get if you want to get a list of all of the available printers by typing the load command as NPRINTER <Enter< without any printer number designation.

________

Packet Number : 836

Socket:  Print Server       - - - >  0x4010>
Connection Control: 0x80 (System Packet; )

In this packet, the print server is sending an SPX acknowledgement packet to NPRINTER in response to Packet 835.

Packet Number : 837
Socket:  Print Server       - - - >  0x4010>
Connection Control: 0x40 (Send ACK;)
Datastream Type: 0
Data:
  0: 00 00 00 07 00 50 31 00 00 00 00 00 00 00 00 00 |.....P1.........
 10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................
 20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................
 30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................
 40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................
 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................
 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................
 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................
 80: 00 00 00 00 00                                  |.....

Packet 837 is also from the print server, but this packet contains data that was requested in Packet 835. Because it is a data packet, the Connection Control sends the packet as a Send ACK packet. It is also Datastream Type 0, which means that the data portion of the packet contains information.

The first line in the Data area is explained as follows:

00 00 If the first word (two bytes) of the completion code is zero, the request is successful.

00 The next byte is the printer number, which in this case is 0 because that is the number of the remote printer we defined in PCONSOLE.

70 00 The next word is the printer type, displayed as 70 00. These bytes are in Lo/Hi order and should therefore be transposed to read as 00 07. This corresponds to the printer type "remote printer using parallel port 1." Other possible codes for printer types are as follows:


07

Remote printer using parallel printer port 1

08

Remote printer using parallel printer port 2

09

Remote printer using parallel printer port 3

10

Remote printer using serial printer port 1

11

Remote printer using serial printer port 2

12

Remote printer using serial printer port 3

13

Remote printer using serial printer port 4

14

Remote printer of other/unknown type

15

Defined elsewhere

16

eXtended Network Printer

17

AIO auto-start printer

18

AIO user-started printer

100

Apple-Talk printer

200

UNIX user-started printer

50 31 00 00 00 00 00 00 00 00 00 |.....P1.........

The printer name is given next, which can be up to 48 bytes and is zero terminated. The printer name in this example is P1, the default printer name assigned if you choose the Quick Setup option in PCONSOLE.


Note: Sometimes you might see data that is left over from a previousentry. But since the printer name string is zero terminated, anydata after the 00 byte immediately following the printer nameis ignored.

________
Packet Number : 838
Socket:  0x4010             - - - >  Print Server     >
Connection Control: 0x80 (System Packet; )

Since Packet 837 said to acknowledge the reception of the information, the next byte that comes back from NPRINTER is another system packet type 80, which is an acknowledgement to the previous packet.

________
Packet Number : 839
Socket:  0x4010             - - - >  Print Server     >
Connection Control: 0x50 (Send ACK; End of Message; )
Data:  0: 81 00  |..

At this point, NPRINTER has received the information that it wanted - the printer is available and it can now use that printer number. NPRINTER will next request a connection for that remote printer to the print server. So packet 839 is similar to the first packet: a Send ACK packet that also contains an End of Message.

The first byte in the Data portion of the packet contains the command code 0x81, which is the API request for the Print Server to assign the specified printer number to a remote printer.

The next byte is the printer number (00) for which NPRINTER wants the connection. In packet 837, NPRINTER discovered that this printer number does indeed exist and now wants to connect to that printer and also wants configuration information for that printer. NPRINTER receives this information about this remote printer by issuing a NWPSComRequestRemotePrinter request (as specified by command code 81 in the first byte of the Data area).

________#013___
Packet Number : 840
Socket:  Print Server       - - - >  0x4010           >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 3456
Destination Connection ID: 17849

This is another SPX acknowledgement system packet.

________
Packet Number : 841
Socket:  Print Server       - - - >  0x4010           >
Connection Control: 0x40 (Send ACK; )
Datastream Type: 0 
Source Connection ID: 3456
Destination Connection ID: 17849
Data:
  0: 00 00 07 00 00 00 07 00 06 00 00 00 7A 05 5E 12 |............z.^.
 10: 3F A7 31 18 81 1E                               |?.1...

Packet 841 is sent from the print server to NPRINTER, requesting an acknowledgement to ensure that the information arrived intact. The Datastream Type says that this packet contains data, and it does indeed contain information about printer 0. Because this is a parallel printer, a large part of the information sent does not apply because it's for serial printers. What does apply is listed below:

00 00 The first word is the completion code indicating it was successful.

07 00 The next word is the printer type (this was explained earlier).

00 00 The next word indicates whether the printer is using interrupts or is running in "polled mode." If it is not using interrupts, these two bytes are zeroed out.

07 00 The next word contains the interrupt, which is 7.

06 00 The next word shows the number of blocks in the pass-along buffers. NPRINTER defaults to 3KB buffers, and blocks are typically 512 bytes (0.5KB). So we see a value of 06, which means six 512-byte buffers.

The next five words are used for serial printers only and are ignored by parallel printer connections:

00 00       Whether the XON/XOFF protocol is used
7A 05       Baud rate
5E 12       Data bits
3F A7       Stop bits
31 18       Parity type

81 1E The last word is the remote socket number, so NPRINTER knows which one to attach to. For NetWare 3.1x and 4.x, this socket number is always the same: 81-1E. However, this will change in future releases of NetWare Print Services.

________
Packet Number : 842
Socket: 0x4010    - - - >   Print Server        >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID:    17849
Destination Connection ID:3456

This is another SPX acknowledgement system packet.

Thus far, we have seen the following communications between NPRINTER and the print server. NPRINTER initially established an SPX connection with the print server. This initial connection used the client socket and was performed by issuing a NWPSComAttach-ToPrintServer call. Next, NPRINTER tried to find out if the printer number that was typed in at the NPRINTER command was available for remote printers by using the command code 0x80. If the printer number was available, the printer number is assigned to NPRINTER, which we saw through the print server command code 0x81.

Stage 2: Changing from the Client Socket to the Remote Printer Socket

In this next stage of our packet tracing, we will see the communications between NPRINTER and the print server terminate on the client socket and be reestablished on the remote printer socket.

__________
Packet Number : 843
Socket:  0x4010             - - - >  Print Server     >
Connection Control: 0x50 (Send ACK; End of Message; )
Datastream Type: 254 (End of Connection)
Source Connection ID: 17849
Destination Connection ID: 3456
Data:
  0: 45 B9                                       |E.

In this packet, NPRINTER is ready to drop the client socket connection. We can tell this by the 0x50 code in the Connection Control entry and the Datastream Type changing to 254, which signifies an SPX "End of Connection" request. This request precipitates the SPX connection tear-down procedure with the communications partner. In this case, the request is from the NPRINTER software in preparation for changing over to the remote printer socket.

The Data field contains SPX information that is used to assist in the process of tearing down the connection.

___________
Packet Number : 844
Socket: Print Server          - - - > 0x4010>
Connection Control: 0x10 (End of Message; )
Datastream Type: 255 (End of Connection Acknowledgement)
Source Connection ID: 3456
Destination Connection ID: 17849

At this point, the print server acknowledges the tear-down procedure by having SPX send a packet with Datastream Type 255. This ends the client socket connection.


Note: Packet numbers 846 through 854 were not SPX packets and were thereforefiltered out of this packet trace.

With packet 855, we begin making an SPX connection on the remote printer socket.

_____________
Packet Number : 855
Socket:  0x4011             - - - >  Print Server (811E)>
Connection Control: 0xC0 (System Packet; Send ACK; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 65535

SPX sends a system packet with an acknowledgement requested. As a result of this packet, the socket number for NPRINTER changes from 0x4010 to 4011 and the socket number for the print server changes from 8060 to 811E. The Datastream Type becomes 0 again. Notice that the Source Connection ID and Destination Connection ID fields have changed, indicating a new connection. For NPRINTER, the Source Connection ID for the remote printer socket becomes 18105. The Destination Connection ID is again the temporary 65535 (FFFF) until a real ID is established.

______________
Packet Number : 856
Socket: Print Server          - - - > 0x4011>
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105

This packet is an SPX system packet that sends the Source Connection ID (3712) for the print server. Whereas SPX was communicating on socket 8060 for the client connection, now SPX is using socket 811E, which will be its permanent remote printer socket connection for this NPRINTER transaction. The official SPX connection is now established.

__________
Packet Number : 857
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x40 (Send ACK; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 3712
Data:
0: 00 04 00 00 00     |. . . .

Now that NPRINTER has established the connection with the print server, it sends a status packet. In fact, NPRINTER will send a status packet whenever there is a status change at NPRINTER's end. The Data entry contains the following information:


00

The first byte is the printer number, which is printer number 0in this example.

04

The next byte is the number of data buffers that NPRINTERhas available for receiving data from the print server (see the sidenoteon this page).

00

The next byte shows how many buffers have been printed since the last status packet was sent. Since nothing has started printing yet, the numberis 00.

00

The next byte is a trouble code packet, whichhas three possibilities:

0 = everything is okay; the printer is online1 = offline2 = out of paper

00

The last byte tells you whether the remote printer is using sideband mode. Sideband mode is used to send printer control information, such as to eject a page, or to stop or start the printer. You can perform these functions if you go to the print server and select the corresponding item from the Printer Control menu fromthe Printer Status option on the main Print Server screen.


Sidenote Back in packet number 841, we sawthat the number of 512-byte buffers was six, to equal the defaultsize of 3KB. Now NPRINTER is showing only four 512-byte buffers(2KB). The reason is that NPRINTER uses the first 1KB of its buffersfor a working area to help manipulate the current print job. Formost versions of NetWare 3 and NetWare 4, the default 3KB buffersize works fine. If you have a fast laser printer, you may wantto experiment to see if increasing the number of print buffershelps performance. (For information on adjusting buffer sizesin NetWare 3.11 and earlier, see the AppNote entitled "Dealingwith LAN Printing Problem Areas" in the June 1992 Novell Application Notes.)

________
Packet Number : 858
Socket: Print Server          - - - > 0x4011>
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105

Packet 858 is an SPX system packet sent from the print server to NPRINTER to acknowledge the data packet it just received from NPRINTER.

Stage 3: Sending a Print Job

The next sequence of packets covers how print jobs are sent from the print server to NPRINTER, as well as the data fields NPRINTER uses to talk to the print server. For our example we used a small print job with banner information, so the print job transfer was performed with a minimal number of packets.

__________
Packet Number : 859
Socket: Print Server          - - - > 0x4011>
Connection Control: 0x40 (Send ACK; )
Datastream Type: 5
Source Connection ID: 3712
Destination Connection ID: 18105
Data:
  0: 00 04 01 E0 31 01           |......

In packet 859, the print server is sending a data packet to NPRINT-ER. This packet carries a Send ACK type in the Connection Control entry. The Datastream Type is 5, which stands for "Start new print job." The information in the Data area is about the print job that the print server found in the print queue this printer is servicing:


00

The first byte is the tab expansion size. A value of 0 means that this print job is using a byte-stream type of data (no tabs). If the Tab setting were active, you would see anumber hereindicating how many spaces to put into theTab.

04

The second byte denotes whether or not there is a banner with the print job. A value of 04 means there is a banner; 00 meansthere isn't one.

01 E0 31 01

The print job number (in hexadecimal) associatedwith this print job.

___________
Packet Number : 860
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 3712

This packet is an acknowledgement from the NPRINTER side of the information it received in Packet 859.

___________
Packet Number : 861
Socket: Print Server          - - - > 0x4011>
Connection Control: 0x40 (Send ACK; )
Datastream Type: 0
Source Connection ID: 3712
Destination Connection ID: 18105
Data:
  0: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
 10: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
 20: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
 30: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
 40: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
 50: 0D 0A 2A 20 55 73 65 72 20 6E 61 6D 65 3A 20 20 |..* User name:  
 60: 20 43 4E 3D 41 64 6D 69 6E 2E 4F 3D 6E 6F 76 65 | CN'Admin.O'nove
 70: 6C 6C 20 28 32 29 20 20 20 20 20 20 20 20 20 20 |ll (2)          
 80: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
 90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
 A0: 20 2A 0D 0A 2A 20 46 69 6C 65 20 6E 61 6D 65 3A | *..* File name:
 B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
 C0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
 D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
 E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
 F0: 20 20 20 2A 0D 0A 2A 20 44 69 72 65 63 74 6F 72 |   *..* Director
100: 79 3A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |y:              
110: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
120: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
140: 20 20 20 20 20 2A 0D 0A 2A 20 50 72 69 6E 74 20 |     *..* Print 
150: 71 75 65 75 65 3A 20 50 52 56 2D 43 4C 49 45 4E |queue: PRV- CLIEN
160: 54 2F 51 31 2E 4E 4F 56 45 4C 4C 20 20 20 20 20 |T/Q1.NOVELL     
170: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
180: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
190: 20 20 20 20 20 20 20 2A 0D 0A 2A 20 50 53 65 72 |       *..* PSer
1A0: 76 65 72 3A 20 20 20 20 20 43 4E 3D 50 53 2D 4E |ver:     CN'PS- N
1B0: 4F 56 45 4C 4C 2E 4F 3D 4E 4F 56 45 4C 4C 20 20 |OVELL.O'NOVELL  
1C0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
1D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |                
1E0: 20 20 20 20 20 20 20 20 20 2A 0D 0A 2A 20 44 65 |         *..* De
1F0: 73 63 72 69 70 74 69 6F 6E 3A 20 4C 50 54 31 20 |scription: LPT1

In Packet 861, the Datastream Type of 0 means "the data portion of the packet now contains information that is to be printed." At this time, the print server sends one 512-byte chunk of information that fills one of NPRINTER's 512-byte buffers that is uses for print job storage.

Because this is a straight ASCII file dump, we can look at the data in a trace to see the data being sent to one of the print buffers in NPRINTER. In this example, you can see the asterisks and other information to be printed as part of the banner page. For a PCL or PostScript print job, you would see all the escape codes and sequences that format the page for printing. By looking at this data for your own print jobs, you can check for corruption or other problems in the print job.

________
Packet Number : 862
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 3712

This packet is an acknowledgement from the NPRINTER side of the information it received in Packet 861.

The procedure described above continued until all four of NPRINTER's buffers had received data to be printed. Each data packet received from the print server was followed by a system packet from NPRINTER to acknowledge the reception of the data. This continued until packet 869.

____________
Packet Number : 869
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x40 (Send ACK; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 3712
Data:
0: 00 01 01 00 00     |......

Now that the print server has sent enough data to fill NPRINTER's data buffers and NPRINTER has begun sending the print job to its connected printer, NPRINTER sends back printer status information through the Data field. Here's the explanation:


00

The first byte gives the printer number (here it's printer 0).

01

The second byte shows that the print server can send one more data buffer to fill NPRINTER'sempty buffer that it has just sent to the printer.

01

The third byte shows that NPRINTER has printed one buffer. Sometimes you will see one, two, or with heavy network traffic, you may see three or more buffers that have been printed. The numbers listed depends partially on how fast the printer is and how much network traffic the networksegment currently has.

00

The fourth byte give printer status (00 means the printeris online).

00

The fifth byte shows sideband mode status (00 means no information is being sent through the sideband mode).

________#013___
Packet Number : 870
Socket: Print Server          - - - > 0x4011>
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105

Packet 870 is an SPX system packet from the print server to NPRINTER to acknowledge the data packet it just received from NPRINTER.

________#013___
Packet Number : 871
Socket:  Print Server       - - - >  0x4011           >
Connection Control: 0x40 (Send ACK; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105
Data:
 0: 0D 0A 2A 20 20 20 20 20 20 20 20 20 20 20 20 20 |..*             
 10: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4C |               L
 20: 20 20 20 20 20 50 20 20 20 20 20 20 20 54 20 20 |     P       T 
 30: 20 20 20 31 20 20 20 20 20 20 20 20 20 20 20 20 |   1           
 40: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |               
 50: 20 2A 0D 0A 2A 20 20 20 20 20 20 20 20 20 20 20 | *..*          
 60: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |               
 70: 20 4C 4C 4C 4C 4C 20 50 20 20 20 20 20 20 20 54 | LLLLL P       T
 80: 20 20 20 31 31 31 31 31 20 20 20 20 20 20 20 20 |   11111       
 90: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |               
 A0: 20 20 20 2A 0D 0A 2A 20 20 20 20 20 20 20 20 20 |   *..*        
 B0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |               
 C0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |               
 D0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |               
 E0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 |               
 F0: 20 20 20 20 20 2A 0D 0A 2A 2A 2A 2A 2A 2A 2A 2A |     *..********
100: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
110: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
120: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
130: 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A 2A |****************
140: 2A 2A 2A 2A 2A 2A 2A 2A 0D 0A 0C                |********...

Packet 871 is in response to the data sent to the print server in Packet 869, which told the print server that NPRINTER had one empty buffer. The information sent is to fill that empty buffer.

___________
Packet Number : 872
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x40 (Send ACK; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 3712
Data:
0: 00 01 01 00 00     |......

Packet 872 is a status packet, showing that another buffer is free and another buffer has been printed.

___________
Packet Number : 873
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 3712

Packet 873 is a system packet that is an acknowledgement to Packet 871, when NPRINTER received new data from the print server and the print server sent a Send ACK call in the Connection Control field.

Packet Number : 874
Socket: Print Server          - - - > 0x4011>
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105

Packet 874 is an SPX system packet from the print server to NPRINTER to acknowledge the data packet it received from NPRINTER in packet 872.

Packet Number : 875
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x40 (Send ACK; )
Datastream Type: 0
Source Connection ID: 18105
Destination Connection ID: 3712
Data:
0: 00 00 00 00 00     |......

Packet 875 is a status packet from NPRINTER, but this time it is showing that it hasn't yet printed a buffer-full since the last update and that it currently doesn't need any more data.

Packets 876 through 887 continue with the information being exchanged between the print server and NPRINTER until the print job is complete. In Packet 887, the Datastream Type is 8, which is a signal from NetWare 4 print servers that all data for the print job has been transmitted.

By Packet 889, the print server had started sending more information to NPRINTER for the next print job, and the whole process began all over again.

Stage 4: SPX Connection Maintenance

Now that we have followed a print job through to completion, let's take a look at a LANalyzer trace of SPX packets between the print server and NPRINTER in an idle or quiescent state. This is covered in a new SPX-filtered packet trace consisting of 12 packets.

In this idle state, SPX maintains the connection by sending system packets back and forth to ensure that the communications partners are talking to one another. Occasionally, either side will ask for an acknowledgement when it has not received a packet after a preconfigured period of time to ensure that communications are still taking place.

________
Packet Number : 1
Socket:  Print Server       - - - >  0x4011           >
Connection Control: 0xC0 (System Packet; Send ACK; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105

In packet 1, the print server is sending a system packet that includes a Send ACK.

____________
Packet Number : 2
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 18105
Destination Connection ID: 3712

In packet 2, NPRINTER is sending a system packet (type 80) to the print server in response to packet 1.

________
Packet Number : 3
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 18105
Destination Connection ID: 3712

NPRINTER is sending another a system packet (type 80) to the print server. This is just a normal "I'm still here" packet.

___________
Packet Number : 4
Socket:  Print Server       - - - >  0x4011           >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105

In packet 4, the print server is sending a system packet to ensure that communications are still happening with NPRINTER.

___________
Packet Number : 5
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 18105
Destination Connection ID: 3712

NPRINTER is sending another a system packet (type 80) to the print server. This acknowledgement took about 7.5 seconds to occur.

___________
Packet Number : 6
Socket:  0x4011             - - - >  Print Server     >
Connection Control: 0xC0 (System Packet; Send ACK; )
Datastream Type: 0 
Source Connection ID: 18105
Destination Connection ID: 3712

A timeout for not receiving a packet from NPRINTER has occurred and triggered a type C0 packet. As we can see, the Control Connection field becomes 0xC0 (System Packet; Send ACK; )again, which forces the print server to respond immediately to NPRINTER.

___________
Packet Number : 7
Socket:  Print Server       - - - >  0x4011           >
Connection Control: 0x80 (System Packet; )
Datastream Type: 0 
Source Connection ID: 3712
Destination Connection ID: 18105

This time the print server responds in about 2 milliseconds by sending a system packet to NPRINTER.

You can control how often SPX looks for its communications partners to communicate by adjusting various settings in the NET.CFG file. These settings are covered in the next section.

Setting IPX/SPX Parameters in the NET.CFG File

Four NET.CFG parameters affect the timing of how often NPRINTER and the print server send connection information packets back and forth. These NET.CFG parameters are set in the NET.CFG file of the workstation that is running NPRINTER, and are summarized in Figure 3.


Note: The SPX Abort Timeout, SPX Verify Timeout, and SPX Listen Timeoutsettings are all set in "ticks" (approximately 18.21 ticks equals one second).

Figure 3: Summary of relevant NET.CFG parameters.


Parameter
Default
Explanation
GuidelinesforChanging the Setting

IPX Retry Count

20

This parameteractually affects SPX retries. It determineshow many times SPX will retry sending toa communications partner (in this case, theprint server) if a request is not answered.

The defaultsetting works fine in most cases, but youcan vary it depending on your installation.On some networks, increasing the number ofretries may help sustain the connection betweenNPRINTER and the print server.

SPX Abort Timeout

540(about30 sec.)

This parameterspecifies how long the SPX protocol waitswithout receiving any packets from the communicationspartner before it determines the connectionis no longer valid and terminates the connection.

On some networks,you will need to increase this number toensure that the connection is maintained.The side effect is that it will take longerto terminate the SPX connection, which meansa longer wait before you can reload NPRINTER.

SPX VerifyTimeout

54(about3sec.)

This parameteris the amount of time in ticks that a connectionsending a packet with the acknowledge bitset will wait before sending a retry.

The defaultsetting normally should not be changed.

SPX ListenTimeout

108(about6sec.)

This parameteris the amount of time in ticks that one sideof the connection will wait without receivinga packet from the other side before sendinga packet requesting an acknowl-edgement fromthe communi-cations partner (System Packet,Send ACK).

The defaultsetting normally should not be changed.

Conclusion

This AppNote has presented an inside look at the SPX communications that occur between the print server and RPRINTER/NPRINTER. The detailed, packet-by-packet analysis should give you a deeper understanding of how NetWare's print services work with remote printers. With this understanding, you are better prepared to work with remote printers and troubleshoot problems in this area.

* Originally published in Novell AppNotes


Disclaimer

The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.

© Copyright Micro Focus or one of its affiliates