This preview shows page 1. Sign up to view the full content.
Unformatted text preview: c
-rw-rw-r-1 rstevens 38 Jul 18
but file contains 38 bytes
count the lines in the file
sun % wc -l hello.c
Forty-two bytes are transferred across the data connection because the file contains four
lines. Each Unix newline character (\n) is converted into the NVT ASCII 2-byte end-ofline sequence (\r\n) by the server for transmission, and then converted back by the client
Newer clients attempt to determine if the server is of the same system type, and if so,
transfer files in binary (image file type) instead of ASCII. This helps in two ways.
1. The sender and receiver don't have to look at every byte (a big savings).
2. Fewer bytes are transferred if the host operating system uses fewer bytes for the
end-of-line than the 2-byte NVT ASCII sequence (a smaller savings). file:///D|/Documents%20and%20Settings/bigini/Docum.../homenet2run/tcpip/tcp-ip-illustrated/ftp_file.htm (15 of 24) [12/09/2001 14.47.49] Chapter 27. FTP: File Transfer Protocol We can see this optimization using a BSD/386 client and server. We'll enable the debug
mode, to see the client FTP commands:
bsdi % ftp -d slip
Connected to slip.
220 slip FTP server (Version 5.60)
---> USER rstevens
331 Password required for rstevens.
---> PASS XXXX
230 User rstevens logged in.
---> SYST specify -d to see client commands we type RETURN we type our password this is sent automatically by
client 215 UNIX Type: L8 Version: BSDserver's reply
information output by client
Remote system type is UNIX.
Using binary mode to transfer files. information output by client
fetch a file
ftp> get hello.c
sent automatically by client
---> TYPE I
200 Type set to I.
---> PORT 140,252,13,66,4,84
200 PORT command successful.
---> RETR hello.c
150 Opening BINARY mode data connection for hello.c (38
226 Transfer complete.
38 bytes received in 0.035 seconds
only 38 bytes this time
After we l...
View Full Document
- Spring '12