Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
UDP/TCP transmission speed tester
Aim of the work:
The aim of this work is to implement the client-server computer program for measuring the data transmission speed in unicast mode using two protocols: UDP and TCP. The example of this program may be find under this link.
Conditions:
In order to complete this project it is required to implement two parallel data transmissions. Both transmissions should be in unicast mode but in basis of two different network protocols i.e. TCP and UDP. In a frame of these transmissions from the client to the server module the same data set must be sent. Therefore, two separate applications have to be developed.
The server application:
0 immediately after start-up (or after an user request) asks about:
o the communication port number (the same for TCP and UDP protocols), and creates:
o a thread #1 responsible for TCP listening on user defined port number waiting for the client connection requests,
o a thread #2 responsible for looped UDP messages listening on user defined port,
o a thread #3 responsible for the multicast DISCOVERY requests listening, which right after receiving such request sends to the multicast group the response OFFER:PORT with the TCP/UDP listening port number,
additionally:
0 the thread #1 is able to handle only one client in the same time, therefore after accepting the incoming connection with one client it sends to the others the BUSY command,
0 the thread #1 in a separate child-thread #4 starts (in a loop) waiting for the messages from the connected client and terminates the thread #4 after client disconnect,
0 the threads #1 and #2 create the data buffer of size agreed with the client; the client as a first message sends the command SIZE:xyz with the buffer size value given in bytes,
0 the threads #1 and #2 separately count the amount of data received from the client and prepare the
report to show it in a form e.g.:
Thread (TCP or UDP): received ???kb in time ???sec with the speed ???kb/sec
0 the transmission time is triggered with the first message (in both threads independently).
0 the thread #2 may have implemented the statistic mechanism for lost data analysis in comparison to the data pattern (e.g. the same method for data generation in both client and server modules) and
should print the analysis results in a form:
Thread UDP: the transmission error: ???%
0 the transmission (especially in case of the thread #2) should be stopped after the last command e.g. FINE,
0 the user should be allowed to stop all threads and to close application.
The client application:
0 after start-up:
o in order to find the server creates the thread #1 for sending in a multicast mode the DISCOVER command and waits for the OFFER:PORT response and finally prints the list of found servers,
o provides to the user the possibility to manually input the server IP address and the TCP/UDP communication port number,
o asks the user about the size of the data set (in bytes)