File Transfer Protocol

  • transport layer service used: TCP
  • port number: 21 for control connection and some port for data connection

    The following commands are allowed before logging in:

    After logging in, the following are also allowed:

    To emulate a typical FTP session we need to open two DOS windows and have either a small server (which is capable on listening on a given port and printing all incoming messages on the screen) or be ready to start the second TELNET client. Then the session may look like:

    ...> telnet ist.marshall.edu 21
    220 ProFTPD 1.2.7 Server (ProFTPD Default Installation) [dementiev-x.marshall.edu]
    user ist362
    331 Password required for ist362.
    pass test
    230 User ist362 logged in.
    port 10,102,44,119,8,0 use IP of your computer here
    At this moment we need to start the server and make the server wait on the
    port 2048 = 8*256+0. We also assume that the IP of the computer we are working on is 10.102.44.119
    200 PORT command successful
    list
    150 Opening ASCII mode data connection for file list
    226 Transfer complete.
    pasv
    227 Entering Passive Mode (10,102,44,117,130,55).
    At this moment we need to start the second telnet client and connect to
    IP 10.102.44.117 PORT 33335 = 130*256+55
    noop
    200 NOOP command successful.
    retr hello.txt
    150 Opening ASCII mode data connection for message.txt (147 bytes)
    226 Transfer complete.
    quit
    221 Goodbye.
    

    For more information read RFC spec about FTP.