Giter VIP home page Giter VIP logo

computernetworkshw1's Introduction

Implementation of the File Transfer Protocol

This GitHub repo contains the solution for Project 1 for the Computer Networks course taught by Professor Yasir Zaki at NYU Abu Dhabi. Here, we implement a simple file transfer protocol designed to handle multiple concurrent client connections and file transfers. The team members for this project are Avinash Gyawali and Aadim Nepal.

Running the Repo

To run the code in your terminal, please follow these steps:

  1. Clone the Repository:

    git clone https://github.com/Tauke190/ComputerNetworksHW1.git
  2. Navigate to the Server and Client Directories:

    Inspect the directories closely. The server directory contains:

    • Three subdirectories: Bob, Harry, and Ron
    • A text file: users.txt

    The subdirectories Bob, Harry, and Ron are for the authenticated users stored on the server. The users.txt file contains usernames and passwords that the server authenticates before running the program.

How to Proceed

  1. Open Four Terminals:

    • One for the server
    • Three for the clients: Bob, Harry, and Ron
  2. Run the Server Code:

    • Navigate to the server directory:
      cd server
    • Compile the makefile.
  3. Run the Client Code:

    • In each client terminal, navigate to the client directory:
      cd client
    • Compile the makefile for all three clients.
  4. Start Authenticating:

    • Follow the procedures displayed by the terminal. Typically, you will input:
      • USER <username>
      • PASS <password>
      • Commands like RETR <filename>, STOR <filename>, CWD <directory>, !CWD <directory>, LIST <directory>, !LIST <directory>, QUIT

The code should handle concurrent connections smoothly.

Limitations and Assumptions

  • Directory Changes:

    • Once the client changes the server directory, it cannot revert.
    • Once you change the client directory, you cannot revert.
  • File Overwrites:

    • If the client attempts to send a filename that already exists, the new file overwrites the existing file.
  • Users.txt Format:

    • The users.txt file should have a delimiter at the end ("-------") for ease of loading into the code.
    • Each username and password pair should be on one line, separated by a space, with a delimiter at the end of the file. Example:
      Aadim Nepal
      Avinash Gyawali
      ----------------
      

Design Choice for Port

  • Port Selection:

    • We used port 9002 instead of the default ports 21 and 20 due to availability issues on MacOS.
    • If you encounter a "cannot bind to address" error, change the port by navigating to:
      #DEFINE CMD_PORT 9002
      • You can try different port numbers if necessary.
  • Implementation of PORT Command:

    • The client sends a PORT command to the server before initiating a new TCP connection for file transfer.
    • We use a random free port provided by the OS instead of implementing N+i.
    • This approach was discussed and approved by both the professor and the TA.

computernetworkshw1's People

Contributors

aadimnepal avatar

Watchers

Avinash Gyavali avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.