CSCE 515 Project 2: Implementing a TFTP Server in C - Prof. W. Xu, Study Guides, Projects, Research of Computer Science

A computer networking programming project for csce 515 students. The goal is to develop a tftp server using udp socket programming in c, capable of handling read requests (rrqs) and supporting binary mode, time-out and retransmission, and concurrency. Students are encouraged to refer to the tftp protocol (rfc 1350) and use the tftp client for testing. The project is worth 15 points towards the final grade.

Typology: Study Guides, Projects, Research

Pre 2010

Uploaded on 09/02/2009

koofers-user-onw
koofers-user-onw 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSCE 515 Computer Network Programming
Project 2, Due Date: October 27, 2:30pm, 2008
Undergraduate level
This is an individual project. In this project, you are required to use UDP socket programming in C to implement a
TFTP server that can handle Read Requests (RRQs). Your server does not have to be able to handle Write Requests
(WRQs). Please refer to the TFTP Protocol (as defined in RFC 1350) for implementation details, your
implementation should support for the file transfer modes "octet".
You can use any TFTP client to test your TFTP server, the easiest way is to use the program tftp installed on the CS
workstations. You should understand some of the options possible with this client, in particular the "verbose" and
"trace" options (which result in the client printing out information about every TFTP message sent and received).
You should read the man page for tftp, and pay attention to commands including “binary”, and “get filename”.
More specifically, your server needs to achieve the following requirements:
1. (1 point) Your program for server needs to take an argument that specifies the port that it is listening to
(just like your server in project 1 did).
2. (1 point) Your server should print out information about every message received and every message
sent (something like what a tftp client prints when "trace" is enabled).
3. (4 points) Your server should support binary mode. When everything goes well, there should be no lost
message in the RRQ binary transfer (“octet”).
4. (3 point) Your server should support time-out and retransmission. Your server should retransmit the
message after if no acknowledge is received in 5 seconds (the timeout period) and should retransmit a
total of 3 times before giving up. There are a number of ways to handle timeouts, you can use alarm,
but using select() is probably the easiest and most portable.
When testing your server you can emulate the loss of messages by suspending the client during an
ongoing TFTP conversation. On the CS workstation, you can suspend a process by pressing ctrl-Z.
When running a TFTP client, this will suspend the client and return you to the shell. To bring the
client back to life you can use the shell job control commands, the command "fg" will bring the
last suspended process to the foreground ("fg" stands for "foreground").
5. (3 points) Your server should be concurrence, which is able to support multiple, simultaneous clients
(new clients may come in the middle of a file transfer at the same time).
6. (1 point) I will use a standard TFTP client as well as custom clients. As with any server, your server
should not crash as a result of receiving unexpected messages from the client!
7. (2 points) The quality of the code including Error handling, Style/Code structure, etc.
This project will count for 15 points toward your final grade. You must submit your source code, a Makefile, and a
README file via the Dropbox named project02 before the due day.
Remember a grade of zero will be given, if your programs cannot be compiled and executed on Unix/Linux
machines. You should report your projects in a short write up, README file. The README file should contain
following information: 0) your name and whether you are undergraduate; 1) the programming
environment/hostname you used; 2) including the name of each file submitted along with a one line description of
what is in the file 3) If your code is not complete, tell me what works and what doesn't. 4) how to compile your
programs; 5) how to execute your programs. The programs will be graded based on the amount of the required
functionalities that has been implemented (13 points), the quality of the code (2 points).
Resources:
1) RFC 1350 TFTP: http://www.faqs.org/rfcs/rfc1350.html
2) Sample UDP client and server code is available at http://www.cse.sc.edu/~wyxu/515Fall08/pj2/all.tar

Partial preview of the text

Download CSCE 515 Project 2: Implementing a TFTP Server in C - Prof. W. Xu and more Study Guides, Projects, Research Computer Science in PDF only on Docsity!

CSCE 515 Computer Network Programming

Project 2, Due Date: October 27, 2:30pm, 2008

Undergraduate level

This is an individual project. In this project, you are required to use UDP socket programming in C to implement a TFTP server that can handle Read Requests (RRQs). Your server does not have to be able to handle Write Requests (WRQs). Please refer to the TFTP Protocol (as defined in RFC 1350) for implementation details, your implementation should support for the file transfer modes "octet".

You can use any TFTP client to test your TFTP server, the easiest way is to use the program tftp installed on the CS workstations. You should understand some of the options possible with this client, in particular the "verbose" and "trace" options (which result in the client printing out information about every TFTP message sent and received). You should read the man page for tftp, and pay attention to commands including “binary”, and “get filename”. More specifically, your server needs to achieve the following requirements:

  1. (1 point) Your program for server needs to take an argument that specifies the port that it is listening to (just like your server in project 1 did).
  2. (1 point) Your server should print out information about every message received and every message sent (something like what a tftp client prints when "trace" is enabled).
  3. (4 points) Your server should support binary mode. When everything goes well, there should be no lost message in the RRQ binary transfer (“octet”).
  4. (3 point) Your server should support time-out and retransmission. Your server should retransmit the message after if no acknowledge is received in 5 seconds (the timeout period) and should retransmit a total of 3 times before giving up. There are a number of ways to handle timeouts, you can use alarm, but using select() is probably the easiest and most portable.

When testing your server you can emulate the loss of messages by suspending the client during an ongoing TFTP conversation. On the CS workstation, you can suspend a process by pressing ctrl-Z. When running a TFTP client, this will suspend the client and return you to the shell. To bring the client back to life you can use the shell job control commands, the command "fg" will bring the last suspended process to the foreground ("fg" stands for "foreground").

  1. (3 points) Your server should be concurrence, which is able to support multiple, simultaneous clients (new clients may come in the middle of a file transfer at the same time).
  2. (1 point) I will use a standard TFTP client as well as custom clients. As with any server, your server should not crash as a result of receiving unexpected messages from the client!
  3. (2 points) The quality of the code including Error handling, Style/Code structure, etc.

This project will count for 15 points toward your final grade. You must submit your source code, a Makefile, and a README file via the Dropbox named project02 before the due day.

Remember a grade of zero will be given, if your programs cannot be compiled and executed on Unix/Linux machines. You should report your projects in a short write up, README file. The README file should contain following information: 0) your name and whether you are undergraduate; 1) the programming environment/hostname you used; 2) including the name of each file submitted along with a one line description of what is in the file 3) If your code is not complete, tell me what works and what doesn't. 4) how to compile your programs; 5) how to execute your programs. The programs will be graded based on the amount of the required functionalities that has been implemented (13 points), the quality of the code (2 points). Resources:

  1. RFC 1350 TFTP: http://www.faqs.org/rfcs/rfc1350.html
  2. Sample UDP client and server code is available at http://www.cse.sc.edu/~wyxu/515Fall08/pj2/all.tar