Ping and ICMP
Lesson 13 of 32 in Coddy's The OSI Model course.
Layer 3 has its own control protocol: ICMP. It carries no user data, only signals: "destination unreachable", "TTL expired", and the famous echo request and reply pair that powers ping.
ping sends an ICMP echo request and waits for the reply, proving layer 3 reachability in both directions. It is always the first question to ask a misbehaving network: can I even reach it?
ping -c 1 host sends a single probe, and its exit status tells scripts whether the reply came back.
Challenge
EasyPing 127.0.0.1 exactly once, hide all of ping's own output, and print ok if the reply arrived or fail if it did not.
Expected output:
okTry it yourself
All lessons in The OSI Model
Practice on your own: Terminal playground