The Use of "Set Data Type" Transaction in File Transfer Protocol
Clarifying data type conversion in file transfer protocol
Bhushan, A.K., "The Use of "Set Data Type" Transaction in File Transfer Protocol", RFC 294, DOI 10.17487/RFC0294, January 1972, <https://www.rfc-editor.org/info/rfc294>.
@misc{rfc294,
series = {Request for Comments},
number = 294,
howpublished = {RFC 294},
publisher = {RFC Editor},
doi = {10.17487/RFC0294},
url = {https://www.rfc-editor.org/info/rfc294},
author = {A.K. Bhushan},
title = {{The Use of "Set Data Type" Transaction in File Transfer Protocol}},
pagetotal = 2,
year = 1972,
month = jan,
} RFC text
Contents
Network Working Group 25 January 1972 RFC 294 Abhay Bhushan, MIT NIC 8304 Categories: D.4, D.5, and D.7 Updates: RFC 265 The Use of 'Set Data Type' Transaction in File Transfer Protocol ---------------------------------------------------------------- As mentioned in RFC 265, the opcode of '00' is set aside for the clarify the use of 'set data type' in file transfer operations. In many systems such as Multics at MIT, there is no provision to identify the type of data (i.e., ASCII or numeric) stored in files. The manner in which the data is handled is context dependent. ASCII characters are stored as four 9-bit characters per 36-bit word, right justified with left most bit as zero. As efficient conversion programs exists in Multics for conversion of data from Multics' ASCII into Network ASCII, it would be useful for a user to be able to instruct the Multics server to convert data into Network ASCII in retrieve operations. It is suggested that the 'set data type' transaction be used for this purpose. The 'set data type' transaction preceding a retrieve request should be interpreted by a server to mean that the user wants to receive his data in that form. If the server is unable to convert the data into the desired form, it should return a 'set data type' of [ This RFC was put into machine readable form for entry ] [ into the online RFC archives by BBN Corp. under the ] [ direction of Alex McKenzie. 12/96 ] RFC 294 Abhay Bhushan, MIT The following examples should clarify the use of 'set data type' transactions. 1. USER SERVER ---- ------ Set data type '02' (Network ASCII) -------------------------------------> Store File X -------------------------------------> File X (in Network ASCII) -------------------------------------> End of File -------------------------------------> Acknowledge <------------------------------------- Retrieve File X -------------------------------------> File X in Network ASCII <------------------------------------- End of File <------------------------------------- 2. USER SERVER ---- ------ Set data type'03' (EBCDIC) -------------------------------------> Retrieve File Y -------------------------------------> Set data type '00' ("bit-stream") <------------------------------------- File Y as stored (no conversion) <------------------------------------- End of File <------------------------------------- Set data type '02' (Network ASCII) -------------------------------------> Retrieve File Z -------------------------------------> File Z in Network ASCII <------------------------------------- End of File <-------------------------------------
AI ELI5
On this page
§1The Problem of Data Types
On systems such as Multics at MIT, there is no built-in way to record what type of data a file contains. ASCII characters are stored as four 9-bit characters per 36-bit word, right-justified with the leftmost bit as zero. When transferring files to other computers, it is important to know which format the receiving system expects.
RFC 265 defined File Transfer Protocol and reserved opcode 00 for 'set data type' transactions, but its use was unclear. This RFC clarifies how the transaction should work in practice.
Different computers store words and letters differently, so they need to ask each other what format to use when sending files.
§2Using Set Data Type
When a client sends a 'set data type' transaction before a retrieve request, it tells the server the format desired for the data. If the server is unable to convert the data into the requested form, it should return a 'set data type' message indicating the refusal.
For example, a Multics user can use efficient conversion programs to transform data into Network ASCII and request that conversion when retrieving files from a Multics server. The server can either perform the conversion or inform the client it cannot.
Before asking for a file, the client says 'send it in this format please,' and the server either does it or says it cannot.
§3Common Scenarios
A client might set data type to Network ASCII (type 02) before storing files, expecting the server to keep them in that format. On retrieval, the client again sets the data type to Network ASCII and receives the file in that format.
Alternatively, if a server cannot provide the requested format, it replies with 'set data type' 00 (bit-stream), meaning it will send the file as stored without conversion. The client can then either accept the raw data or request a different format.
If you ask for Network ASCII and the server can do that, you get it. If it cannot, it sends the raw file instead.