Inter-Office MemorandumToDistributed ComputingDateOctober 9, 1979FromGlenn KrasnerLocationPalo AltoSubjectTape Server Protocol(Version 0.1)OrganizationPARC/SSLXEROX Filed on: [IVY]Docs>TapeServerProtocol.memo, .pressThe Tape Server Protocol is a means for accessing magnetic tapes via a tape server over anEthernet. It currently provides only a low-level interface to the tape server; in general allowingrecord-level manipulation rather than file-level manipulation. It does support all the magtapeoperations understood to be required by Tenex. The protocol uses the Byte Stream Protocol (BSP)and is somewhat based on the File Transfer Protocol (see AltoSubsystems manual) and theCopyDisk Protocol (see CopyDisk.press).OverviewThere are two parties involved in mag tape operations: a server which controlls the actual tapedrive(s) and which responds to commands, and a user which makes command requests from theserver.Initially, the server is listening for connection requests at a well-known socket (followingRendezvous/Termination Protocol) until the user initiates a connection. Once the connection isestablished, the user sends commands and receives answers from the server until the connection isterminated.It is the operator's responsibility to mount the correct tapes on the correct drives; there is noprovision in the Protocol to check this.Similar to the File Transfer and CopyDisk Protocols, the server should be passively responding tocommands but never initiating action, and the user is responsible for checking to be sure alloperations are reasonable.The ProtocolHaving once established a BSP connection with the server, the user sends a [Version] command toinsure that they are using the same protocol version. Typically the user then issues an [OpenDrive]command and proceeds to issue comands for that drive. When through, the typical user issues a[CloseDrive] command to free the drive, and terminates the connection.The tape manipulation commands are outlined below, and include reading and writing records,forward and backward skipping of records and files, rewinding and unloading of drives anderror/status handling. As mentioned earlier the commands currently do not include higher-levelfunctions such as write/read file or position at file x.Commands are generally answered by the server with a [Yes] message, meaning that the operationwas performed successfully, also in some cases indicating an ending status, or with a [No] message,meaning that the operation was not performed succcessfully, indicating what may have been the]gpi c8q]rX-q7Br ]q]r -q7Br Yq]r]W -q 7BrSsr M? GZ FkZ D%: CcK AQ @[, =/t :r9ur 8/ur& 6 3#urG 2L+ur0 0ur-ur /D , ur,# *( 'i9ur %.ur' $a !6t  r 3ur 5ur %,ur ~F S> (1 K_ 8 P S ]  L=]#Tape Server Protocol (TSP)2cause.The protocol allows one user to have only one drive open at a time (i.e. one drive per connection).In order for one machine to user more than one drive, it must establish multiple connections withthe server; in effect becoming more than one user.MessagesCommands and responses (generically called messages) in the Tape Server Protocol are sent inblocks similar to those of the CopyDisk Protocol. These blocks consist of a length word (which isin words and includes that word), followed generally by a numeric code word distinguishing themessage, usually followed by a block of data (record transfers) or string of text (intended to beprinted at the operator's console). Blocks are an integral number of words long.Below is the list of messages. It is organized in terms of the command sent by the user followed bycorresponding responses sent by the server. Following this list is an example of typical tape service,and following that is a complete list of messages along with their currently assigned numbers.Command/Response ListIdentification/Termination:Command: [Version] This command should be the first sent by the user after establishing a BSP connection. The codeshould be a numeric code representing the current version number of the user's TSP. String is anarbitrary string such as "Tape Server Protocol, V0.0".Response: [Version] The server should respond with this message. It is the user's responsibility to match codes forcompatibility. String could be displayed at the operator's consold to indicate good connection.Drive Control:Command: [OpenDrive] This command requests the use of drive drive#, providing userID as some sort of passwordprotection. Currently userID is ignored by the server.Response: [Yes] Should the drive be free and ok for the user to have, the server responds with this message. Code-good open is used to distinguish this [Yes] message from the many others. Each user (eachconnection) may have only one drive open at a time.Response: [No] Should the server be unable to open this drive for this user, this is the appropriate response. Thecode indicates the reason that the open was unsuccessful, and the string may be sent to theoperator.Command: [CloseDrive]This command relinquishes control over the drive. It does not request an unload of the tape.Response: [Yes] Response: [No] Reading/Writing:Records to be read/written may be of arbitrary length, as far as the protocol is concerned. However, in the Altoimplementation they may be no longer than 32K bytes (16K words).Command: [ReadRecord]Requests that the next record on the tape be read.Response: [HereIsRecord] This is the record requested by the last [ReadRecord]. Status indicates ending status of the read,such as EOT or EOF or error. Data are the data bytes read. Length is the number of bytes frG b ^ ur(ur ]nY [ur#ur Xt Ur+ur! T_ RD QH OQ LX@ur Jur= IP> F$t Bur ?ur >m !ur/ <Cur ;e6 9ur 8]ur.ur 6F 5Uu r 2)urur 0&ur /!urur -ur ,(ur ur# *Q )3 'ur' & ur'ur( $[ # ur t*3 ur lur Aur 9q$M @ ur 2 ur) c S >]LZTape Server Protocol (TSP)3actually read.Command: [WriteRecord] Requests that data be written as the next record of the tape.Response: [Yes] All went well with write.Response: [No] Something went wrong with write, code and string describe problems.Skipping:Command: [FwdSpaceRecord]Requests the next record forward to be skipped over.Response: [Yes] Response: [No] Command: [BackSpaceRecord]Requests a backward skip of one record.Response: same as [FwdSpaceRecord].Command: [ForwardSpaceFile]Requests skipping one file forward.Response: same as [FwdSpaceRecord]. No indication of number of records skipped is given.Command: [BackSpaceFile]Requests skipping back one file.Response: same as [FwdSpaceRecord].Writing Spaces:Command: [WriteEndOfFile]Requests an EOF be put on the tape, indicating the end of the current file.Response: [Yes] Response: [No] Command: [WriteBlankTape] Requests that inches of tape be written blank.Response: [Yes] Response: [No] Rewinding:The [Yes] response to these commands indicates that the operation has been initiated, not completed. This allows theuser to initiate a rewind or unload, but not have to wait for its completion.Command: [Rewind]Requests a rewind of the tape.Response: [Yes] Response: [No] Command: [Unload]Requests that the tape be rewound and unloaded.Response: [Yes] Response: [No] Status:Statuses that may be read or written have not yet been fully established. So far they include write frG b _ur ]= \ur Z Yur( WC TVur QNur O4 NFur Lur( Iur H6' Fur Cur B%# @ur4 =ur < :ur 7fu r 4:ur 2K 12ur /ur( ,ur +". )ur (ur( $ur "Pq` M ur @ ur 8ur 0ur / (ur ur xur pQ )=\Tape Server Protocol (TSP)4protection, device error (hung device), data rerror, BOT, EOT which may be read; and writeprotection and suppress error correction, which may be set. These include the statuses required byTenex.Command: [GetStatus]Requests the current status of the drive.Response: [HereIsStatus] Returns status of drive.Command: [SetStatus] Requests that this drive status be given this new setting.Response: [Yes] Response: [No] Command: [SendToOperator] Requests that the string be printed on the operator's consoleResponse: [Yes] Response: [No] Command: [GetFromOperator]Requests that a string typed by the operator be sent to the user.Response: [HereIsText] Response: [No] ExampleA operator desires to read file 3 from a tape on drive 2. The operator must mount the tape on thedrive, put it on line and start the user program. The user establishes connection with the server andthe following conversation occurs:U: [Version] <1> Alto TSP user 1.00S: [Version] <1> TSP server 1.00 User verifies that versions match, and proceeds.U: [OpenDrive] <2> S: [Yes] U: [Rewind] Rewind drive to get to file 3.U: [FwdSpaceFile]S: [Yes] U: [FwdSpaceFile]S: [Yes] U: [FwdSpaceFile]S: [Yes] At file 3, now read records.U: [ReadRecord]S: [HereIsRecord] ...U: [ReadRecord]S: [HereIsRecord] frG b= `L _ \ur Z) Yur W Tyur$ R: Qqur Our Lur- Ka= Iur HYur EQur CA BIur) @ur =t :nr02 8G 7f" 4^# 2 1Uu1 .Mr , ) (=u %5r #  %   u  r F x F4 )=\Tape Server Protocol (TSP)5U: [ReadRecord]S: [HereIsRecord] End of File, last record read.U: [CloseDrive]S: [Yes] Connection is terminated; all went well.Message ListMessageMark Byte Value(octal)[Yes] 1[No] 2[Version] 3[SendToOperator] 4[GetFromOperator] 5[OpenDrive] 6[CloseDrive] 7[ReadRecord] 10[WriteRecord] 11[FwdSpaceRecord] 12[BackSpaceRecord] 13[FwdSpaceFile] 14[BackSpaceFile] 15[WriteEndOfFile] 16[WriteBlankTape] 17[Rewind] 20[Unload] 21[GetStatus] 22[SetStatus] 23[HereIsText] 24[HereIsRecord] 25[HereIsStatus] 26Ending Codes (Yes, No response codes)0Ok op, operation went well, no problems1BOT, last op resulted in Beginning of Tape condition2EOT, last op resulted in End of Tape condition3EOF, last op resulted in End Of File condition4Drive offline error5Hardware error6Software error7Illegal handle10Write attempted on write-protected tapeThe file TSP.decl includes the BCPL declarations for the TSP messages. frG b `D _u \r Z W( Rt Ou$ N#r$ L$ K$ I$ H$ F $ E $ C $ B $ @~$ >$ =v $ ;$ :n$ 8$ 7f$ 5$ 4^ $ 2 $ 1U $ / $ .M $ +"t r (' &4 %. #. "    } ' F 00U TIMESROMAN  TIMESROMAN TIMESROMAN LOGO TIMESROMAN  TIMESROMAN $j/ l2JTapeServerProtocol.memoDiebertJune 9, 1980 4:59 PM