ARP Packet Format

 

ARP Packet Format

An ARP (Address Resolution Protocol) packet contains the information required to map an IP address to its corresponding link-layer address. It includes fields that identify the protocols involved and the sender's and receiver's addresses.

1. Format of an ARP Packet



2. Explanation of the Fields

Field

Purpose

Hardware Type (HTYPE)

Specifies the type of link-layer network. For Ethernet, the value is 1.

Protocol Type (PTYPE)

Specifies the network-layer protocol. For IPv4, the value is hexadecimal 0x0800.

Hardware Address Length (HLEN)

Specifies the length of the hardware address. For Ethernet MAC addresses, it is 6 bytes.

Protocol Address Length (PLEN)

Specifies the length of the protocol address. For IPv4 addresses, it is 4 bytes.

Operation (OPER)

Specifies the ARP operation: request (1) or reply (2).

Sender Hardware Address (SHA)

Contains the sender's MAC address.

Sender Protocol Address (SPA)

Contains the sender's IP address.

Target Hardware Address (THA)

Contains the target's MAC address. It is typically unknown and set to zero in an ARP request.

Target Protocol Address (TPA)

Contains the IP address of the target whose MAC address is being requested or reported.

3. Example: ARP Request

Suppose Host A wants to find the MAC address of Host B, whose IP address is 192.168.1.20.

  • Sender hardware address: Host A's MAC address.

  • Sender protocol address: Host A's IP address, 192.168.1.10.

  • Target hardware address: Unknown, typically filled with zeros.

  • Target protocol address: 192.168.1.20.

  • Operation: 1 (ARP request).

Host A broadcasts this request. Host B recognizes its IP address and sends an ARP reply containing its MAC address.

4. Encapsulation of an ARP Packet

An ARP packet is encapsulated directly inside a data-link frame, rather than inside an IP datagram.

The frame header contains a field identifying the payload as ARP. For Ethernet, this is the EtherType value 0x0806.


Ethernet identifies the payload as ARP using EtherType 0x0806.

Key point: The ARP packet contains both hardware addresses and protocol addresses, allowing a node to associate an IP address with the corresponding MAC address.

Comments

Popular posts from this blog

Computer Networks PCCST501 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Model Question Paper Computer Networks PCCST501 KTU 2024 Scheme and Answer Key

Introduction to Computer Networks