You are on page 1of 6

CHAPTER 19

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.

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

5. See Figure 19.1.

Figure 19.1 Exercise 5

Ephemeral port number 21


Sequence number
Acknowledgment number
5 Reserved Flags Window size
Checksum Urgent Pointer
"C" "O" "M" "M"
"A" "N" "D" ""
"a" "r" "g" "u"
"m" "e" "n" "t"
"s" CR LF

7. See Figure 19.2.

1
SECTION 2

Figure 19.2 Exercise 7

Ephemeral port number 20


Sequence number
Acknowledgment number
5 Reserved Flags Window size
Checksum Urgent Pointer

DATA

9. See Figure 19.3.

Figure 19.3 Exercise 9

Client Server

220 (Service ready)


USER forouzan
331 (User name OK. Password?)
PASS xxxx
230 (User login OK)
PASV
Passive
open
Active 227 (Entering passive mode, socket)
open
LIST /usr/user/reports
125 (Data connection OK)

DATA TRANSFER
226 (Closing data connection)
QUIT
221 (Service closing)

11. See Figure 19.4.

13. See Figure 19.5


SECTION 3

Figure 19.4 Exercise 11

Client Server

220 (Service ready)


USER forouzan
331 (User name OK. Password?)
PASS xxxx

Passive 230 (User login OK)


open
PORT 1267
Active
open
150 (Data connection will open)
RETR/usr/user/report

250 (Requested file action OK)

DATA TRANSFER
226 (Closing data connection)
QUIT
221 (Service closing)

Figure 19.5 Exercise 13

Client Server

220 (Service ready)


USER forouzan
331 (User name OK. Password?)
PASS xxxx
230 (User login OK)
NOOP
211 (System status or help)

QUIT
221 (Service closing)

15. See Figure 19.6.

17. See Figure 19.7.


SECTION 4

Figure 19.6 Exercise 15

Client Server

220 (Service ready)


USER forouzan
331 (User name OK. Password?)
PASS xxxx
230 (User login OK)
MKD /usr/user/letters/Jan
200 (Command OK)

Figure 19.7 Exercise 17

Client Server

220 (Service ready)


USER forouzan
331 (User name OK. Password?)
PASS xxxx
230 (User login OK)
PWD
212 (Status) /usr/user/forouzan
RNFR /usr/usrs/report/file1
200 (Command OK)

RNTO /usr/usrs/letters/file1
200 (Command OK)

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.

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


SECTION 5

Figure 19.8 Exercise 21

Ephemeral port number 69


26 Checksum
2 "R" "e"
"p" "o" "r" "t "
0 "n" "e" "t"
"a" "s" "c" "i"
"i" 0

23. See Figure 19.9.

Figure 19.9 Exercise 23

Host A Host B

ascii file1 1
Block 1
3 1 512 bytes

1 4
Block 2
3 2 512 bytes

2 4
Block 3
3 3 512 bytes

3 ACK
4
Block 4
3 4 512 bytes

4 4
Block 5
3 5 102 bytes

5 4

25. See Figure 19.10.


SECTION 6

Figure 19.10 Exercise 25

Host A Host B

Resent

ascii file1 1
3 1 Block 1
512 bytes
1 4
Damaged 3 2 Block 2
512 bytes

Timeout
3 2 Block 2
512 bytes

2 4
3 3 Block 3
512 bytes
3 ACK
4

3 4 Block 4
512 bytes
4 4

3 5 Block 5
102 bytes
5 4

You might also like