search
HomeOperation and MaintenanceWindows Operation and MaintenanceDetailed explanation of the workflow of ARP address resolution protocol

We know that if two hosts want to communicate with each other, they both need to have an IP address, and they also need to know the IP address of the other party. So can we communicate with an IP address? Not yet, you still need the other party's MAC address to communicate. The MAC address and IP address are indispensable. Let's look at how to find out the other party's MAC address once we know the IP address of the other party's host.

Each host has its own arp cache list, which stores the mapping relationship between the IP addresses and Mac addresses of other hosts in the LAN. You can enter `arp -a in the command window to view the arp cache of this host.

arp -a
接口: 192.168.110.145 --- 0x13
  Internet 地址         物理地址              类型
  192.168.110.1         30-0d-9e-61-27-3a     动态        
  192.168.110.255       ff-ff-ff-ff-ff-ff     静态        
……

When host A on the LAN (IP is 192.168.1.11) wants to communicate with host B on the same LAN, after knowing the IP address of host B (192.168.1.13), it will check its own arp cache , see if there is the MAC address of host B. If so, you can communicate with host B. If not, the ARP address resolution protocol must be used to obtain the MAC address of host B. Let's take a look at the workflow of arp:

(1) Host A sends a broadcast packet within the LAN. The message content is similar to: "I am 192.168.1.11, and the mac address is a0:a4:ce:42: 29:56, I want to know the MAC address of 192.168.1.13".

(2) All hosts running the arp program on this LAN can receive the broadcast message.

(3) The IP of host B matches, the request is accepted, and the mapping relationship between the IP and MAC address of host A is recorded in the remembered arp cache. Then send a unicast packet to host A with content similar to: "I am 192.168.1.13, and my MAC address is f1:21:fa:c2:d2:ad".

(4) Host A receives the unicast message from B and records the relationship between host B’s IP address and MAC address in its own arp cache.

Note that because the LAN host changes dynamically, the ARP cache has a survival time and will be automatically deleted when it expires.

You may have questions. What you are talking about is only the situation of hosts in the LAN. What if they are on different network segments? In fact, it is still obtained through ARP, but multiple ARP requests are required.

The above is the detailed content of Detailed explanation of the workflow of ARP address resolution protocol. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment