ICMP and Ping

Task 1: Basic Echo Requests

  1. Send 4 ICMP Echo Request packets to a public DNS target.
  2. Student Deliverables: Identify the sequence number (icmp_seq), RTT (Round-Trip Time).
  3. Q&A:
    1. What does ICMP stand for?
    2. How do you explain the relationship between ICMP and Ping?
    3. Read RFC 792 to take a glance at the ICMP protocol. Read the description about "Echo Request" and "Echo Reply".

Task 2: Packet Loss Rate

  1. Send 200 ICMP Echo Request packets to a host inside NCNU (10.20.128.1).
  2. Student Deliverables: Count the number of lost packets, and figure out how packet loss rate is calculated. Compare your measurement with your classmates. What is the highest and the lowest value you measured?

Task 3: Sending ICMP Packets by Python

  1. Create a virtual environment for this class:
    1. python3 -m venv SNMP
    2. source SNMP/bin/activate
    3. pip install --upgrade pip
  2. Install the "icmplib" package:
  3. Run the following program:
    from icmplib import ping
    host = ping('8.8.8.8', privileged=False)
    print(host.avg_rtt)
  4. dir(host) shows that ping() also returns several useful attributes:
  5. Compare them with the values you got in running the "ping" Linux command.

Exercise: If I manage several hosts ...