Wednesday, August 22, 2012

Address Resolution Protocol : Computer Networks






    Before we start learning about ARP i.e Address Resolution Protocol, we need to understand one very basic element of networking - IP Address. In a simple way, we can say that IP address is a logical address assigned to a machine over a network. It allows a machine to be defined as an end point. Whenever communication takes place between two entities, both the parties should have a unique identifier or an address or some other way to represent themselves uniquely. In networking this job is done by using IP addresses.

   When communication takes place data is sent in the form of packets from the source to the destination. Although every machine on the Internet has one (or more) IP addresses, these cannot actually be used for sending packets because the data link layer hardware does not understand Internet addresses. i.e  your network interface card (eg. Ethernet card) in the physical layer doesn't know anything about your IP address. Instead, it has a unique Ethernet address (also called its hardware address or more often its Media Access Control (MAC) address). This is what is used in the physical and data link layers to uniquely identify a network interface so that the frames can be transferred properly. 


So how does a data link network ever manage to send IP packets around?

A special protocol bridges the gap between the data link layer and the network layer. The Address Resolution Protocol (ARP) is used in a local (physical) network to convert IP addresses to MAC addresses. ARP is not technically a part of the IP protocol, but it is a nearly universal means for mapping IP addresses to hardware addresses, so it is often discussed in the context of IP-based networks.



Let us understand how do IP addresses get mapped onto data link layer addresses, such as Ethernet? 

To explain how this works, let us use the example given below in which a small university with several class C networks is illustrated. Here we have two Ethernets, one in the Computer Science Dept., with IP address 192.31.65.0 and one in Electrical Engineering, with IP address 192.31.63.0. These are connected by a campus backbone ring (e.g., FDDI) with IP address 192.31.60.0. Each machine on an Ethernet has a unique Ethernet address, labeled E1 through E6, and each machine on the FDDI ring has an FDDI address, labeled F1 through F3.


  Suppose a user on host 1 sends a packet to a user on host 2. Let us assume the sender knows the name of the intended receiver, possibly something like mary@eagle.cs.uni.edu. The first step is to find the IP address for host 2, known as eagle.cs.uni.edu. This lookup is performed by the Domain Name System (DNS), now the DNS returns the IP address for host 2  say (192.31.65.5).

  The upper layer software on host 1 now builds a packet with 192.31.65.5 in the Destination address field and gives it to the IP software to transmit. The IP software can look at the address and see that the destination is on its own network, but it needs some way to find the destination's Ethernet address. One solution is to have a configuration file somewhere in the system that maps IP addresses onto Ethernet addresses. While this solution is certainly possible, for organizations with thousands of machines, keeping all these files up to date is an error-prone, time-consuming job.

  A better solution is for host 1 to output a broadcast packet onto the Ethernet asking: Who owns IP address 192.31.65.5? The broadcast will arrive at every machine on Ethernet 192.31.65.0, and each one will check its IP address. Host 2 alone will respond with its Ethernet address (E2). In this way host 1 learns that IP address 192.31.65.5 is on the host with Ethernet address E2. The protocol used for asking this question and getting the reply is called ARP (Address Resolution Protocol). Almost every machine on the Internet runs it. ARP is defined in RFC 826.

  The advantage of using ARP over configuration files is the simplicity. The system manager does not have to do much except assign each machine an IP address and decide about subnet masks. ARP does the rest.

  To have a more simplified view of the Address Resolution Protocol , please view the animation given below.

Flash Animation
---------------------------------------------------------------------------------

Video Tutorial 


ARP Proxy Simulation: Animate ARP Over Router 



-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x

0 comments:

Post a Comment