ping implementation, unit test for ping