meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
courses:ct30a5000:assignment6 [2011/10/17 17:14]
julaakko [Additional notes and hints]
courses:ct30a5000:assignment6 [2012/09/10 12:46]
julaakko
Line 1: Line 1:
-Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5000/etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]] - +Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5001/etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]] - 
 Updated: ​ --- //​[[jussi.laakkonen@lut.fi|Jussi Laakkonen]] 2011/10/17 15:40// Updated: ​ --- //​[[jussi.laakkonen@lut.fi|Jussi Laakkonen]] 2011/10/17 15:40//
  
Line 5: Line 5:
  
  
-====== Assignment6: ​POP3 client ====== +====== Assignment6: ​FTP client ======
- +
-In this assignment you are going to implement Post Office Protocol3 (POP3) server according to [[http://​tools.ietf.org/​html/​rfc1939|RFC 1939]]. In POP3 protocol everything is sent as ASCII text command and each command string is terminated with carriage return and line feed -characters (CRLF). POP3 uses TCP as transport layer protocol.  +
- +
-Use your previously implemented test server for testing the client.+
  
 +In sixth assignment you'll implement a FTP client. It must comply to RFC specification of FTP and must be able to interact with FTP servers.
  
 ===== Description ===== ===== Description =====
  
-This is the second part of the POP3 assignment, in this  part you are going to implement ​a client ​for listing the mailbox contents ​on the serverClient should not crash if invalid data is received from the server. +Create ​FTP client ​based on [[http://​tools.ietf.org/​html/​rfc959|RFC 959]].
- +
-Client connects to the selected port of the server and after the authentication is successful the server allows the client to access the mailbox +
- +
-Client must support: +
- +
-  * logging in to mailbox +
-  * requesting of mails in the mailbox +
-  * requesting a specific mail from the mailbox and parsing the contents to be shown to the user +
-  * deleting the selected mail from the mailbox +
-  * reseting the state of the mailbox +
-  * logging out of the mailbox (quit) +
  
 ===== Requirements ===== ===== Requirements =====
- 
-Client has to support at least following commands resulting in protocol commands defined for minimal POP3 implementation in the [[http://​tools.ietf.org/​html/​rfc1939|RFC]]:  ​ 
- 
-^ User command ​    ^ Protocol command ^ When command is OK client should ​   ^ 
-| /user <​username>​ | USER <​username> ​ | ask for password. ​                  | 
-| /pass <​password>​ | PASS <​password> ​ |  | 
-| /noop            | NOOP             ​| ​ | 
-| /quit            | QUIT             | shut down. | 
-| /​status ​         | STAT             | print the mailbox size and message count to stdout | 
-| /list <​x> ​       | LIST <​x> ​        | print the message ids and sizes to stdout | 
-| /get <​x> ​        | RETR <​x> ​        | print the parsed message to stdout. | 
-| /delete <​x> ​     | DELE <​x> ​        | inform user that the messages was deleted | 
-| /​reset ​          | RSET             ​| ​ | 
- 
  
   * [[generic_features_to_implement|Generic features]]   * [[generic_features_to_implement|Generic features]]
-  * Client must handle possible error situations specified for each protocol command+  ​* Client 
-  Keep track of the state of the connection between client ​and server +    * Run with:​ <​code>​./​ftpclient -h <​hostname>​ -p <​port></​code>​ 
-    * Remember that some commands are available only in certain states+      * If no port defined (no ''​-p <​port>''​) use default FTP port. 
-  * Client must parse the message headers returned by the server and not to print them directly+    ​* Client must be interactive
-    Hide the ''​to'' ​field since the logged ​user should be the recipient +    Support both IP address and hostname ​of server. 
-    Always hide the message id  +    * Support **stream mode** only. 
-  To run the client:<​code>​./pop3client -h <pop3 server address> -p <​listening port></​code>​+    * Support both **upload** and **download**. 
 +    * Support **ascii** and **binary** files. 
 +      * Use __''​file-structure''​__ as data structure. 
 +      * Since we are dealing with x86 architecture there is no need to take care of different byte sizes. 
 +    * Support **active** and **passive** modes of FTP 
 +      * For help about the difference of active ​and passive FTP see [[http://​slacksite.com/​other/​ftp.html|Active FTP vs. Passive FTP, a Definitive Explanation]]) 
 +    * Support __anonymous FTP servers__ (no authentication). 
 +    * Must not crash in any circumstances
 +    * Client must support following
 +      Access control commands: 
 +        * **open** - open connection to server (send ''​anonymous'' ​as user name and empty password if no authentication is implemented) 
 +        **cd** - change working directory 
 +        * **close** - close connection to server 
 +      * Transfer parameter commands: 
 +        * **active** - change mode to active 
 +        * **passive** - change mode to passive 
 +      * FTP service commands: 
 +        * **get** - retrieve a file from server 
 +        * **put** - send a file to server 
 +        * **ls** - request a list of files on the server in current working directory 
 +      Other commands: 
 +        * **ascii** - change transfer mode to ascii 
 +        * **binary** - change transfer mode to binary 
 +        * **quit** - quit the client 
 +      * Process replies for these commands sent by server. 
 +    * Must be compatible with standard FTP servers 
 +  * OPTIONAL: 
 +    * Show transfer speed after transmission and the total size of the file. 
 +    * Implement support for user authentication. 
 +    * Implement commands (and handle replies properly):​ 
 +      * SYST 
 +      * STATUS 
 +      * HELP 
  
 +===== Protocol =====
  
 +[[http://​tools.ietf.org/​html/​rfc959|RFC 959]]
  
 ===== Additional notes and hints ===== ===== Additional notes and hints =====
  
-  * Remember the ''​CRLF''​ at the end of each protocol command.+  ​* HINT: **STATE MACHINE**. 
 +  * Read the RFC __carefully__. 
 +  ​* Remember ​that ''​\n''​ is not the line end marker in FTP. 
 +  * Some FTP servers to use for testing 
 +    * Anonymous FTP server in University network, no outside access: 
 +      * Name: venla.it.lut.fi 
 +      * IP: 157.24.27.242 
 +      * Port: Standard FTP port (21) 
 +      * Instructions:​ 
 +        * Username: anonymous 
 +        * Password: <blank i.e. no password>​ 
 +        * Folders 
 +          * ''​read/'' ​- Readonly access, contains example files (3 binary and 1 text). 
 +            * the ''​sample.txt''​ seems to contain linefeed+carriage return ​at the end of each line, new text file will be added without \r. 
 +          * ''​write/''​ - Write and read access, place to upload data. Will be cleared at 6:00 every morning, quota is 2GB (?). 
 +    * Funet FTP server: 
 +      * Address: ftp.funet.fi 
 +      * Port: Standard FTP port (21) 
 +      * Anonymous access from everywhere. 
 +      * Read only access. 
 +      * Provided by Funet 
 +      * Lots of different sized data (RFCs, Linux/UNIX images ...) 
 +    * Or you can install a FTP server on your own machine, some FTP servers: 
 +      * For Windows machines: 
 +        * [[http://​filezilla-project.org/​|Filezilla FTP server]] 
 +        * [[http://​smallftpd.sourceforge.net/​|Smallftpd]] 
 +        * [[http://​www.pablosoftwaresolutions.com/​html/​quick__n_easy_ftp_server.html|Quick 'n easy FTP server]] 
 +      * For Linux machines: 
 +        * [[http://​www.pureftpd.org/​project/​pure-ftpd|Pure-ftpd]] 
 +        * [[http://​vsftpd.beasts.org/​|Vstfpd]] 
 ===== Questions ===== ===== Questions =====
  
 +  * TBA
  
 ---- ----
-Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5000/etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]] +Network programming [[https://​noppa.lut.fi/​noppa/​opintojakso/​ct30a5001/etusivu|@ Noppa]] | [[courses:​ct30a5000:​start|@ wiki]]