SlideShare a Scribd company logo
1 of 13
Download to read offline
Computer Networks – CSE331
Lecture 8
1 Hr
file transfer
FTP
server
FTP
user
interface
FTP
client
local file
system
remote file
system
user
at host
 transfer file to/from remote host
 client/server model
 client: side that initiates transfer (either to/from remote)
 server: remote host
 ftp: RFC 959
 ftp server: port 21
 FTP client (FileZila, CuteFtp etc)
 Separate connection for commands and data
 2 connections
 21 for commands (persistent)
 20 for data (non-persistent)
 Out of band
 Data connection can be initiated by
server (PORT command) or by client (PASV
command)
 Remember connection status history
(authentication, cur dir)
21
20
MSG MSG
101010101101…
 Control Connection
 Server Port 21
 NVT ASCII format
 Each command or
response is one line
 Terminated by CR LF
 Data Connection
 Server port 20
 File type, data
structure, transmission
mode defined by client
 File type
 NVT ASCII
 EBCDIC
 Image
 Data structure
 File structure
(stream) default
 Record structure
 Page Structure
 Transmission mode
 Stream mode
 EOF is when connection close
 Block mode
 Data in the form of block
 3 byte header (1 byte descriptor, 2
byte block length)
 Compress mode
TYPE
command
STRU
command
MODE
command
 Let the user to access remote system
Command Argument Description
USER User id User name to login
PASS Password Login password
ACCT Account to be changed Account information
REIN Reinitialize
QUIT Logout from system
ABOR Abort previous command
 Access/navigate the file system, manipulate files
Command Argument Description
CWD Directory name Change directory
CDUP Change to parent dir
DELE File name Delete a file
LIST Directory name List subdirectory or files
NLIST Directory name List subdirectory or file without attributes
MKWD Directory name Create directory
PWD Name of current directory
RMD Directory name Delete a directory
RNFR File name (old) File to be renamed
RNTO File name (new) Rename the file
SMNT File system name Mount a file system
 Sent the data connection options
Command Argument Description
TYPE A (NVT ASCII), E (EBCDIC), I
(Image), N (Nonprint), T (Telnet)
Define file type
STRU F (File), R (Record), P (Page) Define organization of data
MODE S (Stream), B (Block), C
(Compressed)
Define transmission mode
 Define port number for data connection
Command Argument Description
PORT 6 digit identifier Client choose a port
PASV Server chooses a port
PORT a1,a2,a3,a4,p1,p2
This is interpreted as IP address a1.a2.a3.a4, port p1*256+p2
Does port command always work/used? Brain storm on weekend
 3 digit number followed by text in action of any command
 First digit can be 1-5
 1yz Positive preliminary reply
 2yz Positive completion reply
 3yz Positive intermediate reply
 4yz Transient negative completion reply
 5yz Permanent negative completion reply
 Second digit can be 0-5
 x0z Syntax
 x1z information
 x2z connection
 x3z authentication
 x4z unspecified
 x5z file system
Third digit provide additional information
See table 21.7 from forouzan
Control connection b/w client
server
220 Service Ready
USER ali12
331 User Ok password?
PWD XYZXYZ
230 user login OK
PORT 8888
150 Data connection opens shortly
LIST usr/backup/reports
125 Data connection OK
Data connection b/w client
server
List of file or dirs
Connection closed
Data Transfer
QUIT
221 Service closing
226 Closing data connection
Control connection b/w client
server
220 Service Ready
USER ali12
331 User Ok password?
PWD XYZXYZ
230 user login OK
PORT 1900
150 Data connection opens shortly
TYPE I
200 OK
Data connection b/w client
server
Send file
Connection closed
QUIT
221 Service closing
226 Closing data connection
STRU F
200 OK
STOR usr/backup/y5.jpg
250 OK connection open
Data transfer
 Some FTP server maintain public account for some public
files
 User is Ananymous
 PWD is guest
 Restricted access
 FTP is not secure as sending password as plain
 Trivial File Transfer Protocol (TFTP)
 Less features of FTP, light weight
 Uses UDP on port 69
 But UDP is non-reliable
 Uses ACKs to confirm data
 Demo
 Ross book 2.3
 Forouzan book Chapter 21 (Leave details of TFTP)
 List of FTP commands
 http://www.nsftools.com/tips/RawFTP.htm

More Related Content

What's hot

Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
asimnawaz54
 
Point To Point Protocol
Point To Point ProtocolPoint To Point Protocol
Point To Point Protocol
Phan Vuong
 

What's hot (20)

FTP & TFTP
FTP & TFTPFTP & TFTP
FTP & TFTP
 
5. protocol layering
5. protocol layering5. protocol layering
5. protocol layering
 
Multiplexing
MultiplexingMultiplexing
Multiplexing
 
Lecture 6 -_presentation_layer
Lecture 6 -_presentation_layerLecture 6 -_presentation_layer
Lecture 6 -_presentation_layer
 
TCP/ IP
TCP/ IP TCP/ IP
TCP/ IP
 
IPv4
IPv4IPv4
IPv4
 
X.25
X.25X.25
X.25
 
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
TCP & UDP ( Transmission Control Protocol and User Datagram Protocol)
 
Chapter04 -- network protocols
Chapter04  -- network protocolsChapter04  -- network protocols
Chapter04 -- network protocols
 
ATM Networking Concept
ATM Networking ConceptATM Networking Concept
ATM Networking Concept
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
Telnet
TelnetTelnet
Telnet
 
Internet control message protocol
Internet control message protocolInternet control message protocol
Internet control message protocol
 
Tcpip services and applications
Tcpip services and applicationsTcpip services and applications
Tcpip services and applications
 
Tcp/ip model
Tcp/ip  modelTcp/ip  model
Tcp/ip model
 
Remote procedure call
Remote procedure callRemote procedure call
Remote procedure call
 
Ftp
FtpFtp
Ftp
 
Point To Point Protocol
Point To Point ProtocolPoint To Point Protocol
Point To Point Protocol
 
X.25 protocol
X.25 protocolX.25 protocol
X.25 protocol
 
User datagram protocol (udp)
User datagram protocol (udp)User datagram protocol (udp)
User datagram protocol (udp)
 

Similar to Lec 8(FTP Protocol)

To Get To The Command Prompt In Windows Xp Go To
To Get To The Command Prompt In Windows Xp Go ToTo Get To The Command Prompt In Windows Xp Go To
To Get To The Command Prompt In Windows Xp Go To
drcha drche
 
ftp.07f.ppt
ftp.07f.pptftp.07f.ppt
ftp.07f.ppt
aozcan1
 

Similar to Lec 8(FTP Protocol) (20)

F T P
F T PF T P
F T P
 
13 coms 525 tcpip - applications - file transfer protocol
13   coms 525 tcpip - applications - file transfer protocol13   coms 525 tcpip - applications - file transfer protocol
13 coms 525 tcpip - applications - file transfer protocol
 
Cmd
CmdCmd
Cmd
 
File tranfer protocol
File tranfer protocolFile tranfer protocol
File tranfer protocol
 
CMD Command
CMD CommandCMD Command
CMD Command
 
patelchodu
patelchodupatelchodu
patelchodu
 
File transfer protocol (ftp) in application
File transfer protocol (ftp) in applicationFile transfer protocol (ftp) in application
File transfer protocol (ftp) in application
 
All dos commands
All dos commandsAll dos commands
All dos commands
 
OSI (Open System Interconnection) Model
OSI (Open System Interconnection) Model OSI (Open System Interconnection) Model
OSI (Open System Interconnection) Model
 
Cmd
CmdCmd
Cmd
 
Cmd
CmdCmd
Cmd
 
CCNA Day 1
CCNA Day 1CCNA Day 1
CCNA Day 1
 
Cita310chap09
Cita310chap09Cita310chap09
Cita310chap09
 
OSI layer by cisco
OSI layer by ciscoOSI layer by cisco
OSI layer by cisco
 
Using an FTP client - Client server computing
Using an FTP client -  Client server computingUsing an FTP client -  Client server computing
Using an FTP client - Client server computing
 
To Get To The Command Prompt In Windows Xp Go To
To Get To The Command Prompt In Windows Xp Go ToTo Get To The Command Prompt In Windows Xp Go To
To Get To The Command Prompt In Windows Xp Go To
 
ftp.07f.ppt
ftp.07f.pptftp.07f.ppt
ftp.07f.ppt
 
File Transfer Protocol
File Transfer ProtocolFile Transfer Protocol
File Transfer Protocol
 
An overview of ftp
An overview of ftpAn overview of ftp
An overview of ftp
 
Internetworking Overview
Internetworking OverviewInternetworking Overview
Internetworking Overview
 

More from maamir farooq (20)

Ooad lab1
Ooad lab1Ooad lab1
Ooad lab1
 
Lesson 03
Lesson 03Lesson 03
Lesson 03
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Php client libray
Php client librayPhp client libray
Php client libray
 
Swiftmailer
SwiftmailerSwiftmailer
Swiftmailer
 
Lect15
Lect15Lect15
Lect15
 
Lec 7
Lec 7Lec 7
Lec 7
 
Lec 6
Lec 6Lec 6
Lec 6
 
Lec 5
Lec 5Lec 5
Lec 5
 
J query 1.7 cheat sheet
J query 1.7 cheat sheetJ query 1.7 cheat sheet
J query 1.7 cheat sheet
 
Assignment
AssignmentAssignment
Assignment
 
Java script summary
Java script summaryJava script summary
Java script summary
 
Lec 3
Lec 3Lec 3
Lec 3
 
Lec 2
Lec 2Lec 2
Lec 2
 
Lec 1
Lec 1Lec 1
Lec 1
 
Css summary
Css summaryCss summary
Css summary
 
Manual of image processing lab
Manual of image processing labManual of image processing lab
Manual of image processing lab
 
Session management
Session managementSession management
Session management
 
Data management
Data managementData management
Data management
 
Content provider
Content providerContent provider
Content provider
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 

Recently uploaded (20)

How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 

Lec 8(FTP Protocol)

  • 1. Computer Networks – CSE331 Lecture 8 1 Hr
  • 2. file transfer FTP server FTP user interface FTP client local file system remote file system user at host  transfer file to/from remote host  client/server model  client: side that initiates transfer (either to/from remote)  server: remote host  ftp: RFC 959  ftp server: port 21  FTP client (FileZila, CuteFtp etc)  Separate connection for commands and data
  • 3.  2 connections  21 for commands (persistent)  20 for data (non-persistent)  Out of band  Data connection can be initiated by server (PORT command) or by client (PASV command)  Remember connection status history (authentication, cur dir) 21 20 MSG MSG 101010101101…
  • 4.  Control Connection  Server Port 21  NVT ASCII format  Each command or response is one line  Terminated by CR LF  Data Connection  Server port 20  File type, data structure, transmission mode defined by client  File type  NVT ASCII  EBCDIC  Image  Data structure  File structure (stream) default  Record structure  Page Structure  Transmission mode  Stream mode  EOF is when connection close  Block mode  Data in the form of block  3 byte header (1 byte descriptor, 2 byte block length)  Compress mode TYPE command STRU command MODE command
  • 5.  Let the user to access remote system Command Argument Description USER User id User name to login PASS Password Login password ACCT Account to be changed Account information REIN Reinitialize QUIT Logout from system ABOR Abort previous command
  • 6.  Access/navigate the file system, manipulate files Command Argument Description CWD Directory name Change directory CDUP Change to parent dir DELE File name Delete a file LIST Directory name List subdirectory or files NLIST Directory name List subdirectory or file without attributes MKWD Directory name Create directory PWD Name of current directory RMD Directory name Delete a directory RNFR File name (old) File to be renamed RNTO File name (new) Rename the file SMNT File system name Mount a file system
  • 7.  Sent the data connection options Command Argument Description TYPE A (NVT ASCII), E (EBCDIC), I (Image), N (Nonprint), T (Telnet) Define file type STRU F (File), R (Record), P (Page) Define organization of data MODE S (Stream), B (Block), C (Compressed) Define transmission mode
  • 8.  Define port number for data connection Command Argument Description PORT 6 digit identifier Client choose a port PASV Server chooses a port PORT a1,a2,a3,a4,p1,p2 This is interpreted as IP address a1.a2.a3.a4, port p1*256+p2 Does port command always work/used? Brain storm on weekend
  • 9.  3 digit number followed by text in action of any command  First digit can be 1-5  1yz Positive preliminary reply  2yz Positive completion reply  3yz Positive intermediate reply  4yz Transient negative completion reply  5yz Permanent negative completion reply  Second digit can be 0-5  x0z Syntax  x1z information  x2z connection  x3z authentication  x4z unspecified  x5z file system Third digit provide additional information See table 21.7 from forouzan
  • 10. Control connection b/w client server 220 Service Ready USER ali12 331 User Ok password? PWD XYZXYZ 230 user login OK PORT 8888 150 Data connection opens shortly LIST usr/backup/reports 125 Data connection OK Data connection b/w client server List of file or dirs Connection closed Data Transfer QUIT 221 Service closing 226 Closing data connection
  • 11. Control connection b/w client server 220 Service Ready USER ali12 331 User Ok password? PWD XYZXYZ 230 user login OK PORT 1900 150 Data connection opens shortly TYPE I 200 OK Data connection b/w client server Send file Connection closed QUIT 221 Service closing 226 Closing data connection STRU F 200 OK STOR usr/backup/y5.jpg 250 OK connection open Data transfer
  • 12.  Some FTP server maintain public account for some public files  User is Ananymous  PWD is guest  Restricted access  FTP is not secure as sending password as plain  Trivial File Transfer Protocol (TFTP)  Less features of FTP, light weight  Uses UDP on port 69  But UDP is non-reliable  Uses ACKs to confirm data  Demo
  • 13.  Ross book 2.3  Forouzan book Chapter 21 (Leave details of TFTP)  List of FTP commands  http://www.nsftools.com/tips/RawFTP.htm