The goal of this assignment is to develop a custom ping utility that replicates the basic functionality of the standard ping tool. This tool will allow users to test network reachability and measure round-trip time (RTT) for packets sent to a target IP address.
Your task is to build a custom ping utility that performs the following functions:
- Send ICMP echo requests to a target IP address.
- Receive and process ICMP echo replies from the target.
- Calculate and display round-trip time (RTT) for each ICMP echo request-reply cycle.
- [Bonus] Provide statistics on:
- Packet loss
- Minimum RTT
- Maximum RTT
- Average RTT
- Standard deviation of RTT
- [Bonus] Provide options to configure the utility:
- Choose the network interface for sending packets.
- Set the Time-To-Live (TTL) value.
- Support both IPv4 and IPv6.
- Clone the repository:
git clone <repo-link> cd custom-ping-utility
- Modify and extend the provided template according to the requirements.
- Implement socket programming to handle ICMP (Internet Control Message Protocol) packets.
- Ensure compatibility with both Linux and macOS systems.
- Use appropriate error handling to deal with network timeouts, unreachable hosts, and permission issues.
- Structure your code to allow easy extension for bonus features.
Your submission must include:
- A README.md file with:
- Clear setup and installation instructions.
- Usage examples with command-line arguments.
- Required dependencies and supported versions.
- Well-documented code with meaningful comments.
- A script (
scripts/test.sh) to test the functionality of your custom ping utility.
/ (Root)
│── README.md # Detailed assignment instructions
│── Makefile # Build and run commands (if applicable)
│── src/
│ │── main.py # Main Python script for the ping utility
│ │── icmp_handler.py # ICMP packet handling logic
│── scripts/
│ │── test.sh # Script to test the program
- What are Ping and Traceroute Really?
- Socket Programming Guide
- Understanding ICMP and Ping
- Socket Programming in Python (for implementation reference)
- Complete your implementation and ensure it meets the assignment requirements.
- Update the
README.mdwith detailed instructions on how to build and run your solution. - Make a pull request (PR) to submit your final code.
- Your PR should include:
- A description of your implementation.
- Any limitations or known issues.
- Example test cases demonstrating the tool's functionality.
Happy coding! 🚀