• No results found

File Transfer: FTP and TFTP

N/A
N/A
Protected

Academic year: 2021

Share "File Transfer: FTP and TFTP"

Copied!
10
0
0

Loading.... (view fulltext now)

Full text

(1)

1

File Transfer: FTP and TFTP

Exercises

1.

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.

2.

The client issues an active open for the control connection because it is the client who initiates the communication for the control process. The client issues a pas-sive open for the data connection because it is the server who initiates the commu-nication for data transfer after receipt of the ephemeral port number.

3.

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).

4.

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.

(2)

6. See Figure 19.2.

7. See Figure 19.3.

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.

Figure 19.1 Exercise 5 Figure 19.2 Exercise 6 Figure 19.3 Exercise 7 5 "C" "O" "M" "M" "A" "N" "D" " " "a" "r" "g" "u" "m" "s" "e" CR LF "n" "t" Ephemeral port number 21

Sequence number Acknowledgment number

Reserved Flags Window size

Checksum Urgent Pointer

5 "x" "y" "z" " " "d" "e" "s" " c" "r" "i" "p" "t" "i" LF "o" "n" CR Ephemeral port number 21

Sequence number Acknowledgment number

Reserved Flags Window size

Checksum Urgent Pointer

5

Ephemeral port number 20 Sequence number Acknowledgment number

Reserved Flags Window size

Checksum

DATA

(3)

10. See Figure 19.5 Figure 19.4 Exercise 9 Figure 19.5 Exercise 10 Client Server 220 (Service ready) USER forouzan QUIT LIST /usr/user/reports PASS xxxx

125 (Data connection OK) 226 (Closing data connection)

221 (Service closing) 331 (User name OK. Password?)

PASV

227 (Entering passive mode, socket) 230 (User login OK)

DATA TRANSFER Passive open Active open Client Server 220 (Service ready) USER forouzan QUIT TYPE EBCDIC PASS xxxx 200 (Command OK) STRU R 200 (Command OK) STOU /usr/user/report 250 (Requested file action OK)

226 (Closing data connection) 221 (Service closing) 331 (User name OK. Password?)

PORT 1267 150 (Data connection will open)

230 (User login OK)

DATA TRANSFER

Passive open

Active open

(4)

12. Figure 19.7. Figure 19.6 Exercise 11 Figure 19.7 Exercise 12 Client Server 220 (Service ready) USER forouzan QUIT RETR/usr/user/report PASS xxxx

250 (Requested file action OK)

226 (Closing data connection)

221 (Service closing) 331 (User name OK. Password?)

PORT 1267 150 (Data connection will open)

230 (User login OK)

DATA TRANSFER Passive open Active open Client Server 220 (Service ready) USER forouzan QUIT PASS xxxx 221 (Service closing) 331 (User name OK. Password?)

HELP 214 (Help message) 230 (User login OK)

(5)

14. See Figure 19.9. Figure 19.8 Exercise 13 Figure 19.9 Exercise 14 Client Server 220 (Service ready) USER forouzan QUIT PASS xxxx 221 (Service closing) 331 (User name OK. Password?)

NOOP 211 (System status or help)

230 (User login OK)

Client Server 220 (Service ready) USER forouzan QUIT PASS xxxx 221 (Service closing) 331 (User name OK. Password?)

SYST

215 (Naming the system type) 230 (User login OK)

(6)

16. See Figure 19.11.

17. See Figure 19.12.

18. See Figure 19.13.

19.

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.

Figure 19.10 Exercise 15 Figure 19.11 Exercise 16 Client Server 220 (Service ready) USER forouzan PASS xxxx 331 (User name OK. Password?)

MKD /usr/user/letters/Jan 200 (Command OK) 230 (User login OK)

Client Server 220 (Service ready) USER forouzan CDUP PASS xxxx 200 (Command OK) 331 (User name OK. Password?)

PWD

212 (Status) /usr/user/forouzan 230 (User login OK)

(7)

Figure 19.13 Exercise 18 Client Server 220 (Service ready) USER forouzan RNFR /usr/usrs/report/file1 PASS xxxx 200 (Command OK) RNTO /usr/usrs/letters/file1 200 (Command OK) 331 (User name OK. Password?)

PWD

212 (Status) /usr/user/forouzan 230 (User login OK)

Client Server 220 (Service ready) USER forouzan QUIT TYPE EBCDIC PASS xxxx 200 (Command OK) MODE C 200 (Command OK) RETR /usr/user/report/file1 125 (Data connection open)

226 (Closing data connection)

221 (Service closing) 331 (User name OK. Password?)

PORT 1267 150 (Data connection will open)

230 (User login OK)

DATA TRANSFER

Passive open

Active open

(8)

21. See Figure 19.15. The user datagram is 26 bytes.

22. See Figure 19.16. The user datagram is 524 bytes.

23. See Figure 19.17. 24. See Figure 19.18. Figure 19.14 Exercise 20 Figure 19.15 Exercise 21 Figure 19.16 Exercise 22 "p" "o" "R" "e" "n" "r" "t " "a" "s" "e" "t" "i" "c" "i" Ephemeral port number 69

26 1 0 0 Checksum "p" "o" "R" "e" "n" "r" "t " "a" "s" "e" "t" "i" "c" "i" Ephemeral port number 69

26 2

0

0

Checksum

Ephemeral port number(server)

512 bytes of data

Ephemeral port number(client) 524

3 7

(9)

Figure 19.18 Exercise 24 Host A Host B file1 ascii 1 3 1 1 3 3 4 3 2 3 2 ACK 3 4 4 Block 4 512 bytes 5 3 5 4 Block 5 102 bytes Block 3 512 bytes Block 1 512 bytes Block 2 512 bytes 4 4 4 "p" "o" "R" "e" "n" "r" "t " "a" "s" "e" "t" "i" "c" "i" 69 26 51235 1 0 0 Checksum 57122 512 bytes 51235 524 3 1 Checksum 51235 57122 12 4 1 Checksum a. read request

b.typical data block (block 5 only 102 bytes)

(10)

26. See Figure 19.20. Figure 19.19 Exercise 25 Figure 19.20 Exercise 26 Host A Host B file1 ascii 1 3 1 1 3 3 4 3 2 3 2 ACK 3 4 4 Block 4 512 bytes 5 3 5 4 Block 5 102 bytes Block 3 512 bytes Block 1 512 bytes Block 2 512 bytes 2 3 512 bytesBlock 2 4 4 4 Damaged Resent Timeout "p" "o" "R" "e" "n" "r" "t " "a" "s" "e" "t" "i" "c" "i" 69 26 51235 1 0 0 Checksum 57122 512 bytes 51235 524 3 1 Checksum 51235 57122 12 4 1 Checksum a. read request

Figure

Figure 19.1 Exercise 5 Figure 19.2 Exercise 6 Figure 19.3 Exercise 75 "C" "O" "M" "M""A""N""D"" ""a""r""g""u""m""s""e"CRLF"n"&#3
Figure 19.10 Exercise 15 Figure 19.11 Exercise 16Client Server220 (Service ready)USER forouzanPASS xxxx331 (User name OK
Figure 19.13 Exercise 18Client Server220 (Service ready)USER forouzanRNFR /usr/usrs/report/file1 PASS xxxx200 (Command OK)RNTO /usr/usrs/letters/file1200 (Command OK)331 (User name OK
Figure 19.18 Exercise 24 Host A Host Bfile1ascii131133432323ACK44Block 4512 bytes3554Block 5102 bytesBlock 3512 bytesBlock 1512 bytesBlock 2512 bytes444 "p" "o" "R" "e" "n" "r" "t " "a" "s

References

Related documents

Second paragraph: Summarize in your own words the key points of input text two.Give your opinion. Conclusion: Restate your previous arguments, sum up and relate to a

3) Challenges: The major challenges for BBN are: the energy efficiency, when the coordinators will play the role of cluster head and will transmit the value or vital signs in the

Theorem 4.10: Every edge-to-edge tiling of the plane by congruent triangles meeting 6 at a vertex formed by dividing the plane by lines, except tilings by isosceles triangles

From January 1967 to July 1968, the money stock had risen at a 7 per cent annual rate, about three times the trend rate from 1957 to 1966, Studies indicate that changes in the

Comparing grazing intensities in relation to the seed furrow mechanisms ( Figure 3B ), it is noticed that corn plant height (86 DAS) were affected by the graz- ing intensities at

DFID funds are now increasingly awarded directly to programmes in LMICs or through large grant support to initiatives such as the Global Alliance for Livestock Veterinary

A diferencia de la mayoría de los ejecutivos (que establecen redes de contacto para tener acceso a recursos, para promocionarse a sí mismos o a sus compañías, o para impulsar

This document was produced to assist in the development and testing of small pyrolysis This document was produced to assist in the development and testing of small pyrolysis plants