Question: Problem Using UDP - based Internet sockets, write a C program, myping.c , which mimics the standard ping command as shown below: $ . /

Problem
Using UDP-based Internet sockets, write a C program, myping.c, which mimics the standard ping command as shown below:
$ ./myping sys22.cs.abc.edu
from sys22.cs.abc.edu (157.252.16.50): time =0.620 ms
from sys22.cs.abc.edu (157.252.16.50): time =0.445 ms
from sys22.cs.abc.edu (157.252.16.50): time =0.500 ms
from sys22.cs.abc.edu (157.252.16.50): time =0.615 ms
from sys22.cs.abc.edu (157.252.16.50): time =0.495 ms
where time is the Round Trip Time (RTT), the delay between the client sending the ping message and receiving the pong message. Note that standard ping programs use the Internet Control Message Protocol (ICMP)(to be discussed later), not UDP.
Your client program should send five ping messages to the server at every second interval (see the sleep function). For each message, your client is to determine and print the RTT in milliseconds when the corresponding pong message is returned (see the clock function).
Recall that UDP is an unreliable protocol; a packet sent by the client or server may be lost. The client may have to send more than five ping messages to receive five pong messages from the server.
To handle the clients ping request, write another C program, myping_server.c, which runs on the server. Your server program must be UDP-based and may use any ports between 9000 and 9999. Run your server with:
$ ./myping_server

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 Databases Questions!