FTP
This presentation is the property of its rightful owner.
Sponsored Links
1 / 18

FTP PowerPoint PPT Presentation


  • 82 Views
  • Uploaded on
  • Presentation posted in: General

FTP. Introduction. File Transfer Protocol RFC 959 Transfer file to / from remote host Client / Server architecture Separate control, data connection FTP server control connection : port 21. Model for FTP (1/2). User Interface. User. FTP Command. Server PI. User PI. FTP Replies.

Download Presentation

FTP

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Ftp

FTP


Introduction

Introduction

  • File Transfer Protocol

  • RFC 959

  • Transfer file to / from remote host

  • Client / Server architecture

  • Separate control, data connection

  • FTP server control connection : port 21


Model for ftp 1 2

Model for FTP (1/2)

User

Interface

User

FTP Command

Server

PI

User

PI

FTP Replies

Data

File

System

Server

DTP

User

DTP

File

System

Connection

Server-FTP

USER-FTP


Model for ftp 2 2

Model for FTP (2/2)

  • PI : The protocol interpreter

  • DTP : The data transfer process establishes and manages the data connection

  • The Data connection may be used in either direction

  • The data connection need not exist all of the time


Ftp command 1 3

FTP Command (1/3)

  • USER

    • Syntax : USER username

    • Used to send the user identification to the server

    • Response : 331 (username okay, need password)

  • PASS

    • Syntax : PASS password

    • Used to send password to the server

    • Response : 230 (user logged in)

  • PWD

    • Syntax : PWD

    • Used to get the current working directory

    • Response : 257 (current directory)


Ftp command 2 3

FTP Command (2/3)

  • PASV

    • Syntax : PASV

    • Used to request the server to listen on a data port

    • Response : 227 (entering passive mode)

    • The response includes the host and port address this server is listening on

    • Ex : 163.112.28.104.19.196

      • IP : 163.112.28.104

      • Port : 19x256+196 = 5060

  • LIST

    • Syntax : LIST

    • Used to ask the server to send back a list of all the files in the current remote directory


Ftp command 3 3

FTP Command (3/3)

  • CWD

    • Syntax : CWD pathname

    • Used to change working directory

    • Response : 250 (Request file action okay)

  • TYPE

    • Syntax : TYPE type

    • Response : 200

  • RETR

    • Syntax : RETR filename

    • Used to get a file from the current directory of the remote host


Ftp

NOTE

  • We must append “\r\n” to the end of FTP command


Login

Login

Client

Server

Control

Port

Control

Port(21)

TCP connection

220 ready

USER username

331 password require

PASS password

230 user username logged in


Print working directory

Print Working Directory

Client

Server

Control

Port

Control

Port(21)

PWD

257 “/” is current direction


List files in current directory

List Files in Current Directory

Client

Server

Data

Port

Control

Port

Control

Port(21)

Data

Port

PASV

227 Entering Passive Mode

(163.112.28.104.19.196)

LIST

TCP connection

Port:

5060

150 Data Connection

FTP-DA

Close TCP connection

226 Transfer ok


Change working directory

Change Working Directory

Client

Server

Control

Port

Control

Port(21)

CWD pathname

250 CWD command successful


Download file 1 2

Download File (1/2)

Client

Server

Data

Port

Control

Port

Control

Port(21)

Data

Port

Type I

200 Type set to I

PASV

227 Entering Passive Mode

RETR filename

TCP connection

150 Data Connection

FTP-DA (傳檔案)


Download file 2 2

Download File (2/2)

Client

Server

Data

Port

Control

Port

Control

Port(21)

Data

Port

Close TCP connection

226 file send ok


Resource

Resource

  • RFC 959, http://www.ietf.org

  • Ethereal, http://www.ethereal.com


Ftp

評分標準

  • 基本功能 (共85%)

    • 顯示所有傳送出和接收到的訊息 (5%)

    • 使用帳號和密碼登入FTP Server (15%)

    • 顯示目前所在工作目錄 (10%)

    • 列出目前工作目錄內容 (15%)

    • 切換工作目錄 (10%)

    • 下載FTP Server端的檔案至本機端磁碟中 (25%)

    • 結束與FTP Server的連線 (5%)

  • 書面報告 (共10%)

    • 程式架構與寫法介紹 (5%)

    • 程式功能與操作方法 (5%)

  • 程式註解 (5%)

  • 其他功能 (Bonus)

    • 上傳檔案至FTP Server (10%)

    • 可同時下載多個檔案 (10%)


Ftp

繳交日期

  • 94年5月9日 24:00前

  • 於截止時間前將Source Code寄至 [email protected]

  • Demo地點 : R219

  • Demo時段

    • 5/10 (三)

    • 5/11 (四)

  • 請於Demo前一週至R442門口填表預約時段


Ftp

注意事項

  • 可以使用任何程式語言

  • 不可使用和FTP相關的API

  • Demo時當場以截止繳交日期前寄出的source code編譯執行檔

  • 執行環境以R219電腦中可提供的為主,如使用特殊的Compiler,請自行準備執行環境

  • 作業驗收標準以可在 R219 之電腦執行為準,若Demo時程式無法於 R219 之電腦執行,則視同作業未完成 (可自備執行環境,工作站上亦可)

  • 作業驗收時,只要能通過指定的FTP Server之測試即可

  • 作業請勿抄襲

  • Demo 時請攜帶書面報告紙本,並於封面註明姓名與學號


  • Login