How does the ping command really work? Specifically where does the ARP (Address Resolution Protocol) come into picture?
I was asked this question in an interview and I was not able to come up with a scenario when ARP could be used.
Answer
If you really want to understand, there is an excellent (very well written) white paper here:
http://images.globalknowledge.com/wwwimages/whitepaperpdf/WP_Mays_Ping.pdf
Here is the summary ->
Ping (Program on the application layer)
------->Opens a 'raw' socket to IP Layer
------>IP layer (Layer 2 on OSI) packages ICMP packet and sends it
Since there is no TCP layer in between, the Ping (program)
has to monitor all the incoming ICMP packets and filter only the one's from the destination.
Hope that helps.
Comments
Post a Comment