Send 4 ICMP Echo Request packets to a public DNS target.
ping -c 4 1.1.1.1
ping -c 4 8.8.8.8
Student Deliverables: Identify the sequence number (icmp_seq), RTT
(Round-Trip Time).
Q&A:
What does ICMP stand for?
How do you explain the relationship between ICMP and Ping?
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
Send 200 ICMP Echo Request packets to a host inside NCNU
(10.20.128.1).
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
Create a virtual environment for this class:
python3 -m venv SNMP
source SNMP/bin/activate
pip install --upgrade pip
Install the "icmplib" package:
pip install icmplib
Run the following program:
from icmplib import ping
host = ping('8.8.8.8', privileged=False)
print(host.avg_rtt)
dir(host) shows that ping() also returns several
useful attributes:
is_alive
packets_sent
packets_received
packet_loss
max_rtt
min_rtt
Compare them with the values you got in running the "ping" Linux
command.
Exercise: If I manage several hosts ...
Imagine that you are managing several hosts, say, 10.20.128.1 ~
10.20.128.254.
Please extend the previous program and design how you plan to
display the status of each host.
This week we only need a plain-text output.
In the future, we would like to output a webpage.