File Transfer Protocol (FTP)

Slides:



Advertisements
Similar presentations
FILE TRANSFER PROTOCOL Short for File Transfer Protocol, the protocol for exchanging files over the Internet. FTP works in the same way as HTTP for transferring.
Advertisements

Chapter 26 FTP.
TCP/IP Protocol Suite 1 Chapter 18 Upon completion you will be able to: Remote Login: Telnet Understand how TELNET works Understand the role of NVT in.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Layer 7- Application Layer
FTP – File Transfer Protocol. 5 דברים שלא ידעתם על FTP FTP is commonly run on two ports, 20 and 21.ports FTP run exclusively over TCP.TCP FTP is separated.
Telnet/SSH Tim Jansen, Mike Stanislawski. TELNET is short for Terminal Network Enables the establishment of a connection to a remote system, so that the.
File Transfer: FTP and TFTP
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Application Layer PART VI.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
Ch 23 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007 Ameera Almasoud.
Ch 23 Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 21 File Transfer: FTP and.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 20 File Transfer Protocol (FTP)
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Chapter 20 File Transfer Protocol (FTP)
Introduction 1 Lecture 7 Application Layer (FTP, ) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
FTP File Transfer Protocol Reference: RFC 959. FTP Objectives (from RFC 959) n promote sharing of files n encourage indirect use of remote computers n.
Chapter 26 remote logging & Ftp
TCP/IP suit 4th Edition by Behrouz A Forouzan. 2 Internet Computing (CS-413)
John Degenhart Joseph Allen.  What is FTP?  Communication over Control connection  Communication over Data Connection  File Type  Data Structure.
File Transfer Protocol (FTP)
File Transfer Protocol CS-328 Dick Steflik. FTP RFC 959 uses two TCP Ports –one for control –one for data transfers command-response protocol control.
Telnet/SSH: Connecting to Hosts Internet Technology1.
Chapter 31 File Transfer & Remote File Access (NFS)
FTP File Transfer Protocol. Introduction transfer file to/from remote host client/server model  client: side that initiates transfer (either to/from.
2: Application Layer1 Chapter 2 Application Layer These slides derived from Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross.
Electronic Mail (SMTP, POP, IMAP, MIME)
Process-to-Process Delivery:
Ferry Astika Saputra FTP & TFTP Server. Overview File Transfer Protocol (RFC 959) Why FTP? FTP’s connections FTP in action FTP commands/responses Trivial.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 2: Application.
BY SAGAR SINHA SAPTARSHI BAKSHI SARTHAK JAIN SHAILZA CHAUDHARY
FTP (File Transfer Protocol) & Telnet
Applications: Remote Login (TELNET,Rlogin) In this chapter we shall explore internetworking by examining high level internet services and protocols that.
Simple Mail Transfer Protocol (SMTP)
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Network Protocols Chapter 26 (Data Communication and Networking): Remote Logging, Electronic Mail, and.
Computer Networking From LANs to WANs: Hardware, Software, and Security Chapter 13 FTP and Telnet.
BASIC INTERNET PROTOCOLS: http, ftp, telnet. Mirela Walczak.
TFTP: Trivial file transfer protocol
CS 3830 Day 9 Introduction 1-1. Announcements r Quiz #2 this Friday r Demo prog1 and prog2 together starting this Wednesday 2: Application Layer 2.
TCP/IP Protocol Suite 1 Chapter 19 Upon completion you will be able to: File Transfer: FTP and TFTP Understand the connections needed for FTP file transfer.
FTP File Transfer Protocol Graeme Strachan. Agenda  An Overview  A Demonstration  An Activity.
File Transfer Protocol (FTP)
Chapter 27 - Faxes & File Transfer (FTP) Introduction Sending a Fax –The Internet can be used to send a fax. Two fax machines can be modified to communicate.
1 Tips for the assignment. 2 Socket: a door between application process and end- end-transport protocol (UDP or TCP) TCP service: reliable transfer of.
INTERNET TECHNOLOGIES
Telnet  TErminaL NETwork  TELNET is a general-purpose client-server application program  TELNET enables the establishment of a connection to a remote.
Netprog: TELNET1 The TELNET Protocol Mozafar Bag mohammadi.
Ch26 Ameera Almasoud 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007.
1 Kyung Hee University Chapter 22 Simple Mail Transfer Protocol (SMTP)
Internet and Intranet Protocols and Applications Lecture 6 Application Protocols: Telnet, FTP February 27, 2002 Joseph Conron Computer Science Department.
TCP/IP Protocol Suite Suresh Kr Sharma 1 The OSI Model and the TCP/IP Protocol Suite Established in 1947, the International Standards Organization (ISO)
Chapter 26 Standard Client-Server Protocols Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Ch23 Ameera Almasoud 1 Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007.
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 21 File Transfer: FTP and.
Chapter 26 Standard Client-Server Protocols
Application layer Lecture 7.
Module 4 Remote Login.
Networking Applications
Chapter 21 File Transfer: FTP and TFTP
Net 323 D: Networks Protocols
FTP & TFTP Server Ferry Astika Saputra.
File Transfer: FTP Objectives Chapter 19
Application layer Lecture 7.
Net 323 D: Networks Protocols
FTP AND COMMAND PROCESSING IN FTP
Chapter 7 Network Applications
File Transfer: FTP and TFTP
File Transfer Protocol
Internet Applications (Telnet, FTP)
Presentation transcript:

File Transfer Protocol (FTP) Ch26 Ameera Almasoud Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

FILE TRANSFER File Transfer Protocol (FTP) is the standard mechanism provided by TCP/IP for copying a file from one host to another. Although transferring files from one system to another seems simple and straightforward. Before transferring, some problems must be dealt with first, such as: two systems may use different file name conventions. Two systems may have different ways to represent text and data. Two systems may have different directory structures. All of these problems have been solved by FTP in a very simple and elegant approach. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

FILE TRANSFER FTP differs from other client-server applications in that it establishes two connections between the hosts. One connection is used for data transfer, the other for control information (commands and responses). Separation of commands and data transfer makes FTP more efficient. We need to transfer only a line of command or a line of response at a time. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

FILE TRANSFER The control connection uses very simple rules of communication. The data connection, on the other hand, needs more complex rules due to the variety of data types transferred. FTP uses two well-known TCP ports: Port 21 is used for the control connection, port 20 is used for the data connection. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

FTP Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Control Connection There are two steps: The server issues a passive open on the well-known port 21 and waits for a client. The client uses an ephemeral port and issues an active open. The connection remains open during the entire process. The service type, used by the IP protocol, is minimize delay because this is an interactive connection between a user (human) and a server. The user types commands and expects to receive responses without significant delay. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Opening the control connection Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Data Connection The data connection uses the well-known port 20 at the server site. The following shows how FTP creates a data connection: The client, not the server, issues a passive open using an ephemeral port. The client sends this port number to the server using the PORT command. The server receives the port number and issues an active open using the well known port 20 and the received ephemeral port number. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Creating the data connection Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Data Connection The data connection is opened and then closed for each file transferred. It opens each time commands that involve transferring files are used, and it closes when the file is transferred. While the control connection is open, the data connection can be opened and closed multiple times if several files are transferred. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Communication The FTP client and server, which run on different computers, must communicate with each other. These two computers may use: different operating systems different character sets different file structures different file formats FTP must make this heterogeneity compatible. FTP has two different approaches, one for the control connection and one for the data connection. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Communication over Control Connection FTP uses the same approach as SMTP to communicate across the control connection. It uses the 7-bit ASCII character set. Communication is achieved through commands and responses. Each command or response is only one short line, so we need not worry about file format or file structure. Each line is terminated with a two-character (carriage return and line feed) end-of-line token. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Using the control connection Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Communication over Data Connection File transfer occurs over the data connection under the control of the commands sent over the control connection. We prepare for transmission through the control connection. The heterogeneity problem is resolved by defining three attributes of communication before sending the file through the data connection : file type data structure transmission mode Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Using the data connection Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

File Type FTP can transfer one of the following file types across the data connection: ASCII file. EBCDIC file image file. The ASCII file is the default format for transferring text files. Each character is encoded using 7-bit ASCII. The sender transforms the file from its own representation into ASCII characters, and the receiver transforms the ASCII characters to its own representation. The EBCDIC file used If one or both ends of the connection use EBCDIC encoding (the file format used by IBM). The image file is the default format for transferring binary files. The file is sent as continuous streams of bits without any interpretation or encoding. This is mostly used to transfer binary files such as compiled programs. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Data Structure FTP can transfer a file across the data connection by using one of the following interpretations about the structure of the data: file structure: the file is a continuous stream of bytes. record structure: the file is divided into records. This can be used only with text files. page structure: the file is divided into pages, with each page having a page number and a page header. The pages can be stored and accessed randomly or sequentially. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Transmission Mode FTP can transfer a file across the data connection using one of the following three transmission modes: Stream mode. Block mode. Compressed mode. Stream mode: This is the default mode. Data are delivered from FTP to TCP as a continuous stream of bytes. TCP is responsible for chopping data into segments of appropriate size. If the data is simply a stream of bytes (file structure), no end-of-file is needed. End-of-file in this case is the closing of the data connection by the sender. If the data are divided into records (record structure), each record will have a 1-byte end-of-record (EOR) character and the end of the file will have a 1-byte end-of-file (EOF) character. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Transmission Mode Block mode: Data can be delivered from FTP to TCP in blocks. Each block is preceded by a 3-byte header. The first byte is called the block descriptor; the next two bytes define the size of the block in bytes. Compressed mode: If the file is big, the data can be compressed. The compression method normally used is run-length encoding. consecutive appearances of a data unit are replaced by one occurrence and the number of repetitions. In a text file, this is usually spaces (blanks). In a binary file, null characters are usually compressed. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Command Processing FTP uses the control connection to establish a communication between the client control process and the server control process. During this communication, the commands are sent from the client to the server and the responses are sent from the server to the client. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Commands Commands are sent from the FTP client control process. are in the form of ASCII uppercase, which may or may not be followed by an argument. commands are divided into six groups: access commands file management commands data formatting commands port defining commands file transferring commands miscellaneous commands Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Commands Access commands: These commands let the user access the remote system. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Commands File management commands: These commands let the user access the file system on the remote computer. They allow the user to navigate through the directory structure, create new directories, delete files, and so on. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Commands Data formatting commands: These commands let the user define the data structure, file type, and transmission mode. The defined format is then used by the file transfer commands. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Commands Port defining commands: These commands define the port number for the data connection on the client site. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Commands File transfer commands: These commands actually let the user transfer files. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Commands Miscellaneous commands: These commands deliver information to the FTP user at the client site. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Responses Every FTP command generates at least one response. A response has two parts: a three digit number followed by text. The numeric part defines the code. The first digit defines the status of the command. The second digit also defines the status of the command The third digit provides additional information the text part defines needed parameters or extra explanations. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

File Transfer file transfer in FTP means one of three things: Retrieving: A file is to be copied from the server to the client. It is done under the supervision of the RETR command. Storing: A file is to be copied from the client to the server. It is done under the supervision of the STOR command. List: A list of directory or file names is to be sent from the server to the client. This is done under the supervision of the LIST command. FTP treats a list of directory or file names as a file. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

File Transfer Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Example: using FTP for retrieving a list of items in a directory Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Example: an actual FTP session Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Example: how an image (binary) file is stored Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Anonymous FTP To use FTP, a user needs an account (user name) and a password on the remote server. Some sites have a set of files available for public access, to enable anonymous FTP. To access these files, a user does not need to have an account or password. the user can use anonymous as the user name and guest as the password. User access to the system is very limited. Some sites allow anonymous users only a subset of commands. For example, most sites allow the user to copy some files, but do not allow navigation through the directories. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Example Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

Security for FTP The FTP protocol was designed when the security was not a big issue. FTP requires a password, the password is sent in plaintext (unencrypted), which means it can be intercepted and used by an attacker. The data transfer connection also transfers data in plaintext, which is insecure. The solution is by adding a Secure Socket Layer between the FTP application layer and the TCP layer. is called SSL-FTP. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007

The sftp Program Another way to transfer files using a secure channel is to use another independent protocol called sftp (secure file transfer protocol). This is actually a program in Unix called sftp that is part of the SSH (Secure Shell)protocol. When SSH has established a secure connection between an SSH client and an SSH server, sftp can be used. Ameera Almasoud Based on Data Communications and Networking, 4th Edition. by Behrouz A. Forouzan, McGraw-Hill Companies, Inc., 2007