- Learn how clients and servers interract via socket programming.
- Learn how the ping utility software works.
- Model the ping utility server via a simple python program.
git clone git@github.com:mglush/ping-client.git # clone repository.
cd ping-client # enter repository folder.
On one host:
python PingServer.py # start the server.
On another host:
python PingClient.py 0.0.0.0 12000 # start the client.
- The program sets up a server on localhost port 12000, and lets a client connect to it.\
- The client sends 10 pings to the server, and waits exactly a second for reply.\
- The server simulates artificial packet loss, and either sends a reply (with a 70% chance) or it doesn't.\
- When the client receives a reply from the server, it records the round-trip time of the connection.\
- If the client does not receive a reply from the server, it assumes the packet was lost, and sends a new ping request out.\
- This goes on for a total of 10 times, at the end of which a linux-like ping message is printed, showing the average round-trip time, number of pings, percent of successfull pings, etc.