			   NQS Network Protocol v1
			  w/ Generic NQS Extentions

			   Author: Stuart Herbert
			      (stuart@gnqs.org)

			   Using Information From:
		  ``NQS Networking Protocol Specification''
			    Production(4) Version
		   Published by Cray Research Inc. July 1990

Abstract:

	The Network Queueing System (NQS) enables users to queue computer
	programs onto (possibly) remote machines.  NQS provides its own
	application-layer protocol to communicate over the network with
	compatible implementations of the NQS Network Protocol v1.
	

----------------------------
	Introduction
----------------------------

	--------------------
	About This Paper
	
	This paper describes

----------------------------
	NQS Message Contents
----------------------------

	--------------------
	Introduction
	
	--------------------
	COMMIT
	
	----------
	Function
	
	This packetperforms the first stage of a two-phase commitduring the
	transfer of a Raw Request from one NQS node to another.
	
	----------
	Integers
	
	o  [01]: NPK_COMMIT constant
	
	----------
	Strings
	
	No string fields defined.
	
	--------------------
	DELREQ
	
	----------
	Function
	
	This is the first packet in a Delete Request.  It identifies the
	type of request that is to be performed, the identities of the
	parties involved, the type of delete request, and the situations in
	which the request is to be performed.
	
	----------
	Integers
	
	o  [01]: User ID of request owner.
	o  [02]: Original request sequence number
	         (field #7 in Raw Request)
	o  [03]: Original machine identifier (MID)
	o  [04]: UNIX signal to be reflected to process to delete
	         the request
	o  [05]: Delete to proceed only if the request is in one of the NQS 
	         Request Queue States identified by this field (RQS_...
		 macros).
	o  [06]: NPK_MAGIC1
	o  [07]: NPK_DELREQ
	o  [08]: From (client's) machine identifier (MID)
	o  [09]: To (server's) machine identifier (MID)
	o  [10]: Client user ID
	o  [11]: Time zone difference, in seconds, from GMT
	
	----------
	Strings
	
	o  [01]: User name of request owner
	o  [02]: Network password
	o  [03]: Client user name
	o  [04]: Time zone name
	
	----------
	String Restrictions
	
	o  [01]: MAX_ACCOUNTNAME
	o  [02]: MAX_NETPASSWORD
	o  [03]: MAX_ACCOUNTNAME
	o  [04]: 3 bytes
	
	--------------------
	DONE
	
	----------
	Function
	
	This packet notifies the server that all files have been sent as
	part of a Move Output File request.
	
	----------
	Integers
	
	o  [01]: NPK_DONE
	o  [02]: The integer value zero
	o  [03]: The integer value zero
	
	----------
	Strings
	
	None.
	
	--------------------
	FILE DATA
	
	----------
	Function
	
	The file is transferred in a sequence of NQS packets that contain no
	NQS protocol control information.  The file is in standard UNIX
	format (that is, it consists of a sequence of characters), and is
	ASCII encoded and uses the Carriage Return and Tab characters to
	specify the layout of lines in the file.

	The file is buffered into blocks of 8192 bytes that are transported
	over the underlying network.  THe last block may be less than 8192
	bytes in length.  The total length of the file being transferred is
	known in advance by examining the preceeding File Information Packet.

	--------------------
	MVOUTFILE
	
	----------
	Function
	
	This is the first packet in a Move Output File sequence of
	transactions.  It identifies the type of request that is to be
	performed and the identities of the parties involved.
	
	----------
	Integers
	
	o  [01]: NPK_MAGIC
	o  [02]: NPK_MVOUTFILE
	o  [03]: From (client's) machine identifier (MID)
	o  [04]: To (server's) machine identifier (MID)
	o  [05]: Client user ID
	o  [06]: Time zone difference, in seconds, from GMT
	
	----------
	Strings
	
	o  [01]: Network password
	o  [02]: Client user name
	o  [03]: Time zone name
	
	----------
	String Restrictions
	
	o  [01]: MAX_NETPASSWORD
	o  [02]: MAX_ACCOUNTNAME
	o  [03]: 3 bytes
	
	--------------------
	FILE INFO
	
	----------
	Function

	This is the packet that precedes each individual transfer of a user
	data file in a Move Output File request.  It identifies the type of
	file that follows, its length in bytes, and the path name for the
	output file on the remote machine.
	
	----------
	Integers
	
	o  [01]: NPK_MVOUTFILE
	o  [02]: 12 bits:
	          8 bits: Reserved for future use
		 12 bits: file mode of spooled copy of output file.
	o  [03]: Size of the spooled copy of the output file, in bytes.

	----------
	Strings

	o  [01]: Destination path name for the output file on the remote
	         machine.

	----------
	String Restrictions
	
	o  [01]: MAX_REQPATH

	--------------------
	QUEREQ
	
	----------
	Function
	
	This is the first packet in a Queue Request sequence of
	transactions.  It identifies the type of request that is to be
	performed and the identities of the parties involved.
	
	----------
	Integers
	
	o  [01]: NPK_MAGIC1
	o  [02]: NPK_QUEREQ
	o  [03]: From (client's) machine identifier (MID)
	o  [04]: To (server's) machine identifier (MID)
	o  [05]: Client user ID
	o  [06]: Time zone difference, in seconds, from GMT
	
	----------
	Strings
	
	o  [01]: Network Password
	o  [02]: Client user name
	o  [03]: Time zone name
	
	----------
	String Restrictions
	
	o  [01]: MAX_NETPASSWORD
	o  [02]: MAX_ACCOUNTNAME
	o  [03]: 3 bytes
	
	--------------------
	QSTAT

	----------
	Function
	
	This is the first packet in a QSTAT request.  It identifies the type
	of request that is to be performed and the identities of the parties
	involved.
	
	----------
	Integers
	
	o  [01]: Flags controlling qstat display requested
	         (see SHO_... flags)
	o  [02]: User ID of request owner
	o  [03]: NPK_MAGIC1
	o  [04]: NPK_QSTAT
	o  [05]: From (client's) machine identifier (MID)
	o  [06]: To (server's) machine identifier (MID)
	o  [07]: Client user ID
	o  [08]: Time zone difference, in seconds, from GMT
	
	----------
	Strings
	
	o  [01]: Queue name, request name, or queue complex name
	o  [02]: User name of request owner
	o  [03]: Network password
	o  [04]: Client user name
	o  [05]: Time zone name
	
	----------
	String Restrictions
	
	o  [01]: MAX_QUEUENAME, MAX_QCOMPLXNAME, or MAX_REQNAME
	o  [02]: MAX_ACCOUNTNAME
	o  [03]: MAX_NETPASSWORD
	o  [04]: MAX_ACCOUNTNAME
	o  [05]: 3 bytes

	--------------------
	RAW REQUEST
	
	----------
	Function
	
	This is the packet that carries the raw request representing a batch
	(or device) requestfrom one NQS node to another.
	
	----------
	Integers
	
	o  [01]: REQMAGIC1
	o  [02]: Time that the request was first created
	o  [03]: Time that the request entered the current queue
	o  [04]: Request type (RTYPE_BATCH or RTYPE_DEVICE)
	o  [05]: Original user ID of submitter on originating machine
	o  [06]: Originating machine ID (MID)
	o  [07]: Request sequence number
	o  [08]: Relative intraqueue priority
	o  [09]: Flags (made from RQF_USERHOLD, RQF_EXTERNAL, RQF_BEGINMAIL,
	         RQF_ENDMAIL, RQF_TRANSMAIL, RQF_RESTARTABLE, RQF_RECOVERABLE,
		 RQF_EXPORTVALUE, RQF_USCP, and RQF_USCPOUT)
	o  [10]: Start time (this can be a future time at which the request
	         is to be executed)
	o  [11]: Number of data files for request
	o  [12]: Destination machine ID for all mail
	
	RTYPE_BATCH requests have the following additional fields.
	
	o  [13]: User file mask
	o  [14]: Explicit quota limits and nice values defined
	
	         This is made from the LIM_xxx flags.  Set bits indicate
		 that the limit has been set by QSUB.  Unset bits indicate
		 that the limit has been set by NQS.
	
	o  [15]: Infinite quota limits and nice values defined
	
	         This is made from the LIM_xxx flags.  Set bits indicate
		 that the limit should be set to infinite.

	o  [16]: Per-process core file size quota limit
	o  [17]: Per-process core file size units (QLM_...)
	o  [18]: Per-process core file size warn quota limit
	o  [19]: Per-process core file size warn units (QLM_...)
	o  [20]: Per-process data segment quota limit
	o  [21]: Per-process data segment quota units (QLM_...)
	o  [22]: Per-process data segment warn quota limit
	o  [23]: Per-process data segment warn quota units (QLM_...)
	o  [24]: Per-process permanent file quota limit
	o  [25]: Per-process permanent file quota units (QLM_...)
	o  [26]: Per-process permanent file warn quota limit
	o  [27]: Per-process permanent file warn quota units (QLM_...)
	o  [28]: Per-request permanent file quota limit
	o  [29]: Per-request permanent file quota units (QLM_...)
	o  [30]: Per-request permanent file warn quota limit
	o  [31]: Per-request permanent file warn quota units (QLM_...)
	o  [32]: Per-process quick file quota limit
	o  [33]: Per-process quick file quota units (QLM_...)
	o  [34]: Per-process quick file warn quota limit
	o  [35]: Per-process quick file warn quota units (QLM_...)
	o  [36]: Per-request quick file quota limit
	o  [37]: Per-request quick file quota units (QLM_...)
	o  [38]: Per-request quick file warn quota limit
	o  [39]: Per-request quick file warn quota units (QLM_...)
	o  [40]: Per-process temporary file quota limit
	o  [41]: Per-process temporary file quota units (QLM_...)
	o  [42]: Per-process temporary file warn quota limit
	o  [43]: Per-process temporary file warn quota units (QLM_...)
	o  [44]: Per-request temporary file quota limit
	o  [45]: Per-request temporary file quota units (QLM_...)
	o  [46]: Per-request temporary file warn quota limit
	o  [47]: Per-request temporary file warn quota units (QLM_...)
	o  [48]: Per-process memory quota limit
	o  [49]: Per-process memory quota units (QLM_...)
	o  [50]: Per-process memory warn quota limit
	o  [51]: Per-process memory warn quota units (QLM_...)
	o  [52]: Per-request memory quota limit
	o  [53]: Per-request memory quota units (QLM_...)
	o  [54]: Per-request memory warn quota limit
	o  [55]: Per-request memory warn quota units (QLM_...)
	o  [56]: Per-process stack segment quota limit
	o  [57]: Per-process stack segment quota units (QLM_...)
	o  [58]: Per-process stack segment warn quota limit
	o  [59]: Per-process stack segment warn quota units (QLM_...)
	o  [60]: Per-process working set quota limit
	o  [61]: Per-process working set quota units (QLM_...)
	o  [62]: Per-process working set warn quota limit
	o  [63]: Per-process working set warn quota units (QLM_...)
	o  [64]: Per-process CPU time quota limit
	o  [65]: Per-process CPU time quota units (QLM_...)
	o  [66]: Per-process CPU time warn quota limit
	o  [67]: Per-process CPU time warn quota units (QLM_...)
	o  [68]: Per-request CPU time quota limit
	o  [69]: Per-request CPU time quota units (QLM_...)
	o  [70]: Per-request CPU time warn quota limit
	o  [71]: Per-request CPU time warn quota units (QLM_...)
	o  [72]: Per-process nice value
	o  [73]: Per-request tape drive limit
	o  [74]: Per-request number of CPUs
	o  [75]: Standard error file access mode bits
	         OMD_SPOOL, OMD_EO, OMD_NOSPOOL or OMD_M_KEEP
	o  [76]: RESERVED
	o  [77]: Standard output file access mode bits
	         OMD_SPOOL, OMD_EO, OMD_NOSPOOL or OMD_M_KEEP
	o  [78]: Standard error file machine ID (MID) destination
	o  [79]: RESERVED
	o  [80]: Standard error file machine ID (MID) destination
	o  [81]: Number of files to be staged in
	o  [82]: Number of files to be staged out
	o  [83]: Stage in recessive hierarchy
	o  [84]: Stage out recursive hierarchy
	o  [85] -> [85 + MAX_INSTAPERREQ - 1]: Machine IDs of the files
	   that will be staged in
	o  [ -> MAX_OUTSTAPERREQ -1]: Machine IDs of the file that will be
	   staged out
	
	----------
	Strings

	o  [01]: Name of the destination for this request
	o  [02]: Request name (set automatically by NQS if the user does not
	         specify a name using QSUB)
	o  [03]: Alternative username at the destination machine
	o  [04]: Username for mail
	
	The following strings are for RTYPE_BATCH requests
	
	o  [05]: Name of shell to be used when executing shell script
	o  [06] -> [06 + MAX_PREDECESSOR - 1]: Names of the requests that
	   this request is dependant upon
	o  [+1]: Standard error file path name at machine
	o  [+2]: Standard log name (currently unused)
	o  [+3]: Standard output file path name at machine

	----------
	String Restrictions
	
	Unknown
	
	--------------------
	REQFILE
	
	----------
	Function

	This is the first packet in a request file of transactions.  It
	identifies the type of request and the identities of the parties
	involved.

	----------
	Integers
	
	o  [01]: NPK_MAGIC1
	o  [02]: NPK_REQFILE
	o  [03]: From (client's) machine identifier (MID)
	o  [04]: To (server's) machine identifier (MID)
	o  [05]: Client user id
	o  [06]: Time zone difference, in seconds, from GMT
	
	----------
	Strings
	
	o  [01]: Network password
	o  [02]: Client user name
	o  [03]: Time zone name
	
	----------
	String Restrictions
	
	o  [01]: MAX_NETPASSWORD
	o  [02]: MAX_ACCOUNTNAME
	o  [03]: 3 bytes
	
	--------------------
	FILE INFO
	
	----------
	Function

	This is the packet that precedes each individual transfer of either
	a control file or a user data file in a request file sequence.  It
	identifies the type of file that follows it and its length (in
	bytes).

	----------
	Integers
	
	o  [01]: NPK_REQFILE
	o  [02]: -1: NQS Control File (+ possible user data file fragment)
	         >= 0: User data file fragment
	o  [03]: Size of data file fragment (can only be zero if integer [02]
	         is value -1)

	The following integers only exist when integer [02] is -1 (ie, the
	file being transmitted is the NQS Control File).
	
	o  [04]: Original request sequence number
	o  [05]: Original machine identifier
		 
	----------
	Strings
	
	No strings are defined.
	
	--------------------
	TCMP
	
	----------
	Function

	This packet returns completion codes for each transaction issued
	between the client and server.

	----------
	Integers
	
	o  [01]: TCMP_... code
	
	----------
	Strings
	
	No strings are defined.
	
----------------------------
	Generic NQS Protocol Extensions
----------------------------

	--------------------
	Introduction
