Project Description

In this Project we will be creating a transfer protocol that provides a reliable datagram service. We will need to compare this protocol with the TCP protocol. This protocol should guarantee that the data be sent without faults, errors and data loss. The data being sent should also be sent in the right order and should not be sent multiple times.

In order for this Project to succeed, appropriate coding should be done so that the data can be sent correctly between the user and sender nodes.

Protocol Requirements

A package format should be created and UDP should be used in order for the packages to be moved. Package type, order number, information to be used for error control, etc. Can be added to the package. The format for the package can be created in any way. Besides these requirements should be fulfilled:

  • File name should be transferred correctly
  • File content should be transferred correctly
  • The file to be received by the receiver should be name properly, created with the proper content.
  • After the data transfer, the user and the receiver should complete a hand-shake that guarantees the data transfer and the transfer should end.

If any of the packages delay, or transfers with any kind of data loss; the file should be sent again properly.

Program

You will be needing 2 programs to create this protocol. First program(Sender/Server) will be listening 1 port at all times, it will be waiting for a request from the client, and it will sending the file which is intended to be sent. The second program(Receiver/Client) will be reading the data after it receives a request, it will be using the data to properly create a file.

Sender Program

The sender program should be able to be run using the command line(cmd), it should be able to listen to any port that is intended in the running program. If it receives a request with this port, it should send the certain file to the processer and continue to listen to the port for the incoming new requests.

The sender program should be able to send information on the sent packages to the monitor.(Printed to the screen) The format of the information should be like this:

< i >)[package sent] -(< length >)
  • < i >: The iteration number indicating how many times the package has been sent.
  • < package_number>: The offset information about where the data will be appended In the file.
  • < length>: The file size being sent in the package, not the whole size of the package itself.

The information sent to the monitor can also include information such as: time-out information, acknowledgement etc.

Receiver Program

It should be similar to the Sender program, being able to be run using the command line. After the receiver program has started, it should ask the user about the IP information about the sender/server.(The program will ask the servers IP address to the user, this information will be received from the user via the keyboard input.)

The receiver program should be able to send information to the monitor about every package being received.(Printed to the screen)

If the package is valid:

< i >)[package_received]< package_number >-(< length >)-< state >
  • < i>: Iteration number showing how many times package send request has been made.
  • < package_number>: Offset information about where the package data will be appended in the file being sent.
  • < length>: The size of the file being sent inside the package, not the whole package size. Example: 1024 KB.
  • < state>: ACCEPT(in the right order), ACCEPT(in the wrong order),DENIED

If the package is not valid, [Non-valid package received] should be sent to the monitor.

Extra information can be added.

After the file transfer, the file received be named the same as the file being sent except that _received will be added to the end. For ex: ABC.rar the file being sent, ABC_recieved.rar the file being received.

When the transferred has finished, both the receiver and the sender program should print ****** FILE TRANSFER COMPLETED SUCCESFULY******* to the screen and terminate the connection.

PS: Sender program will be something like Sender.java (class), receiver program will be something like Reciever.java (class).

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.