lecture 22- ftp

Upload: aji-kurniawan-rahman

Post on 04-Jun-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Lecture 22- FTP

    1/25

  • 8/13/2019 Lecture 22- FTP

    2/25

  • 8/13/2019 Lecture 22- FTP

    3/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    FTP uses the services of TCP.

    It needs two TCP connections.

    The well-known port 21 is usedfor the control connection

    and the well-known

    port 20 for the data connection.

  • 8/13/2019 Lecture 22- FTP

    4/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Figure 20-1

    FTP

  • 8/13/2019 Lecture 22- FTP

    5/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    20.1 Connections: The control connection

  • 8/13/2019 Lecture 22- FTP

    6/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    The Data Connection

    Uses Servers well-known port 20

    1. Client issues a passive open on an ephemeralport, sayx.

    2. Client uses PORT command to tell the serverabout the port numberx.

    3. Server issues an active open from port 20 to

    portx.4. Server creates a child server/ephemeral port

    number to serve the client

  • 8/13/2019 Lecture 22- FTP

    7/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Creatingthe data

    connection

  • 8/13/2019 Lecture 22- FTP

    8/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Figure 20-4

    20.2 Communication

    Using the control connection

  • 8/13/2019 Lecture 22- FTP

    9/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    NVT

    FTP FTP

  • 8/13/2019 Lecture 22- FTP

    10/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Format of NVT ASCII characters

  • 8/13/2019 Lecture 22- FTP

    11/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Format of NVT control characters

  • 8/13/2019 Lecture 22- FTP

    12/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Figure 20-5

    Using the data connection

  • 8/13/2019 Lecture 22- FTP

    13/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    File Type

    ASCII or EBCDIC

    Nonprint

    TELNET

    Image

  • 8/13/2019 Lecture 22- FTP

    14/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Data Structure

    File Structure

    Record Structure

    Page Structure

  • 8/13/2019 Lecture 22- FTP

    15/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Transmission Mode

    Stream mode

    Block mode

    Compressed mode

  • 8/13/2019 Lecture 22- FTP

    16/25McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    20.3 Command processing

    Access Commands File Management

    Data Formatting

    Port defining File transfer

    Miscellaneous

  • 8/13/2019 Lecture 22- FTP

    17/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    20.4 File transfer

    Fi 20 8

  • 8/13/2019 Lecture 22- FTP

    18/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Figure 20-8

    Example 1

    Fi 20 9

  • 8/13/2019 Lecture 22- FTP

    19/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Figure 20-9Example 2

  • 8/13/2019 Lecture 22- FTP

    20/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    USERINTERFACE

    20.5

  • 8/13/2019 Lecture 22- FTP

    21/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Solution

    %ftp challenger.atc.fhda.edu

    Connected to challenger.atc.fhda.edu

    220 Server ready

    Name:forouzan

    Password:xxxxxxx

    ftp >ls /usr/user/report

    200 OK

  • 8/13/2019 Lecture 22- FTP

    22/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Solution

    150 Opening ASCII mode

    ...........

    226 transfer complete

    ftp >close

    221 Goodbye

    ftp >quit

  • 8/13/2019 Lecture 22- FTP

    23/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    ANONYMOUS

    FTP

    20.6

    S l i

  • 8/13/2019 Lecture 22- FTP

    24/25

    McGraw-Hill The McGraw-Hill Companies, Inc., 2000

    Solution

    % ftp internic.net

    Connected to internic.net

    220 Server ready

    Name:anonymous

    331 Guest login OK, send guestas password

    Password:guestftp >pwd

    257 /is current directory

    S l ti

  • 8/13/2019 Lecture 22- FTP

    25/25

    ll h ll

    Solution

    ftp >ls

    200 OK

    150 Opening ASCII mode

    bin

    ftp> close221 Goodbye

    ftp> quit