Introduction

There are 2 goals for this project. The first goal is to develop a download application that can download a file from a given URL. The second goal is to configure a network on the NetLab room and test the download application on the network.

Part 1: Development of a Download Application

The download application is developed in C, and it implements the FTP protocol (RFC959).It is able to download a single file from a given URL in the form of ftp://[user[:password]@]host[:port]/path.

It does so by following these steps:

  1. Parse the URL to extract the host, port, path, username and password.
  2. Make a DNS query to resolve the host name to an IP address.
  3. Establish a TCP connection to the FTP server using sockets.
  4. Authenticate with the server using the username and password.
  5. Activate passive mode.
  6. Open a new socket for data transfer.
  7. Send the RETR command to the server via the first connection to request the file.
  8. Receive the file data from the server via the second connection.
  9. Write the file data to a local file.
  10. Close the connections.

Part 2: Configuration of the NetLab Network