Git Product home page Git Product logo

tftp's Introduction

TFTP

File list:

  1. tftp_c.c - TFTP Client Side Implementation.
  2. tftp_s.c - TFTP Server Side Implementation. (Included in the folder just for the purpose of testing!!)
  3. readme.txt.

Extract the zip file and place all the files(including readme.txt) into a folder named "TFTP". Move into the "TFTP" folder.

Now tftp_s.c and tftp_c.c is compiled using the following commands.

gcc tftp_s.c -o tftp_s
gcc tftp_c.c -o tftp_c

Setting up the server and client. Open two terminals and move into the TFTP folder in both terminals.

  1. In the first terminal, TFTP Server is started before the client.

./tftp_s ServerPortNo

(Make sure that all the port nos. are greater than 1024)

  1. In the second terminal, TFTP Client is started after the server is started.

./tftp_c Server ServerPortNo GET/PUT Filename

(The Server Port Number here must match the server port no above)

GET = TO FETCH FILE FROM SERVER. PUT = TO SEND FILE TO SERVER.

Different scenarios handled:

  1. When correct file is sent using PUT(the file is not already present in the server side)

./tftp_s 1025
./tftp_c localhost 1025 PUT abc.txt

Newfile, abc.txt_server is created, and the file is transferred from client to server!!

  1. When correct file is requested using GET.

./tftp_s 8090
./tftp_c localhost 8090 GET abc.txt

Newfile, abc.txt_GET is created, and the file is transferred from server to client!!

  1. When incorrect file is requested using GET(i.e, the file that is not present in the server)

./tftp_s 7890
./tftp_c localhost 7890 GET xyz.txt

Error, the client and server side connection is terminated!!

  1. When incorrect file is sent using PUT(i.e, the file which is already in server is sent again)

./tftp_s 7890
./tftp_c localhost 7890 PUT abc.txt

Note if this case is run after case 2, error occurs, else the file is transferred to server and a new file is created!!

  1. When incorrect file is sent using PUT(i.e, the file which is not present in client)

./tftp_s 7890
./tftp_c localhost 7890 PUT xyz.txt

Error, the client and the server side connection is terminated!!

tftp's People

Contributors

sanidhya2101 avatar y0g38h-kum4r 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.