Question: Write a Java program for Assignment 2 on page 175 of the text - but you will develop the pinger using UDP this time.

Write a Java program for Assignment 2 on page 175 of the


Write a Java program for Assignment 2 on page 175 of the text - but you will develop the pinger using UDP this time. Modify the UDP client and server code already posted in Canvas as required for this program. (10 points) The following are additional requirements: 1. The client should send a ping consisting of exactly 1,000 (one thousand) bytes for each ping. These bytes should consist of alternating ones and zeros (that is the binary pattern 1010101....0) - the byte pattern is OxAA repeated. 2. The server should check if the ping consists of 1,000 bytes of alternating bit pattern - else should print an error. If the pattern is correctly received, the server should echo the ping with its pong of the same 1,000 bytes. 3. The client should check if the pong received from the server matches the alternating bit pattern - else should print an error; if no error, then the client should record the RTT for these 1,000 bytes in ms. 4. One trial consists of 10 pings and pongs and your program should calculate the average RTT of each of these ten pings/pongs and print them to two decimal digits. Time unit for the average should be ms. 5. You should perform this trial three times - that is the client program must be run three times; do not code the three trials in the same program. 6. You should compute the average data rate (in Mbps) for each trial consisting of 10 pings and pongs using the formula given below and your program must print this data rate as well after each trial (rounded to 1 decimal digit): 16 Average data rate -Mbps Average RTT in ms 7. Run the server on the localhost and perform Steps 4, 5, and 6 above. 8. Make sure your program prints the RTT and the average data rate only once at the end of each trial (consisting of 10 pings & pongs). 9. Give the response in a tabular form as shown in the example below in a separate pdf file. UDP: Server Location localhost RTT Average for First Trial (10 pings) 0.17 ms Average Data Rate for First Trial 92.5 Mbps RTT Average for Second Trial (10 pings) 0.13 ms Average Data Rate for Second Trial 128.0 Mbps RTT Average for Third Trial (10 pings) 0.14 ms Average Data Rate for Third Trial 110.8 Mbps

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!