📄 rfc607.txt
字号:
Request for Comments: 607 Mark KrilanovichNIC # 21255 George Greggreferences: RFC #542 UCSB Jan 1974 Comments on the File Transfer ProtocolThere are several aspects of the File Transfer Protocol that constituteserious drawbacks. Some of these are quite basic in nature, and implysubstantial design changes; these will be discussed in a later RFC.Others could be remedied with very little effort, and this should be doneas soon as possible.Following is a list of those problems that can be easily solved, togetherwith their proposed solutions:1. Once a server has been told to be "passive" with regard to establishmentof data connections, there is no way for the user to make him "active"again. SOLUTION: define a new command, with a command verb of "ACTV", tomean that the server is to issue a CONNECT rather than a LISTEN on the datasocket. If the server is already "active", the command is a no op. "ACTV"is to have the same reply codes as "PASV".2. Design of an FTP server would be simpler if all command verbs were thesame length, and design of an FTP user would be simpler if either allcommand verbs were the same length, or if multiple blanks were allowedfollowing the verb. SOLUTION: replace the only three-letter verb, "BYE",with a four-letter one, such as "QUIT", and constrain future command verbsto be four letters long.3. The order of the handshaking elements following a file transfer commandis left unspecified. After sending a STOR command, for example, a userprocess has no way of knowing which to wait for first, the "250 FILETRANSFER STARTED" reply, or establishment of the data connection. SOLUTION:specify that the server is to send a "250" reply before attempting toestablish the data connection. If it is desired to check if the user islogged in, if the file exists, or if the user is to be allowed access tothe file, these checks must be made before any reply is sent. The text ofthe "250" reply would perhaps be more appropriate as "250 OPENING DATACONNECTION", since it comes before actual data transfer begins. If theserver wishes to send an error reply in the event that the data connectioncannot be opened, it is to be sent in lieu of the "252 TRANSFER COMPLETE"reply. 4. Some hosts currently send an error reply on receipt of a commandthat is unimplemented because it is not needed (e.g., "ACCT" or "ALLO").Even though the text of the reply indicates that the command has beenignored, it is obviously impossible for a user process to know that thereis no real "error". SOLUTION: require that any server that does not supporta particular command because it is not needed in that system must return asuccess reply.5. There is no specified maximum length of a TELNET line, user name,password, account, or pathname. It is true that every system implementingan FTP server likely has different maxima for its own parameters, but it isnearly impossible for the writer of an FTP user (which must converse withmany FTP servers) to construct an indefinite length buffer. Typically some -1-arbitrary maximum must be chosen. SOLUTION: specify a maximum length forTELNET lines, user names, passwords, account numbers, and pathnames. Thisis to be done after conducting a poll of serving sites concerning theirindividual maxima.6. The notion of allowing continuation lines to start with arbitrary textsolves a minor problem for a few server FTP implementers at the expense ofcreating a major problem for all user FTP implementers. The logic needed todecode a multi-line reply is unnecessarily complex, and made an order ofmagnitude more so by the fact that multi-line replies are allowed to benested. SOLUTION: assign a unique (numeric) reply code, such as "009", tobe used on all lines of a multi-line reply after the first.7. Given that multi-line replies are allowed to be nested, the fact thatthe maximum allowed level of nesting is left unspecified creates a hardshipfor implementers of user FTPs. This hardship is somewhat easily solved on amachine that has hardware stacks, but not so for other machines. SOLUTION:specify a maximum level of nesting of multi-line replies.8. In blocked mode, the protocol states that "all end-of-record markers(EOR) are explicit, including the final one." This prohibits sending databetween the final end of record and the end of file, but does not specifywhat the receiver of data is to do if this rule is broken. That is, shouldthe intervening data be discarded or treated as a new (final) record?SOLUTION: specify that if an end-of-file marker is not immediately precededby an end-of-record marker, the intervening data is to be discarded.A major complaint about the protocol concerns the fact that the writer ofan FTP user process must handle a considerable number of special casesmerely to determine whether or not the last command sent was successful. Itis admitted that the protocol is well-defined in all the following areas,but it is important to realize that the characteristic "well-defined" isnecessary, but not sufficient; for many reasons, it is very desirable toemploy the simplest mechanism that satisfies all the needs. Following is alist of those drawbacks that unduly complicate the flow chart of an FTPuser process:9. Different commands have different success reply codes. A successful"USER" command, for example, returns a "230" whereas a successful "BYTE"command returns a "200". The concept that success replies should have aneven first digit and failure replies an odd first digit does not apply, as"100, means success for "STAT", and "402" means failure for "BYTE".SOLUTION: specify that any command must return a reply code beginning withsome unique digit, such as "2", if successful, and anything other than thatdigit if not successful.10. Some commands have multiple possible success reply codes, e.g., "USER","REIN", and "BYE". It is undesirable for an FTP user to be required to keepa list of reply codes for each command, all of which mean "commandaccepted, continue". SOLUTION: same as for (9.) above. The desire tocommunicate more specific information than simply "yes" or "no", such asthe difficulty in the login procedure that some sites do not need all theparameters, may be solved by having, for example, "238" mean "PASSWORDACCEPTED, YOU ARE NOW LOGGED IN", and "237" mean "PASSWORD ACCEPTED,ACCOUNT NOW NEEDED" The important point is that the idea of "commandaccepted" is conveyed by the initial "2", and that finer gradations ofmeaning can be deduced by the user process, if desired. -2- 11. There are several types of replies that are extraneous from the pointof view of a user FTP process, and their reply codes have no characteristicthat makes them easily distinguishable. For example, "010 message fromoperator" and "050 FTP commentary" are superfluous to a user process, and"000 announcing FTP" (in place of "300" greeting) is not. SOLUTION: specifythat any reply that has meaning only to a human user and not to a userprocess must have a reply code beginning with a unique digit, such as "0".The continuation line reply code proposed in (8.) above falls into thiscategory, and therefore must start with the same unique digit.12. The notion of a server sending a "000 announcing FTP" or a "020expected delay" immediately after completion of the ICP if input cannot beaccepted right away is another instance of multiple reply codes having thesame meaning to a user process. SOLUTION: require that the server send areply with a "020" reply code in the situation cited. If it is desired tocommunicate more detailed information, the text of the reply may used forthis purpose.In addition to the above mentioned weaknesses in the protocol, thefollowing is believed to be a typographical error:13. Reply code "331" is cited as a possible success reply code for thecommands "BYTE", "SOCK", "PASV", "TYPE", "STRU", "MODE", "ALLO", "REST","SITE", AND "STAT". This reply code means "ENTER ACCOUNT" (if required aspart of login sequence), and perhaps should be "332 LOGIN FIRST, PLEASE".This is especially indicated by the fact that "332" is not listed anywherein the command-reply correspondence table. -3-
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -