domingo, 20 de noviembre de 2011

PING

Ping (Pachet Internet Groper) tests the state of a host connection with one or more computers by sending ICMP (Internet Control Message Protocol) packets. For example, imagine that we have a ball and we throw it to someone in order to prove if he is awake, he returns the ball and we now know he is, if he doesn’t respond at this it means that he is not awake. This is how ping works. Ping works in network layer, it encapsulates the message into a packet and then sends it.

 
(In this image we show you how this packet is composed)

How does the ping work? In which port is it connected?. Ping works like ICMP, ICMP is part of the network layer (IP, routes, its objective is to make information to come from its origin to its destination), this layer is below the transport layer and works with routers. In the terminal, we can see ping by writing the command ping [ip adress], once that this is done, we can see constant messages of sent or lost packages.


Here we show you how a PING works
///request
Ping()
   ping.txt
validate()
   verify structure
execute()
   do ping->send

receive_ans(answer)
validate()
if  answer = true{
  echo “Connected”
}
else{
echo “Not Connected”
}

////anwer
receive_request()
validate(request)
if request = true{
 answer->send
}

References 
PING Image

1 comentario: