As far as java network programming goes, I would recommend the O'Reilly book "Java Network Programming" by Elliotte Rusty Harold. One limitation of java's internal network classes is that they are confined to TCP and UDP protocols. Ping requires ICMP (Internet Control Message Protocol). There is a raw sockets library avialable for java
here. It was written using JNI and can probably do all the things you are looking for, but I have never tried using it.
I hope this helps a little.
Chris