CHAPTER 9 File Transfer: FTP and TFTP Exercises. 2... If the control connection is accidentally severed during an FTP transfer, there would be no problem until the data transfer completed and the client attempted to send another command. The client issues an active for the control connection because it is the client who initiates the communication for the control process. The client issues a passive for the data connection because it is the server who initiates the communication for data transfer after receipt of the ephemeral port number. There should be limitations on anonymous FTP because it is unwise to grant the public complete access to a system. If the commands that an anonymous user could use were not limited, that user could do great damage to the file system (e.g., erase it completely). FTP does not need a message format because there is no need to send additional information back and forth aside from the commands and responses, which use the control connection.
SECTION 2 5. See Figure 9.. Figure 9. Exercise 5 5 Ephemeral port number 2 Sequence number Acknowledgment number Reserved Flags Window size Urgent Pointer "C" "O" "M" "M" "A" "N" "D" " " "a" "r" "g" "u" "m" "s" CR "n" LF "t" 6. See Figure 9.2. Figure 9.2 Exercise 6 5 2 Ephemeral port number Sequence number Acknowledgment number Reserved Flags Window size Urgent Pointer "x" "y" "z" " " "d" "s" " c" "r" "p" "t" LF "o" "n" CR 7. See Figure 9.. Figure 9. Exercise 7 5 Ephemeral port number 2 Sequence number Acknowledgment number Reserved Flags Window size Urgent Pointer DATA 8. If the file already exists, the file will be overwritten. If this is not what is desired, the STOU command should be used instead of the STOR command.
SECTION 9. See Figure 9.. Figure 9. Exercise 9 Active PASV 227 (Entering passive mode, socket) LIST /usr/user/reports 25 (Data connection OK) DATA TRANSFER 226 (Closing data connection) 22 (Service closing) Passive. See Figure 9.5 Figure 9.5 Exercise Passive PORT 267 5 (Data connection will ) TYPE EBCDIC 2 (Command OK) STRU R 2 (Command OK) STOU /usr/user/report 25 (Requested file action OK) DATA TRANSFER 226 (Closing data connection) 22 (Service closing) Active
SECTION. See Figure 9.6. Figure 9.6 Exercise Passive PORT 267 5 (Data connection will ) RETR/usr/user/report 25 (Requested file action OK) DATA TRANSFER 226 (Closing data connection) 22 (Service closing) Active 2. Figure 9.7. Figure 9.7 Exercise 2 HELP 2 (Help message) 22 (Service closing)
SECTION 5. See Figure 9.8 Figure 9.8 Exercise NOOP 2 (System status or help) 22 (Service closing). See Figure 9.9. Figure 9.9 Exercise SYST 25 (Naming the system type) 22 (Service closing)
SECTION 6 5. See Figure 9.. Figure 9. Exercise 5 MKD /usr/user/letters/jan 2 (Command OK) 6. See Figure 9.. Figure 9. Exercise 6 PWD 22 (Status) /usr/user/forouzan CDUP 2 (Command OK) 7. See Figure 9.2. 8. See Figure 9.. 9. TFTP needs to use RRQ and WRQ messages for connection establishment and to let the server know what kind of service is required. These functions are served by various commands in FTP using the FTP control connection.
SECTION 7 Figure 9.2 Exercise 7 PWD 22 (Status) /usr/user/forouzan RNFR /usr/usrs/report/file 2 (Command OK) RNTO /usr/usrs/letters/file 2 (Command OK) Figure 9. Exercise 8 Passive PORT 267 5 (Data connection will ) TYPE EBCDIC 2 (Command OK) MODE C 2 (Command OK) RETR /usr/user/report/file 25 (Data connection ) DATA TRANSFER 226 (Closing data connection) 22 (Service closing) Active
SECTION 8 2. See Figure 9.. The user datagram is 26 bytes. Figure 9. Exercise 2 Ephemeral port number 69 26 "R" "p" "o" "r" "t " "n" "t" "a" "s" "c" 2. See Figure 9.5. The user datagram is 26 bytes. Figure 9.5 Exercise 2 Ephemeral port number 69 26 2 "R" "p" "o" "r" "t " "n" "t" "a" "s" "c" 22. See Figure 9.6. The user datagram is 52 bytes. Figure 9.6 Exercise 22 Ephemeral port number(server) Ephemeral port number(client) 52 7 of data 2. See Figure 9.7. 2. See Figure 9.8.
SECTION 9 Figure 9.7 Exercise 2 Host A Host B ascii 2 file Block Block 2 2 ACK 5 Block Block Block 5 2 bytes 5 Figure 9.8 Exercise 2 "p" "a" 525 26 "o" "n" "s" a. read request 69 "R" "r" "t " "t" "c" 5722 525 52 b.typical data block (block 5 only 2 bytes) 525 5722 2 c. typical acknowledgement
SECTION 25. See Figure 9.9. Figure 9.9 Exercise 25 Host A Host B Damaged ascii 2 2 file Block ACK 5 5 Block Block 2 2 Block 2 Block Block 5 2 bytes Resent Timeout 26. See Figure 9.2. Figure 9.2 Exercise 26 "p" "a" 525 26 "o" "n" "s" 69 "R" "r" "t " "t" "c" a. read request 5722 525 52 b. typical data block (block 5 only 2 bytes) 525 5722 2 c. typical acknowledgement