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.
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:
If any of the packages delay, or transfers with any kind of data loss; the file should be sent again properly.
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.
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 >)
The information sent to the monitor can also include information such as: time-out information, acknowledgement etc.
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 >
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).