The Address Resolution Protocol (ARP) is a
communication protocol
A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any variation of a physical quantity. The protocol defines the rules, syntax, semantics (computer science), sem ...
for discovering the
link layer address, such as a
MAC address
A MAC address (short for medium access control address or media access control address) is a unique identifier assigned to a network interface controller (NIC) for use as a network address in communications within a network segment. This use i ...
, associated with a
internet layer
The internet layer is a group of internetworking methods, protocols, and specifications in the Internet protocol suite that are used to transport network packets from the originating host across network boundaries; if necessary, to the desti ...
address, typically an
IPv4 address. The protocol, part of the
Internet protocol suite
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
, was defined in 1982 by , which is
Internet Standard
In computer network engineering, an Internet Standard is a normative specification of a technology or methodology applicable to the Internet. Internet Standards are created and published by the Internet Engineering Task Force (IETF). They allow ...
STD 37.
ARP enables a host to send an IPv4 packet to another node in the local network by providing a protocol to get the MAC address associated with an IP address. The host broadcasts a request containing the node's IP address, and the node with that IP address replies with its MAC address.
ARP has been implemented with many combinations of network and data link layer technologies, such as
IPv4
Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a standalone specification. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. ...
,
Chaosnet,
DECnet
DECnet is a suite of network protocols created by Digital Equipment Corporation. Originally released in 1975 in order to connect two PDP-11 minicomputers, it evolved into one of the first peer-to-peer network architectures, thus transforming DEC ...
and Xerox
PARC Universal Packet
The PARC Universal Packet (PUP or PuP, although the original documents usually use Pup) was one of the two earliest internetworking protocol suites; it was created by researchers at Xerox PARC in the mid-1970s. (Technically, the name ''PUP'' on ...
(PUP) using
IEEE 802
IEEE 802 is a family of Institute of Electrical and Electronics Engineers (IEEE) standards for local area networks (LANs), personal area networks (PANs), and metropolitan area networks (MANs). The IEEE 802 LAN/MAN Standards Committee (LMSC) main ...
standards,
FDDI
Fiber Distributed Data Interface (FDDI) is a standard for data transmission in a local area network.
It uses optical fiber as its standard underlying physical medium.
It was also later specified to use copper cable, in which case it may be c ...
,
X.25
X.25 is an ITU-T standard protocol suite for Packet switched network, packet-switched data communication in wide area network, wide area networks (WAN). It was originally defined by the CCITT, International Telegraph and Telephone Consultative Co ...
,
Frame Relay
Frame Relay (FR) is a standardized wide area network (WAN) technology that specifies the Physical layer, physical and data link layers of digital telecommunications channels using a packet switching methodology.
Frame Relay was originally devel ...
and
Asynchronous Transfer Mode
Asynchronous Transfer Mode (ATM) is a telecommunications standard defined by the American National Standards Institute and International Telecommunication Union Telecommunication Standardization Sector (ITU-T, formerly CCITT) for digital trans ...
(ATM).
In
Internet Protocol Version 6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
(IPv6) networks, the functionality of ARP is provided by the
Neighbor Discovery Protocol
The Neighbor Discovery Protocol (NDP), or simply Neighbor Discovery (ND), is a protocol of the Internet protocol suite used with Internet Protocol Version 6 (IPv6). It operates at the internet layer of the Internet model, and is responsible for ...
(NDP).
Operating scope
The Address Resolution Protocol is a
request-response protocol. Its messages are directly encapsulated by a link layer protocol. It is communicated within the boundaries of a single
subnetwork
A subnet, or subnetwork, is a logical subdivision of an IP network. Updated by RFC 6918. The practice of dividing a network into two or more networks is called subnetting.
Computers that belong to the same subnet are addressed with an identic ...
and is never
routed.
Packet structure
The Address Resolution Protocol uses a simple message format containing one address resolution request or response. The packets are carried at the
data link layer
The data link layer, or layer 2, is the second layer of the seven-layer OSI model of computer networking. This layer is the protocol layer that transfers data between nodes on a network segment across the physical layer. The data link layer p ...
of the underlying network as raw payload. In the case of Ethernet, a
EtherType
EtherType is a two- octet field in an Ethernet frame. It is used to indicate which protocol is encapsulated in the payload of the frame and is used at the receiving end by the data link layer to determine how the payload is processed. The same ...
value is used to identify ARP frames.
The size of the ARP message depends on the link layer and network layer address sizes. The message
header specifies the types of network in use at each layer as well as the size of addresses of each. The message header is completed with the operation code for request (1) and reply (2). The payload of the packet consists of four addresses, the hardware and protocol address of the sender and receiver hosts.
The principal packet structure of ARP packets is shown in the following table which illustrates the case of IPv4 networks running on Ethernet. In this scenario, the packet has 48-bit fields for the sender hardware address (SHA) and target hardware address (THA), and 32-bit fields for the corresponding sender and target protocol addresses (SPA and TPA). The ARP packet size in this case is 28 bytes.
;
;
;
;
;
;
;
;
;
ARP parameter values have been standardized and are maintained by the
Internet Assigned Numbers Authority
The Internet Assigned Numbers Authority (IANA) is a standards organization that oversees global IP address allocation, Autonomous system (Internet), autonomous system number allocation, DNS root zone, root zone management in the Domain Name Syste ...
(IANA).
The
EtherType
EtherType is a two- octet field in an Ethernet frame. It is used to indicate which protocol is encapsulated in the payload of the frame and is used at the receiving end by the data link layer to determine how the payload is processed. The same ...
for ARP is . This appears in the Ethernet frame header when the payload is an ARP packet and is not to be confused with PTYPE, which appears within this encapsulated ARP packet.
Layering
ARP's placement within the
Internet protocol suite
The Internet protocol suite, commonly known as TCP/IP, is a framework for organizing the communication protocols used in the Internet and similar computer networks according to functional criteria. The foundational protocols in the suite are ...
and the
OSI model
The Open Systems Interconnection (OSI) model is a reference model developed by the International Organization for Standardization (ISO) that "provides a common basis for the coordination of standards development for the purpose of systems inter ...
may be a matter of confusion or even of dispute. places it into the
Link Layer and characterizes it as a tool to inquire about the "higher level layer", such as the Internet layer. also discusses ARP in its link layer section.
Richard Stevens places ARP in OSI's data link layer while newer editions associate it with the network layer or introduce an intermediate OSI layer 2.5.
Example
Two computers, ''A'' and ''B'', are connected to the same
local area network
A local area network (LAN) is a computer network that interconnects computers within a limited area such as a residence, campus, or building, and has its network equipment and interconnects locally managed. LANs facilitate the distribution of da ...
with no intervening
gateway or
router. ''A'' has a packet to send to IP address which happens to be the address of ''B''.
Before sending the packet to ''B'', ''A'' broadcasts an ARP request message addressed with the broadcast MAC address and requesting response from the node with IP address . All nodes of the network receive the message, but only ''B'' replies since it has the requested IP address. ''B'' responds with an ARP response message containing its MAC addresses which ''A'' receives. ''A'' sends the data packet on the link addressed with ''B''s MAC address.
Typically, network nodes maintain a
lookup
In computer science, a lookup table (LUT) is an array that replaces runtime computation of a mathematical function with a simpler array indexing operation, in a process termed as ''direct addressing''. The savings in processing time can be sig ...
cache that associates IP and MAC addressees. In this example, if ''A'' had the lookup cached, then it would not need to broadcast the ARP request. Also, when ''B'' received the request, it could cache the lookup to ''A'' so that if ''B'' needs to send a packet to ''A'' later, it does not need to use ARP to lookup its MAC address. Finally, when ''A'' receives the ARP response, it can cache the lookup for future messages addressed to the same IP address.
ARP probe
An ARP probe in IPv4 is an ARP request constructed with the SHA of the probing host, an SPA of all 0s, a THA of all 0s, and a TPA set to the IPv4 address being probed for. If some host on the network regards the IPv4 address (in the TPA) as its own, it will reply to the probe (via the SHA of the probing host) thus informing the probing host of the address conflict. If instead there is no host which regards the IPv4 address as its own, then there will be no reply. When several such probes have been sent, with slight delays, and none receive replies, it can reasonably be expected that no conflict exists. As the original probe packet contains neither a valid SHA/SPA nor a valid THA/TPA pair, there is no risk of any host using the packet to update its cache with problematic data. Before beginning to use an IPv4 address (whether received from manual configuration, DHCP, or some other means), a host implementing this specification must test to see if the address is already in use, by broadcasting ARP probe packets.
ARP announcements
ARP may also be used as a simple announcement protocol. This is useful for updating other hosts' mappings of a hardware address when the sender's IP address or MAC address changes. Such an announcement, also called a gratuitous ARP (GARP) message, is usually broadcast as an ''ARP request'' containing the SPA in the target field (TPA=SPA), with THA set to zero. An alternative way is to broadcast an ''ARP reply'' with the sender's SHA and SPA duplicated in the target fields (TPA=SPA, THA=SHA).
The ''ARP request'' and ''ARP reply'' announcements are both standards-based methods, but the ''ARP request'' method is preferred. Some devices may be configured for the use of either of these two types of announcements.
An ARP announcement is not intended to solicit a reply; instead, it updates any cached entries in the ARP tables of other hosts that receive the packet. The operation code in the announcement may be either request or reply; the ARP standard specifies that the opcode is only processed after the ARP table has been updated from the address fields.
Many operating systems issue an ARP announcement during startup. This helps to resolve problems that would otherwise occur if, for example, a
network card
A network interface controller (NIC, also known as a network interface card, network adapter, LAN adapter and physical network interface) is a computer hardware component that connects a computer to a computer network.
Early network interface ...
was recently changed (changing the IP-address-to-MAC-address mapping) and other hosts still have the old mapping in their ARP caches.
ARP announcements are also used by some network interfaces to provide load balancing for incoming traffic. In a
team
A team is a group of individuals (human or non-human) working together to achieve their goal.
As defined by Professor Leigh Thompson of the Kellogg School of Management, " team is a group of people who are interdependent with respect to in ...
of network cards, it is used to announce a different MAC address within the team that should receive incoming packets.
ARP announcements can be used in the
Zeroconf
Zero-configuration networking (zeroconf) is a set of technologies that automatically creates a usable computer network based on the Internet Protocol Suite (TCP/IP) when computers or network peripherals are interconnected. It does not require manu ...
protocol to allow automatic assignment of a
link-local address
In computer networking, a link-local address is a network address that is valid only for communications on a ''local link'', i.e. within a subnetwork that a host is connected to. Link-local addresses are typically assigned automatically through ...
to an interface where no other IP address configuration is available. The announcements are used to ensure an address chosen by a host is not in use by other hosts on the network link.
This function can be dangerous from a cybersecurity viewpoint since an attacker can obtain information about the other hosts of its subnet to save in their ARP cache (
ARP spoofing
In computer networking, ARP spoofing (also ARP cache poisoning or ARP poison routing) is a technique by which an attacker sends ( spoofed) Address Resolution Protocol (ARP) messages onto a local area network. Generally, the aim is to associate ...
) an entry where the attacker MAC is associated, for instance, to the IP of the
default gateway
A default gateway is the node in a computer network using the Internet protocol suite that serves as the forwarding host ( router) to other networks when no other route specification matches the destination IP address of a packet.
Role
A gatew ...
, thus allowing them to
intercept all the traffic to external networks.
ARP mediation
ARP mediation refers to the process of resolving Layer-2 addresses through a
virtual private wire service (VPWS) when different resolution protocols are used on the connected circuits, e.g.,
Ethernet
Ethernet ( ) is a family of wired computer networking technologies commonly used in local area networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). It was commercially introduced in 1980 and first standardized in 198 ...
on one end and
Frame Relay
Frame Relay (FR) is a standardized wide area network (WAN) technology that specifies the Physical layer, physical and data link layers of digital telecommunications channels using a packet switching methodology.
Frame Relay was originally devel ...
on the other. In
IPv4
Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a standalone specification. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. ...
, each
provider edge (PE) device discovers the IP address of the locally attached
customer edge (CE) device and distributes that IP address to the corresponding remote PE device. Then each PE device responds to local ARP requests using the IP address of the remote CE device and the hardware address of the local PE device. In
IPv6
Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communication protocol, communications protocol that provides an identification and location system for computers on networks and routes traffic ...
, each PE device discovers the IP address of both local and remote CE devices and then intercepts local
Neighbor Discovery (ND) and
Inverse Neighbor Discovery (IND) packets and forwards them to the remote PE device.
Inverse ARP and Reverse ARP
Inverse Address Resolution Protocol (Inverse ARP or InARP) is used to obtain
network layer
In the seven-layer OSI model of computer networking, the network layer is layer 3. The network layer is responsible for packet forwarding including routing through intermediate Router (computing), routers.
Functions
The network layer provides t ...
addresses (for example,
IP address
An Internet Protocol address (IP address) is a numerical label such as that is assigned to a device connected to a computer network that uses the Internet Protocol for communication. IP addresses serve two main functions: network interface i ...
es) of other nodes from
data link layer
The data link layer, or layer 2, is the second layer of the seven-layer OSI model of computer networking. This layer is the protocol layer that transfers data between nodes on a network segment across the physical layer. The data link layer p ...
(Layer 2) addresses. Since ARP translates layer-3 addresses to layer-2 addresses, InARP may be described as its inverse. In addition, InARP is implemented as a protocol extension to ARP: it uses the same packet format as ARP, but different operation codes.
InARP is primarily used in
Frame Relay
Frame Relay (FR) is a standardized wide area network (WAN) technology that specifies the Physical layer, physical and data link layers of digital telecommunications channels using a packet switching methodology.
Frame Relay was originally devel ...
(
DLCI) and ATM networks, in which layer-2 addresses of
virtual circuit
A virtual circuit (VC) is a means of transporting data over a data network, based on packet switching and in which a connection is first established across the network between two endpoints. The network, rather than having a fixed data rate reser ...
s are sometimes obtained from layer-2 signaling, and the corresponding layer-3 addresses must be available before those virtual circuits can be used.
The
Reverse Address Resolution Protocol (Reverse ARP or RARP), like InARP, translates layer-2 addresses to layer-3 addresses. However, in InARP the requesting station queries the layer-3 address of another node, whereas RARP is used to obtain the layer-3 address of the requesting station itself for address configuration purposes. RARP is obsolete; it was replaced by
BOOTP, which was later superseded by the
Dynamic Host Configuration Protocol
The Dynamic Host Configuration Protocol (DHCP) is a network protocol, network management protocol used on Internet Protocol (IP) networks for automatically assigning IP addresses and other communication parameters to devices connected to the netw ...
(DHCP).
ARP spoofing and proxy ARP
Because ARP does not provide methods for authenticating ARP replies on a network, ARP replies can come from systems other than the one with the required Layer 2 address. An ARP ''proxy'' is a system that answers the ARP request on behalf of another system for which it will forward traffic, normally as a part of the network's design, such as for a dialup internet service. By contrast, in ARP ''spoofing'' the answering system, or ''spoofer'', replies to a request for another system's address with the aim of intercepting data bound for that system. A malicious user may use ARP spoofing to perform a
man-in-the-middle or
denial-of-service attack on other users on the network. Various software exists to both detect and perform ARP spoofing attacks, though ARP itself does not provide any methods of protection from such attacks.
Alternatives
IPv6 uses the
Neighbor Discovery Protocol
The Neighbor Discovery Protocol (NDP), or simply Neighbor Discovery (ND), is a protocol of the Internet protocol suite used with Internet Protocol Version 6 (IPv6). It operates at the internet layer of the Internet model, and is responsible for ...
and its extensions such as
Secure Neighbor Discovery, rather than ARP.
Computers can maintain lists of known addresses, rather than using an active protocol. In this model, each computer maintains a database of the mapping of
Layer 3 addresses (e.g.,
IP addresses) to
Layer 2 addresses (e.g.,
Ethernet
Ethernet ( ) is a family of wired computer networking technologies commonly used in local area networks (LAN), metropolitan area networks (MAN) and wide area networks (WAN). It was commercially introduced in 1980 and first standardized in 198 ...
MAC addresses). This data is maintained primarily by interpreting ARP packets from the local network link. Thus, it is often called the ''
ARP cache''. Since at least the 1980s, networked computers have a utility called ''arp'' for interrogating or manipulating this database.
Historically, other methods were used to maintain the mapping between addresses, such as static configuration files, or centrally maintained lists.
ARP stuffing
Embedded systems such as networked cameras and networked power distribution devices,
[
] which lack a user interface, can use so-called ''ARP stuffing'' to make an initial network connection, although this is a misnomer, as ARP is not involved.
ARP stuffing is accomplished as follows:
# The user's computer has an IP address ''stuffed'' manually into its address table (normally with the ''arp'' command with the MAC address taken from a label on the device)
# The computer sends special packets to the device, typically a
ping packet with a non-default size.
# The device then adopts this IP address
# The user then communicates with it by
telnet
Telnet (sometimes stylized TELNET) is a client-server application protocol that provides access to virtual terminals of remote systems on local area networks or the Internet. It is a protocol for bidirectional 8-bit communications. Its main ...
or
protocols to complete the configuration.
Such devices typically have a method to disable this process once the device is operating normally, as the capability can make it vulnerable to attack.
Standards documents
*
*
*
*
See also
*
*
*
*
*
References
External links
*
Gratuitous ARPInformation and sample capture from WiresharkARP-SK ARP traffic generation tools
{{IETF RFC standards
Address Resolution Protocol,
Internet Standards