tags:

views:

28

answers:

1

Hello,

interested in ARP and wanted to check.

ARP protocol is used found MAC and IP addresses, yes?

How is it different from this:

IPHostEntry iphostentry = Dns.GetHostByName(strHostName);
+3  A: 

Dns.GetHostByName() uses DNS - to get IP address (1.2.3.4) from a DNS domain (www.google.com).

ARP is used to get a MAC address (11:22:33:44:55:66) from IP (1.2.3.4).

Let's say you write www.google.com in your browser:

  1. It needs to find out what IP is www.google.com, so it uses DNS to do that.
  2. It needs to send packets to the IP address of www.google.com, but in the Ethernet level, this means you first need to send the packets to the next router in the route to the target (probably your default gateway).
  3. To do that in the Ethernet level, you need to know what is the MAC address of the default gateway - this is done using ARP.

ARP sends a question to the LAN - who has 1.2.3.4? And whoever has it answers - so the sender knows what's the MAC address of 1.2.3.4 that he needs to send the packets to.

See http://en.wikipedia.org/wiki/Address_Resolution_Protocol

And http://en.wikipedia.org/wiki/Domain_Name_System

brickner