Write a Java program for Assignment 2 on page 175 of the text - but you...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Posted Date:
Students also viewed these computer network questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Krell Industries has a share price of $22 46 today. If Krell is expected to pay a dividend of S0.83 this year, and its stock price is expected to grow to $24.11 at the end of the year, what is...
-
Briefly explain each of the three perspectives of human nature.
-
Berset Inc. (BI) has just issued semi-annual coupon bonds with 12 years to maturity and a face value of $1,000 per bond. The bonds make semi-annual coupon payments of $60. What is the price of one...
-
Refer to Exercise 12.50. (a) Perform an analysis of covariance. Test for a difference in treatments using level of significance 0.05 . (b) Compare your analysis in part (a) with the analysis of...
-
George Company purchased land for use as its corporate headquarters. A small factory that was on the land when it was purchased was torn down before construction of the office building began....
-
Non-current liabilities Bonds payable Equity Share capital-ordinary, 1.00 par, authorized 400,000 shares, issued 295,500 Share premium-ordinary Retained earnings 505,500 295,500 165,500 ? Prepare a...
-
I open a barber shop on State Street selling cheap haircuts to undergrads. My barbers work fast. They can give a good haircut in just 15 minutes, but going that fast, each time they give a haircut,...
-
Suppose stock in Banda Corporation has a beta of .80. The market risk premium is 6 percent, and the risk-free rate is 6 percent. Banda's last dividend was $1.20 per share, and the dividend is...
-
1. Calculate the net force (which would include the force of gravity and the force of buoyancy) acting on a spherical helium-filled balloon in air with radius R=12 cm. The mass of the empty balloon...
-
15. A constant force is applied to an 8.7 kg wagon to bring its velocity from 4.6 m/s to 1.2 m/s over a distance of 15 m. Calculate the force. tr che
-
Recall that under Church encoding, we have the following definitions: IF Xbt f. bt f TRUE = Xt f. t FALSE Xt f. f a) (2pt) Fully evaluate (x. (x y TRUE)) FALSE so that no further -reduction is...
-
Jean feels that she's weak in business writing and teamwork. She wants to address her weaknesses to improve her performance and further her career. What can Jean do to deal with her weaknesses?
-
Imagine that you are interested in starting an e-Commerce business. Compare the major advantages and disadvantages of starting an e-commerce business versus a traditional brick-and-mortar business....
-
Choose a company from the SEC EDGAR Web site for your Key Assignment to evaluate for the impact of convergence to IFRS. Review the financial reports and notes of the company you have chosen from the...
-
Consider an experiment that selects a cell phone camera and records the recycle time of a flash (the time taken to ready the camera for another flash). The possible values for this time depend on the...
-
Suppose that the recycle times of two cameras are recorded. The extension of the positive real line \(R\) is to take the sample space to be the positive quadrant of the plane \[ S=R^{+} \times R^{+}...
-
Consider the sample space \(S=\{y y, y n, n y, n n\}\) in Example 2.2. Suppose that the subset of outcomes for which at least one camera conforms is denoted as \(E_{1}\). Then, \[ E_{1}=\{y y, y n, n...
Study smarter with the SolutionInn App