Study of ping Command

 

Experiment

Study of ping Command

๐ŸŽฏ Aim

To test network connectivity between systems using the ping command.


๐Ÿ“˜ Objective

By the end of this experiment, students will be able to:

  • Check connectivity between two hosts
  • Measure network latency
  • Understand packet transmission and loss
  • Diagnose basic network issues

๐Ÿ“– Theory

The ping command is used to:

  • Test whether a host (computer/server) is reachable
  • Measure round-trip time (RTT) of packets

It works using the ICMP (Internet Control Message Protocol) by sending:

  • Echo Request packets
  • Receiving Echo Reply responses

๐Ÿ‘‰ If replies are received → host is reachable
๐Ÿ‘‰ If not → network issue or host unreachable


๐Ÿงพ Syntax

ping [options] <destination>
  • <destination> → IP address or domain name

๐Ÿ”ง Common Options

  • -c <count> → Number of packets to send
  • -i <interval> → Time interval between packets
  • -s <size> → Packet size
  • -t <ttl> → Set Time To Live
  • -w <deadline> → Total time limit

๐Ÿงฐ Prerequisites

  • Linux system
  • Network connection
  • Basic terminal knowledge

๐Ÿ”ฌ Procedure & Commands

1️⃣ Ping a Remote Host (Domain Name)

ping google.com

2️⃣ Ping an IP Address

ping 8.8.8.8

3️⃣ Send Limited Packets

ping -c 4 google.com

๐Ÿ‘‰ Sends only 4 packets.


4️⃣ Set Time Interval

ping -i 2 google.com

๐Ÿ‘‰ Sends packets every 2 seconds.


5️⃣ Change Packet Size

ping -s 100 google.com

๐Ÿ–ฅ️ Sample Output

64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=20.3 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=117 time=21.1 ms

๐Ÿ” Output Interpretation

FieldMeaning
bytes        Size of packet received
icmp_seq        Sequence number
ttl        Time To Live
time        Round-trip time (latency)

๐Ÿ“Š Summary Statistics (End Output)

4 packets transmitted, 4 received, 0% packet loss rtt min/avg/max = 20.3/21.0/22.5 ms

๐Ÿ‘‰ Indicates:

  • Packet loss percentage
  • Network delay performance

๐Ÿ“ Exercises for Students

  1. Ping a known website and note response time.
  2. Ping an unreachable IP and observe output.
  3. Compare latency for different websites.
  4. Send 5 packets and calculate average delay.
  5. Disconnect network and observe packet loss.

❓ Viva Questions

  • What is the purpose of ping?
  • What protocol does ping use?
  • What is RTT?
  • What does TTL indicate?
  • What is packet loss?

⚠️ Precautions

  • Some servers block ICMP (ping may fail even if host is up)
  • Continuous ping may consume network resources
  • Use responsibly in shared networks

✅ Result

The ping command is a basic yet powerful tool to test connectivity and measure network performance, widely used in troubleshooting.

Comments

Popular posts from this blog

Networks Lab PCCSL507 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Analysis of HTTP Protocol using Wireshark

Study and Use of ifconfig Command