In computer networking, the Address Resolution Protocol (ARP) is the method for finding a host's hardware address when only its IP address is known. Due to the overwhelming prevalence of IPv4 and Ethernet, ARP is primarily used to translate Ethernet MAC addresses from IP addresses. It can, however, easily be used for IP over ATM or FDDI.
ARP is used in four cases of two hosts communicating:
The first case is used when two hosts are on the same physical network (that is, they can directly communicate without going through a router). The last three cases are the most used over the Internet as two computers on the internet are typically separated by more than 3 hops.
Imagine computer A sends a packet to computer D and there are two routers, B & C, between them. Case 2 covers A sending to B; case 3 covers B sending to C; and case 4 covers C sending to D.
ARP is defined in RFC 826.
ARP can be used to resolve MAC addresses to many different Layer 3 protocols addresses. ARP has also been adapted to resolve other kinds of Layer 2 addresses; for example, ATMARP is used to resolve ATM NSAP addresses in the Classical IP over ATM protocol.
RARP, like InARP, also translates Layer 2 addresses to Layer 3 addresses. However, RARP is used to obtain the Layer 3 address of the requesting station itself, while in InARP the requesting station already knows its own Layer 2 and Layer 3 addresses, and it is querying the Layer 3 address of another station. RARP has since been abandoned in favor of BOOTP which was subsequently replaced by DHCP.
| + | Bits 0 - 7 | 8 - 15 | 16 - 31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Hardware type (HTYPE) | Protocol type (PTYPE) | ||||||||||||||||||||||||||||||
| 32 | Hardware length (HLEN) | Protocol length (PLEN) | Operation (OPER) | |||||||||||||||||||||||||||||
| 64 | Sender hardware address (SHA) | |||||||||||||||||||||||||||||||
| ? | Sender protocol address (SPA) | |||||||||||||||||||||||||||||||
| ? | Target hardware address (THA) | |||||||||||||||||||||||||||||||
| ? | Target protocol address (TPA) | |||||||||||||||||||||||||||||||
| + | Bits 0 - 7 | 8 - 15 | 16 - 31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Hardware type = 1 | Protocol type = 0x0800 | ||||||||||||||||||||||||||||||
| 32 | Hardware length = 6 | Protocol length = 4 | Operation = 1 | |||||||||||||||||||||||||||||
| 64 | SHA (first 32 bits) = 0x000958D8 | |||||||||||||||||||||||||||||||
| 96 | SHA (last 16 bits) = 0x1122 | SPA (first 16 bits) = 0x0A0A | ||||||||||||||||||||||||||||||
| 128 | SPA (last 16 bits) = 0x0A7B | THA (first 16 bits) = 0x0000 | ||||||||||||||||||||||||||||||
| 160 | THA (last 32 bits) = 0x00000000 | |||||||||||||||||||||||||||||||
| 192 | TPA = 0x0A0A0A8C | |||||||||||||||||||||||||||||||
If a host with IPv4 address of 10.10.10.123 and MAC address of 00:09:58:D8:11:22 wants to send a packet to another host at 10.10.10.140 but it does not know the MAC address then it must send an ARP request to discover the address. The packet shown shows what would be broadcast over the local network. If the host 10.10.10.140 is running and available then it would receive the ARP request and send the appropriate reply.
| + | Bits 0 - 7 | 8 - 15 | 16 - 31 | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Hardware type = 1 | Protocol type = 0x0800 | ||||||||||||||||||||||||||||||
| 32 | Hardware length = 6 | Protocol length = 4 | Operation = 2 | |||||||||||||||||||||||||||||
| 64 | SHA (first 32 bits) = 0x000958D8 | |||||||||||||||||||||||||||||||
| 96 | SHA (last 16 bits) = 0x33AA | SPA (first 16 bits) = 0x0A0A | ||||||||||||||||||||||||||||||
| 128 | SPA (last 16 bits) = 0x0A8C | THA (first 16 bits) = 0x0009 | ||||||||||||||||||||||||||||||
| 160 | THA (last 32 bits) = 0x58D81122 | |||||||||||||||||||||||||||||||
| 192 | TPA = 0x0A0A0A7B | |||||||||||||||||||||||||||||||
Given the scenario laid out in the request section, if the host 10.10.10.140 has a MAC address of 00:09:58:D8:33:AA then it would send the shown reply packet. Note that the sender and target address blocks have been swapped (the sender of the reply is the target of the request; the target of the reply is the sender of the request). Furthermore the host 10.10.10.140 has filled in its MAC address in the sender hardware address.
Any hosts on the same network as these two hosts would also see the request (since it is a BroadCast) and they can cache the request result as well, thus saving those hosts from having to perform the same query. This is an advantage of a multiple-access bus like Ethernet.
Internet protocols | Internet standards
Address Resolution Protocol | Address Resolution Protocol | Address resolution protocol | Address Resolution Protocol | Address Resolution Protocol | Address Resolution Protocol | Address Resolution Protocol | Address Resolution Protocol | Address Resolution Protocol | Address Resolution Protocol | Address Resolution Protocol | Address Resolution Protocol | ARP (protokół komunikacyjny) | Address Resolution Protocol | ARP | ARP | ARP | ARP | Address Resolution Protocol
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Address Resolution Protocol".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world