Pages1

Most frequent interview Question: How "ping" Command work, Draw flow of ping command

Ping command (Program on the application layer) --->
Opens a 'raw' socket to IP Layer -->

IP layer (Layer 2 on OSI) packages ICMP(ICMP (Internet Control Message Protocol) 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.

Relation with ARP( Address Resolution Protocol)
You enter a command to ping a destination
- DNS is used to determine the IP address (if needed)
- The routing table is consulted to find the next hop towards that destination
- ARP is used to find the hardware address of the next hop
The IP packet is sent to the next hop, encapsulated in an Ethernet or WiFi frame

ARP protocol also used when a device boots up, it sends ARP packet through this an entry in routing table is made against device mac address. Final delivery of any packet  in a network is done via use of mac address. 

No comments:

Post a Comment