SlideShare una empresa de Scribd logo
1 de 29
Sub Topic   : Introduction to File Transfer Protocol
              (FTP)
.




                  ftp protocol with video              1
Recap

 In the previous class, you have learnt about

     •   Post Office Protocol
     •   Installation and configuration of POP3 connector
     •   POP and commands and process
     •   Limitations of POP
     •   Internet Mail Access Protocol (IMAP)
     •   Comparison of POP and IMAP



                                                            2
Objectives

 On completion of this class, you would be able to
 understand about
      • FTP’s connections

      • FTP commands and responses

      • FTP in action

      • FTP Connections

      • Transfer Modes


                                                     3
Recap of Mail Protocols
BHARATHI                                                               SANTOSH

                   SMTP         SMTP              POP3 or       user
            user
           agent                                   IMAP        agent


                    sender’s mail   receiver’s mail
                       server           server        Fig .1

  • SMTP: delivery/storage to receiver’s mail server

  • Mail access protocols: retrieval from server
    – POP: Post Office Protocol [RFC 1939]
        • authorization and download
    – IMAP: Internet Mail Access Protocol [RFC 1730]
        • manipulation of stored messages on server
    – HTTP: Hotmail , Yahoo! Mail, etc
                                                                           4
File Transfer Protocol (FTP)
• A general-purpose protocol that can be used to copy an
  arbitrary file from one computer to another

• one of the oldest network application---predates TCP
  and IP

• Later versions were built on top of TCP/IP

• Among the most heavily used applications
   – FTP generated as much as 1/3 of the traffic on the
     Internet
   – Was exceeded only by WWW (in 1995)
                                                           5
File Transfer Protocol

• Provides reliable transfer of files
   • Between different hosts running on different platforms
   MS Windows, Apple Mac,                               Sun,
   BSD UNIX, SCO UNIX, Linux
   • Using different file structures
   • Supports ASCII and binary content



                                                    Fig .2

                                                               6
FTP Standards
• RFC 959

• uses two TCP Ports
   – one for control
   – one for data transfers

• command-response protocol

• control port uses telnet protocol to negotiate session
   – US-ASCII
   – <crlf> is end-of-line character


                                                           7
Control and Data Connections

• Control functions (commands) and reply codes are
  transferred over the control connection

• All data transfer takes place over the data connection

• The control connection must be “up” while data transfer
  takes place




                                                            8
Control Connection

• The control connection is the “well known” service

• The control connection uses the TELNET protocol

• Commands and replies are all line oriented text (default
  is ASCII)




                                                             9
Standard Connection Model




           Control

A
A          Data             B
                            B
             Fig .3


                                10
Alternative Connection Model


 Control                 Control
              A


B
B           Data                   C
                                   C
                Fig .4

                                       11
Transfer Modes
• FTP defines two types of transfer
   – textual and binary
• Textual: is used for text files
   – most text files are encoded in ASCII or EBCDIC
   – ftp can translate from the local to remote character
     set when transferring a file
• Binary: used for all other files (audio, image, numbers,
  …)
   – Files are copied exactly
   – The resulting copy might be meaningless because
     FTP does not convert values to the local
     representation

                                                             12
FTP: File Transfer Protocol


                FTP                   file transfer
                        FTP                            FTP
                user   client                         server
             interface

                         local file                            remote file
  user
                         system                                system
 at host
                                       Fig .5


• transfer file to/from remote host
• client/server model
   – client: side that initiates transfer (either to/from remote)
   – server: remote host, serves the file
• ftp: RFC 959
• ftp server: port 21 (well known)
                                                                             13
Separate Control & Data Connections

• ftp client contacts server at
  port 21, specifying TCP as
  the transport protocol                       TCP control connection
                                                      port 21
• Parallel TCP connections
   – control: exchange commands,
                                               TCP data connection
     responses between client and      FTP          port 20           FTP
     server                           client                         server
   – data: file data to/from server
                                                    Fig .6
• ftp server maintains “state”
   – current directory
   – earlier authentication


                                                                        14
FTP Client Commands

Command              Description
get filename         Retrieve file from server

mget filename*       Retrieve multiple files from server

put filename         Copy local file to server

mput filename*       Copy multiple local files to server

open server          Begin login to server

bye / close / exit   Logoff server

ls / dir             List files in current remote dir on server

lcd                  Change local directory

cd                   Change remote directory

rhelp / remotehelp
                                                                  15
           Table 1
FTP Commands


       Command                              Description
Abor                          Abort previous FTP command and any
                              data transfer
List [filelist ]              List files or directories (ls / dir)

Pass password                 Password on server

Port n1,n2,n3,n4,n5,n6        Client IP and port number

Retr filename                 Retrieve (get) filename

Stor filename                 Store (put) filename

Noop                          Do nothing (check if server is alive)


                    Table 2
                                                                      16
FTP Response Format

Reply                            Description
 1yz    Positive preliminary reply.The action is being started but
          expect another reply before sending another cmd
 2yz    Positive completion reply. A new cmd can be sent
 3yz    Positive intermediate reply. The cmd has been accepted but
            another cmd must be sent
 4yz    Transient negative completion reply. The requested action
            did not take place but can be sent later
 5yz    Permanent negative completion reply. Cmd not accepted and
            should not be reissued
 x0z    Syntax errors
 x1z    Information
 x2z    Connections. Replies referring to the control or data
          connections
 x3z    Authentication and accounting

 x4z    Unspecified
 x5z    Filesystem status                         Table 3
                                                                     17
Example FTP Responses

• 120   Service will be ready shortly
• 200   Command OK
• 230   User login OK
• 331   User name OK; password is needed
• 421   Service not available
• 503   Bad sequence of commands
• 530   User not logged in


                                           18
Connections, Authorizations and File permissions

 • The remote system has to verify that the user is
   authorized to access files
    – The user has to provide a login name and a password
    – If the user is authorized he/she may start transferring
      files
 • What if the user does not have an account?
    – System administrator can configure FTP to support
      anonymous FTP
    – Login name anonymous and password guest (or e-
      mail address) allows a user access to public files


                                                            19
FTP uses the client-server paradigm

– Local application (or
  browser) is the client
– Remote FTP program
  is the server
– The FTP server
  authorizes the
  connection, locates
  the file, and uses TCP
                             Fig .8
  to send it



                                      20
Active Mode FTP
• Client connect from a random unprivileged port (n >
  1023) to the servers command port (21) and sends
  port command to tell server to connect to n+1 then
  listens on the next higher unprivileged port (n+1) for
  server responses. The server connects from it’s data
  port (20) to the client data port (n+1)
              Server                      Client
         20       21                   1026        1027


                           1

                                   2

                       3


                               4


                                                          21
Passive Mode FTP
• Client opens two random unprivileged ports ( n >
  1023 and n+1; ex 1026 and 1027) and connects the
  first port (n) to server command port 21 and issues a
  pasv command (server sends port to use for data);
  client connects to servers specified data port, server
  completes connection

            Server                   Client
       20   2024   21             1026        1027

                          1

                              2

                           3


                           4


                                                           22
Transmission Modes

• Mode is used to specify additional coding or sequencing
  performed on data
• independent of data type and file structure
   – Stream        S      stream of bytes, if record
     structure            EOF sent as record indication;
                          if file eof indicated by closing
                          stream
   – Block         B      file sent as sequence of blocks
                          preceded by header info allows
                          restart of an interruped transfer
   – Compressed C         data compressed using run
                          length encoding
                                                          23
Transfer Files in a Heterogeneous Host
Environment

  • Due to multiple hardware types and operating systems
    file are converted to four environmentally neutral data
    type for transport and the converted to local types at the
    destination
     – ASCII A         NVT-ASCII
     – EBCDIC          E       EBCDIC Text
     – IMAGE I         Raw binary, series of octets
     – LOCAL L         Raw binary using a variable byte size
  • Client responsibility to tell server data type to use
  • Default data type, unless otherwise specified is ASCII


                                                             24
File Structures

• Operating System store files in different structures
• FTP defined file structures for transporting files
   – File      F      Unstructured, sequence of bytes
   – Record R         Series of records
   – Page P           Series of data blocks (pages)
• Default file structure is File (F)
• File Structure specified using STRU command




                                                         25
A Browser can use FTP
• A W W W browser can be used for FTP instead of a
  dedicated interface
• A browser uses FTP as the transfer protocol, when the
  URL starts with ftp (instead of http)
• Example
   – ftp://ftp.acunix.albany.edu/as7656/temp --- instructs
     the browser to get file “as7656/temp” from machine
     ftp.acunix.edu
   – ftp://ftp.acunix.edu/as7656 --- displays all files in the
     directory “as7656”




                                                                 26
Summary

In this class, you have learnt about


       • File Transfer Protocol
       • Commands & Responses
       • FTP Transfer Modes
       • Transaction Phase
       • Transmission Modes



                                       27
Quiz
1)   FTP uses 2 TCP ports : one for data transfer and the
     other for____
A)   Control

2)   Control connection uses ___ protocol
A)   Telnet

3)   The FTP command used to retrieve a file from the
      remote computer is ___
A)   Get

4)   The remote system verifies ____ and ___ to
     authorize user to access files
A)   login Name (or user id) and Password
                                                            28
Frequently Asked Questions


1. Explain file transfer protocol (FTP)




                                     Home              29
                             ftp protocol with video

Más contenido relacionado

La actualidad más candente

File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocolguest029bcd
 
Lecture 7 -_ftp,_tftp,_telnet_and_ssh
Lecture 7 -_ftp,_tftp,_telnet_and_sshLecture 7 -_ftp,_tftp,_telnet_and_ssh
Lecture 7 -_ftp,_tftp,_telnet_and_sshSerious_SamSoul
 
File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer ProtocolVinh Nguyen
 
(Ftp) file transfer protocol
(Ftp)   file transfer protocol(Ftp)   file transfer protocol
(Ftp) file transfer protocolGouasmia Zakaria
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocolAmandeep Kaur
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocolVipin Rai
 
FTP - File Transfer Protocol
FTP - File Transfer ProtocolFTP - File Transfer Protocol
FTP - File Transfer ProtocolPeter R. Egli
 
TFTP - Trivial File Transfer Protocol
TFTP - Trivial File Transfer ProtocolTFTP - Trivial File Transfer Protocol
TFTP - Trivial File Transfer ProtocolPeter R. Egli
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsHimanshu Pathak
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)Raghu nath
 
File Transfer Protocol(FTP)
File Transfer Protocol(FTP)File Transfer Protocol(FTP)
File Transfer Protocol(FTP)Varnit Yadav
 
Domain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTPDomain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTPsaurav kumar
 

La actualidad más candente (20)

File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocol
 
Lecture 7 -_ftp,_tftp,_telnet_and_ssh
Lecture 7 -_ftp,_tftp,_telnet_and_sshLecture 7 -_ftp,_tftp,_telnet_and_ssh
Lecture 7 -_ftp,_tftp,_telnet_and_ssh
 
File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocol
 
(Ftp) file transfer protocol
(Ftp)   file transfer protocol(Ftp)   file transfer protocol
(Ftp) file transfer protocol
 
Ftp tftp
Ftp tftpFtp tftp
Ftp tftp
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocol
 
Ftp server
Ftp serverFtp server
Ftp server
 
FTP
FTPFTP
FTP
 
TFTP
TFTPTFTP
TFTP
 
FTP & TFTP
FTP & TFTPFTP & TFTP
FTP & TFTP
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocol
 
Ftp server
Ftp serverFtp server
Ftp server
 
FTP - File Transfer Protocol
FTP - File Transfer ProtocolFTP - File Transfer Protocol
FTP - File Transfer Protocol
 
TFTP - Trivial File Transfer Protocol
TFTP - Trivial File Transfer ProtocolTFTP - Trivial File Transfer Protocol
TFTP - Trivial File Transfer Protocol
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer Protocols
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
 
File Transfer Protocol(FTP)
File Transfer Protocol(FTP)File Transfer Protocol(FTP)
File Transfer Protocol(FTP)
 
Ftp
FtpFtp
Ftp
 
Domain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTPDomain name system (dns) , TELNET ,FTP, TFTP
Domain name system (dns) , TELNET ,FTP, TFTP
 
An overview of ftp
An overview of ftpAn overview of ftp
An overview of ftp
 

Destacado

Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commandsHimani Singh
 
Different types of Editors in Linux
Different types of Editors in LinuxDifferent types of Editors in Linux
Different types of Editors in LinuxBhavik Trivedi
 
Telnet & SSH Configuration
Telnet & SSH ConfigurationTelnet & SSH Configuration
Telnet & SSH ConfigurationVinod Gour
 
Presentation on telnet
Presentation on telnetPresentation on telnet
Presentation on telnetAmandeep Kaur
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linuxanandvaidya
 
Text editor
Text editorText editor
Text editorsriashu
 

Destacado (10)

Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commands
 
Vi editor in linux
Vi editor in linuxVi editor in linux
Vi editor in linux
 
Different types of Editors in Linux
Different types of Editors in LinuxDifferent types of Editors in Linux
Different types of Editors in Linux
 
Telnet & SSH Configuration
Telnet & SSH ConfigurationTelnet & SSH Configuration
Telnet & SSH Configuration
 
Telnet
TelnetTelnet
Telnet
 
TELNET Protocol
TELNET ProtocolTELNET Protocol
TELNET Protocol
 
Presentation on telnet
Presentation on telnetPresentation on telnet
Presentation on telnet
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Text editor
Text editorText editor
Text editor
 
The "vi" Text Editor
The "vi" Text EditorThe "vi" Text Editor
The "vi" Text Editor
 

Similar a Introduction to FTP Protocol

ftp.07f.ppt
ftp.07f.pptftp.07f.ppt
ftp.07f.pptaozcan1
 
BITM3730Week10.pptx
BITM3730Week10.pptxBITM3730Week10.pptx
BITM3730Week10.pptxMattMarino13
 
Telnet and FTP.ppt
Telnet and FTP.pptTelnet and FTP.ppt
Telnet and FTP.pptssuser1774d3
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocolTechieHands
 
Computer network
Computer networkComputer network
Computer networkPihu Goel
 
Application layer
Application layerApplication layer
Application layerNeha Kurale
 
Application layer
Application layerApplication layer
Application layerNeha Kurale
 
File tranfer protocol
File tranfer protocolFile tranfer protocol
File tranfer protocolKunalThorat9
 
Web Dev Research
Web Dev ResearchWeb Dev Research
Web Dev Researchnathomas82
 
File Transfer Protocol (FTP)
File Transfer Protocol (FTP)File Transfer Protocol (FTP)
File Transfer Protocol (FTP)AxelXrest
 
10 Lecture Ftp
10 Lecture Ftp10 Lecture Ftp
10 Lecture FtpEri Alam
 
009478419.pdf
009478419.pdf009478419.pdf
009478419.pdfEidTahir
 
FILE TRANSFER PROTOCOL BY LAXMI $ Group
FILE TRANSFER PROTOCOL BY LAXMI $ GroupFILE TRANSFER PROTOCOL BY LAXMI $ Group
FILE TRANSFER PROTOCOL BY LAXMI $ Grouprajeev bhatt
 
FTP-PPT.pptx
FTP-PPT.pptxFTP-PPT.pptx
FTP-PPT.pptxMemerhub1
 
Group20 Dynamic Networks
Group20 Dynamic NetworksGroup20 Dynamic Networks
Group20 Dynamic Networkshariprasadnr
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- finalTaymoor Nazmy
 
application layer protocol for iot.pptx
application layer protocol for iot.pptxapplication layer protocol for iot.pptx
application layer protocol for iot.pptxaravind Guru
 

Similar a Introduction to FTP Protocol (20)

ftp.07f.ppt
ftp.07f.pptftp.07f.ppt
ftp.07f.ppt
 
BITM3730Week10.pptx
BITM3730Week10.pptxBITM3730Week10.pptx
BITM3730Week10.pptx
 
Telnet and FTP.ppt
Telnet and FTP.pptTelnet and FTP.ppt
Telnet and FTP.ppt
 
File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocol
 
Ft pv2(1)
Ft pv2(1)Ft pv2(1)
Ft pv2(1)
 
patelchodu
patelchodupatelchodu
patelchodu
 
File transfer protocol
File transfer protocolFile transfer protocol
File transfer protocol
 
Computer network
Computer networkComputer network
Computer network
 
Application layer
Application layerApplication layer
Application layer
 
Application layer
Application layerApplication layer
Application layer
 
File tranfer protocol
File tranfer protocolFile tranfer protocol
File tranfer protocol
 
Web Dev Research
Web Dev ResearchWeb Dev Research
Web Dev Research
 
File Transfer Protocol (FTP)
File Transfer Protocol (FTP)File Transfer Protocol (FTP)
File Transfer Protocol (FTP)
 
10 Lecture Ftp
10 Lecture Ftp10 Lecture Ftp
10 Lecture Ftp
 
009478419.pdf
009478419.pdf009478419.pdf
009478419.pdf
 
FILE TRANSFER PROTOCOL BY LAXMI $ Group
FILE TRANSFER PROTOCOL BY LAXMI $ GroupFILE TRANSFER PROTOCOL BY LAXMI $ Group
FILE TRANSFER PROTOCOL BY LAXMI $ Group
 
FTP-PPT.pptx
FTP-PPT.pptxFTP-PPT.pptx
FTP-PPT.pptx
 
Group20 Dynamic Networks
Group20 Dynamic NetworksGroup20 Dynamic Networks
Group20 Dynamic Networks
 
Computer network coe351- part2- final
Computer network coe351- part2- finalComputer network coe351- part2- final
Computer network coe351- part2- final
 
application layer protocol for iot.pptx
application layer protocol for iot.pptxapplication layer protocol for iot.pptx
application layer protocol for iot.pptx
 

Más de myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Introduction to FTP Protocol

  • 1. Sub Topic : Introduction to File Transfer Protocol (FTP) . ftp protocol with video 1
  • 2. Recap In the previous class, you have learnt about • Post Office Protocol • Installation and configuration of POP3 connector • POP and commands and process • Limitations of POP • Internet Mail Access Protocol (IMAP) • Comparison of POP and IMAP 2
  • 3. Objectives On completion of this class, you would be able to understand about • FTP’s connections • FTP commands and responses • FTP in action • FTP Connections • Transfer Modes 3
  • 4. Recap of Mail Protocols BHARATHI SANTOSH SMTP SMTP POP3 or user user agent IMAP agent sender’s mail receiver’s mail server server Fig .1 • SMTP: delivery/storage to receiver’s mail server • Mail access protocols: retrieval from server – POP: Post Office Protocol [RFC 1939] • authorization and download – IMAP: Internet Mail Access Protocol [RFC 1730] • manipulation of stored messages on server – HTTP: Hotmail , Yahoo! Mail, etc 4
  • 5. File Transfer Protocol (FTP) • A general-purpose protocol that can be used to copy an arbitrary file from one computer to another • one of the oldest network application---predates TCP and IP • Later versions were built on top of TCP/IP • Among the most heavily used applications – FTP generated as much as 1/3 of the traffic on the Internet – Was exceeded only by WWW (in 1995) 5
  • 6. File Transfer Protocol • Provides reliable transfer of files • Between different hosts running on different platforms MS Windows, Apple Mac, Sun, BSD UNIX, SCO UNIX, Linux • Using different file structures • Supports ASCII and binary content Fig .2 6
  • 7. FTP Standards • RFC 959 • uses two TCP Ports – one for control – one for data transfers • command-response protocol • control port uses telnet protocol to negotiate session – US-ASCII – <crlf> is end-of-line character 7
  • 8. Control and Data Connections • Control functions (commands) and reply codes are transferred over the control connection • All data transfer takes place over the data connection • The control connection must be “up” while data transfer takes place 8
  • 9. Control Connection • The control connection is the “well known” service • The control connection uses the TELNET protocol • Commands and replies are all line oriented text (default is ASCII) 9
  • 10. Standard Connection Model Control A A Data B B Fig .3 10
  • 11. Alternative Connection Model Control Control A B B Data C C Fig .4 11
  • 12. Transfer Modes • FTP defines two types of transfer – textual and binary • Textual: is used for text files – most text files are encoded in ASCII or EBCDIC – ftp can translate from the local to remote character set when transferring a file • Binary: used for all other files (audio, image, numbers, …) – Files are copied exactly – The resulting copy might be meaningless because FTP does not convert values to the local representation 12
  • 13. FTP: File Transfer Protocol FTP file transfer FTP FTP user client server interface local file remote file user system system at host Fig .5 • transfer file to/from remote host • client/server model – client: side that initiates transfer (either to/from remote) – server: remote host, serves the file • ftp: RFC 959 • ftp server: port 21 (well known) 13
  • 14. Separate Control & Data Connections • ftp client contacts server at port 21, specifying TCP as the transport protocol TCP control connection port 21 • Parallel TCP connections – control: exchange commands, TCP data connection responses between client and FTP port 20 FTP server client server – data: file data to/from server Fig .6 • ftp server maintains “state” – current directory – earlier authentication 14
  • 15. FTP Client Commands Command Description get filename Retrieve file from server mget filename* Retrieve multiple files from server put filename Copy local file to server mput filename* Copy multiple local files to server open server Begin login to server bye / close / exit Logoff server ls / dir List files in current remote dir on server lcd Change local directory cd Change remote directory rhelp / remotehelp 15 Table 1
  • 16. FTP Commands Command Description Abor Abort previous FTP command and any data transfer List [filelist ] List files or directories (ls / dir) Pass password Password on server Port n1,n2,n3,n4,n5,n6 Client IP and port number Retr filename Retrieve (get) filename Stor filename Store (put) filename Noop Do nothing (check if server is alive) Table 2 16
  • 17. FTP Response Format Reply Description 1yz Positive preliminary reply.The action is being started but expect another reply before sending another cmd 2yz Positive completion reply. A new cmd can be sent 3yz Positive intermediate reply. The cmd has been accepted but another cmd must be sent 4yz Transient negative completion reply. The requested action did not take place but can be sent later 5yz Permanent negative completion reply. Cmd not accepted and should not be reissued x0z Syntax errors x1z Information x2z Connections. Replies referring to the control or data connections x3z Authentication and accounting x4z Unspecified x5z Filesystem status Table 3 17
  • 18. Example FTP Responses • 120 Service will be ready shortly • 200 Command OK • 230 User login OK • 331 User name OK; password is needed • 421 Service not available • 503 Bad sequence of commands • 530 User not logged in 18
  • 19. Connections, Authorizations and File permissions • The remote system has to verify that the user is authorized to access files – The user has to provide a login name and a password – If the user is authorized he/she may start transferring files • What if the user does not have an account? – System administrator can configure FTP to support anonymous FTP – Login name anonymous and password guest (or e- mail address) allows a user access to public files 19
  • 20. FTP uses the client-server paradigm – Local application (or browser) is the client – Remote FTP program is the server – The FTP server authorizes the connection, locates the file, and uses TCP Fig .8 to send it 20
  • 21. Active Mode FTP • Client connect from a random unprivileged port (n > 1023) to the servers command port (21) and sends port command to tell server to connect to n+1 then listens on the next higher unprivileged port (n+1) for server responses. The server connects from it’s data port (20) to the client data port (n+1) Server Client 20 21 1026 1027 1 2 3 4 21
  • 22. Passive Mode FTP • Client opens two random unprivileged ports ( n > 1023 and n+1; ex 1026 and 1027) and connects the first port (n) to server command port 21 and issues a pasv command (server sends port to use for data); client connects to servers specified data port, server completes connection Server Client 20 2024 21 1026 1027 1 2 3 4 22
  • 23. Transmission Modes • Mode is used to specify additional coding or sequencing performed on data • independent of data type and file structure – Stream S stream of bytes, if record structure EOF sent as record indication; if file eof indicated by closing stream – Block B file sent as sequence of blocks preceded by header info allows restart of an interruped transfer – Compressed C data compressed using run length encoding 23
  • 24. Transfer Files in a Heterogeneous Host Environment • Due to multiple hardware types and operating systems file are converted to four environmentally neutral data type for transport and the converted to local types at the destination – ASCII A NVT-ASCII – EBCDIC E EBCDIC Text – IMAGE I Raw binary, series of octets – LOCAL L Raw binary using a variable byte size • Client responsibility to tell server data type to use • Default data type, unless otherwise specified is ASCII 24
  • 25. File Structures • Operating System store files in different structures • FTP defined file structures for transporting files – File F Unstructured, sequence of bytes – Record R Series of records – Page P Series of data blocks (pages) • Default file structure is File (F) • File Structure specified using STRU command 25
  • 26. A Browser can use FTP • A W W W browser can be used for FTP instead of a dedicated interface • A browser uses FTP as the transfer protocol, when the URL starts with ftp (instead of http) • Example – ftp://ftp.acunix.albany.edu/as7656/temp --- instructs the browser to get file “as7656/temp” from machine ftp.acunix.edu – ftp://ftp.acunix.edu/as7656 --- displays all files in the directory “as7656” 26
  • 27. Summary In this class, you have learnt about • File Transfer Protocol • Commands & Responses • FTP Transfer Modes • Transaction Phase • Transmission Modes 27
  • 28. Quiz 1) FTP uses 2 TCP ports : one for data transfer and the other for____ A) Control 2) Control connection uses ___ protocol A) Telnet 3) The FTP command used to retrieve a file from the remote computer is ___ A) Get 4) The remote system verifies ____ and ___ to authorize user to access files A) login Name (or user id) and Password 28
  • 29. Frequently Asked Questions 1. Explain file transfer protocol (FTP) Home 29 ftp protocol with video

Notas del editor

  1. Why separate control and data