PING stands for Packet InterNet Groper in computer networking field. It’s a computer network administration software used to test the reachability of a host on an Internet Protocol (IP) network. It measures the round-trip time for messages sent from the originating host to a destination computer that are echoed back to the source.
Ping operates by sending Internet Control Message Protocol (ICMP/ICMP6 ) Echo Request packets to the target host and waiting for an ICMP Echo Reply. The program reports errors, packet loss, and a statistical summary of the results.
Internet Control Message Protocol (ICMP) : The Internet Control Message Protocol (ICMP) supports protocol in the Internet Protocol suite. It is used by network devices like routers, to send error messages and operational information indicating whether a request to service is available or not or that a host or router could not be reached.
ICMP differs from transport protocols such as TCP and UDP in that it is not typically used to exchange data between systems.
ICMP is not supported in Java and ping in Java as it relies on ICMP
We can’t simply ping in Java as it relies on ICMP, which is sadly not supported in Java
This Java Program pings an IP address in Java using InetAddress class. It is successful in case of Local Host but for other hosts this program shows that the host is unreachable.
Sending Ping Request to 127.0.0.1 Host is reachable Sending Ping Request to 188.8.131.52 Sorry! We can't reach to this host Sending Ping Request to 184.108.40.206 Sorry! We can't reach to this host
Definition Source :
This article is contributed by Mohit Gupta_OMG 😀. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Pinging an IP address in Java | Set 2 (By creating sub-process)
- Finding IP address of a URL in Java
- How to validate an IP address using Regular Expressions in Java
- Java program to find IP address of your computer
- Check if email address valid or not in Java
- Java.util.LinkedList.poll(), pollFirst(), pollLast() with examples in Java
- Java Deprecated API Scanner tool (jdepscan) in Java 9 with Examples
- Java.util.function.DoublePredicate interface in Java with Examples
- Java.util.function.LongPredicate interface in Java with Examples
- Java.util.function.IntPredicate interface in Java with Examples
- Java.util.LinkedList.offer(), offerFirst(), offerLast() in Java
- Java.util.Collections.disjoint() Method in java with Examples
- Java.util.LinkedList.peek() , peekfirst(), peeklast() in Java
- Java.lang.Short toString() method in Java with Examples
- Java lang.Long.lowestOneBit() method in Java with Examples
- Java lang.Long.numberOfTrailingZeros() method in Java with Examples
- Java.util.Collections.rotate() Method in Java with Examples
- Java lang.Long.highestOneBit() method in Java with Examples
- Java lang.Long.byteValue() method in Java with Examples
- Java.util.concurrent.Phaser class in Java with Examples