FTP Proxy

The Final Project of Internet Applications
2016.05
Project Title: FTP Proxy
Goal of the project
Deeply understand the related knowledge of FTP (File Transfer Protocol).
Complete a FTP proxy program based on Linux command line terminal.

Requirements of the project
1. The FTP server can be set up using the existing software, for example FileZilla server. For the FTP client, students can use one general FTP client tool software, for example FileZilla client.
2. The FTP proxy performs as both FTP client and FTP server. FTP client will connect FTP proxy first and send the FTP requests. FTP proxy is able to receive the requests, and then forward the requests to FTP server. After that, it can receive the replies from the FTP server, and then forward the replies to the FTP client.
3. FTP proxy has to listen at port 21.
4. FTP proxy is able to set up separate control connections with FTP client and FTP server separately.
a) FTP proxy is able to receive the commands from FTP client using control connection. The commands include: PWD, CWD, LIST/MLSD, MDIR, DELE, RNFR/RNTO, RETR, and STOR. And it can resolve the commands and modify if necessary (i.e. modify the parameters for PORT), and then forward the commands to the FTP server using control connection.
b) FTP proxy is able to receive the FTP replies from FTP server using control connection. And it can resolve the replies and modify if necessary (i.e. modify the parameters in the replies for PASV), and then forward the replies to the FTP client.
5. FTP proxy is able to set up data connections if required with FTP client and FTP server separately. In this project, cache mechanism will be used in FTP proxy (Only pdf file or image is required in this case). If the file that FTP client wants to download already exists in the cache, FTP proxy will not download the file from FTP server but send the file in the cache to FTP client. And no data connection will be set up between FTP proxy and FTP server. Otherwise, data connection will be set up between FTP proxy and FTP server.
a) If FTP client wants to upload a file, FTP proxy can receive the file from FTP client and then upload the file to FTP server.
b) If FTP client wants to download a file, FTP proxy can receive the file from FTP server and forward the file to FTP client. Meanwhile, the file will store in its cache.
6. For data connection, it is required to implement both passive mode and active mode.
7. Detailed design document and user manual.
8. Detailed annotation of code and nice programming style.
9. Stable and friendly to users, and be able to handle error commands.
10. Two persons as a group.
Environment of the project
1. C language
2. Linux operation system
3. gcc compiler and gdb debug tool
Steps of the project
1. Connect to a ftp server and use wireshark to analyze the FTP commands and replies of FTP protocol.
λ You can connect to a ftp server installed in your own computer by commands:
ν ftp 192.168.56.1
ν In this procedure, you should input the user commands of FTP.
λ You can also open one general FTP client tool software (such as: FlashFXP, CuteFTP etc.)
2. Using telnet command, access the FTP server through port 21 and implement above working flow by manual operations.
λ In this procedure, you should input the FTP control commands.
λ You can connect the ftp server installed in your own computer.
λ Passive mode can be understand clearly.
3. Abstract main modules according to above operations, design the solution, and divide the work into concrete functions.
4. Implement basic TCP socket programming architecture.