TCP IP Illustrated

2 fewer bytes are transferred if the host operating

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: c -rw-rw-r-1 rstevens 38 Jul 18 but file contains 38 bytes 08:48 hello.c count the lines in the file sun % wc -l hello.c 4 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 for storage. 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) ready. Name (slip:rstevens): ---> USER rstevens 331 Password required for rstevens. Password: ---> 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 199103 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 number=4x256+84=1108 ---> PORT 140,252,13,66,4,84 200 PORT command successful. ---> RETR hello.c 150 Opening BINARY mode data connection for hello.c (38 bytes). 226 Transfer complete. 38 bytes received in 0.035 seconds only 38 bytes this time (1.1 Kbytes/s) ftp> quit ---> QUIT 221 Goodbye. After we l...
View Full Document

Ask a homework question - tutors are online