Write a code in UDP Java 1. The client should send a ping consisting of exactly 1,000
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a code in UDP Java
Transcribed Image Text:
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. 4. 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. 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. 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. 5. 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): UDP: Server Location Average data rate localhost 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. RTT Average for First Trial (10 pings) 0.17 ms 16 Average RTT in ms Average Data Rate for First Trial 92.5 Mbps -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 10. Also answer the following question in the pdf file: Compared to the times measured in Programming Assignment 2 using TCP, is UDP faster or slower than TCP? Why? 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. 4. 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. 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. 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. 5. 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): UDP: Server Location Average data rate localhost 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. RTT Average for First Trial (10 pings) 0.17 ms 16 Average RTT in ms Average Data Rate for First Trial 92.5 Mbps -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 10. Also answer the following question in the pdf file: Compared to the times measured in Programming Assignment 2 using TCP, is UDP faster or slower than TCP? Why?
Expert Answer:
Related Book For
Posted Date:
Students also viewed these computer network questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
27 01:08:40 In business decision-making, managers typically examine the two fundamental factors of: Multiple Choice Grow Hill Edurata Type here to search O Risk and capital investment. Risk and...
-
Discuss the balance that can be achieved between fixed salary, bonuses and incentives and the link with motivation of salespeople.
-
Suppose the world demand schedule for oil is as follows: Price per barrelQuantity demanded $50 40 $75 30 $125 20 There are two oil producing countries, A and B. Each will produce either 10 or 20...
-
Find the Nielsen ratings for the past week. What were the three most popular television shows? Explain the meaning of the rating and the share for each show.
-
McAlister Watches, Inc., makes watches. Its assembly department started the accounting period with a beginning inventory balance of $22,000. During the accounting period, the department incurred...
-
Compute the student's GPA for the term. Round your answer to the nearest hundredth. A = 4 points, B = 3 points, C = 2 points, D = 1 point, F = 0 points Course Credits Grade MAT082 3 B ENG071 4 A...
-
The director of RCM inc. plans to launch a new product. The initial investment in equipment and other fittings is $800,000. It's been a while since management thinking of launching this new product....
-
Is the paternity procedure begun in California with a complaint, a petition, or some other pleading?
-
Prepare an initial posting including the following elements: Working title Problem of interest Healthcare administration problem Research domain Gap in practice Reference list using all the sources...
-
An investor has $16,000 to invest and is willing to keep it invested for up to five years. You invest $16,000 in a savings account that offers 1.88% compounded monthly. You can remove the money any...
-
As the book discusses, Cash has high risk because it is involved in nearly every business transaction and it is highly susceptible to theft. For that reason, many businesses focus extensively on...
-
a. Calculate the standard deviation (sigma). (2 points) b. Identify the safety factor for a service level of 98% and calculate the safety stock. (2 points) c. Calculate the order point if lead time...
-
What is the time and space complexity of this code? int A[ n ]; for (i = n / 2; i
-
Significance of Maslow's Hierarchy of Needs - Do you think the framework is relevant even today?
-
DC has unused FTC carryover from 2017 in the separate category for GC income as the result of income generated by a foreign branch. The income was foreign source general category income. In 2018 the...
-
The goal of this lab exercise is to implement an error-detection mechanism using the standard CRC algorithm described in the text. Write two programs, generator and verifier. The generator program...
-
Suppose that John just set up an auto-forwarding mechanism on his work email address, which receives all of his business-related emails, to forward them to his personal email address, which he shares...
-
A CDMA receiver gets the following chips: (1 +1 3 +1 1 3 +1 +1). Assuming the chip sequences defined in Fig. 2-28(a), which stations transmitted, and which bits did each one send? Figure 2-28(a) A =...
-
As the Internet continues to grow in its business influence, it is increasingly being used for applications that were formerly client/server based applications. What are some of the similarities in...
-
Fill in the blanks for the following statements: a. Source documents should be portioned into different zones for data, data, and depending upon the system inputs and reviewing form, for data that...
-
Why does the free-rider problem occur in the debt market?
Study smarter with the SolutionInn App