rfc959.txt 144 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934
  1. Network Working Group J. Postel
  2. Request for Comments: 959 J. Reynolds
  3. ISI
  4. Obsoletes RFC: 765 (IEN 149) October 1985
  5. FILE TRANSFER PROTOCOL (FTP)
  6. Status of this Memo
  7. This memo is the official specification of the File Transfer
  8. Protocol (FTP). Distribution of this memo is unlimited.
  9. The following new optional commands are included in this edition of
  10. the specification:
  11. CDUP (Change to Parent Directory), SMNT (Structure Mount), STOU
  12. (Store Unique), RMD (Remove Directory), MKD (Make Directory), PWD
  13. (Print Directory), and SYST (System).
  14. Note that this specification is compatible with the previous edition.
  15. 1. INTRODUCTION
  16. The objectives of FTP are 1) to promote sharing of files (computer
  17. programs and/or data), 2) to encourage indirect or implicit (via
  18. programs) use of remote computers, 3) to shield a user from
  19. variations in file storage systems among hosts, and 4) to transfer
  20. data reliably and efficiently. FTP, though usable directly by a user
  21. at a terminal, is designed mainly for use by programs.
  22. The attempt in this specification is to satisfy the diverse needs of
  23. users of maxi-hosts, mini-hosts, personal workstations, and TACs,
  24. with a simple, and easily implemented protocol design.
  25. This paper assumes knowledge of the Transmission Control Protocol
  26. (TCP) [2] and the Telnet Protocol [3]. These documents are contained
  27. in the ARPA-Internet protocol handbook [1].
  28. 2. OVERVIEW
  29. In this section, the history, the terminology, and the FTP model are
  30. discussed. The terms defined in this section are only those that
  31. have special significance in FTP. Some of the terminology is very
  32. specific to the FTP model; some readers may wish to turn to the
  33. section on the FTP model while reviewing the terminology.
  34. Postel & Reynolds [Page 1]
  35. RFC 959 October 1985
  36. File Transfer Protocol
  37. 2.1. HISTORY
  38. FTP has had a long evolution over the years. Appendix III is a
  39. chronological compilation of Request for Comments documents
  40. relating to FTP. These include the first proposed file transfer
  41. mechanisms in 1971 that were developed for implementation on hosts
  42. at M.I.T. (RFC 114), plus comments and discussion in RFC 141.
  43. RFC 172 provided a user-level oriented protocol for file transfer
  44. between host computers (including terminal IMPs). A revision of
  45. this as RFC 265, restated FTP for additional review, while RFC 281
  46. suggested further changes. The use of a "Set Data Type"
  47. transaction was proposed in RFC 294 in January 1982.
  48. RFC 354 obsoleted RFCs 264 and 265. The File Transfer Protocol
  49. was now defined as a protocol for file transfer between HOSTs on
  50. the ARPANET, with the primary function of FTP defined as
  51. transfering files efficiently and reliably among hosts and
  52. allowing the convenient use of remote file storage capabilities.
  53. RFC 385 further commented on errors, emphasis points, and
  54. additions to the protocol, while RFC 414 provided a status report
  55. on the working server and user FTPs. RFC 430, issued in 1973,
  56. (among other RFCs too numerous to mention) presented further
  57. comments on FTP. Finally, an "official" FTP document was
  58. published as RFC 454.
  59. By July 1973, considerable changes from the last versions of FTP
  60. were made, but the general structure remained the same. RFC 542
  61. was published as a new "official" specification to reflect these
  62. changes. However, many implementations based on the older
  63. specification were not updated.
  64. In 1974, RFCs 607 and 614 continued comments on FTP. RFC 624
  65. proposed further design changes and minor modifications. In 1975,
  66. RFC 686 entitled, "Leaving Well Enough Alone", discussed the
  67. differences between all of the early and later versions of FTP.
  68. RFC 691 presented a minor revision of RFC 686, regarding the
  69. subject of print files.
  70. Motivated by the transition from the NCP to the TCP as the
  71. underlying protocol, a phoenix was born out of all of the above
  72. efforts in RFC 765 as the specification of FTP for use on TCP.
  73. This current edition of the FTP specification is intended to
  74. correct some minor documentation errors, to improve the
  75. explanation of some protocol features, and to add some new
  76. optional commands.
  77. Postel & Reynolds [Page 2]
  78. RFC 959 October 1985
  79. File Transfer Protocol
  80. In particular, the following new optional commands are included in
  81. this edition of the specification:
  82. CDUP - Change to Parent Directory
  83. SMNT - Structure Mount
  84. STOU - Store Unique
  85. RMD - Remove Directory
  86. MKD - Make Directory
  87. PWD - Print Directory
  88. SYST - System
  89. This specification is compatible with the previous edition. A
  90. program implemented in conformance to the previous specification
  91. should automatically be in conformance to this specification.
  92. 2.2. TERMINOLOGY
  93. ASCII
  94. The ASCII character set is as defined in the ARPA-Internet
  95. Protocol Handbook. In FTP, ASCII characters are defined to be
  96. the lower half of an eight-bit code set (i.e., the most
  97. significant bit is zero).
  98. access controls
  99. Access controls define users' access privileges to the use of a
  100. system, and to the files in that system. Access controls are
  101. necessary to prevent unauthorized or accidental use of files.
  102. It is the prerogative of a server-FTP process to invoke access
  103. controls.
  104. byte size
  105. There are two byte sizes of interest in FTP: the logical byte
  106. size of the file, and the transfer byte size used for the
  107. transmission of the data. The transfer byte size is always 8
  108. bits. The transfer byte size is not necessarily the byte size
  109. in which data is to be stored in a system, nor the logical byte
  110. size for interpretation of the structure of the data.
  111. Postel & Reynolds [Page 3]
  112. RFC 959 October 1985
  113. File Transfer Protocol
  114. control connection
  115. The communication path between the USER-PI and SERVER-PI for
  116. the exchange of commands and replies. This connection follows
  117. the Telnet Protocol.
  118. data connection
  119. A full duplex connection over which data is transferred, in a
  120. specified mode and type. The data transferred may be a part of
  121. a file, an entire file or a number of files. The path may be
  122. between a server-DTP and a user-DTP, or between two
  123. server-DTPs.
  124. data port
  125. The passive data transfer process "listens" on the data port
  126. for a connection from the active transfer process in order to
  127. open the data connection.
  128. DTP
  129. The data transfer process establishes and manages the data
  130. connection. The DTP can be passive or active.
  131. End-of-Line
  132. The end-of-line sequence defines the separation of printing
  133. lines. The sequence is Carriage Return, followed by Line Feed.
  134. EOF
  135. The end-of-file condition that defines the end of a file being
  136. transferred.
  137. EOR
  138. The end-of-record condition that defines the end of a record
  139. being transferred.
  140. error recovery
  141. A procedure that allows a user to recover from certain errors
  142. such as failure of either host system or transfer process. In
  143. FTP, error recovery may involve restarting a file transfer at a
  144. given checkpoint.
  145. Postel & Reynolds [Page 4]
  146. RFC 959 October 1985
  147. File Transfer Protocol
  148. FTP commands
  149. A set of commands that comprise the control information flowing
  150. from the user-FTP to the server-FTP process.
  151. file
  152. An ordered set of computer data (including programs), of
  153. arbitrary length, uniquely identified by a pathname.
  154. mode
  155. The mode in which data is to be transferred via the data
  156. connection. The mode defines the data format during transfer
  157. including EOR and EOF. The transfer modes defined in FTP are
  158. described in the Section on Transmission Modes.
  159. NVT
  160. The Network Virtual Terminal as defined in the Telnet Protocol.
  161. NVFS
  162. The Network Virtual File System. A concept which defines a
  163. standard network file system with standard commands and
  164. pathname conventions.
  165. page
  166. A file may be structured as a set of independent parts called
  167. pages. FTP supports the transmission of discontinuous files as
  168. independent indexed pages.
  169. pathname
  170. Pathname is defined to be the character string which must be
  171. input to a file system by a user in order to identify a file.
  172. Pathname normally contains device and/or directory names, and
  173. file name specification. FTP does not yet specify a standard
  174. pathname convention. Each user must follow the file naming
  175. conventions of the file systems involved in the transfer.
  176. PI
  177. The protocol interpreter. The user and server sides of the
  178. protocol have distinct roles implemented in a user-PI and a
  179. server-PI.
  180. Postel & Reynolds [Page 5]
  181. RFC 959 October 1985
  182. File Transfer Protocol
  183. record
  184. A sequential file may be structured as a number of contiguous
  185. parts called records. Record structures are supported by FTP
  186. but a file need not have record structure.
  187. reply
  188. A reply is an acknowledgment (positive or negative) sent from
  189. server to user via the control connection in response to FTP
  190. commands. The general form of a reply is a completion code
  191. (including error codes) followed by a text string. The codes
  192. are for use by programs and the text is usually intended for
  193. human users.
  194. server-DTP
  195. The data transfer process, in its normal "active" state,
  196. establishes the data connection with the "listening" data port.
  197. It sets up parameters for transfer and storage, and transfers
  198. data on command from its PI. The DTP can be placed in a
  199. "passive" state to listen for, rather than initiate a
  200. connection on the data port.
  201. server-FTP process
  202. A process or set of processes which perform the function of
  203. file transfer in cooperation with a user-FTP process and,
  204. possibly, another server. The functions consist of a protocol
  205. interpreter (PI) and a data transfer process (DTP).
  206. server-PI
  207. The server protocol interpreter "listens" on Port L for a
  208. connection from a user-PI and establishes a control
  209. communication connection. It receives standard FTP commands
  210. from the user-PI, sends replies, and governs the server-DTP.
  211. type
  212. The data representation type used for data transfer and
  213. storage. Type implies certain transformations between the time
  214. of data storage and data transfer. The representation types
  215. defined in FTP are described in the Section on Establishing
  216. Data Connections.
  217. Postel & Reynolds [Page 6]
  218. RFC 959 October 1985
  219. File Transfer Protocol
  220. user
  221. A person or a process on behalf of a person wishing to obtain
  222. file transfer service. The human user may interact directly
  223. with a server-FTP process, but use of a user-FTP process is
  224. preferred since the protocol design is weighted towards
  225. automata.
  226. user-DTP
  227. The data transfer process "listens" on the data port for a
  228. connection from a server-FTP process. If two servers are
  229. transferring data between them, the user-DTP is inactive.
  230. user-FTP process
  231. A set of functions including a protocol interpreter, a data
  232. transfer process and a user interface which together perform
  233. the function of file transfer in cooperation with one or more
  234. server-FTP processes. The user interface allows a local
  235. language to be used in the command-reply dialogue with the
  236. user.
  237. user-PI
  238. The user protocol interpreter initiates the control connection
  239. from its port U to the server-FTP process, initiates FTP
  240. commands, and governs the user-DTP if that process is part of
  241. the file transfer.
  242. Postel & Reynolds [Page 7]
  243. RFC 959 October 1985
  244. File Transfer Protocol
  245. 2.3. THE FTP MODEL
  246. With the above definitions in mind, the following model (shown in
  247. Figure 1) may be diagrammed for an FTP service.
  248. -------------
  249. |/---------\|
  250. || User || --------
  251. ||Interface|<--->| User |
  252. |\----^----/| --------
  253. ---------- | | |
  254. |/------\| FTP Commands |/----V----\|
  255. ||Server|<---------------->| User ||
  256. || PI || FTP Replies || PI ||
  257. |\--^---/| |\----^----/|
  258. | | | | | |
  259. -------- |/--V---\| Data |/----V----\| --------
  260. | File |<--->|Server|<---------------->| User |<--->| File |
  261. |System| || DTP || Connection || DTP || |System|
  262. -------- |\------/| |\---------/| --------
  263. ---------- -------------
  264. Server-FTP USER-FTP
  265. NOTES: 1. The data connection may be used in either direction.
  266. 2. The data connection need not exist all of the time.
  267. Figure 1 Model for FTP Use
  268. In the model described in Figure 1, the user-protocol interpreter
  269. initiates the control connection. The control connection follows
  270. the Telnet protocol. At the initiation of the user, standard FTP
  271. commands are generated by the user-PI and transmitted to the
  272. server process via the control connection. (The user may
  273. establish a direct control connection to the server-FTP, from a
  274. TAC terminal for example, and generate standard FTP commands
  275. independently, bypassing the user-FTP process.) Standard replies
  276. are sent from the server-PI to the user-PI over the control
  277. connection in response to the commands.
  278. The FTP commands specify the parameters for the data connection
  279. (data port, transfer mode, representation type, and structure) and
  280. the nature of file system operation (store, retrieve, append,
  281. delete, etc.). The user-DTP or its designate should "listen" on
  282. the specified data port, and the server initiate the data
  283. connection and data transfer in accordance with the specified
  284. parameters. It should be noted that the data port need not be in
  285. Postel & Reynolds [Page 8]
  286. RFC 959 October 1985
  287. File Transfer Protocol
  288. the same host that initiates the FTP commands via the control
  289. connection, but the user or the user-FTP process must ensure a
  290. "listen" on the specified data port. It ought to also be noted
  291. that the data connection may be used for simultaneous sending and
  292. receiving.
  293. In another situation a user might wish to transfer files between
  294. two hosts, neither of which is a local host. The user sets up
  295. control connections to the two servers and then arranges for a
  296. data connection between them. In this manner, control information
  297. is passed to the user-PI but data is transferred between the
  298. server data transfer processes. Following is a model of this
  299. server-server interaction.
  300. Control ------------ Control
  301. ---------->| User-FTP |<-----------
  302. | | User-PI | |
  303. | | "C" | |
  304. V ------------ V
  305. -------------- --------------
  306. | Server-FTP | Data Connection | Server-FTP |
  307. | "A" |<---------------------->| "B" |
  308. -------------- Port (A) Port (B) --------------
  309. Figure 2
  310. The protocol requires that the control connections be open while
  311. data transfer is in progress. It is the responsibility of the
  312. user to request the closing of the control connections when
  313. finished using the FTP service, while it is the server who takes
  314. the action. The server may abort data transfer if the control
  315. connections are closed without command.
  316. The Relationship between FTP and Telnet:
  317. The FTP uses the Telnet protocol on the control connection.
  318. This can be achieved in two ways: first, the user-PI or the
  319. server-PI may implement the rules of the Telnet Protocol
  320. directly in their own procedures; or, second, the user-PI or
  321. the server-PI may make use of the existing Telnet module in the
  322. system.
  323. Ease of implementaion, sharing code, and modular programming
  324. argue for the second approach. Efficiency and independence
  325. Postel & Reynolds [Page 9]
  326. RFC 959 October 1985
  327. File Transfer Protocol
  328. argue for the first approach. In practice, FTP relies on very
  329. little of the Telnet Protocol, so the first approach does not
  330. necessarily involve a large amount of code.
  331. 3. DATA TRANSFER FUNCTIONS
  332. Files are transferred only via the data connection. The control
  333. connection is used for the transfer of commands, which describe the
  334. functions to be performed, and the replies to these commands (see the
  335. Section on FTP Replies). Several commands are concerned with the
  336. transfer of data between hosts. These data transfer commands include
  337. the MODE command which specify how the bits of the data are to be
  338. transmitted, and the STRUcture and TYPE commands, which are used to
  339. define the way in which the data are to be represented. The
  340. transmission and representation are basically independent but the
  341. "Stream" transmission mode is dependent on the file structure
  342. attribute and if "Compressed" transmission mode is used, the nature
  343. of the filler byte depends on the representation type.
  344. 3.1. DATA REPRESENTATION AND STORAGE
  345. Data is transferred from a storage device in the sending host to a
  346. storage device in the receiving host. Often it is necessary to
  347. perform certain transformations on the data because data storage
  348. representations in the two systems are different. For example,
  349. NVT-ASCII has different data storage representations in different
  350. systems. DEC TOPS-20s's generally store NVT-ASCII as five 7-bit
  351. ASCII characters, left-justified in a 36-bit word. IBM Mainframe's
  352. store NVT-ASCII as 8-bit EBCDIC codes. Multics stores NVT-ASCII
  353. as four 9-bit characters in a 36-bit word. It is desirable to
  354. convert characters into the standard NVT-ASCII representation when
  355. transmitting text between dissimilar systems. The sending and
  356. receiving sites would have to perform the necessary
  357. transformations between the standard representation and their
  358. internal representations.
  359. A different problem in representation arises when transmitting
  360. binary data (not character codes) between host systems with
  361. different word lengths. It is not always clear how the sender
  362. should send data, and the receiver store it. For example, when
  363. transmitting 32-bit bytes from a 32-bit word-length system to a
  364. 36-bit word-length system, it may be desirable (for reasons of
  365. efficiency and usefulness) to store the 32-bit bytes
  366. right-justified in a 36-bit word in the latter system. In any
  367. case, the user should have the option of specifying data
  368. representation and transformation functions. It should be noted
  369. Postel & Reynolds [Page 10]
  370. RFC 959 October 1985
  371. File Transfer Protocol
  372. that FTP provides for very limited data type representations.
  373. Transformations desired beyond this limited capability should be
  374. performed by the user directly.
  375. 3.1.1. DATA TYPES
  376. Data representations are handled in FTP by a user specifying a
  377. representation type. This type may implicitly (as in ASCII or
  378. EBCDIC) or explicitly (as in Local byte) define a byte size for
  379. interpretation which is referred to as the "logical byte size."
  380. Note that this has nothing to do with the byte size used for
  381. transmission over the data connection, called the "transfer
  382. byte size", and the two should not be confused. For example,
  383. NVT-ASCII has a logical byte size of 8 bits. If the type is
  384. Local byte, then the TYPE command has an obligatory second
  385. parameter specifying the logical byte size. The transfer byte
  386. size is always 8 bits.
  387. 3.1.1.1. ASCII TYPE
  388. This is the default type and must be accepted by all FTP
  389. implementations. It is intended primarily for the transfer
  390. of text files, except when both hosts would find the EBCDIC
  391. type more convenient.
  392. The sender converts the data from an internal character
  393. representation to the standard 8-bit NVT-ASCII
  394. representation (see the Telnet specification). The receiver
  395. will convert the data from the standard form to his own
  396. internal form.
  397. In accordance with the NVT standard, the <CRLF> sequence
  398. should be used where necessary to denote the end of a line
  399. of text. (See the discussion of file structure at the end
  400. of the Section on Data Representation and Storage.)
  401. Using the standard NVT-ASCII representation means that data
  402. must be interpreted as 8-bit bytes.
  403. The Format parameter for ASCII and EBCDIC types is discussed
  404. below.
  405. Postel & Reynolds [Page 11]
  406. RFC 959 October 1985
  407. File Transfer Protocol
  408. 3.1.1.2. EBCDIC TYPE
  409. This type is intended for efficient transfer between hosts
  410. which use EBCDIC for their internal character
  411. representation.
  412. For transmission, the data are represented as 8-bit EBCDIC
  413. characters. The character code is the only difference
  414. between the functional specifications of EBCDIC and ASCII
  415. types.
  416. End-of-line (as opposed to end-of-record--see the discussion
  417. of structure) will probably be rarely used with EBCDIC type
  418. for purposes of denoting structure, but where it is
  419. necessary the <NL> character should be used.
  420. 3.1.1.3. IMAGE TYPE
  421. The data are sent as contiguous bits which, for transfer,
  422. are packed into the 8-bit transfer bytes. The receiving
  423. site must store the data as contiguous bits. The structure
  424. of the storage system might necessitate the padding of the
  425. file (or of each record, for a record-structured file) to
  426. some convenient boundary (byte, word or block). This
  427. padding, which must be all zeros, may occur only at the end
  428. of the file (or at the end of each record) and there must be
  429. a way of identifying the padding bits so that they may be
  430. stripped off if the file is retrieved. The padding
  431. transformation should be well publicized to enable a user to
  432. process a file at the storage site.
  433. Image type is intended for the efficient storage and
  434. retrieval of files and for the transfer of binary data. It
  435. is recommended that this type be accepted by all FTP
  436. implementations.
  437. 3.1.1.4. LOCAL TYPE
  438. The data is transferred in logical bytes of the size
  439. specified by the obligatory second parameter, Byte size.
  440. The value of Byte size must be a decimal integer; there is
  441. no default value. The logical byte size is not necessarily
  442. the same as the transfer byte size. If there is a
  443. difference in byte sizes, then the logical bytes should be
  444. packed contiguously, disregarding transfer byte boundaries
  445. and with any necessary padding at the end.
  446. Postel & Reynolds [Page 12]
  447. RFC 959 October 1985
  448. File Transfer Protocol
  449. When the data reaches the receiving host, it will be
  450. transformed in a manner dependent on the logical byte size
  451. and the particular host. This transformation must be
  452. invertible (i.e., an identical file can be retrieved if the
  453. same parameters are used) and should be well publicized by
  454. the FTP implementors.
  455. For example, a user sending 36-bit floating-point numbers to
  456. a host with a 32-bit word could send that data as Local byte
  457. with a logical byte size of 36. The receiving host would
  458. then be expected to store the logical bytes so that they
  459. could be easily manipulated; in this example putting the
  460. 36-bit logical bytes into 64-bit double words should
  461. suffice.
  462. In another example, a pair of hosts with a 36-bit word size
  463. may send data to one another in words by using TYPE L 36.
  464. The data would be sent in the 8-bit transmission bytes
  465. packed so that 9 transmission bytes carried two host words.
  466. 3.1.1.5. FORMAT CONTROL
  467. The types ASCII and EBCDIC also take a second (optional)
  468. parameter; this is to indicate what kind of vertical format
  469. control, if any, is associated with a file. The following
  470. data representation types are defined in FTP:
  471. A character file may be transferred to a host for one of
  472. three purposes: for printing, for storage and later
  473. retrieval, or for processing. If a file is sent for
  474. printing, the receiving host must know how the vertical
  475. format control is represented. In the second case, it must
  476. be possible to store a file at a host and then retrieve it
  477. later in exactly the same form. Finally, it should be
  478. possible to move a file from one host to another and process
  479. the file at the second host without undue trouble. A single
  480. ASCII or EBCDIC format does not satisfy all these
  481. conditions. Therefore, these types have a second parameter
  482. specifying one of the following three formats:
  483. 3.1.1.5.1. NON PRINT
  484. This is the default format to be used if the second
  485. (format) parameter is omitted. Non-print format must be
  486. accepted by all FTP implementations.
  487. Postel & Reynolds [Page 13]
  488. RFC 959 October 1985
  489. File Transfer Protocol
  490. The file need contain no vertical format information. If
  491. it is passed to a printer process, this process may
  492. assume standard values for spacing and margins.
  493. Normally, this format will be used with files destined
  494. for processing or just storage.
  495. 3.1.1.5.2. TELNET FORMAT CONTROLS
  496. The file contains ASCII/EBCDIC vertical format controls
  497. (i.e., <CR>, <LF>, <NL>, <VT>, <FF>) which the printer
  498. process will interpret appropriately. <CRLF>, in exactly
  499. this sequence, also denotes end-of-line.
  500. 3.1.1.5.2. CARRIAGE CONTROL (ASA)
  501. The file contains ASA (FORTRAN) vertical format control
  502. characters. (See RFC 740 Appendix C; and Communications
  503. of the ACM, Vol. 7, No. 10, p. 606, October 1964.) In a
  504. line or a record formatted according to the ASA Standard,
  505. the first character is not to be printed. Instead, it
  506. should be used to determine the vertical movement of the
  507. paper which should take place before the rest of the
  508. record is printed.
  509. The ASA Standard specifies the following control
  510. characters:
  511. Character Vertical Spacing
  512. blank Move paper up one line
  513. 0 Move paper up two lines
  514. 1 Move paper to top of next page
  515. + No movement, i.e., overprint
  516. Clearly there must be some way for a printer process to
  517. distinguish the end of the structural entity. If a file
  518. has record structure (see below) this is no problem;
  519. records will be explicitly marked during transfer and
  520. storage. If the file has no record structure, the <CRLF>
  521. end-of-line sequence is used to separate printing lines,
  522. but these format effectors are overridden by the ASA
  523. controls.
  524. Postel & Reynolds [Page 14]
  525. RFC 959 October 1985
  526. File Transfer Protocol
  527. 3.1.2. DATA STRUCTURES
  528. In addition to different representation types, FTP allows the
  529. structure of a file to be specified. Three file structures are
  530. defined in FTP:
  531. file-structure, where there is no internal structure and
  532. the file is considered to be a
  533. continuous sequence of data bytes,
  534. record-structure, where the file is made up of sequential
  535. records,
  536. and page-structure, where the file is made up of independent
  537. indexed pages.
  538. File-structure is the default to be assumed if the STRUcture
  539. command has not been used but both file and record structures
  540. must be accepted for "text" files (i.e., files with TYPE ASCII
  541. or EBCDIC) by all FTP implementations. The structure of a file
  542. will affect both the transfer mode of a file (see the Section
  543. on Transmission Modes) and the interpretation and storage of
  544. the file.
  545. The "natural" structure of a file will depend on which host
  546. stores the file. A source-code file will usually be stored on
  547. an IBM Mainframe in fixed length records but on a DEC TOPS-20
  548. as a stream of characters partitioned into lines, for example
  549. by <CRLF>. If the transfer of files between such disparate
  550. sites is to be useful, there must be some way for one site to
  551. recognize the other's assumptions about the file.
  552. With some sites being naturally file-oriented and others
  553. naturally record-oriented there may be problems if a file with
  554. one structure is sent to a host oriented to the other. If a
  555. text file is sent with record-structure to a host which is file
  556. oriented, then that host should apply an internal
  557. transformation to the file based on the record structure.
  558. Obviously, this transformation should be useful, but it must
  559. also be invertible so that an identical file may be retrieved
  560. using record structure.
  561. In the case of a file being sent with file-structure to a
  562. record-oriented host, there exists the question of what
  563. criteria the host should use to divide the file into records
  564. which can be processed locally. If this division is necessary,
  565. the FTP implementation should use the end-of-line sequence,
  566. Postel & Reynolds [Page 15]
  567. RFC 959 October 1985
  568. File Transfer Protocol
  569. <CRLF> for ASCII, or <NL> for EBCDIC text files, as the
  570. delimiter. If an FTP implementation adopts this technique, it
  571. must be prepared to reverse the transformation if the file is
  572. retrieved with file-structure.
  573. 3.1.2.1. FILE STRUCTURE
  574. File structure is the default to be assumed if the STRUcture
  575. command has not been used.
  576. In file-structure there is no internal structure and the
  577. file is considered to be a continuous sequence of data
  578. bytes.
  579. 3.1.2.2. RECORD STRUCTURE
  580. Record structures must be accepted for "text" files (i.e.,
  581. files with TYPE ASCII or EBCDIC) by all FTP implementations.
  582. In record-structure the file is made up of sequential
  583. records.
  584. 3.1.2.3. PAGE STRUCTURE
  585. To transmit files that are discontinuous, FTP defines a page
  586. structure. Files of this type are sometimes known as
  587. "random access files" or even as "holey files". In these
  588. files there is sometimes other information associated with
  589. the file as a whole (e.g., a file descriptor), or with a
  590. section of the file (e.g., page access controls), or both.
  591. In FTP, the sections of the file are called pages.
  592. To provide for various page sizes and associated
  593. information, each page is sent with a page header. The page
  594. header has the following defined fields:
  595. Header Length
  596. The number of logical bytes in the page header
  597. including this byte. The minimum header length is 4.
  598. Page Index
  599. The logical page number of this section of the file.
  600. This is not the transmission sequence number of this
  601. page, but the index used to identify this page of the
  602. file.
  603. Postel & Reynolds [Page 16]
  604. RFC 959 October 1985
  605. File Transfer Protocol
  606. Data Length
  607. The number of logical bytes in the page data. The
  608. minimum data length is 0.
  609. Page Type
  610. The type of page this is. The following page types
  611. are defined:
  612. 0 = Last Page
  613. This is used to indicate the end of a paged
  614. structured transmission. The header length must
  615. be 4, and the data length must be 0.
  616. 1 = Simple Page
  617. This is the normal type for simple paged files
  618. with no page level associated control
  619. information. The header length must be 4.
  620. 2 = Descriptor Page
  621. This type is used to transmit the descriptive
  622. information for the file as a whole.
  623. 3 = Access Controlled Page
  624. This type includes an additional header field
  625. for paged files with page level access control
  626. information. The header length must be 5.
  627. Optional Fields
  628. Further header fields may be used to supply per page
  629. control information, for example, per page access
  630. control.
  631. All fields are one logical byte in length. The logical byte
  632. size is specified by the TYPE command. See Appendix I for
  633. further details and a specific case at the page structure.
  634. A note of caution about parameters: a file must be stored and
  635. retrieved with the same parameters if the retrieved version is to
  636. Postel & Reynolds [Page 17]
  637. RFC 959 October 1985
  638. File Transfer Protocol
  639. be identical to the version originally transmitted. Conversely,
  640. FTP implementations must return a file identical to the original
  641. if the parameters used to store and retrieve a file are the same.
  642. 3.2. ESTABLISHING DATA CONNECTIONS
  643. The mechanics of transferring data consists of setting up the data
  644. connection to the appropriate ports and choosing the parameters
  645. for transfer. Both the user and the server-DTPs have a default
  646. data port. The user-process default data port is the same as the
  647. control connection port (i.e., U). The server-process default
  648. data port is the port adjacent to the control connection port
  649. (i.e., L-1).
  650. The transfer byte size is 8-bit bytes. This byte size is relevant
  651. only for the actual transfer of the data; it has no bearing on
  652. representation of the data within a host's file system.
  653. The passive data transfer process (this may be a user-DTP or a
  654. second server-DTP) shall "listen" on the data port prior to
  655. sending a transfer request command. The FTP request command
  656. determines the direction of the data transfer. The server, upon
  657. receiving the transfer request, will initiate the data connection
  658. to the port. When the connection is established, the data
  659. transfer begins between DTP's, and the server-PI sends a
  660. confirming reply to the user-PI.
  661. Every FTP implementation must support the use of the default data
  662. ports, and only the USER-PI can initiate a change to non-default
  663. ports.
  664. It is possible for the user to specify an alternate data port by
  665. use of the PORT command. The user may want a file dumped on a TAC
  666. line printer or retrieved from a third party host. In the latter
  667. case, the user-PI sets up control connections with both
  668. server-PI's. One server is then told (by an FTP command) to
  669. "listen" for a connection which the other will initiate. The
  670. user-PI sends one server-PI a PORT command indicating the data
  671. port of the other. Finally, both are sent the appropriate
  672. transfer commands. The exact sequence of commands and replies
  673. sent between the user-controller and the servers is defined in the
  674. Section on FTP Replies.
  675. In general, it is the server's responsibility to maintain the data
  676. connection--to initiate it and to close it. The exception to this
  677. Postel & Reynolds [Page 18]
  678. RFC 959 October 1985
  679. File Transfer Protocol
  680. is when the user-DTP is sending the data in a transfer mode that
  681. requires the connection to be closed to indicate EOF. The server
  682. MUST close the data connection under the following conditions:
  683. 1. The server has completed sending data in a transfer mode
  684. that requires a close to indicate EOF.
  685. 2. The server receives an ABORT command from the user.
  686. 3. The port specification is changed by a command from the
  687. user.
  688. 4. The control connection is closed legally or otherwise.
  689. 5. An irrecoverable error condition occurs.
  690. Otherwise the close is a server option, the exercise of which the
  691. server must indicate to the user-process by either a 250 or 226
  692. reply only.
  693. 3.3. DATA CONNECTION MANAGEMENT
  694. Default Data Connection Ports: All FTP implementations must
  695. support use of the default data connection ports, and only the
  696. User-PI may initiate the use of non-default ports.
  697. Negotiating Non-Default Data Ports: The User-PI may specify a
  698. non-default user side data port with the PORT command. The
  699. User-PI may request the server side to identify a non-default
  700. server side data port with the PASV command. Since a connection
  701. is defined by the pair of addresses, either of these actions is
  702. enough to get a different data connection, still it is permitted
  703. to do both commands to use new ports on both ends of the data
  704. connection.
  705. Reuse of the Data Connection: When using the stream mode of data
  706. transfer the end of the file must be indicated by closing the
  707. connection. This causes a problem if multiple files are to be
  708. transfered in the session, due to need for TCP to hold the
  709. connection record for a time out period to guarantee the reliable
  710. communication. Thus the connection can not be reopened at once.
  711. There are two solutions to this problem. The first is to
  712. negotiate a non-default port. The second is to use another
  713. transfer mode.
  714. A comment on transfer modes. The stream transfer mode is
  715. Postel & Reynolds [Page 19]
  716. RFC 959 October 1985
  717. File Transfer Protocol
  718. inherently unreliable, since one can not determine if the
  719. connection closed prematurely or not. The other transfer modes
  720. (Block, Compressed) do not close the connection to indicate the
  721. end of file. They have enough FTP encoding that the data
  722. connection can be parsed to determine the end of the file.
  723. Thus using these modes one can leave the data connection open
  724. for multiple file transfers.
  725. 3.4. TRANSMISSION MODES
  726. The next consideration in transferring data is choosing the
  727. appropriate transmission mode. There are three modes: one which
  728. formats the data and allows for restart procedures; one which also
  729. compresses the data for efficient transfer; and one which passes
  730. the data with little or no processing. In this last case the mode
  731. interacts with the structure attribute to determine the type of
  732. processing. In the compressed mode, the representation type
  733. determines the filler byte.
  734. All data transfers must be completed with an end-of-file (EOF)
  735. which may be explicitly stated or implied by the closing of the
  736. data connection. For files with record structure, all the
  737. end-of-record markers (EOR) are explicit, including the final one.
  738. For files transmitted in page structure a "last-page" page type is
  739. used.
  740. NOTE: In the rest of this section, byte means "transfer byte"
  741. except where explicitly stated otherwise.
  742. For the purpose of standardized transfer, the sending host will
  743. translate its internal end of line or end of record denotation
  744. into the representation prescribed by the transfer mode and file
  745. structure, and the receiving host will perform the inverse
  746. translation to its internal denotation. An IBM Mainframe record
  747. count field may not be recognized at another host, so the
  748. end-of-record information may be transferred as a two byte control
  749. code in Stream mode or as a flagged bit in a Block or Compressed
  750. mode descriptor. End-of-line in an ASCII or EBCDIC file with no
  751. record structure should be indicated by <CRLF> or <NL>,
  752. respectively. Since these transformations imply extra work for
  753. some systems, identical systems transferring non-record structured
  754. text files might wish to use a binary representation and stream
  755. mode for the transfer.
  756. Postel & Reynolds [Page 20]
  757. RFC 959 October 1985
  758. File Transfer Protocol
  759. The following transmission modes are defined in FTP:
  760. 3.4.1. STREAM MODE
  761. The data is transmitted as a stream of bytes. There is no
  762. restriction on the representation type used; record structures
  763. are allowed.
  764. In a record structured file EOR and EOF will each be indicated
  765. by a two-byte control code. The first byte of the control code
  766. will be all ones, the escape character. The second byte will
  767. have the low order bit on and zeros elsewhere for EOR and the
  768. second low order bit on for EOF; that is, the byte will have
  769. value 1 for EOR and value 2 for EOF. EOR and EOF may be
  770. indicated together on the last byte transmitted by turning both
  771. low order bits on (i.e., the value 3). If a byte of all ones
  772. was intended to be sent as data, it should be repeated in the
  773. second byte of the control code.
  774. If the structure is a file structure, the EOF is indicated by
  775. the sending host closing the data connection and all bytes are
  776. data bytes.
  777. 3.4.2. BLOCK MODE
  778. The file is transmitted as a series of data blocks preceded by
  779. one or more header bytes. The header bytes contain a count
  780. field, and descriptor code. The count field indicates the
  781. total length of the data block in bytes, thus marking the
  782. beginning of the next data block (there are no filler bits).
  783. The descriptor code defines: last block in the file (EOF) last
  784. block in the record (EOR), restart marker (see the Section on
  785. Error Recovery and Restart) or suspect data (i.e., the data
  786. being transferred is suspected of errors and is not reliable).
  787. This last code is NOT intended for error control within FTP.
  788. It is motivated by the desire of sites exchanging certain types
  789. of data (e.g., seismic or weather data) to send and receive all
  790. the data despite local errors (such as "magnetic tape read
  791. errors"), but to indicate in the transmission that certain
  792. portions are suspect). Record structures are allowed in this
  793. mode, and any representation type may be used.
  794. The header consists of the three bytes. Of the 24 bits of
  795. header information, the 16 low order bits shall represent byte
  796. count, and the 8 high order bits shall represent descriptor
  797. codes as shown below.
  798. Postel & Reynolds [Page 21]
  799. RFC 959 October 1985
  800. File Transfer Protocol
  801. Block Header
  802. +----------------+----------------+----------------+
  803. | Descriptor | Byte Count |
  804. | 8 bits | 16 bits |
  805. +----------------+----------------+----------------+
  806. The descriptor codes are indicated by bit flags in the
  807. descriptor byte. Four codes have been assigned, where each
  808. code number is the decimal value of the corresponding bit in
  809. the byte.
  810. Code Meaning
  811. 128 End of data block is EOR
  812. 64 End of data block is EOF
  813. 32 Suspected errors in data block
  814. 16 Data block is a restart marker
  815. With this encoding, more than one descriptor coded condition
  816. may exist for a particular block. As many bits as necessary
  817. may be flagged.
  818. The restart marker is embedded in the data stream as an
  819. integral number of 8-bit bytes representing printable
  820. characters in the language being used over the control
  821. connection (e.g., default--NVT-ASCII). <SP> (Space, in the
  822. appropriate language) must not be used WITHIN a restart marker.
  823. For example, to transmit a six-character marker, the following
  824. would be sent:
  825. +--------+--------+--------+
  826. |Descrptr| Byte count |
  827. |code= 16| = 6 |
  828. +--------+--------+--------+
  829. +--------+--------+--------+
  830. | Marker | Marker | Marker |
  831. | 8 bits | 8 bits | 8 bits |
  832. +--------+--------+--------+
  833. +--------+--------+--------+
  834. | Marker | Marker | Marker |
  835. | 8 bits | 8 bits | 8 bits |
  836. +--------+--------+--------+
  837. Postel & Reynolds [Page 22]
  838. RFC 959 October 1985
  839. File Transfer Protocol
  840. 3.4.3. COMPRESSED MODE
  841. There are three kinds of information to be sent: regular data,
  842. sent in a byte string; compressed data, consisting of
  843. replications or filler; and control information, sent in a
  844. two-byte escape sequence. If n>0 bytes (up to 127) of regular
  845. data are sent, these n bytes are preceded by a byte with the
  846. left-most bit set to 0 and the right-most 7 bits containing the
  847. number n.
  848. Byte string:
  849. 1 7 8 8
  850. +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
  851. |0| n | | d(1) | ... | d(n) |
  852. +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
  853. ^ ^
  854. |---n bytes---|
  855. of data
  856. String of n data bytes d(1),..., d(n)
  857. Count n must be positive.
  858. To compress a string of n replications of the data byte d, the
  859. following 2 bytes are sent:
  860. Replicated Byte:
  861. 2 6 8
  862. +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
  863. |1 0| n | | d |
  864. +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+
  865. A string of n filler bytes can be compressed into a single
  866. byte, where the filler byte varies with the representation
  867. type. If the type is ASCII or EBCDIC the filler byte is <SP>
  868. (Space, ASCII code 32, EBCDIC code 64). If the type is Image
  869. or Local byte the filler is a zero byte.
  870. Filler String:
  871. 2 6
  872. +-+-+-+-+-+-+-+-+
  873. |1 1| n |
  874. +-+-+-+-+-+-+-+-+
  875. The escape sequence is a double byte, the first of which is the
  876. Postel & Reynolds [Page 23]
  877. RFC 959 October 1985
  878. File Transfer Protocol
  879. escape byte (all zeros) and the second of which contains
  880. descriptor codes as defined in Block mode. The descriptor
  881. codes have the same meaning as in Block mode and apply to the
  882. succeeding string of bytes.
  883. Compressed mode is useful for obtaining increased bandwidth on
  884. very large network transmissions at a little extra CPU cost.
  885. It can be most effectively used to reduce the size of printer
  886. files such as those generated by RJE hosts.
  887. 3.5. ERROR RECOVERY AND RESTART
  888. There is no provision for detecting bits lost or scrambled in data
  889. transfer; this level of error control is handled by the TCP.
  890. However, a restart procedure is provided to protect users from
  891. gross system failures (including failures of a host, an
  892. FTP-process, or the underlying network).
  893. The restart procedure is defined only for the block and compressed
  894. modes of data transfer. It requires the sender of data to insert
  895. a special marker code in the data stream with some marker
  896. information. The marker information has meaning only to the
  897. sender, but must consist of printable characters in the default or
  898. negotiated language of the control connection (ASCII or EBCDIC).
  899. The marker could represent a bit-count, a record-count, or any
  900. other information by which a system may identify a data
  901. checkpoint. The receiver of data, if it implements the restart
  902. procedure, would then mark the corresponding position of this
  903. marker in the receiving system, and return this information to the
  904. user.
  905. In the event of a system failure, the user can restart the data
  906. transfer by identifying the marker point with the FTP restart
  907. procedure. The following example illustrates the use of the
  908. restart procedure.
  909. The sender of the data inserts an appropriate marker block in the
  910. data stream at a convenient point. The receiving host marks the
  911. corresponding data point in its file system and conveys the last
  912. known sender and receiver marker information to the user, either
  913. directly or over the control connection in a 110 reply (depending
  914. on who is the sender). In the event of a system failure, the user
  915. or controller process restarts the server at the last server
  916. marker by sending a restart command with server's marker code as
  917. its argument. The restart command is transmitted over the control
  918. Postel & Reynolds [Page 24]
  919. RFC 959 October 1985
  920. File Transfer Protocol
  921. connection and is immediately followed by the command (such as
  922. RETR, STOR or LIST) which was being executed when the system
  923. failure occurred.
  924. 4. FILE TRANSFER FUNCTIONS
  925. The communication channel from the user-PI to the server-PI is
  926. established as a TCP connection from the user to the standard server
  927. port. The user protocol interpreter is responsible for sending FTP
  928. commands and interpreting the replies received; the server-PI
  929. interprets commands, sends replies and directs its DTP to set up the
  930. data connection and transfer the data. If the second party to the
  931. data transfer (the passive transfer process) is the user-DTP, then it
  932. is governed through the internal protocol of the user-FTP host; if it
  933. is a second server-DTP, then it is governed by its PI on command from
  934. the user-PI. The FTP replies are discussed in the next section. In
  935. the description of a few of the commands in this section, it is
  936. helpful to be explicit about the possible replies.
  937. 4.1. FTP COMMANDS
  938. 4.1.1. ACCESS CONTROL COMMANDS
  939. The following commands specify access control identifiers
  940. (command codes are shown in parentheses).
  941. USER NAME (USER)
  942. The argument field is a Telnet string identifying the user.
  943. The user identification is that which is required by the
  944. server for access to its file system. This command will
  945. normally be the first command transmitted by the user after
  946. the control connections are made (some servers may require
  947. this). Additional identification information in the form of
  948. a password and/or an account command may also be required by
  949. some servers. Servers may allow a new USER command to be
  950. entered at any point in order to change the access control
  951. and/or accounting information. This has the effect of
  952. flushing any user, password, and account information already
  953. supplied and beginning the login sequence again. All
  954. transfer parameters are unchanged and any file transfer in
  955. progress is completed under the old access control
  956. parameters.
  957. Postel & Reynolds [Page 25]
  958. RFC 959 October 1985
  959. File Transfer Protocol
  960. PASSWORD (PASS)
  961. The argument field is a Telnet string specifying the user's
  962. password. This command must be immediately preceded by the
  963. user name command, and, for some sites, completes the user's
  964. identification for access control. Since password
  965. information is quite sensitive, it is desirable in general
  966. to "mask" it or suppress typeout. It appears that the
  967. server has no foolproof way to achieve this. It is
  968. therefore the responsibility of the user-FTP process to hide
  969. the sensitive password information.
  970. ACCOUNT (ACCT)
  971. The argument field is a Telnet string identifying the user's
  972. account. The command is not necessarily related to the USER
  973. command, as some sites may require an account for login and
  974. others only for specific access, such as storing files. In
  975. the latter case the command may arrive at any time.
  976. There are reply codes to differentiate these cases for the
  977. automation: when account information is required for login,
  978. the response to a successful PASSword command is reply code
  979. 332. On the other hand, if account information is NOT
  980. required for login, the reply to a successful PASSword
  981. command is 230; and if the account information is needed for
  982. a command issued later in the dialogue, the server should
  983. return a 332 or 532 reply depending on whether it stores
  984. (pending receipt of the ACCounT command) or discards the
  985. command, respectively.
  986. CHANGE WORKING DIRECTORY (CWD)
  987. This command allows the user to work with a different
  988. directory or dataset for file storage or retrieval without
  989. altering his login or accounting information. Transfer
  990. parameters are similarly unchanged. The argument is a
  991. pathname specifying a directory or other system dependent
  992. file group designator.
  993. CHANGE TO PARENT DIRECTORY (CDUP)
  994. This command is a special case of CWD, and is included to
  995. simplify the implementation of programs for transferring
  996. directory trees between operating systems having different
  997. Postel & Reynolds [Page 26]
  998. RFC 959 October 1985
  999. File Transfer Protocol
  1000. syntaxes for naming the parent directory. The reply codes
  1001. shall be identical to the reply codes of CWD. See
  1002. Appendix II for further details.
  1003. STRUCTURE MOUNT (SMNT)
  1004. This command allows the user to mount a different file
  1005. system data structure without altering his login or
  1006. accounting information. Transfer parameters are similarly
  1007. unchanged. The argument is a pathname specifying a
  1008. directory or other system dependent file group designator.
  1009. REINITIALIZE (REIN)
  1010. This command terminates a USER, flushing all I/O and account
  1011. information, except to allow any transfer in progress to be
  1012. completed. All parameters are reset to the default settings
  1013. and the control connection is left open. This is identical
  1014. to the state in which a user finds himself immediately after
  1015. the control connection is opened. A USER command may be
  1016. expected to follow.
  1017. LOGOUT (QUIT)
  1018. This command terminates a USER and if file transfer is not
  1019. in progress, the server closes the control connection. If
  1020. file transfer is in progress, the connection will remain
  1021. open for result response and the server will then close it.
  1022. If the user-process is transferring files for several USERs
  1023. but does not wish to close and then reopen connections for
  1024. each, then the REIN command should be used instead of QUIT.
  1025. An unexpected close on the control connection will cause the
  1026. server to take the effective action of an abort (ABOR) and a
  1027. logout (QUIT).
  1028. 4.1.2. TRANSFER PARAMETER COMMANDS
  1029. All data transfer parameters have default values, and the
  1030. commands specifying data transfer parameters are required only
  1031. if the default parameter values are to be changed. The default
  1032. value is the last specified value, or if no value has been
  1033. specified, the standard default value is as stated here. This
  1034. implies that the server must "remember" the applicable default
  1035. values. The commands may be in any order except that they must
  1036. precede the FTP service request. The following commands
  1037. specify data transfer parameters:
  1038. Postel & Reynolds [Page 27]
  1039. RFC 959 October 1985
  1040. File Transfer Protocol
  1041. DATA PORT (PORT)
  1042. The argument is a HOST-PORT specification for the data port
  1043. to be used in data connection. There are defaults for both
  1044. the user and server data ports, and under normal
  1045. circumstances this command and its reply are not needed. If
  1046. this command is used, the argument is the concatenation of a
  1047. 32-bit internet host address and a 16-bit TCP port address.
  1048. This address information is broken into 8-bit fields and the
  1049. value of each field is transmitted as a decimal number (in
  1050. character string representation). The fields are separated
  1051. by commas. A port command would be:
  1052. PORT h1,h2,h3,h4,p1,p2
  1053. where h1 is the high order 8 bits of the internet host
  1054. address.
  1055. PASSIVE (PASV)
  1056. This command requests the server-DTP to "listen" on a data
  1057. port (which is not its default data port) and to wait for a
  1058. connection rather than initiate one upon receipt of a
  1059. transfer command. The response to this command includes the
  1060. host and port address this server is listening on.
  1061. REPRESENTATION TYPE (TYPE)
  1062. The argument specifies the representation type as described
  1063. in the Section on Data Representation and Storage. Several
  1064. types take a second parameter. The first parameter is
  1065. denoted by a single Telnet character, as is the second
  1066. Format parameter for ASCII and EBCDIC; the second parameter
  1067. for local byte is a decimal integer to indicate Bytesize.
  1068. The parameters are separated by a <SP> (Space, ASCII code
  1069. 32).
  1070. The following codes are assigned for type:
  1071. \ /
  1072. A - ASCII | | N - Non-print
  1073. |-><-| T - Telnet format effectors
  1074. E - EBCDIC| | C - Carriage Control (ASA)
  1075. / \
  1076. I - Image
  1077. L <byte size> - Local byte Byte size
  1078. Postel & Reynolds [Page 28]
  1079. RFC 959 October 1985
  1080. File Transfer Protocol
  1081. The default representation type is ASCII Non-print. If the
  1082. Format parameter is changed, and later just the first
  1083. argument is changed, Format then returns to the Non-print
  1084. default.
  1085. FILE STRUCTURE (STRU)
  1086. The argument is a single Telnet character code specifying
  1087. file structure described in the Section on Data
  1088. Representation and Storage.
  1089. The following codes are assigned for structure:
  1090. F - File (no record structure)
  1091. R - Record structure
  1092. P - Page structure
  1093. The default structure is File.
  1094. TRANSFER MODE (MODE)
  1095. The argument is a single Telnet character code specifying
  1096. the data transfer modes described in the Section on
  1097. Transmission Modes.
  1098. The following codes are assigned for transfer modes:
  1099. S - Stream
  1100. B - Block
  1101. C - Compressed
  1102. The default transfer mode is Stream.
  1103. 4.1.3. FTP SERVICE COMMANDS
  1104. The FTP service commands define the file transfer or the file
  1105. system function requested by the user. The argument of an FTP
  1106. service command will normally be a pathname. The syntax of
  1107. pathnames must conform to server site conventions (with
  1108. standard defaults applicable), and the language conventions of
  1109. the control connection. The suggested default handling is to
  1110. use the last specified device, directory or file name, or the
  1111. standard default defined for local users. The commands may be
  1112. in any order except that a "rename from" command must be
  1113. followed by a "rename to" command and the restart command must
  1114. be followed by the interrupted service command (e.g., STOR or
  1115. RETR). The data, when transferred in response to FTP service
  1116. Postel & Reynolds [Page 29]
  1117. RFC 959 October 1985
  1118. File Transfer Protocol
  1119. commands, shall always be sent over the data connection, except
  1120. for certain informative replies. The following commands
  1121. specify FTP service requests:
  1122. RETRIEVE (RETR)
  1123. This command causes the server-DTP to transfer a copy of the
  1124. file, specified in the pathname, to the server- or user-DTP
  1125. at the other end of the data connection. The status and
  1126. contents of the file at the server site shall be unaffected.
  1127. STORE (STOR)
  1128. This command causes the server-DTP to accept the data
  1129. transferred via the data connection and to store the data as
  1130. a file at the server site. If the file specified in the
  1131. pathname exists at the server site, then its contents shall
  1132. be replaced by the data being transferred. A new file is
  1133. created at the server site if the file specified in the
  1134. pathname does not already exist.
  1135. STORE UNIQUE (STOU)
  1136. This command behaves like STOR except that the resultant
  1137. file is to be created in the current directory under a name
  1138. unique to that directory. The 250 Transfer Started response
  1139. must include the name generated.
  1140. APPEND (with create) (APPE)
  1141. This command causes the server-DTP to accept the data
  1142. transferred via the data connection and to store the data in
  1143. a file at the server site. If the file specified in the
  1144. pathname exists at the server site, then the data shall be
  1145. appended to that file; otherwise the file specified in the
  1146. pathname shall be created at the server site.
  1147. ALLOCATE (ALLO)
  1148. This command may be required by some servers to reserve
  1149. sufficient storage to accommodate the new file to be
  1150. transferred. The argument shall be a decimal integer
  1151. representing the number of bytes (using the logical byte
  1152. size) of storage to be reserved for the file. For files
  1153. sent with record or page structure a maximum record or page
  1154. size (in logical bytes) might also be necessary; this is
  1155. indicated by a decimal integer in a second argument field of
  1156. Postel & Reynolds [Page 30]
  1157. RFC 959 October 1985
  1158. File Transfer Protocol
  1159. the command. This second argument is optional, but when
  1160. present should be separated from the first by the three
  1161. Telnet characters <SP> R <SP>. This command shall be
  1162. followed by a STORe or APPEnd command. The ALLO command
  1163. should be treated as a NOOP (no operation) by those servers
  1164. which do not require that the maximum size of the file be
  1165. declared beforehand, and those servers interested in only
  1166. the maximum record or page size should accept a dummy value
  1167. in the first argument and ignore it.
  1168. RESTART (REST)
  1169. The argument field represents the server marker at which
  1170. file transfer is to be restarted. This command does not
  1171. cause file transfer but skips over the file to the specified
  1172. data checkpoint. This command shall be immediately followed
  1173. by the appropriate FTP service command which shall cause
  1174. file transfer to resume.
  1175. RENAME FROM (RNFR)
  1176. This command specifies the old pathname of the file which is
  1177. to be renamed. This command must be immediately followed by
  1178. a "rename to" command specifying the new file pathname.
  1179. RENAME TO (RNTO)
  1180. This command specifies the new pathname of the file
  1181. specified in the immediately preceding "rename from"
  1182. command. Together the two commands cause a file to be
  1183. renamed.
  1184. ABORT (ABOR)
  1185. This command tells the server to abort the previous FTP
  1186. service command and any associated transfer of data. The
  1187. abort command may require "special action", as discussed in
  1188. the Section on FTP Commands, to force recognition by the
  1189. server. No action is to be taken if the previous command
  1190. has been completed (including data transfer). The control
  1191. connection is not to be closed by the server, but the data
  1192. connection must be closed.
  1193. There are two cases for the server upon receipt of this
  1194. command: (1) the FTP service command was already completed,
  1195. or (2) the FTP service command is still in progress.
  1196. Postel & Reynolds [Page 31]
  1197. RFC 959 October 1985
  1198. File Transfer Protocol
  1199. In the first case, the server closes the data connection
  1200. (if it is open) and responds with a 226 reply, indicating
  1201. that the abort command was successfully processed.
  1202. In the second case, the server aborts the FTP service in
  1203. progress and closes the data connection, returning a 426
  1204. reply to indicate that the service request terminated
  1205. abnormally. The server then sends a 226 reply,
  1206. indicating that the abort command was successfully
  1207. processed.
  1208. DELETE (DELE)
  1209. This command causes the file specified in the pathname to be
  1210. deleted at the server site. If an extra level of protection
  1211. is desired (such as the query, "Do you really wish to
  1212. delete?"), it should be provided by the user-FTP process.
  1213. REMOVE DIRECTORY (RMD)
  1214. This command causes the directory specified in the pathname
  1215. to be removed as a directory (if the pathname is absolute)
  1216. or as a subdirectory of the current working directory (if
  1217. the pathname is relative). See Appendix II.
  1218. MAKE DIRECTORY (MKD)
  1219. This command causes the directory specified in the pathname
  1220. to be created as a directory (if the pathname is absolute)
  1221. or as a subdirectory of the current working directory (if
  1222. the pathname is relative). See Appendix II.
  1223. PRINT WORKING DIRECTORY (PWD)
  1224. This command causes the name of the current working
  1225. directory to be returned in the reply. See Appendix II.
  1226. LIST (LIST)
  1227. This command causes a list to be sent from the server to the
  1228. passive DTP. If the pathname specifies a directory or other
  1229. group of files, the server should transfer a list of files
  1230. in the specified directory. If the pathname specifies a
  1231. file then the server should send current information on the
  1232. file. A null argument implies the user's current working or
  1233. default directory. The data transfer is over the data
  1234. connection in type ASCII or type EBCDIC. (The user must
  1235. Postel & Reynolds [Page 32]
  1236. RFC 959 October 1985
  1237. File Transfer Protocol
  1238. ensure that the TYPE is appropriately ASCII or EBCDIC).
  1239. Since the information on a file may vary widely from system
  1240. to system, this information may be hard to use automatically
  1241. in a program, but may be quite useful to a human user.
  1242. NAME LIST (NLST)
  1243. This command causes a directory listing to be sent from
  1244. server to user site. The pathname should specify a
  1245. directory or other system-specific file group descriptor; a
  1246. null argument implies the current directory. The server
  1247. will return a stream of names of files and no other
  1248. information. The data will be transferred in ASCII or
  1249. EBCDIC type over the data connection as valid pathname
  1250. strings separated by <CRLF> or <NL>. (Again the user must
  1251. ensure that the TYPE is correct.) This command is intended
  1252. to return information that can be used by a program to
  1253. further process the files automatically. For example, in
  1254. the implementation of a "multiple get" function.
  1255. SITE PARAMETERS (SITE)
  1256. This command is used by the server to provide services
  1257. specific to his system that are essential to file transfer
  1258. but not sufficiently universal to be included as commands in
  1259. the protocol. The nature of these services and the
  1260. specification of their syntax can be stated in a reply to
  1261. the HELP SITE command.
  1262. SYSTEM (SYST)
  1263. This command is used to find out the type of operating
  1264. system at the server. The reply shall have as its first
  1265. word one of the system names listed in the current version
  1266. of the Assigned Numbers document [4].
  1267. STATUS (STAT)
  1268. This command shall cause a status response to be sent over
  1269. the control connection in the form of a reply. The command
  1270. may be sent during a file transfer (along with the Telnet IP
  1271. and Synch signals--see the Section on FTP Commands) in which
  1272. case the server will respond with the status of the
  1273. operation in progress, or it may be sent between file
  1274. transfers. In the latter case, the command may have an
  1275. argument field. If the argument is a pathname, the command
  1276. is analogous to the "list" command except that data shall be
  1277. Postel & Reynolds [Page 33]
  1278. RFC 959 October 1985
  1279. File Transfer Protocol
  1280. transferred over the control connection. If a partial
  1281. pathname is given, the server may respond with a list of
  1282. file names or attributes associated with that specification.
  1283. If no argument is given, the server should return general
  1284. status information about the server FTP process. This
  1285. should include current values of all transfer parameters and
  1286. the status of connections.
  1287. HELP (HELP)
  1288. This command shall cause the server to send helpful
  1289. information regarding its implementation status over the
  1290. control connection to the user. The command may take an
  1291. argument (e.g., any command name) and return more specific
  1292. information as a response. The reply is type 211 or 214.
  1293. It is suggested that HELP be allowed before entering a USER
  1294. command. The server may use this reply to specify
  1295. site-dependent parameters, e.g., in response to HELP SITE.
  1296. NOOP (NOOP)
  1297. This command does not affect any parameters or previously
  1298. entered commands. It specifies no action other than that the
  1299. server send an OK reply.
  1300. The File Transfer Protocol follows the specifications of the Telnet
  1301. protocol for all communications over the control connection. Since
  1302. the language used for Telnet communication may be a negotiated
  1303. option, all references in the next two sections will be to the
  1304. "Telnet language" and the corresponding "Telnet end-of-line code".
  1305. Currently, one may take these to mean NVT-ASCII and <CRLF>. No other
  1306. specifications of the Telnet protocol will be cited.
  1307. FTP commands are "Telnet strings" terminated by the "Telnet end of
  1308. line code". The command codes themselves are alphabetic characters
  1309. terminated by the character <SP> (Space) if parameters follow and
  1310. Telnet-EOL otherwise. The command codes and the semantics of
  1311. commands are described in this section; the detailed syntax of
  1312. commands is specified in the Section on Commands, the reply sequences
  1313. are discussed in the Section on Sequencing of Commands and Replies,
  1314. and scenarios illustrating the use of commands are provided in the
  1315. Section on Typical FTP Scenarios.
  1316. FTP commands may be partitioned as those specifying access-control
  1317. identifiers, data transfer parameters, or FTP service requests.
  1318. Certain commands (such as ABOR, STAT, QUIT) may be sent over the
  1319. control connection while a data transfer is in progress. Some
  1320. Postel & Reynolds [Page 34]
  1321. RFC 959 October 1985
  1322. File Transfer Protocol
  1323. servers may not be able to monitor the control and data connections
  1324. simultaneously, in which case some special action will be necessary
  1325. to get the server's attention. The following ordered format is
  1326. tentatively recommended:
  1327. 1. User system inserts the Telnet "Interrupt Process" (IP) signal
  1328. in the Telnet stream.
  1329. 2. User system sends the Telnet "Synch" signal.
  1330. 3. User system inserts the command (e.g., ABOR) in the Telnet
  1331. stream.
  1332. 4. Server PI, after receiving "IP", scans the Telnet stream for
  1333. EXACTLY ONE FTP command.
  1334. (For other servers this may not be necessary but the actions listed
  1335. above should have no unusual effect.)
  1336. 4.2. FTP REPLIES
  1337. Replies to File Transfer Protocol commands are devised to ensure
  1338. the synchronization of requests and actions in the process of file
  1339. transfer, and to guarantee that the user process always knows the
  1340. state of the Server. Every command must generate at least one
  1341. reply, although there may be more than one; in the latter case,
  1342. the multiple replies must be easily distinguished. In addition,
  1343. some commands occur in sequential groups, such as USER, PASS and
  1344. ACCT, or RNFR and RNTO. The replies show the existence of an
  1345. intermediate state if all preceding commands have been successful.
  1346. A failure at any point in the sequence necessitates the repetition
  1347. of the entire sequence from the beginning.
  1348. The details of the command-reply sequence are made explicit in
  1349. a set of state diagrams below.
  1350. An FTP reply consists of a three digit number (transmitted as
  1351. three alphanumeric characters) followed by some text. The number
  1352. is intended for use by automata to determine what state to enter
  1353. next; the text is intended for the human user. It is intended
  1354. that the three digits contain enough encoded information that the
  1355. user-process (the User-PI) will not need to examine the text and
  1356. may either discard it or pass it on to the user, as appropriate.
  1357. In particular, the text may be server-dependent, so there are
  1358. likely to be varying texts for each reply code.
  1359. A reply is defined to contain the 3-digit code, followed by Space
  1360. Postel & Reynolds [Page 35]
  1361. RFC 959 October 1985
  1362. File Transfer Protocol
  1363. <SP>, followed by one line of text (where some maximum line length
  1364. has been specified), and terminated by the Telnet end-of-line
  1365. code. There will be cases however, where the text is longer than
  1366. a single line. In these cases the complete text must be bracketed
  1367. so the User-process knows when it may stop reading the reply (i.e.
  1368. stop processing input on the control connection) and go do other
  1369. things. This requires a special format on the first line to
  1370. indicate that more than one line is coming, and another on the
  1371. last line to designate it as the last. At least one of these must
  1372. contain the appropriate reply code to indicate the state of the
  1373. transaction. To satisfy all factions, it was decided that both
  1374. the first and last line codes should be the same.
  1375. Thus the format for multi-line replies is that the first line
  1376. will begin with the exact required reply code, followed
  1377. immediately by a Hyphen, "-" (also known as Minus), followed by
  1378. text. The last line will begin with the same code, followed
  1379. immediately by Space <SP>, optionally some text, and the Telnet
  1380. end-of-line code.
  1381. For example:
  1382. 123-First line
  1383. Second line
  1384. 234 A line beginning with numbers
  1385. 123 The last line
  1386. The user-process then simply needs to search for the second
  1387. occurrence of the same reply code, followed by <SP> (Space), at
  1388. the beginning of a line, and ignore all intermediary lines. If
  1389. an intermediary line begins with a 3-digit number, the Server
  1390. must pad the front to avoid confusion.
  1391. This scheme allows standard system routines to be used for
  1392. reply information (such as for the STAT reply), with
  1393. "artificial" first and last lines tacked on. In rare cases
  1394. where these routines are able to generate three digits and a
  1395. Space at the beginning of any line, the beginning of each
  1396. text line should be offset by some neutral text, like Space.
  1397. This scheme assumes that multi-line replies may not be nested.
  1398. The three digits of the reply each have a special significance.
  1399. This is intended to allow a range of very simple to very
  1400. sophisticated responses by the user-process. The first digit
  1401. denotes whether the response is good, bad or incomplete.
  1402. (Referring to the state diagram), an unsophisticated user-process
  1403. will be able to determine its next action (proceed as planned,
  1404. Postel & Reynolds [Page 36]
  1405. RFC 959 October 1985
  1406. File Transfer Protocol
  1407. redo, retrench, etc.) by simply examining this first digit. A
  1408. user-process that wants to know approximately what kind of error
  1409. occurred (e.g. file system error, command syntax error) may
  1410. examine the second digit, reserving the third digit for the finest
  1411. gradation of information (e.g., RNTO command without a preceding
  1412. RNFR).
  1413. There are five values for the first digit of the reply code:
  1414. 1yz Positive Preliminary reply
  1415. The requested action is being initiated; expect another
  1416. reply before proceeding with a new command. (The
  1417. user-process sending another command before the
  1418. completion reply would be in violation of protocol; but
  1419. server-FTP processes should queue any commands that
  1420. arrive while a preceding command is in progress.) This
  1421. type of reply can be used to indicate that the command
  1422. was accepted and the user-process may now pay attention
  1423. to the data connections, for implementations where
  1424. simultaneous monitoring is difficult. The server-FTP
  1425. process may send at most, one 1yz reply per command.
  1426. 2yz Positive Completion reply
  1427. The requested action has been successfully completed. A
  1428. new request may be initiated.
  1429. 3yz Positive Intermediate reply
  1430. The command has been accepted, but the requested action
  1431. is being held in abeyance, pending receipt of further
  1432. information. The user should send another command
  1433. specifying this information. This reply is used in
  1434. command sequence groups.
  1435. 4yz Transient Negative Completion reply
  1436. The command was not accepted and the requested action did
  1437. not take place, but the error condition is temporary and
  1438. the action may be requested again. The user should
  1439. return to the beginning of the command sequence, if any.
  1440. It is difficult to assign a meaning to "transient",
  1441. particularly when two distinct sites (Server- and
  1442. User-processes) have to agree on the interpretation.
  1443. Each reply in the 4yz category might have a slightly
  1444. different time value, but the intent is that the
  1445. Postel & Reynolds [Page 37]
  1446. RFC 959 October 1985
  1447. File Transfer Protocol
  1448. user-process is encouraged to try again. A rule of thumb
  1449. in determining if a reply fits into the 4yz or the 5yz
  1450. (Permanent Negative) category is that replies are 4yz if
  1451. the commands can be repeated without any change in
  1452. command form or in properties of the User or Server
  1453. (e.g., the command is spelled the same with the same
  1454. arguments used; the user does not change his file access
  1455. or user name; the server does not put up a new
  1456. implementation.)
  1457. 5yz Permanent Negative Completion reply
  1458. The command was not accepted and the requested action did
  1459. not take place. The User-process is discouraged from
  1460. repeating the exact request (in the same sequence). Even
  1461. some "permanent" error conditions can be corrected, so
  1462. the human user may want to direct his User-process to
  1463. reinitiate the command sequence by direct action at some
  1464. point in the future (e.g., after the spelling has been
  1465. changed, or the user has altered his directory status.)
  1466. The following function groupings are encoded in the second
  1467. digit:
  1468. x0z Syntax - These replies refer to syntax errors,
  1469. syntactically correct commands that don't fit any
  1470. functional category, unimplemented or superfluous
  1471. commands.
  1472. x1z Information - These are replies to requests for
  1473. information, such as status or help.
  1474. x2z Connections - Replies referring to the control and
  1475. data connections.
  1476. x3z Authentication and accounting - Replies for the login
  1477. process and accounting procedures.
  1478. x4z Unspecified as yet.
  1479. x5z File system - These replies indicate the status of the
  1480. Server file system vis-a-vis the requested transfer or
  1481. other file system action.
  1482. The third digit gives a finer gradation of meaning in each of
  1483. the function categories, specified by the second digit. The
  1484. list of replies below will illustrate this. Note that the text
  1485. Postel & Reynolds [Page 38]
  1486. RFC 959 October 1985
  1487. File Transfer Protocol
  1488. associated with each reply is recommended, rather than
  1489. mandatory, and may even change according to the command with
  1490. which it is associated. The reply codes, on the other hand,
  1491. must strictly follow the specifications in the last section;
  1492. that is, Server implementations should not invent new codes for
  1493. situations that are only slightly different from the ones
  1494. described here, but rather should adapt codes already defined.
  1495. A command such as TYPE or ALLO whose successful execution
  1496. does not offer the user-process any new information will
  1497. cause a 200 reply to be returned. If the command is not
  1498. implemented by a particular Server-FTP process because it
  1499. has no relevance to that computer system, for example ALLO
  1500. at a TOPS20 site, a Positive Completion reply is still
  1501. desired so that the simple User-process knows it can proceed
  1502. with its course of action. A 202 reply is used in this case
  1503. with, for example, the reply text: "No storage allocation
  1504. necessary." If, on the other hand, the command requests a
  1505. non-site-specific action and is unimplemented, the response
  1506. is 502. A refinement of that is the 504 reply for a command
  1507. that is implemented, but that requests an unimplemented
  1508. parameter.
  1509. 4.2.1 Reply Codes by Function Groups
  1510. 200 Command okay.
  1511. 500 Syntax error, command unrecognized.
  1512. This may include errors such as command line too long.
  1513. 501 Syntax error in parameters or arguments.
  1514. 202 Command not implemented, superfluous at this site.
  1515. 502 Command not implemented.
  1516. 503 Bad sequence of commands.
  1517. 504 Command not implemented for that parameter.
  1518. Postel & Reynolds [Page 39]
  1519. RFC 959 October 1985
  1520. File Transfer Protocol
  1521. 110 Restart marker reply.
  1522. In this case, the text is exact and not left to the
  1523. particular implementation; it must read:
  1524. MARK yyyy = mmmm
  1525. Where yyyy is User-process data stream marker, and mmmm
  1526. server's equivalent marker (note the spaces between markers
  1527. and "=").
  1528. 211 System status, or system help reply.
  1529. 212 Directory status.
  1530. 213 File status.
  1531. 214 Help message.
  1532. On how to use the server or the meaning of a particular
  1533. non-standard command. This reply is useful only to the
  1534. human user.
  1535. 215 NAME system type.
  1536. Where NAME is an official system name from the list in the
  1537. Assigned Numbers document.
  1538. 120 Service ready in nnn minutes.
  1539. 220 Service ready for new user.
  1540. 221 Service closing control connection.
  1541. Logged out if appropriate.
  1542. 421 Service not available, closing control connection.
  1543. This may be a reply to any command if the service knows it
  1544. must shut down.
  1545. 125 Data connection already open; transfer starting.
  1546. 225 Data connection open; no transfer in progress.
  1547. 425 Can't open data connection.
  1548. 226 Closing data connection.
  1549. Requested file action successful (for example, file
  1550. transfer or file abort).
  1551. 426 Connection closed; transfer aborted.
  1552. 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).
  1553. 230 User logged in, proceed.
  1554. 530 Not logged in.
  1555. 331 User name okay, need password.
  1556. 332 Need account for login.
  1557. 532 Need account for storing files.
  1558. Postel & Reynolds [Page 40]
  1559. RFC 959 October 1985
  1560. File Transfer Protocol
  1561. 150 File status okay; about to open data connection.
  1562. 250 Requested file action okay, completed.
  1563. 257 "PATHNAME" created.
  1564. 350 Requested file action pending further information.
  1565. 450 Requested file action not taken.
  1566. File unavailable (e.g., file busy).
  1567. 550 Requested action not taken.
  1568. File unavailable (e.g., file not found, no access).
  1569. 451 Requested action aborted. Local error in processing.
  1570. 551 Requested action aborted. Page type unknown.
  1571. 452 Requested action not taken.
  1572. Insufficient storage space in system.
  1573. 552 Requested file action aborted.
  1574. Exceeded storage allocation (for current directory or
  1575. dataset).
  1576. 553 Requested action not taken.
  1577. File name not allowed.
  1578. 4.2.2 Numeric Order List of Reply Codes
  1579. 110 Restart marker reply.
  1580. In this case, the text is exact and not left to the
  1581. particular implementation; it must read:
  1582. MARK yyyy = mmmm
  1583. Where yyyy is User-process data stream marker, and mmmm
  1584. server's equivalent marker (note the spaces between markers
  1585. and "=").
  1586. 120 Service ready in nnn minutes.
  1587. 125 Data connection already open; transfer starting.
  1588. 150 File status okay; about to open data connection.
  1589. Postel & Reynolds [Page 41]
  1590. RFC 959 October 1985
  1591. File Transfer Protocol
  1592. 200 Command okay.
  1593. 202 Command not implemented, superfluous at this site.
  1594. 211 System status, or system help reply.
  1595. 212 Directory status.
  1596. 213 File status.
  1597. 214 Help message.
  1598. On how to use the server or the meaning of a particular
  1599. non-standard command. This reply is useful only to the
  1600. human user.
  1601. 215 NAME system type.
  1602. Where NAME is an official system name from the list in the
  1603. Assigned Numbers document.
  1604. 220 Service ready for new user.
  1605. 221 Service closing control connection.
  1606. Logged out if appropriate.
  1607. 225 Data connection open; no transfer in progress.
  1608. 226 Closing data connection.
  1609. Requested file action successful (for example, file
  1610. transfer or file abort).
  1611. 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).
  1612. 230 User logged in, proceed.
  1613. 250 Requested file action okay, completed.
  1614. 257 "PATHNAME" created.
  1615. 331 User name okay, need password.
  1616. 332 Need account for login.
  1617. 350 Requested file action pending further information.
  1618. 421 Service not available, closing control connection.
  1619. This may be a reply to any command if the service knows it
  1620. must shut down.
  1621. 425 Can't open data connection.
  1622. 426 Connection closed; transfer aborted.
  1623. 450 Requested file action not taken.
  1624. File unavailable (e.g., file busy).
  1625. 451 Requested action aborted: local error in processing.
  1626. 452 Requested action not taken.
  1627. Insufficient storage space in system.
  1628. Postel & Reynolds [Page 42]
  1629. RFC 959 October 1985
  1630. File Transfer Protocol
  1631. 500 Syntax error, command unrecognized.
  1632. This may include errors such as command line too long.
  1633. 501 Syntax error in parameters or arguments.
  1634. 502 Command not implemented.
  1635. 503 Bad sequence of commands.
  1636. 504 Command not implemented for that parameter.
  1637. 530 Not logged in.
  1638. 532 Need account for storing files.
  1639. 550 Requested action not taken.
  1640. File unavailable (e.g., file not found, no access).
  1641. 551 Requested action aborted: page type unknown.
  1642. 552 Requested file action aborted.
  1643. Exceeded storage allocation (for current directory or
  1644. dataset).
  1645. 553 Requested action not taken.
  1646. File name not allowed.
  1647. 5. DECLARATIVE SPECIFICATIONS
  1648. 5.1. MINIMUM IMPLEMENTATION
  1649. In order to make FTP workable without needless error messages, the
  1650. following minimum implementation is required for all servers:
  1651. TYPE - ASCII Non-print
  1652. MODE - Stream
  1653. STRUCTURE - File, Record
  1654. COMMANDS - USER, QUIT, PORT,
  1655. TYPE, MODE, STRU,
  1656. for the default values
  1657. RETR, STOR,
  1658. NOOP.
  1659. The default values for transfer parameters are:
  1660. TYPE - ASCII Non-print
  1661. MODE - Stream
  1662. STRU - File
  1663. All hosts must accept the above as the standard defaults.
  1664. Postel & Reynolds [Page 43]
  1665. RFC 959 October 1985
  1666. File Transfer Protocol
  1667. 5.2. CONNECTIONS
  1668. The server protocol interpreter shall "listen" on Port L. The
  1669. user or user protocol interpreter shall initiate the full-duplex
  1670. control connection. Server- and user- processes should follow the
  1671. conventions of the Telnet protocol as specified in the
  1672. ARPA-Internet Protocol Handbook [1]. Servers are under no
  1673. obligation to provide for editing of command lines and may require
  1674. that it be done in the user host. The control connection shall be
  1675. closed by the server at the user's request after all transfers and
  1676. replies are completed.
  1677. The user-DTP must "listen" on the specified data port; this may be
  1678. the default user port (U) or a port specified in the PORT command.
  1679. The server shall initiate the data connection from his own default
  1680. data port (L-1) using the specified user data port. The direction
  1681. of the transfer and the port used will be determined by the FTP
  1682. service command.
  1683. Note that all FTP implementation must support data transfer using
  1684. the default port, and that only the USER-PI may initiate the use
  1685. of non-default ports.
  1686. When data is to be transferred between two servers, A and B (refer
  1687. to Figure 2), the user-PI, C, sets up control connections with
  1688. both server-PI's. One of the servers, say A, is then sent a PASV
  1689. command telling him to "listen" on his data port rather than
  1690. initiate a connection when he receives a transfer service command.
  1691. When the user-PI receives an acknowledgment to the PASV command,
  1692. which includes the identity of the host and port being listened
  1693. on, the user-PI then sends A's port, a, to B in a PORT command; a
  1694. reply is returned. The user-PI may then send the corresponding
  1695. service commands to A and B. Server B initiates the connection
  1696. and the transfer proceeds. The command-reply sequence is listed
  1697. below where the messages are vertically synchronous but
  1698. horizontally asynchronous:
  1699. Postel & Reynolds [Page 44]
  1700. RFC 959 October 1985
  1701. File Transfer Protocol
  1702. User-PI - Server A User-PI - Server B
  1703. ------------------ ------------------
  1704. C->A : Connect C->B : Connect
  1705. C->A : PASV
  1706. A->C : 227 Entering Passive Mode. A1,A2,A3,A4,a1,a2
  1707. C->B : PORT A1,A2,A3,A4,a1,a2
  1708. B->C : 200 Okay
  1709. C->A : STOR C->B : RETR
  1710. B->A : Connect to HOST-A, PORT-a
  1711. Figure 3
  1712. The data connection shall be closed by the server under the
  1713. conditions described in the Section on Establishing Data
  1714. Connections. If the data connection is to be closed following a
  1715. data transfer where closing the connection is not required to
  1716. indicate the end-of-file, the server must do so immediately.
  1717. Waiting until after a new transfer command is not permitted
  1718. because the user-process will have already tested the data
  1719. connection to see if it needs to do a "listen"; (remember that the
  1720. user must "listen" on a closed data port BEFORE sending the
  1721. transfer request). To prevent a race condition here, the server
  1722. sends a reply (226) after closing the data connection (or if the
  1723. connection is left open, a "file transfer completed" reply (250)
  1724. and the user-PI should wait for one of these replies before
  1725. issuing a new transfer command).
  1726. Any time either the user or server see that the connection is
  1727. being closed by the other side, it should promptly read any
  1728. remaining data queued on the connection and issue the close on its
  1729. own side.
  1730. 5.3. COMMANDS
  1731. The commands are Telnet character strings transmitted over the
  1732. control connections as described in the Section on FTP Commands.
  1733. The command functions and semantics are described in the Section
  1734. on Access Control Commands, Transfer Parameter Commands, FTP
  1735. Service Commands, and Miscellaneous Commands. The command syntax
  1736. is specified here.
  1737. The commands begin with a command code followed by an argument
  1738. field. The command codes are four or fewer alphabetic characters.
  1739. Upper and lower case alphabetic characters are to be treated
  1740. identically. Thus, any of the following may represent the
  1741. retrieve command:
  1742. Postel & Reynolds [Page 45]
  1743. RFC 959 October 1985
  1744. File Transfer Protocol
  1745. RETR Retr retr ReTr rETr
  1746. This also applies to any symbols representing parameter values,
  1747. such as A or a for ASCII TYPE. The command codes and the argument
  1748. fields are separated by one or more spaces.
  1749. The argument field consists of a variable length character string
  1750. ending with the character sequence <CRLF> (Carriage Return, Line
  1751. Feed) for NVT-ASCII representation; for other negotiated languages
  1752. a different end of line character might be used. It should be
  1753. noted that the server is to take no action until the end of line
  1754. code is received.
  1755. The syntax is specified below in NVT-ASCII. All characters in the
  1756. argument field are ASCII characters including any ASCII
  1757. represented decimal integers. Square brackets denote an optional
  1758. argument field. If the option is not taken, the appropriate
  1759. default is implied.
  1760. Postel & Reynolds [Page 46]
  1761. RFC 959 October 1985
  1762. File Transfer Protocol
  1763. 5.3.1. FTP COMMANDS
  1764. The following are the FTP commands:
  1765. USER <SP> <username> <CRLF>
  1766. PASS <SP> <password> <CRLF>
  1767. ACCT <SP> <account-information> <CRLF>
  1768. CWD <SP> <pathname> <CRLF>
  1769. CDUP <CRLF>
  1770. SMNT <SP> <pathname> <CRLF>
  1771. QUIT <CRLF>
  1772. REIN <CRLF>
  1773. PORT <SP> <host-port> <CRLF>
  1774. PASV <CRLF>
  1775. TYPE <SP> <type-code> <CRLF>
  1776. STRU <SP> <structure-code> <CRLF>
  1777. MODE <SP> <mode-code> <CRLF>
  1778. RETR <SP> <pathname> <CRLF>
  1779. STOR <SP> <pathname> <CRLF>
  1780. STOU <CRLF>
  1781. APPE <SP> <pathname> <CRLF>
  1782. ALLO <SP> <decimal-integer>
  1783. [<SP> R <SP> <decimal-integer>] <CRLF>
  1784. REST <SP> <marker> <CRLF>
  1785. RNFR <SP> <pathname> <CRLF>
  1786. RNTO <SP> <pathname> <CRLF>
  1787. ABOR <CRLF>
  1788. DELE <SP> <pathname> <CRLF>
  1789. RMD <SP> <pathname> <CRLF>
  1790. MKD <SP> <pathname> <CRLF>
  1791. PWD <CRLF>
  1792. LIST [<SP> <pathname>] <CRLF>
  1793. NLST [<SP> <pathname>] <CRLF>
  1794. SITE <SP> <string> <CRLF>
  1795. SYST <CRLF>
  1796. STAT [<SP> <pathname>] <CRLF>
  1797. HELP [<SP> <string>] <CRLF>
  1798. NOOP <CRLF>
  1799. Postel & Reynolds [Page 47]
  1800. RFC 959 October 1985
  1801. File Transfer Protocol
  1802. 5.3.2. FTP COMMAND ARGUMENTS
  1803. The syntax of the above argument fields (using BNF notation
  1804. where applicable) is:
  1805. <username> ::= <string>
  1806. <password> ::= <string>
  1807. <account-information> ::= <string>
  1808. <string> ::= <char> | <char><string>
  1809. <char> ::= any of the 128 ASCII characters except <CR> and
  1810. <LF>
  1811. <marker> ::= <pr-string>
  1812. <pr-string> ::= <pr-char> | <pr-char><pr-string>
  1813. <pr-char> ::= printable characters, any
  1814. ASCII code 33 through 126
  1815. <byte-size> ::= <number>
  1816. <host-port> ::= <host-number>,<port-number>
  1817. <host-number> ::= <number>,<number>,<number>,<number>
  1818. <port-number> ::= <number>,<number>
  1819. <number> ::= any decimal integer 1 through 255
  1820. <form-code> ::= N | T | C
  1821. <type-code> ::= A [<sp> <form-code>]
  1822. | E [<sp> <form-code>]
  1823. | I
  1824. | L <sp> <byte-size>
  1825. <structure-code> ::= F | R | P
  1826. <mode-code> ::= S | B | C
  1827. <pathname> ::= <string>
  1828. <decimal-integer> ::= any decimal integer
  1829. Postel & Reynolds [Page 48]
  1830. RFC 959 October 1985
  1831. File Transfer Protocol
  1832. 5.4. SEQUENCING OF COMMANDS AND REPLIES
  1833. The communication between the user and server is intended to be an
  1834. alternating dialogue. As such, the user issues an FTP command and
  1835. the server responds with a prompt primary reply. The user should
  1836. wait for this initial primary success or failure response before
  1837. sending further commands.
  1838. Certain commands require a second reply for which the user should
  1839. also wait. These replies may, for example, report on the progress
  1840. or completion of file transfer or the closing of the data
  1841. connection. They are secondary replies to file transfer commands.
  1842. One important group of informational replies is the connection
  1843. greetings. Under normal circumstances, a server will send a 220
  1844. reply, "awaiting input", when the connection is completed. The
  1845. user should wait for this greeting message before sending any
  1846. commands. If the server is unable to accept input right away, a
  1847. 120 "expected delay" reply should be sent immediately and a 220
  1848. reply when ready. The user will then know not to hang up if there
  1849. is a delay.
  1850. Spontaneous Replies
  1851. Sometimes "the system" spontaneously has a message to be sent
  1852. to a user (usually all users). For example, "System going down
  1853. in 15 minutes". There is no provision in FTP for such
  1854. spontaneous information to be sent from the server to the user.
  1855. It is recommended that such information be queued in the
  1856. server-PI and delivered to the user-PI in the next reply
  1857. (possibly making it a multi-line reply).
  1858. The table below lists alternative success and failure replies for
  1859. each command. These must be strictly adhered to; a server may
  1860. substitute text in the replies, but the meaning and action implied
  1861. by the code numbers and by the specific command reply sequence
  1862. cannot be altered.
  1863. Command-Reply Sequences
  1864. In this section, the command-reply sequence is presented. Each
  1865. command is listed with its possible replies; command groups are
  1866. listed together. Preliminary replies are listed first (with
  1867. their succeeding replies indented and under them), then
  1868. positive and negative completion, and finally intermediary
  1869. Postel & Reynolds [Page 49]
  1870. RFC 959 October 1985
  1871. File Transfer Protocol
  1872. replies with the remaining commands from the sequence
  1873. following. This listing forms the basis for the state
  1874. diagrams, which will be presented separately.
  1875. Connection Establishment
  1876. 120
  1877. 220
  1878. 220
  1879. 421
  1880. Login
  1881. USER
  1882. 230
  1883. 530
  1884. 500, 501, 421
  1885. 331, 332
  1886. PASS
  1887. 230
  1888. 202
  1889. 530
  1890. 500, 501, 503, 421
  1891. 332
  1892. ACCT
  1893. 230
  1894. 202
  1895. 530
  1896. 500, 501, 503, 421
  1897. CWD
  1898. 250
  1899. 500, 501, 502, 421, 530, 550
  1900. CDUP
  1901. 200
  1902. 500, 501, 502, 421, 530, 550
  1903. SMNT
  1904. 202, 250
  1905. 500, 501, 502, 421, 530, 550
  1906. Logout
  1907. REIN
  1908. 120
  1909. 220
  1910. 220
  1911. 421
  1912. 500, 502
  1913. QUIT
  1914. 221
  1915. 500
  1916. Postel & Reynolds [Page 50]
  1917. RFC 959 October 1985
  1918. File Transfer Protocol
  1919. Transfer parameters
  1920. PORT
  1921. 200
  1922. 500, 501, 421, 530
  1923. PASV
  1924. 227
  1925. 500, 501, 502, 421, 530
  1926. MODE
  1927. 200
  1928. 500, 501, 504, 421, 530
  1929. TYPE
  1930. 200
  1931. 500, 501, 504, 421, 530
  1932. STRU
  1933. 200
  1934. 500, 501, 504, 421, 530
  1935. File action commands
  1936. ALLO
  1937. 200
  1938. 202
  1939. 500, 501, 504, 421, 530
  1940. REST
  1941. 500, 501, 502, 421, 530
  1942. 350
  1943. STOR
  1944. 125, 150
  1945. (110)
  1946. 226, 250
  1947. 425, 426, 451, 551, 552
  1948. 532, 450, 452, 553
  1949. 500, 501, 421, 530
  1950. STOU
  1951. 125, 150
  1952. (110)
  1953. 226, 250
  1954. 425, 426, 451, 551, 552
  1955. 532, 450, 452, 553
  1956. 500, 501, 421, 530
  1957. RETR
  1958. 125, 150
  1959. (110)
  1960. 226, 250
  1961. 425, 426, 451
  1962. 450, 550
  1963. 500, 501, 421, 530
  1964. Postel & Reynolds [Page 51]
  1965. RFC 959 October 1985
  1966. File Transfer Protocol
  1967. LIST
  1968. 125, 150
  1969. 226, 250
  1970. 425, 426, 451
  1971. 450
  1972. 500, 501, 502, 421, 530
  1973. NLST
  1974. 125, 150
  1975. 226, 250
  1976. 425, 426, 451
  1977. 450
  1978. 500, 501, 502, 421, 530
  1979. APPE
  1980. 125, 150
  1981. (110)
  1982. 226, 250
  1983. 425, 426, 451, 551, 552
  1984. 532, 450, 550, 452, 553
  1985. 500, 501, 502, 421, 530
  1986. RNFR
  1987. 450, 550
  1988. 500, 501, 502, 421, 530
  1989. 350
  1990. RNTO
  1991. 250
  1992. 532, 553
  1993. 500, 501, 502, 503, 421, 530
  1994. DELE
  1995. 250
  1996. 450, 550
  1997. 500, 501, 502, 421, 530
  1998. RMD
  1999. 250
  2000. 500, 501, 502, 421, 530, 550
  2001. MKD
  2002. 257
  2003. 500, 501, 502, 421, 530, 550
  2004. PWD
  2005. 257
  2006. 500, 501, 502, 421, 550
  2007. ABOR
  2008. 225, 226
  2009. 500, 501, 502, 421
  2010. Postel & Reynolds [Page 52]
  2011. RFC 959 October 1985
  2012. File Transfer Protocol
  2013. Informational commands
  2014. SYST
  2015. 215
  2016. 500, 501, 502, 421
  2017. STAT
  2018. 211, 212, 213
  2019. 450
  2020. 500, 501, 502, 421, 530
  2021. HELP
  2022. 211, 214
  2023. 500, 501, 502, 421
  2024. Miscellaneous commands
  2025. SITE
  2026. 200
  2027. 202
  2028. 500, 501, 530
  2029. NOOP
  2030. 200
  2031. 500 421
  2032. Postel & Reynolds [Page 53]
  2033. RFC 959 October 1985
  2034. File Transfer Protocol
  2035. 6. STATE DIAGRAMS
  2036. Here we present state diagrams for a very simple minded FTP
  2037. implementation. Only the first digit of the reply codes is used.
  2038. There is one state diagram for each group of FTP commands or command
  2039. sequences.
  2040. The command groupings were determined by constructing a model for
  2041. each command then collecting together the commands with structurally
  2042. identical models.
  2043. For each command or command sequence there are three possible
  2044. outcomes: success (S), failure (F), and error (E). In the state
  2045. diagrams below we use the symbol B for "begin", and the symbol W for
  2046. "wait for reply".
  2047. We first present the diagram that represents the largest group of FTP
  2048. commands:
  2049. 1,3 +---+
  2050. ----------->| E |
  2051. | +---+
  2052. |
  2053. +---+ cmd +---+ 2 +---+
  2054. | B |---------->| W |---------->| S |
  2055. +---+ +---+ +---+
  2056. |
  2057. | 4,5 +---+
  2058. ----------->| F |
  2059. +---+
  2060. This diagram models the commands:
  2061. ABOR, ALLO, DELE, CWD, CDUP, SMNT, HELP, MODE, NOOP, PASV,
  2062. QUIT, SITE, PORT, SYST, STAT, RMD, MKD, PWD, STRU, and TYPE.
  2063. Postel & Reynolds [Page 54]
  2064. RFC 959 October 1985
  2065. File Transfer Protocol
  2066. The other large group of commands is represented by a very similar
  2067. diagram:
  2068. 3 +---+
  2069. ----------->| E |
  2070. | +---+
  2071. |
  2072. +---+ cmd +---+ 2 +---+
  2073. | B |---------->| W |---------->| S |
  2074. +---+ --->+---+ +---+
  2075. | | |
  2076. | | | 4,5 +---+
  2077. | 1 | ----------->| F |
  2078. ----- +---+
  2079. This diagram models the commands:
  2080. APPE, LIST, NLST, REIN, RETR, STOR, and STOU.
  2081. Note that this second model could also be used to represent the first
  2082. group of commands, the only difference being that in the first group
  2083. the 100 series replies are unexpected and therefore treated as error,
  2084. while the second group expects (some may require) 100 series replies.
  2085. Remember that at most, one 100 series reply is allowed per command.
  2086. The remaining diagrams model command sequences, perhaps the simplest
  2087. of these is the rename sequence:
  2088. +---+ RNFR +---+ 1,2 +---+
  2089. | B |---------->| W |---------->| E |
  2090. +---+ +---+ -->+---+
  2091. | | |
  2092. 3 | | 4,5 |
  2093. -------------- ------ |
  2094. | | | +---+
  2095. | ------------->| S |
  2096. | | 1,3 | | +---+
  2097. | 2| --------
  2098. | | | |
  2099. V | | |
  2100. +---+ RNTO +---+ 4,5 ----->+---+
  2101. | |---------->| W |---------->| F |
  2102. +---+ +---+ +---+
  2103. Postel & Reynolds [Page 55]
  2104. RFC 959 October 1985
  2105. File Transfer Protocol
  2106. The next diagram is a simple model of the Restart command:
  2107. +---+ REST +---+ 1,2 +---+
  2108. | B |---------->| W |---------->| E |
  2109. +---+ +---+ -->+---+
  2110. | | |
  2111. 3 | | 4,5 |
  2112. -------------- ------ |
  2113. | | | +---+
  2114. | ------------->| S |
  2115. | | 3 | | +---+
  2116. | 2| --------
  2117. | | | |
  2118. V | | |
  2119. +---+ cmd +---+ 4,5 ----->+---+
  2120. | |---------->| W |---------->| F |
  2121. +---+ -->+---+ +---+
  2122. | |
  2123. | 1 |
  2124. ------
  2125. Where "cmd" is APPE, STOR, or RETR.
  2126. We note that the above three models are similar. The Restart differs
  2127. from the Rename two only in the treatment of 100 series replies at
  2128. the second stage, while the second group expects (some may require)
  2129. 100 series replies. Remember that at most, one 100 series reply is
  2130. allowed per command.
  2131. Postel & Reynolds [Page 56]
  2132. RFC 959 October 1985
  2133. File Transfer Protocol
  2134. The most complicated diagram is for the Login sequence:
  2135. 1
  2136. +---+ USER +---+------------->+---+
  2137. | B |---------->| W | 2 ---->| E |
  2138. +---+ +---+------ | -->+---+
  2139. | | | | |
  2140. 3 | | 4,5 | | |
  2141. -------------- ----- | | |
  2142. | | | | |
  2143. | | | | |
  2144. | --------- |
  2145. | 1| | | |
  2146. V | | | |
  2147. +---+ PASS +---+ 2 | ------>+---+
  2148. | |---------->| W |------------->| S |
  2149. +---+ +---+ ---------->+---+
  2150. | | | | |
  2151. 3 | |4,5| | |
  2152. -------------- -------- |
  2153. | | | | |
  2154. | | | | |
  2155. | -----------
  2156. | 1,3| | | |
  2157. V | 2| | |
  2158. +---+ ACCT +---+-- | ----->+---+
  2159. | |---------->| W | 4,5 -------->| F |
  2160. +---+ +---+------------->+---+
  2161. Postel & Reynolds [Page 57]
  2162. RFC 959 October 1985
  2163. File Transfer Protocol
  2164. Finally, we present a generalized diagram that could be used to model
  2165. the command and reply interchange:
  2166. ------------------------------------
  2167. | |
  2168. Begin | |
  2169. | V |
  2170. | +---+ cmd +---+ 2 +---+ |
  2171. -->| |------->| |---------->| | |
  2172. | | | W | | S |-----|
  2173. -->| | -->| |----- | | |
  2174. | +---+ | +---+ 4,5 | +---+ |
  2175. | | | | | | |
  2176. | | | 1| |3 | +---+ |
  2177. | | | | | | | | |
  2178. | | ---- | ---->| F |-----
  2179. | | | | |
  2180. | | | +---+
  2181. -------------------
  2182. |
  2183. |
  2184. V
  2185. End
  2186. Postel & Reynolds [Page 58]
  2187. RFC 959 October 1985
  2188. File Transfer Protocol
  2189. 7. TYPICAL FTP SCENARIO
  2190. User at host U wanting to transfer files to/from host S:
  2191. In general, the user will communicate to the server via a mediating
  2192. user-FTP process. The following may be a typical scenario. The
  2193. user-FTP prompts are shown in parentheses, '---->' represents
  2194. commands from host U to host S, and '<----' represents replies from
  2195. host S to host U.
  2196. LOCAL COMMANDS BY USER ACTION INVOLVED
  2197. ftp (host) multics<CR> Connect to host S, port L,
  2198. establishing control connections.
  2199. <---- 220 Service ready <CRLF>.
  2200. username Doe <CR> USER Doe<CRLF>---->
  2201. <---- 331 User name ok,
  2202. need password<CRLF>.
  2203. password mumble <CR> PASS mumble<CRLF>---->
  2204. <---- 230 User logged in<CRLF>.
  2205. retrieve (local type) ASCII<CR>
  2206. (local pathname) test 1 <CR> User-FTP opens local file in ASCII.
  2207. (for. pathname) test.pl1<CR> RETR test.pl1<CRLF> ---->
  2208. <---- 150 File status okay;
  2209. about to open data
  2210. connection<CRLF>.
  2211. Server makes data connection
  2212. to port U.
  2213. <---- 226 Closing data connection,
  2214. file transfer successful<CRLF>.
  2215. type Image<CR> TYPE I<CRLF> ---->
  2216. <---- 200 Command OK<CRLF>
  2217. store (local type) image<CR>
  2218. (local pathname) file dump<CR> User-FTP opens local file in Image.
  2219. (for.pathname) >udd>cn>fd<CR> STOR >udd>cn>fd<CRLF> ---->
  2220. <---- 550 Access denied<CRLF>
  2221. terminate QUIT <CRLF> ---->
  2222. Server closes all
  2223. connections.
  2224. 8. CONNECTION ESTABLISHMENT
  2225. The FTP control connection is established via TCP between the user
  2226. process port U and the server process port L. This protocol is
  2227. assigned the service port 21 (25 octal), that is L=21.
  2228. Postel & Reynolds [Page 59]
  2229. RFC 959 October 1985
  2230. File Transfer Protocol
  2231. APPENDIX I - PAGE STRUCTURE
  2232. The need for FTP to support page structure derives principally from
  2233. the need to support efficient transmission of files between TOPS-20
  2234. systems, particularly the files used by NLS.
  2235. The file system of TOPS-20 is based on the concept of pages. The
  2236. operating system is most efficient at manipulating files as pages.
  2237. The operating system provides an interface to the file system so that
  2238. many applications view files as sequential streams of characters.
  2239. However, a few applications use the underlying page structures
  2240. directly, and some of these create holey files.
  2241. A TOPS-20 disk file consists of four things: a pathname, a page
  2242. table, a (possibly empty) set of pages, and a set of attributes.
  2243. The pathname is specified in the RETR or STOR command. It includes
  2244. the directory name, file name, file name extension, and generation
  2245. number.
  2246. The page table contains up to 2**18 entries. Each entry may be
  2247. EMPTY, or may point to a page. If it is not empty, there are also
  2248. some page-specific access bits; not all pages of a file need have the
  2249. same access protection.
  2250. A page is a contiguous set of 512 words of 36 bits each.
  2251. The attributes of the file, in the File Descriptor Block (FDB),
  2252. contain such things as creation time, write time, read time, writer's
  2253. byte-size, end-of-file pointer, count of reads and writes, backup
  2254. system tape numbers, etc.
  2255. Note that there is NO requirement that entries in the page table be
  2256. contiguous. There may be empty page table slots between occupied
  2257. ones. Also, the end of file pointer is simply a number. There is no
  2258. requirement that it in fact point at the "last" datum in the file.
  2259. Ordinary sequential I/O calls in TOPS-20 will cause the end of file
  2260. pointer to be left after the last datum written, but other operations
  2261. may cause it not to be so, if a particular programming system so
  2262. requires.
  2263. In fact, in both of these special cases, "holey" files and
  2264. end-of-file pointers NOT at the end of the file, occur with NLS data
  2265. files.
  2266. Postel & Reynolds [Page 60]
  2267. RFC 959 October 1985
  2268. File Transfer Protocol
  2269. The TOPS-20 paged files can be sent with the FTP transfer parameters:
  2270. TYPE L 36, STRU P, and MODE S (in fact, any mode could be used).
  2271. Each page of information has a header. Each header field, which is a
  2272. logical byte, is a TOPS-20 word, since the TYPE is L 36.
  2273. The header fields are:
  2274. Word 0: Header Length.
  2275. The header length is 5.
  2276. Word 1: Page Index.
  2277. If the data is a disk file page, this is the number of that
  2278. page in the file's page map. Empty pages (holes) in the file
  2279. are simply not sent. Note that a hole is NOT the same as a
  2280. page of zeros.
  2281. Word 2: Data Length.
  2282. The number of data words in this page, following the header.
  2283. Thus, the total length of the transmission unit is the Header
  2284. Length plus the Data Length.
  2285. Word 3: Page Type.
  2286. A code for what type of chunk this is. A data page is type 3,
  2287. the FDB page is type 2.
  2288. Word 4: Page Access Control.
  2289. The access bits associated with the page in the file's page
  2290. map. (This full word quantity is put into AC2 of an SPACS by
  2291. the program reading from net to disk.)
  2292. After the header are Data Length data words. Data Length is
  2293. currently either 512 for a data page or 31 for an FDB. Trailing
  2294. zeros in a disk file page may be discarded, making Data Length less
  2295. than 512 in that case.
  2296. Postel & Reynolds [Page 61]
  2297. RFC 959 October 1985
  2298. File Transfer Protocol
  2299. APPENDIX II - DIRECTORY COMMANDS
  2300. Since UNIX has a tree-like directory structure in which directories
  2301. are as easy to manipulate as ordinary files, it is useful to expand
  2302. the FTP servers on these machines to include commands which deal with
  2303. the creation of directories. Since there are other hosts on the
  2304. ARPA-Internet which have tree-like directories (including TOPS-20 and
  2305. Multics), these commands are as general as possible.
  2306. Four directory commands have been added to FTP:
  2307. MKD pathname
  2308. Make a directory with the name "pathname".
  2309. RMD pathname
  2310. Remove the directory with the name "pathname".
  2311. PWD
  2312. Print the current working directory name.
  2313. CDUP
  2314. Change to the parent of the current working directory.
  2315. The "pathname" argument should be created (removed) as a
  2316. subdirectory of the current working directory, unless the "pathname"
  2317. string contains sufficient information to specify otherwise to the
  2318. server, e.g., "pathname" is an absolute pathname (in UNIX and
  2319. Multics), or pathname is something like "<abso.lute.path>" to
  2320. TOPS-20.
  2321. REPLY CODES
  2322. The CDUP command is a special case of CWD, and is included to
  2323. simplify the implementation of programs for transferring directory
  2324. trees between operating systems having different syntaxes for
  2325. naming the parent directory. The reply codes for CDUP be
  2326. identical to the reply codes of CWD.
  2327. The reply codes for RMD be identical to the reply codes for its
  2328. file analogue, DELE.
  2329. The reply codes for MKD, however, are a bit more complicated. A
  2330. freshly created directory will probably be the object of a future
  2331. Postel & Reynolds [Page 62]
  2332. RFC 959 October 1985
  2333. File Transfer Protocol
  2334. CWD command. Unfortunately, the argument to MKD may not always be
  2335. a suitable argument for CWD. This is the case, for example, when
  2336. a TOPS-20 subdirectory is created by giving just the subdirectory
  2337. name. That is, with a TOPS-20 server FTP, the command sequence
  2338. MKD MYDIR
  2339. CWD MYDIR
  2340. will fail. The new directory may only be referred to by its
  2341. "absolute" name; e.g., if the MKD command above were issued while
  2342. connected to the directory <DFRANKLIN>, the new subdirectory
  2343. could only be referred to by the name <DFRANKLIN.MYDIR>.
  2344. Even on UNIX and Multics, however, the argument given to MKD may
  2345. not be suitable. If it is a "relative" pathname (i.e., a pathname
  2346. which is interpreted relative to the current directory), the user
  2347. would need to be in the same current directory in order to reach
  2348. the subdirectory. Depending on the application, this may be
  2349. inconvenient. It is not very robust in any case.
  2350. To solve these problems, upon successful completion of an MKD
  2351. command, the server should return a line of the form:
  2352. 257<space>"<directory-name>"<space><commentary>
  2353. That is, the server will tell the user what string to use when
  2354. referring to the created directory. The directory name can
  2355. contain any character; embedded double-quotes should be escaped by
  2356. double-quotes (the "quote-doubling" convention).
  2357. For example, a user connects to the directory /usr/dm, and creates
  2358. a subdirectory, named pathname:
  2359. CWD /usr/dm
  2360. 200 directory changed to /usr/dm
  2361. MKD pathname
  2362. 257 "/usr/dm/pathname" directory created
  2363. An example with an embedded double quote:
  2364. MKD foo"bar
  2365. 257 "/usr/dm/foo""bar" directory created
  2366. CWD /usr/dm/foo"bar
  2367. 200 directory changed to /usr/dm/foo"bar
  2368. Postel & Reynolds [Page 63]
  2369. RFC 959 October 1985
  2370. File Transfer Protocol
  2371. The prior existence of a subdirectory with the same name is an
  2372. error, and the server must return an "access denied" error reply
  2373. in that case.
  2374. CWD /usr/dm
  2375. 200 directory changed to /usr/dm
  2376. MKD pathname
  2377. 521-"/usr/dm/pathname" directory already exists;
  2378. 521 taking no action.
  2379. The failure replies for MKD are analogous to its file creating
  2380. cousin, STOR. Also, an "access denied" return is given if a file
  2381. name with the same name as the subdirectory will conflict with the
  2382. creation of the subdirectory (this is a problem on UNIX, but
  2383. shouldn't be one on TOPS-20).
  2384. Essentially because the PWD command returns the same type of
  2385. information as the successful MKD command, the successful PWD
  2386. command uses the 257 reply code as well.
  2387. SUBTLETIES
  2388. Because these commands will be most useful in transferring
  2389. subtrees from one machine to another, carefully observe that the
  2390. argument to MKD is to be interpreted as a sub-directory of the
  2391. current working directory, unless it contains enough information
  2392. for the destination host to tell otherwise. A hypothetical
  2393. example of its use in the TOPS-20 world:
  2394. CWD <some.where>
  2395. 200 Working directory changed
  2396. MKD overrainbow
  2397. 257 "<some.where.overrainbow>" directory created
  2398. CWD overrainbow
  2399. 431 No such directory
  2400. CWD <some.where.overrainbow>
  2401. 200 Working directory changed
  2402. CWD <some.where>
  2403. 200 Working directory changed to <some.where>
  2404. MKD <unambiguous>
  2405. 257 "<unambiguous>" directory created
  2406. CWD <unambiguous>
  2407. Note that the first example results in a subdirectory of the
  2408. connected directory. In contrast, the argument in the second
  2409. example contains enough information for TOPS-20 to tell that the
  2410. Postel & Reynolds [Page 64]
  2411. RFC 959 October 1985
  2412. File Transfer Protocol
  2413. <unambiguous> directory is a top-level directory. Note also that
  2414. in the first example the user "violated" the protocol by
  2415. attempting to access the freshly created directory with a name
  2416. other than the one returned by TOPS-20. Problems could have
  2417. resulted in this case had there been an <overrainbow> directory;
  2418. this is an ambiguity inherent in some TOPS-20 implementations.
  2419. Similar considerations apply to the RMD command. The point is
  2420. this: except where to do so would violate a host's conventions for
  2421. denoting relative versus absolute pathnames, the host should treat
  2422. the operands of the MKD and RMD commands as subdirectories. The
  2423. 257 reply to the MKD command must always contain the absolute
  2424. pathname of the created directory.
  2425. Postel & Reynolds [Page 65]
  2426. RFC 959 October 1985
  2427. File Transfer Protocol
  2428. APPENDIX III - RFCs on FTP
  2429. Bhushan, Abhay, "A File Transfer Protocol", RFC 114 (NIC 5823),
  2430. MIT-Project MAC, 16 April 1971.
  2431. Harslem, Eric, and John Heafner, "Comments on RFC 114 (A File
  2432. Transfer Protocol)", RFC 141 (NIC 6726), RAND, 29 April 1971.
  2433. Bhushan, Abhay, et al, "The File Transfer Protocol", RFC 172
  2434. (NIC 6794), MIT-Project MAC, 23 June 1971.
  2435. Braden, Bob, "Comments on DTP and FTP Proposals", RFC 238 (NIC 7663),
  2436. UCLA/CCN, 29 September 1971.
  2437. Bhushan, Abhay, et al, "The File Transfer Protocol", RFC 265
  2438. (NIC 7813), MIT-Project MAC, 17 November 1971.
  2439. McKenzie, Alex, "A Suggested Addition to File Transfer Protocol",
  2440. RFC 281 (NIC 8163), BBN, 8 December 1971.
  2441. Bhushan, Abhay, "The Use of "Set Data Type" Transaction in File
  2442. Transfer Protocol", RFC 294 (NIC 8304), MIT-Project MAC,
  2443. 25 January 1972.
  2444. Bhushan, Abhay, "The File Transfer Protocol", RFC 354 (NIC 10596),
  2445. MIT-Project MAC, 8 July 1972.
  2446. Bhushan, Abhay, "Comments on the File Transfer Protocol (RFC 354)",
  2447. RFC 385 (NIC 11357), MIT-Project MAC, 18 August 1972.
  2448. Hicks, Greg, "User FTP Documentation", RFC 412 (NIC 12404), Utah,
  2449. 27 November 1972.
  2450. Bhushan, Abhay, "File Transfer Protocol (FTP) Status and Further
  2451. Comments", RFC 414 (NIC 12406), MIT-Project MAC, 20 November 1972.
  2452. Braden, Bob, "Comments on File Transfer Protocol", RFC 430
  2453. (NIC 13299), UCLA/CCN, 7 February 1973.
  2454. Thomas, Bob, and Bob Clements, "FTP Server-Server Interaction",
  2455. RFC 438 (NIC 13770), BBN, 15 January 1973.
  2456. Braden, Bob, "Print Files in FTP", RFC 448 (NIC 13299), UCLA/CCN,
  2457. 27 February 1973.
  2458. McKenzie, Alex, "File Transfer Protocol", RFC 454 (NIC 14333), BBN,
  2459. 16 February 1973.
  2460. Postel & Reynolds [Page 66]
  2461. RFC 959 October 1985
  2462. File Transfer Protocol
  2463. Bressler, Bob, and Bob Thomas, "Mail Retrieval via FTP", RFC 458
  2464. (NIC 14378), BBN-NET and BBN-TENEX, 20 February 1973.
  2465. Neigus, Nancy, "File Transfer Protocol", RFC 542 (NIC 17759), BBN,
  2466. 12 July 1973.
  2467. Krilanovich, Mark, and George Gregg, "Comments on the File Transfer
  2468. Protocol", RFC 607 (NIC 21255), UCSB, 7 January 1974.
  2469. Pogran, Ken, and Nancy Neigus, "Response to RFC 607 - Comments on the
  2470. File Transfer Protocol", RFC 614 (NIC 21530), BBN, 28 January 1974.
  2471. Krilanovich, Mark, George Gregg, Wayne Hathaway, and Jim White,
  2472. "Comments on the File Transfer Protocol", RFC 624 (NIC 22054), UCSB,
  2473. Ames Research Center, SRI-ARC, 28 February 1974.
  2474. Bhushan, Abhay, "FTP Comments and Response to RFC 430", RFC 463
  2475. (NIC 14573), MIT-DMCG, 21 February 1973.
  2476. Braden, Bob, "FTP Data Compression", RFC 468 (NIC 14742), UCLA/CCN,
  2477. 8 March 1973.
  2478. Bhushan, Abhay, "FTP and Network Mail System", RFC 475 (NIC 14919),
  2479. MIT-DMCG, 6 March 1973.
  2480. Bressler, Bob, and Bob Thomas "FTP Server-Server Interaction - II",
  2481. RFC 478 (NIC 14947), BBN-NET and BBN-TENEX, 26 March 1973.
  2482. White, Jim, "Use of FTP by the NIC Journal", RFC 479 (NIC 14948),
  2483. SRI-ARC, 8 March 1973.
  2484. White, Jim, "Host-Dependent FTP Parameters", RFC 480 (NIC 14949),
  2485. SRI-ARC, 8 March 1973.
  2486. Padlipsky, Mike, "An FTP Command-Naming Problem", RFC 506
  2487. (NIC 16157), MIT-Multics, 26 June 1973.
  2488. Day, John, "Memo to FTP Group (Proposal for File Access Protocol)",
  2489. RFC 520 (NIC 16819), Illinois, 25 June 1973.
  2490. Merryman, Robert, "The UCSD-CC Server-FTP Facility", RFC 532
  2491. (NIC 17451), UCSD-CC, 22 June 1973.
  2492. Braden, Bob, "TENEX FTP Problem", RFC 571 (NIC 18974), UCLA/CCN,
  2493. 15 November 1973.
  2494. Postel & Reynolds [Page 67]
  2495. RFC 959 October 1985
  2496. File Transfer Protocol
  2497. McKenzie, Alex, and Jon Postel, "Telnet and FTP Implementation -
  2498. Schedule Change", RFC 593 (NIC 20615), BBN and MITRE,
  2499. 29 November 1973.
  2500. Sussman, Julie, "FTP Error Code Usage for More Reliable Mail
  2501. Service", RFC 630 (NIC 30237), BBN, 10 April 1974.
  2502. Postel, Jon, "Revised FTP Reply Codes", RFC 640 (NIC 30843),
  2503. UCLA/NMC, 5 June 1974.
  2504. Harvey, Brian, "Leaving Well Enough Alone", RFC 686 (NIC 32481),
  2505. SU-AI, 10 May 1975.
  2506. Harvey, Brian, "One More Try on the FTP", RFC 691 (NIC 32700), SU-AI,
  2507. 28 May 1975.
  2508. Lieb, J., "CWD Command of FTP", RFC 697 (NIC 32963), 14 July 1975.
  2509. Harrenstien, Ken, "FTP Extension: XSEN", RFC 737 (NIC 42217), SRI-KL,
  2510. 31 October 1977.
  2511. Harrenstien, Ken, "FTP Extension: XRSQ/XRCP", RFC 743 (NIC 42758),
  2512. SRI-KL, 30 December 1977.
  2513. Lebling, P. David, "Survey of FTP Mail and MLFL", RFC 751, MIT,
  2514. 10 December 1978.
  2515. Postel, Jon, "File Transfer Protocol Specification", RFC 765, ISI,
  2516. June 1980.
  2517. Mankins, David, Dan Franklin, and Buzz Owen, "Directory Oriented FTP
  2518. Commands", RFC 776, BBN, December 1980.
  2519. Padlipsky, Michael, "FTP Unique-Named Store Command", RFC 949, MITRE,
  2520. July 1985.
  2521. Postel & Reynolds [Page 68]
  2522. RFC 959 October 1985
  2523. File Transfer Protocol
  2524. REFERENCES
  2525. [1] Feinler, Elizabeth, "Internet Protocol Transition Workbook",
  2526. Network Information Center, SRI International, March 1982.
  2527. [2] Postel, Jon, "Transmission Control Protocol - DARPA Internet
  2528. Program Protocol Specification", RFC 793, DARPA, September 1981.
  2529. [3] Postel, Jon, and Joyce Reynolds, "Telnet Protocol
  2530. Specification", RFC 854, ISI, May 1983.
  2531. [4] Reynolds, Joyce, and Jon Postel, "Assigned Numbers", RFC 943,
  2532. ISI, April 1985.
  2533. Postel & Reynolds [Page 69]