Lab3 2201CS11
Lab3 2201CS11
Objective:
In this assignment, you will analyze the ping utility, a fundamental network diagnostic tool. You will
explore its functionality, usage, and output, and demonstrate your understanding through a series of
tasks.
Tasks:
1. Ping Basics
- Explain the purpose of the ping utility and its basic syntax.
Ans : A ping (Packet Internet or Inter-Network Groper) is a basic Internet program that allows a user
to test and verify if a particular destination IP address exists and can accept requests in computer
network administration. It is also used diagnostically to ensure that the host computer the user is
trying to reach is operating.
- Provide examples of how to use ping to test connectivity to a website and a local host.
Ans :
ping <website>
ping codeforces
for localhost : ping 127.0.0.1
- Run the command ping (link unavailable) and capture the output.
- Analyze the output, explaining each line and its significance (e.g., packet loss, round-trip time,
etc.).
Here 32 bytes of data packet is being received and sent. (to 104.26.6.164
(codeforces.com)
Round trip time for first packet to go to the server and back is 49ms, then 46ms, then 57
ms, and 55 ms
As we can see here 4 packets were sent and 4 were received so 0 packets were lost and
hence 0% loss.
TTL : time to live for every packet tells us how many hops is the packet allowed to make (
the number of routers in between)
Analysis :
Here 32 bytes of data packet is being received and sent. (to 127.0.0.1(localhost)
Round trip time for all the packages is <1ms (almost instantaneous because its localhost
running on the same machine)
As we can see here 4 packets were sent and 4 were received so 0 packets were lost and
hence 0% loss.
TTL : time to live for every packet tells us how many hops is the packet allowed to make (
the number of routers in between)
3. Ping Options
- -s (size)
Use : sets the size of the ICMP (internet control message protocol) packet's payload in bytes.
- -t (ttl)
Use: sets the Time To Live (TTL) value for the outgoing packets
- -W (deadline)
Use : sets a deadline (in seconds) for the ping command to run
Examples :
- Describe a scenario where ping would be used for network troubleshooting (e.g., connectivity
issues, slow network speeds).
- Explain how to use ping to diagnose the issue, including which options to use and why.
Scenario: A user is experiencing slow internet speeds and intermittent connectivity issues while
trying to access a company's web application.
ping iitp.ac.in
This will help determine if there's basic connectivity and reveal any packet loss.
This sends 100 pings, providing a larger sample size to detect intermittent issues.
Larger packets can help identify Maximum Transmission Unit or fragmentation issues.
This sends 1000 large packets at short intervals, providing detailed data on connectivity.
This approach helps determine if the issue is with the local network, ISP, or the remote server,
guiding further troubleshooting steps.
5. Develop a ping type utility using Scapy. It should have the following points.
- 1. Basic Functionality
2. Additional Features
3. Error Handling
- Invalid destination IP
- Timeout errors
4. Output Formatting
Submission:
Please submit a written report (PDF or Word document) containing your answers to the tasks above.
Include screenshots or output captures where relevant.
For programming you need to create a github page (instruction to be given later)