Communication method and apparatus

By recording the ARP entry migration sequence in network devices and sending alarm information, the problems of ARP packet flooding and ARP entry errors during server upgrades were resolved, thereby improving network performance and service availability.

CN122160245APending Publication Date: 2026-06-05NEW H3C TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NEW H3C TECH CO LTD
Filing Date
2026-02-04
Publication Date
2026-06-05

Smart Images

  • Figure CN122160245A_ABST
    Figure CN122160245A_ABST
Patent Text Reader

Abstract

The application provides a communication method and device, which are applied to a first network device, the first network device stores an ARP entry migration time sequence table, the ARP entry migration time sequence table sorts ARP migration time sequence table entries according to ARP entry update time, and the method comprises the following steps: acquiring interface identifiers included in each ARP migration time sequence table entry belonging to the same IP address; identifying whether a loop mode formed by the multiple interface identifiers meets a preset loop condition; and if yes, sending first alarm information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a communication method and apparatus. Background Technology

[0002] Multichassis link aggregation (M-LAG) virtualizes two physical devices into one device at the aggregation level to achieve cross-device link aggregation, thereby providing device-level redundancy protection and traffic load balancing.

[0003] In an M-LAG dual-homed access Layer 3 network scenario, two network devices construct an M-LAG and simultaneously act as Layer 3 gateways. In this scenario, the two network devices share logical interfaces with the same IP address and MAC address. This allows service traffic to quickly switch to the other link when one access link fails, ensuring reliability. The two access links can also handle service traffic simultaneously, forming load balancing and improving bandwidth utilization.

[0004] In practical applications, the scenario of stacked primary and backup servers connected to "M-LAG" is extremely common. In this scenario, such as... Figure 1 As shown, Figure 1 This diagram illustrates the M-LAG network topology for existing primary and backup server stacking. Figure 1 In this configuration, the uplink ports of the primary server are connected to port 1 of the Distributed Relay interface (DR) via a switch. The uplink ports of the backup server are connected to port 2 of DR via a switch. The uplink ports of both the primary and backup servers are configured with the same IP address but different MAC addresses. During normal operation, the uplink ports of the primary server are active, while the uplink ports of the backup server are in standby mode.

[0005] In server upgrade scenarios, a primary / backup switch is triggered first, meaning the original backup server is upgraded to the new primary server, and the original primary server is downgraded to the new backup server. However, during the switchover process, a brief "dual-primary" phenomenon will occur, meaning that the uplink ports of both the old and new primary servers are active simultaneously, both receiving and responding to Address Resolution Protocol (ARP) requests. Specifically, after the original backup server is upgraded to the new primary server, it will actively send gratuitous ARP packets. If a network device in the M-LAG receives this ARP packet through its IPP port, it will query its local ARP table based on the IP address included in the ARP packet. If the MAC address included in the ARP packet does not match the MAC address in the local ARP table, the network device will automatically send an ARP probe packet to confirm the status of the new primary server.

[0006] In a "dual-master" configuration, both the old master and the new master server respond to ARP probes, causing network devices in the M-LAG to repeatedly send ARP probe packets. This leads to an overabundance of ARP packets in the network, severely consuming network bandwidth and affecting network performance and stability. At the same time, some servers' ARP entries may be incorrectly learned on the DR interface. Before the ARP entry ages out, the corresponding server cannot forward service traffic normally, resulting in service unavailability. Summary of the Invention

[0007] In view of this, this application provides a communication method and apparatus to solve the problems of ARP packet flooding in the network under the "dual master" state in existing server upgrade scenarios, which affects network performance and stability, and DR interface incorrectly learning the server's ARP table entries, resulting in service unavailability.

[0008] In a first aspect, this application provides a communication method applied to a first network device, wherein the first network device stores an ARP entry migration sequence table, and the ARP entry migration sequence table sorts the ARP entry entries according to their update time; the method includes: Obtain the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; Identify whether the loop pattern formed by multiple interface identifiers meets the preset loop conditions; If the conditions are met, the first alarm message is sent.

[0009] Secondly, this application provides a communication device applied to a first network device, wherein the first network device stores an ARP entry migration sequence table, and the ARP entry migration sequence table sorts the ARP entry entries according to the ARP entry update time. The device includes: The acquisition unit is used to acquire the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; The identification unit is used to identify whether the loop pattern formed by multiple interface identifiers meets the preset loop conditions. The sending unit is used to send the first alarm information if the conditions are met.

[0010] Thirdly, this application provides a network device including a processor and a machine-readable storage medium storing machine-executable instructions that can be executed by the processor, which in turn cause the processor to perform the method provided in the first aspect of this application.

[0011] Therefore, by applying the communication method and apparatus provided in this application, the first network device obtains the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; the first network device identifies whether the cyclic pattern formed by multiple interface identifiers satisfies the preset cyclic condition; if it does, the first network device sends a first alarm message.

[0012] In this way, by utilizing the ARP entry changes and triggering events recorded in the ARP entry migration time sequence table, fault visualization is achieved, improving troubleshooting efficiency; network devices proactively send alarm information along with key data, reducing fault troubleshooting time from "hours" to "minutes," thus lowering maintenance costs; at the same time, it also solves the problem of ARP packet flooding in the network under the "dual-master" state in existing server upgrade scenarios, affecting network performance and stability, and the DR interface incorrectly learning the server's ARP entries, leading to service unavailability. Attached Figure Description

[0013] Figure 1 A schematic diagram of an existing primary and backup server stacking network connected to M-LAG; Figure 2 A flowchart illustrating the communication method provided in the embodiments of this application; Figure 3 A structural diagram of a communication device provided in an embodiment of this application; Figure 4 The network device hardware structure provided in the embodiments of this application. Detailed Implementation

[0014] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0015] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the corresponding listed items.

[0016] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0017] In a dual-master scenario with primary and backup server failover, both the primary and backup servers will simultaneously respond to ARP probes initiated by network device A and network device B. Because the two servers have different MAC addresses, network device A and network device B will repeatedly trigger a loop of "MAC address mismatch → send ARP probe → receive new MAC address reply → trigger probe again" after receiving ARP replies from different MAC addresses. This is illustrated using an example where the primary server's IP address is 1.1.1.1, MAC address is 1-1-1 (connected to DR1 port), and the backup server's MAC address is 2-2-2 (connected to DR2 port).

[0018] After the backup server is upgraded to the new primary server, network device A first receives a gratuitous ARP request from the new server via IPP port 1, updates its own ARP table entry to "1.1.1.1-2-2-2-IPP1", and initiates an ARP probe. At this time, network device A receives an ARP reply from the new primary server via DR2 port, and updates its ARP table entry again to "1.1.1.1-2-2-2-DR2". Subsequently, network device A receives an ARP reply from the old primary server via IPP port 1. Due to the inconsistent MAC addresses, it updates the table entry again to "1.1.1.1-1-1-1-IPP1" and initiates another ARP probe. This cyclical process continuously consumes network bandwidth, affecting the forwarding of other service traffic.

[0019] For example, when network device A first learns the new master server's ARP entry "1.1.1.1-2-2-2-DR2" through DR2, and then receives an ARP reply from the old master server through DR1, including the MAC address 1-1-1, network device A will update the ARP entry to "1.1.1.1-1-1-1-DR1" because the DR port has a higher priority than the IPP port. Subsequently, if the same ARP reply is received from the old master server through the IPP1 port, because the IPP port has a lower priority than the DR port, an ARP probe cannot be initiated, and network device A cannot overwrite the entry including the DR port. This erroneous entry will remain until it ages (ARP entry aging takes 20 minutes by default). During this period, the device will forward traffic destined for 1.1.1.1 to the DR1 port (corresponding to the downgraded old server), causing a complete interruption of the new server's services.

[0020] The communication method provided in the embodiments of this application will be described in detail below. See also... Figure 2 , Figure 2 This is a flowchart illustrating a communication method provided in an embodiment of this application. The method is applied to a first network device, which is part of an M-LAG network that also includes other network devices. The communication method provided in this application may include the following steps.

[0021] Step 210: Obtain the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; Specifically, the first network device (e.g., Figure 1 Network device A) and other network devices (e.g., Figure 1 The network consists of one network device (B). The first network device includes IPP port 1, and the other network devices include IPP port 2. An IPL link is established through IPP port 1 and IPP port 2. The first network device and the other network devices also include interface 1 and interface 4, and a keepalive link is established through interface 1 and interface 4.

[0022] The first network device also includes interface 2 and interface 3; other network devices also include interface 5 and interface 6. Interface 2 and interface 5 aggregate access to one access device (e.g., Figure 1 Network device C), this access device is used to connect to the main server; interfaces 3 and 6 aggregate access to another access device (e.g., Figure 1 Network device D in the diagram is used to connect to the secondary server. It is understood that the network topology used in this communication method can be referenced from the aforementioned... Figure 1 .

[0023] In this embodiment, an ARP table is configured within the first network device, storing at least one ARP entry. Each ARP entry has the same structure as an existing ARP entry. Simultaneously, an ARP migration sequence table is also configured within the first network device, storing at least one ARP migration sequence table entry. Each ARP migration sequence table entry is generated after an ARP entry is created or updated. Therefore, the ARP migration sequence table is used to record the changes in the ARP entries corresponding to each IP address in real time.

[0024] The ARP migration sequence table includes IP address, MAC address, interface identifier, update time, and trigger event fields, as shown in Table 1 below.

[0025] Table 1 ARP Migration Timing Table The first network device retrieves the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address from the ARP migration sequence table.

[0026] Understandably, based on the update time included in each ARP migration timetable entry belonging to the same IP address, the first network device obtains the interface identifier included in each ARP migration timetable entry according to the update time.

[0027] Step 220: Identify whether the loop pattern formed by multiple interface identifiers meets the preset loop conditions; Specifically, according to the description of step 210, after the first network device obtains multiple interface identifiers according to the update time, it identifies whether the loop pattern formed by the multiple interface identifiers meets the preset loop conditions.

[0028] In this embodiment of the application, the preset loop conditions include the loop time and the number of loops. For example, the time is 10 seconds and the number of loops is 3.

[0029] For example, as shown in Table 1 above, there is a cyclic pattern of DR1-IPP-DR2-IPP-DR1 formed by multiple interface identifiers. The first network device identifies whether the cyclic pattern formed by multiple interface identifiers has reached the required number of cycles within the cyclic time.

[0030] If the preset loop condition is met, that is, if the loop pattern formed by multiple interface identifiers reaches the number of loops within the loop time, then the first network device executes step 230.

[0031] If the preset loop condition is not met, that is, if the loop pattern formed by multiple interface identifiers does not reach the required number of loops within the loop time, the first network device terminates the current process. As mentioned above, if the loop pattern DR1-IPP1-DR2-IPP1-DR1 formed by its multiple interface identifiers does not reach the required number of loops within the loop time, the first network device terminates the current process.

[0032] If the DR1-IPP1-DR2-IPP1-DR1 cyclic pattern formed by multiple interface identifiers reaches the required number of cycles within the cyclic time, the first network device executes step 230.

[0033] Step 230: If the conditions are met, send the first alarm message.

[0034] Specifically, according to the description of step 220, if the cyclic pattern formed by multiple interface identifiers satisfies the preset cyclic conditions, the first network device generates and sends a first alarm message. The first alarm message includes an ARP migration timetable entry that satisfies the preset cyclic conditions, so that administrators (or users) can determine that ARP flooding has occurred in the network based on the first alarm message.

[0035] In this embodiment of the application, the first network device can send a first alarm message to the controller, which will then display the first alarm message to the administrator (or user).

[0036] It is understandable that other network devices, as another network device within the M-LAG network, will also perform the aforementioned steps 210-230, which will not be repeated here.

[0037] Optionally, in this embodiment of the application, the first network device will also create an ARP probe count counter for each IP address included in the ARP entry to limit the number of ARP probes and avoid ARP packet flooding.

[0038] Furthermore, as described above, the first network device has an ARP table, which includes at least one ARP entry, and each ARP entry includes an IP address and an interface identifier.

[0039] The first network device creates an ARP probe count counter for each IP address included in each ARP table entry. In other words, one ARP probe count counter is created for each IP address.

[0040] If the first network device updates the first interface identifier included in the first ARP entry to the IPP port according to the received first ARP packet, the first network device initiates an ARP probe to the second network device (e.g., primary or backup server) indicated by the first IP address included in the first ARP entry, and increments the value of the ARP probe count counter for the first IP address by 1.

[0041] If the first network device updates the first interface identifier to the DR interface based on the received second ARP packet, the first network device will not initiate an ARP probe to the second network device and will maintain the value of the ARP probe count counter for the first IP address.

[0042] If the first network device updates the first interface identifier to the IPP port again based on the received third ARP packet and the value of the ARP probe count counter is the first value (for example, the first value is 2), then the first network device will not initiate an ARP probe to the second network device and will maintain the value of the ARP probe count counter for the first IP address.

[0043] The first, second, and third ARP messages mentioned above can be specifically gratuitous ARP messages or ARP responses.

[0044] Optionally, in this embodiment of the application, the first network device will also perform a second ARP probe based on the interface identifier included in the ARP entry to accurately determine the status of the old master server and the new master server.

[0045] Furthermore, as described above, the first network device has an ARP table, which includes at least one ARP entry, and each ARP entry includes a MAC address, an IP address, and an interface identifier.

[0046] In this embodiment of the application, after the network device performs the aforementioned ARP probe, if it executes this process, it first resets the value of the ARP probe count counter corresponding to the IP address to 0.

[0047] After a preset time (e.g., 1 minute), the first network device retrieves a second ARP entry from the ARP table. The second ARP entry includes an interface identifier indicating a first DR port, which is used to access the legacy master device.

[0048] The first network device initiates an ARP probe to the third network device (e.g., the old master server) indicated by the IP address.

[0049] If the first network device receives multiple ARP responses within the probe period, the first network device determines that the switchover between the old master server and the new master server has not been completed or the switchover has failed, and the device is still in a "dual master" state. The first network device marks the IP address as pending confirmation. If the first network device receives an ARP reply and the MAC address included in the ARP reply is the same as the MAC address included in the second ARP entry, then the first network device determines that the old master server experienced a brief oscillation rather than a switchover. The first network device keeps the interface identifier included in the second ARP entry as the identifier of the first DR port and refreshes the second ARP entry (this refresh specifically refers to refreshing the aging time of the second ARP entry). If the first network device receives an ARP reply and the MAC address included in the ARP reply is different from the MAC address included in the second ARP entry, the first network device determines that the switchover between the old master server and the new master server has been completed (a brief "dual master" state). The first network device updates the MAC address included in the second ARP entry according to the MAC address included in the ARP reply, and updates the interface identifier included in the second ARP entry to the identifier of the second DR port, which is used to access the new master device.

[0050] It should be noted that when the first network device receives ARP replies, it can receive them through the DR port or through IPP port 1.

[0051] Optionally, in this embodiment of the application, the first network device will also perform a second ARP probe based on the interface identifier included in the ARP entry to accurately determine the status of the old master server and the new master server.

[0052] Furthermore, as described above, the first network device has an ARP table, which includes at least one ARP entry, and each ARP entry includes a MAC address, an IP address, and an interface identifier.

[0053] After a preset time, the first network device retrieves a third ARP entry from the ARP table. The third ARP entry includes an interface identifier indicating the second DR port, which is used to access the new master device.

[0054] The first network device initiates an ARP probe to the fourth network device (e.g., the new primary server) indicated by the IP address.

[0055] If the first network device receives multiple ARP responses within the probe period, the first network device determines that the switchover between the old master server and the new master server has not been completed or the switchover has failed, and the device is still in a "dual master" state. The first network device marks the IP address as pending confirmation. If the first network device receives an ARP reply and the MAC address included in the ARP reply is the same as the MAC address included in the third ARP entry, then the first network device determines that the switchover between the old master server and the new master server has been completed (a brief "dual master" state). The first network device keeps the interface identifier included in the third ARP entry as the identifier of the second DR port and refreshes the third ARP entry (this refresh specifically refers to refreshing the aging time of the third ARP entry). If the first network device receives an ARP reply and the MAC address included in the ARP reply is different from the MAC address included in the third ARP entry, the first network device determines that the old master server is experiencing a brief oscillation rather than a switchover. The first network device updates the MAC address included in the third ARP entry according to the MAC address included in the ARP reply, and updates the interface identifier included in the third ARP entry to the identifier of the first DR port. The first DR port is used to access the old master device.

[0056] It should be noted that the second network device can receive ARP replies through the DR port or through IPP port 2.

[0057] Optionally, in this embodiment of the application, the first network device probes the IP address marked as pending confirmation again to determine the network device status indicated by the IP address, thereby ensuring network security.

[0058] Furthermore, based on a preset detection strategy (e.g., including the detection period and the number of detections, where the detection period can be 1 minute and the number of detections can be 10), an ARP probe is generated and initiated on the fifth network device (e.g., the primary or backup server) that is marked as having an IP address in a pending confirmation state.

[0059] During the detection period, if the first network device receives an ARP reply after any ARP probe within the number of probes, the first network device can update or refresh the corresponding ARP table entry and delete the pending confirmation status mark of the IP address according to the aforementioned process of receiving an ARP reply (i.e., the switchover between the old master server and the new master server has been completed or the oscillation has ended).

[0060] If, within the detection period, the first network device receives multiple ARP responses after reaching the required number of detections, it determines that both the new and old master servers have failed, resulting in a persistent "dual-master" state. The first network device then initiates "fault isolation," adding the IP address to the ARP isolation list and ceasing to respond to subsequent ARP requests containing that IP address. Simultaneously, it generates and sends a second alarm message, which includes the detection logs and timing information for that IP address, allowing administrators (or users) to handle the "dual-master" state independently based on this second alarm message.

[0061] In this embodiment of the application, the first network device can send a second alarm message to the controller, which will then display the second alarm message to the administrator (or user).

[0062] It is understandable that other network devices within the M-LAG network will also perform the aforementioned optional steps.

[0063] Therefore, by applying the communication method provided in this application, the first network device obtains the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; the first network device identifies whether the cyclic pattern formed by multiple interface identifiers satisfies the preset cyclic condition; if it does, the first network device sends a first alarm message.

[0064] In this way, by utilizing the ARP entry changes and triggering events recorded in the ARP entry migration time sequence table, fault visualization is achieved, improving troubleshooting efficiency; network devices proactively send alarm information along with key data, reducing fault troubleshooting time from "hours" to "minutes," thus lowering maintenance costs; at the same time, it also solves the problem of ARP packet flooding in the network under the "dual-master" state in existing server upgrade scenarios, affecting network performance and stability, and the DR interface incorrectly learning the server's ARP entries, leading to service unavailability.

[0065] The communication method provided in the embodiments of this application will be described in detail below. Please refer to [link / reference]. Figure 1 .exist Figure 1 In this example, network device A and network device B form an M-LAG network. Network device A includes IPP port 1, and network device B includes IPP port 2. An IPL link is established through IPP port 1 and IPP port 2. Network device A also includes interfaces 1, 2, and 3; network device B also includes interfaces 4, 5, and 6. A keepalive link is established between interface 1 of network device A and interface 4 of network device B.

[0066] Network device A connects to interface 7 of network device C via interface 2, and to interface 9 of network device D via interface 3. Network device B connects to interface 8 of network device C via interface 5, and to interface 10 of network device D via interface 6. Network device C connects to uplink port 1 of the primary server; network device D connects to uplink port 2 of the backup server. Uplink ports 1 and 2 are configured with the same IP address 1.1.1.1 but different MAC addresses. For example, the MAC address of uplink port 1 is 1-1-1; the MAC address of uplink port 2 is 2-2-2. During normal operation, uplink port 1 is active, and uplink port 2 is in standby mode.

[0067] In this embodiment, interfaces 2, 3, 5, and 6 are all Layer 2 aggregation ports connected to external devices, also known as DR ports. Interfaces 2 and 5 belong to aggregation group 1 and can both be called DR1 ports (hereafter referred to as DR1 ports for consistency). Interfaces 3 and 6 belong to aggregation group 2 and can both be called DR2 ports (hereafter referred to as DR2 ports for consistency). Interfaces 7 and 8 also belong to aggregation group 1, and interfaces 9 and 10 also belong to aggregation group 2.

[0068] Let's take network device A as an example. Network device A has an ARP table configured, which stores at least one ARP entry. Each ARP entry has the same structure as existing ARP entries. Simultaneously, network device A also has an ARP migration sequence table, which stores at least one ARP migration sequence entry. Each ARP migration sequence table entry is generated after an ARP entry is created or updated. Therefore, the ARP migration sequence table is used to record the changes in the ARP entries corresponding to each IP address in real time.

[0069] The ARP migration sequence table includes IP address field, MAC address field, interface identifier field, update time field, and trigger event field.

[0070] In the initial phase, the master server sends a gratuitous ARP packet 1, which includes the IP address 1.1.1.1 and the MAC address 1-1-1. Network device C receives the gratuitous ARP packet 1 and determines to forward it via aggregation group 1. According to the existing hash algorithm, network device C determines to send the gratuitous ARP packet 1 from interface 7 to DR1 interface of network device 1.

[0071] After receiving gratuitous ARP packet 1 through DR1 port, network device A generates ARP entry 1 locally, as shown in Table 2 below.

[0072] Table 2 ARP Item 1 Network device A also creates an ARP probe count counter for the IP address 1.1.1.1 included in the newly generated ARP table entry 1 to limit the number of ARP probes and avoid ARP packet flooding. In this embodiment, the value of the ARP probe count counter corresponding to IP address 1.1.1.1 is 0.

[0073] At the same time, network device A also generates ARP migration sequence table entry 1 based on ARP entry 1, as shown in Table 3 below.

[0074] Table 3 ARP Migration Timing Table Item 1 If the primary and backup servers trigger an upgrade process at this time, the primary server remains the old primary server, and the backup server is upgraded to the new primary server, resulting in a "dual-primary" scenario of primary and backup server switching. In this scenario, the new primary server generates and sends a gratuitous ARP packet 2, which includes the IP address 1.1.1.1 and the MAC address 2-2-2.

[0075] Understandably, after receiving the gratuitous ARP packet 2, network device D determines to forward it via aggregation group 2. According to the existing hash algorithm, network device D determines to send the gratuitous ARP packet 2 from interface 10 to the DR2 interface of network device B.

[0076] Network device B can generate ARP entries and ARP migration sequence entries locally according to the process described above for network device A receiving gratuitous ARP packets 1, which will not be repeated here.

[0077] According to the existing M-LAG networking protocol, network device B will send a gratuitous ARP message 2 to network device A through the IPL link.

[0078] After receiving a gratuitous ARP packet 2 through IPP port 1, network device A obtains the IP address and MAC address from it and uses the IP address to look up ARP entry 1. Network device A compares the MAC address included in ARP entry 1 with the MAC address included in gratuitous ARP packet 2, determines that the MAC address has changed, and that the receiving interface for gratuitous ARP packet 2 is IPP port 1. Therefore, network device A updates ARP entry 1 and obtains ARP entry 2. See Table 4 below.

[0079] Table 4 ARP Item 2 Understandably, network device A also generates ARP migration sequence table entry 2 based on ARP entry 2, as shown in Table 5 below.

[0080] Table 5 ARP Migration Timing Table Item 2 Meanwhile, since a gratuitous ARP packet 2 was received through IPP port 1 with an inconsistent MAC address, network device A triggers an ARP probe and increments the ARP probe count counter corresponding to IP address 1.1.1.1 by 1. At this point, the ARP probe count counter corresponding to IP address 1.1.1.1 has a value of 1. Since the ARP probe count counter value of 1 is not equal to 2, network device A triggers the ARP probe normally.

[0081] Network device A generates and broadcasts ARP request message 1, which includes the IP address 1.1.1.1.

[0082] In a "dual master" scenario, both the old master server and the new master server will receive ARP request packet 1 and send ARP reply packet 1 (the old master server can send it through interface 7 or interface 8, and the new master server can send it through interface 9 or interface 10). The ARP request packet 1 includes the IP address 1.1.1.1 and their respective MAC addresses (1-1-1 or 2-2-2).

[0083] In this embodiment of the application, if network device A receives an ARP reply sent by the new master server through the DR2 port, that is, the new master server sends an ARP reply message 1 to the DR2 port of network device A through interface 9.

[0084] After receiving ARP reply packet 1 through DR2 port, network device A obtains the IP address and MAC address from it and uses the IP address to find ARP entry 2. Network device A compares the MAC address in ARP entry 2 with the MAC address in ARP reply packet 1, confirms that the MAC address has not changed, and that the receiving interface of ARP reply packet 1 is DR2 port. Therefore, network device A updates ARP entry 2 and obtains ARP entry 3, as shown in Table 6 below. At this time, the value of the ARP probe count counter corresponding to IP address 1.1.1.1 is still 1.

[0085] Table 6 ARP Item 3 Understandably, network device A also generates ARP migration sequence table entry 3 based on ARP entry 3, as shown in Table 7 below.

[0086] Table 7 ARP Migration Timing Table Item 3 If, at this time, network device A receives ARP reply packet 1 from the old master server via IPP port 1, obtains the IP address and MAC address from it, and uses the IP address to find ARP entry 3. Network device A compares the MAC address included in ARP entry 3 with the MAC address included in ARP reply packet 1, determines that the MAC address has changed, and that the receiving interface of ARP reply packet 1 is IPP port 1. Therefore, network device A updates ARP entry 3 and obtains ARP entry 4. See Table 8 below.

[0087] Table 8 ARP Item 3 Understandably, network device A also generates ARP migration sequence table entry 4 based on ARP entry 3, as shown in Table 9 below.

[0088] Table 9 ARP Migration Timing Table Item 4 Meanwhile, since ARP reply packet 1 was received through IPP port 1 and the MAC address was inconsistent, network device A triggered an ARP probe again. Network device A identified the value of the ARP probe count counter corresponding to IP address 1.1.1.1. Since the value of the ARP probe count counter was 1, which is not equal to 2, network device A triggered an ARP probe normally.

[0089] Network device A generates and broadcasts ARP request packet 2, which includes the IP address 1.1.1.1. The network device also increments the value of the ARP probe count counter corresponding to IP address 1.1.1.1 by 1. At this time, the value of the ARP probe count counter corresponding to IP address 1.1.1.1 is 2.

[0090] As mentioned above, in the "dual master" scenario, both the old master server and the new master server will receive ARP request packet 2 and send ARP reply packet 2 (the old master server can send it through interface 7 or interface 8, and the new master server can send it through interface 9 or interface 10). The ARP request packet 2 includes the IP address 1.1.1.1 and their respective MAC addresses (1-1-1 or 2-2-2).

[0091] In this embodiment of the application, if network device A receives an ARP reply sent by the old master server through the DR1 port, that is, the old master server sends an ARP reply message 2 to the DR1 port of network device A through interface 7.

[0092] After receiving ARP reply packet 2 through DR1 port, network device A obtains the IP address and MAC address from it and uses the IP address to find ARP entry 3. Network device A compares the MAC address in ARP entry 3 with the MAC address in ARP reply packet 2, confirms that the MAC address has not changed, and that the receiving interface for ARP reply packet 1 is DR1 port. Therefore, network device A updates ARP entry 3 and obtains ARP entry 4. At this time, the value of the ARP probe count counter corresponding to IP address 1.1.1.1 is still 2. As shown in Table 10 below.

[0093] Table 10 ARP Entry 4 Understandably, network device A also generates ARP migration sequence table entry 5 based on ARP entry 4, as shown in Table 11 below.

[0094] Table 11 ARP Migration Timing Table Item 5 Thus, through the above process, an ARP migration sequence table is formed within network device A, as shown in Table 1.

[0095] Table 1 ARP Migration Timing Table For the ARP migration sequence table shown in Table 1, network device A obtains the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address 1.1.1.1.

[0096] Understandably, based on the update time included in each ARP migration timetable entry belonging to the same IP address, network device A obtains the interface identifier included in each ARP migration timetable entry according to the update time.

[0097] After obtaining multiple interface identifiers according to the update time, network device A identifies whether the loop pattern formed by the multiple interface identifiers meets the preset loop conditions.

[0098] In this embodiment of the application, the preset loop conditions include the loop time and the number of loops. For example, the time is 10 seconds and the number of loops is 3.

[0099] For example, in Table 1, there is a cyclic pattern of DR1-IPP-DR2-IPP-DR1 formed by multiple interface identifiers. The first network device identifies whether the cyclic pattern formed by multiple interface identifiers has reached the required number of cycles within the cyclic time.

[0100] If the preset loop condition is not met, that is, if the loop pattern formed by multiple interface identifiers does not reach the required number of loops within the loop time, then network device A terminates the current process. As mentioned above, the loop pattern DR1-IPP1-DR2-IPP1-DR1 formed by its multiple interface identifiers did not reach the required number of loops within the loop time, so network device A terminated the current process.

[0101] Understandably, if the DR1-IPP1-DR2-IPP1-DR1 cyclic pattern formed by multiple interface identifiers reaches the required number of cycles within the cyclic time, network device A will generate and send alarm message 1. This alarm message 1 includes an ARP migration timetable entry that meets the preset cyclic conditions, so that administrators (or users) can determine that ARP flooding has occurred within the network based on alarm message 1.

[0102] Network device A can send alarm message 1 to the controller, which will then display alarm message 1 to the administrator (or user).

[0103] After triggering two ARP probes, network device A waits for a preset time (e.g., 1 minute). After the preset time, based on the ARP migration sequence table shown in Table 1, network device A will also perform a second ARP probe according to the interface identifiers included in the ARP entries to accurately determine the status of the old master server and the new master server.

[0104] Network device A retrieves ARP entry 5 from the ARP table and the value of the ARP probe count counter corresponding to IP address 1.1.1.1 included in ARP entry 5. The interface identifier included in ARP entry 5 indicates DR1.

[0105] Since the ARP probe count counter corresponding to IP address 1.1.1.1 has a value of 2, network device A resets the ARP probe count counter to 0 and triggers ARP probe again.

[0106] Network device A generates and broadcasts ARP request packet 3, which includes the IP address 1.1.1.1. The network device also increments the value of the ARP probe count counter corresponding to IP address 1.1.1.1 by 1. At this time, the value of the ARP probe count counter corresponding to IP address 1.1.1.1 is 1.

[0107] As mentioned above, network device A is waiting to receive ARP reply message 3. It is understood that the process of network device A receiving ARP reply message 3 is the same as the process of receiving ARP reply message 1 and ARP reply message 2, and will not be repeated here.

[0108] If network device A receives multiple ARP reply packets 3 within the probe period, then network device A determines that the switchover between the old master server and the new master server has not been completed or the switchover has failed, and the network device A is still in the "dual master" state. Network device A will mark the IP address as pending confirmation.

[0109] If network device A receives an ARP reply packet 3 and the MAC address included in ARP reply packet 3 is the same as the MAC address included in ARP entry 5, then network device A determines that the old master server experienced a brief oscillation rather than a switchover. Network device A keeps the interface identifier included in ARP entry 5 as DR1 port and refreshes ARP entry 5 (this refresh specifically refers to refreshing the aging time of ARP entry 5).

[0110] If network device A receives an ARP reply packet 3 and the MAC address included in the ARP reply packet 3 is different from the MAC address included in ARP entry 5, then network device A determines that the switchover between the old master server and the new master server has been completed (a brief "dual master" state). Network device A updates the MAC address included in ARP entry 5 according to the MAC address included in ARP reply packet 5, and updates the interface identifier included in ARP entry 5 to DR2 port.

[0111] It should be noted that when network device A receives ARP reply message 5, it can receive it through DR1 port, DR2 port, or IPP port 1. When network device A updates ARP table entry 5, it also generates an ARP migration sequence table entry.

[0112] After the aforementioned process, network device A will probe the IP address marked as pending confirmation again to determine the server status indicated by the IP address and ensure network security.

[0113] Network device A identifies the value of the ARP probe count counter corresponding to the IP address marked as pending confirmation. If the value of the ARP probe count counter is 1 and not equal to 2, network device A triggers ARP probe normally.

[0114] Based on a preset probing strategy (e.g., including the probing period and the number of probing attempts, where the probing period can be 1 minute and the number of probing attempts can be 10), an ARP probe is generated and initiated against the server indicated by the IP address marked as pending confirmation.

[0115] During the detection period, if network device A receives an ARP reply packet after any ARP probe within the number of probes, network device A can update or refresh the corresponding ARP table entry and delete the pending confirmation status mark of the IP address according to the aforementioned process of receiving an ARP reply packet (i.e., the switchover between the old master server and the new master server has been completed or the oscillation has ended).

[0116] If network device A receives multiple ARP reply packets after reaching the required number of probes within the probe period, network device A determines that both the new and old master servers have failed, resulting in a persistent "dual-master" state. Network device A initiates "fault isolation," meaning it adds the IP address to the ARP isolation list and will no longer respond to ARP request packets containing that IP address. Simultaneously, it generates and sends alarm message 2, which includes the probe logs and probe sequence for that IP address, allowing administrators (or users) to handle the "dual-master" state based on alarm message 2.

[0117] In this embodiment of the application, network device A can send alarm information 2 to the controller, which will then display alarm information 2 to the administrator (or user).

[0118] By applying the communication method provided in the embodiments of this application, the following can be achieved: (1) Reduce the number of ARP packets and improve network performance. By limiting the number of probes (≤2 preceding probes) and using interval probes (1 minute / probe), the ARP packet flooding caused by "looping probes" in existing technologies is completely avoided. Tests have shown that in a dual-active server scenario, this can reduce the number of ARP packets by more than 90%, significantly reducing network bandwidth usage and ensuring the normal forwarding of other service traffic.

[0119] (2) Eliminate residual ARP entries to ensure business continuity. By employing "secondary interface probing" and "10 repeated confirmations," the M-LAG device accurately determines the server switching status (complete / incomplete / fluctuating) and updates the ARP table entries accordingly, preventing erroneous entries from remaining. In practical applications, service interruption time is reduced from "ARP entry aging time (usually 10-30 minutes)" to "less than 1 minute," and service availability is improved to 99.99%.

[0120] (3) Achieve fault visualization and improve troubleshooting efficiency The "ARP Migration Sequence Table" fully records changes in ARP entries and probe behavior, allowing administrators (or users) to quickly trace the cause of faults (such as "duration of dual primary" and "number of probe triggers") without packet capture. At the same time, the M-LAG device actively sends "alarm information" along with key data, reducing troubleshooting time from "hours" to "minutes" and lowering maintenance costs.

[0121] Based on the same inventive concept, embodiments of this application also provide a communication device corresponding to the communication method. See also Figure 3 , Figure 3 The communication apparatus provided in this application embodiment is applied to a first network device. The first network device stores an ARP entry migration sequence table, and the ARP entry migration sequence table sorts the ARP entry entries according to their update time. The apparatus includes: The acquisition unit 310 is used to acquire the interface identifier included in each ARP migration sequence table entry belonging to the same IP address; The identification unit 320 is used to identify whether the loop pattern formed by multiple interface identifiers meets the preset loop conditions. The sending unit 330 is used to send a first alarm message if the condition is met.

[0122] Optionally, the first network device stores an ARP table, the ARP table including at least one ARP entry, each ARP entry including an IP address and an interface identifier, and the device further includes: A creation unit (not shown in the figure) is used to create an ARP probe count counter for each IP address included in the ARP entry; The detection unit (not shown in the figure) is used to initiate an ARP probe to the second network device indicated by the first IP address included in the first ARP entry if the first interface identifier included in the first ARP entry is updated to the IPP port according to the received first ARP packet, and to increment the value of the ARP probe count counter of the first IP address by 1. The maintenance unit (not shown in the figure) is used to not initiate an ARP probe to the second network device if the first interface identifier is updated to the DR interface according to the received second ARP packet, and to maintain the value of the ARP probe count counter of the first IP address; The maintenance unit (not shown in the figure) is further configured to: if the first interface identifier is updated to the IPP port again according to the received third ARP packet and the value of the ARP probe count counter is the first value, then not initiate an ARP probe to the second network device, and maintain the value of the ARP probe count counter of the first IP address.

[0123] Optionally, the first network device stores an ARP table, which includes at least one ARP entry, and each ARP entry includes a MAC address, an IP address, and an interface identifier. The acquisition unit 310 is further configured to acquire a second ARP entry from the ARP table after a preset time, wherein the interface identifier included in the second ARP entry indicates a first DR port, and the first DR port is used to access the old master device; The device further includes: a detection unit (not shown in the figure), used to initiate an ARP probe to the third network device indicated by the IP address; A marking unit (not shown in the figure) is used to mark the IP address as pending confirmation if multiple ARP replies are received. The maintenance unit (not shown in the figure) is used to maintain the interface identifier included in the second ARP table entry as the identifier of the first DR port if an ARP reply is received and the MAC address included in the ARP reply is the same as the MAC address included in the second ARP table entry. An update unit (not shown in the figure) is used to update the MAC address included in the second ARP entry according to the MAC address included in the ARP reply if an ARP reply is received and the MAC address included in the ARP reply is different from the MAC address included in the second ARP entry, and to update the interface identifier included in the second ARP entry to the identifier of the second DR port, which is used to access the new master device.

[0124] Optionally, the first network device stores an ARP table, which includes at least one ARP entry, and each ARP entry includes a MAC address, an IP address, and an interface identifier. The acquisition unit 310 is further configured to, after a preset time, acquire a third ARP entry from the ARP table, wherein the third ARP entry includes an interface identifier indicating a second DR port, and the second DR port is used to access a new master device; The device further includes: a detection unit (not shown in the figure), used to initiate an ARP probe to the fourth network device indicated by the IP address; A marking unit (not shown in the figure) is used to mark the IP address as pending confirmation if multiple ARP replies are received. The maintenance unit (not shown in the figure) is used to maintain the interface identifier included in the third ARP entry as the identifier of the second DR port if an ARP reply is received and the MAC address included in the ARP reply is the same as the MAC address included in the third ARP entry. An update unit (not shown in the figure) is used to update the MAC address included in the third ARP entry according to the MAC address included in the ARP reply if an ARP reply is received and the MAC address included in the ARP reply is different from the MAC address included in the third ARP entry, and to update the interface identifier included in the third ARP entry to the identifier of the first DR port, the first DR port being used to access the old master device.

[0125] Optionally, the detection unit (not shown in the figure) is further configured to initiate an ARP probe to the fifth network device indicated by the IP address marked as pending confirmation, according to a preset detection strategy; The device further includes: a deletion unit (not shown in the figure), used to delete the unacknowledged status mark of the IP address if an ARP reply is received after any ARP probe within the probe count; The sending unit (not shown in the figure) is used to add the IP address to the ARP isolation list and send a second alarm message if multiple ARP replies are received after reaching the number of probes.

[0126] Therefore, using the communication device provided in this application, the first network device obtains the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; the first network device identifies whether the cyclic pattern formed by multiple interface identifiers satisfies the preset cyclic condition; if it does, the first network device sends a first alarm message.

[0127] In this way, by utilizing the ARP entry changes and triggering events recorded in the ARP entry migration time sequence table, fault visualization is achieved, improving troubleshooting efficiency; network devices proactively send alarm information along with key data, reducing fault troubleshooting time from "hours" to "minutes," thus lowering maintenance costs; at the same time, it also solves the problem of ARP packet flooding in the network under the "dual-master" state in existing server upgrade scenarios, affecting network performance and stability, and the DR interface incorrectly learning the server's ARP entries, leading to service unavailability.

[0128] Based on the same inventive concept, embodiments of this application also provide a network device, such as... Figure 4 As shown, the system includes a processor 410, a transceiver 420, and a machine-readable storage medium 430. The machine-readable storage medium 430 stores machine-executable instructions that can be executed by the processor 410. The processor 410 is prompted by the machine-executable instructions to execute the communication method provided in the embodiments of this application. (The foregoing...) Figure 3 The communication device shown can be used as follows: Figure 4 The hardware structure of the network device shown is implemented.

[0129] The aforementioned computer-readable storage medium 430 may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the computer-readable storage medium 430 may also be at least one storage device located remotely from the aforementioned processor 410.

[0130] The processor 410 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0131] In this embodiment of the application, the processor 410 reads the machine-executable instructions stored in the machine-readable storage medium 430, and is prompted by the machine-executable instructions to enable the processor 410 itself and the transceiver 420 to execute the communication method described in the foregoing embodiment of the application.

[0132] In addition, this application provides a machine-readable storage medium 430 that stores machine-executable instructions. When called and executed by the processor 410, the machine-executable instructions cause the processor 410 itself and the transceiver 420 to execute the communication method described in the aforementioned application.

[0133] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0134] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0135] For the embodiments of communication devices and machine-readable storage media, since the methods involved are basically similar to those of the aforementioned method embodiments, the description is relatively simple, and relevant details can be found in the descriptions of the method embodiments.

[0136] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A communication method, characterized in that, The method is applied to a first network device, which stores an ARP entry migration sequence table. The ARP entry migration sequence table sorts the ARP entry entries according to their update time. The method includes: Obtain the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; Identify whether the loop pattern formed by multiple interface identifiers meets the preset loop conditions; If the conditions are met, the first alarm message is sent.

2. The method according to claim 1, characterized in that, The first network device stores an ARP table, which includes at least one ARP entry. Each ARP entry includes an IP address and an interface identifier. The method further includes: Create an ARP probe count counter for each IP address included in the ARP entry; If the first interface identifier included in the first ARP entry is updated to the IPP port according to the received first ARP packet, then an ARP probe is initiated to the second network device indicated by the first IP address included in the first ARP entry, and the value of the ARP probe count counter of the first IP address is incremented by 1; If the first interface identifier is updated to DR interface according to the received second ARP packet, then no ARP probe is initiated to the second network device, and the value of the ARP probe count counter for the first IP address is maintained; If the first interface identifier is updated to the IPP port again based on the received third ARP packet and the value of the ARP probe count counter is the first value, then no ARP probe is initiated to the second network device, and the value of the ARP probe count counter for the first IP address is maintained.

3. The method according to claim 1, characterized in that, The first network device stores an ARP table, which includes at least one ARP entry. Each ARP entry includes a MAC address, an IP address, and an interface identifier. The method further includes: After a preset time, a second ARP entry is obtained from the ARP table. The interface identifier included in the second ARP entry indicates the first DR port, which is used to access the old master device. Initiate an ARP probe to the third network device indicated by the IP address; If multiple ARP replies are received, the IP address is marked as pending confirmation. If an ARP reply is received and the MAC address included in the ARP reply is the same as the MAC address included in the second ARP entry, then the interface identifier included in the second ARP entry is kept as the identifier of the first DR port; If an ARP reply is received and the MAC address included in the ARP reply is different from the MAC address included in the second ARP entry, then the MAC address included in the second ARP entry is updated according to the MAC address included in the ARP reply, and the interface identifier included in the second ARP entry is updated to the identifier of the second DR port, which is used to access the new master device.

4. The method according to claim 1, characterized in that, The first network device stores an ARP table, which includes at least one ARP entry. Each ARP entry includes a MAC address, an IP address, and an interface identifier. The method further includes: After a preset time, a third ARP entry is obtained from the ARP table. The third ARP entry includes an interface identifier indicating the second DR port, which is used to connect to the new master device. Initiate an ARP probe to the fourth network device indicated by the IP address; If multiple ARP replies are received, the IP address is marked as pending confirmation. If an ARP reply is received and the MAC address included in the ARP reply is the same as the MAC address included in the third ARP entry, then the interface identifier included in the third ARP entry is kept as the identifier of the second DR port; If an ARP reply is received and the MAC address included in the ARP reply is different from the MAC address included in the third ARP entry, then the MAC address included in the third ARP entry is updated according to the MAC address included in the ARP reply, and the interface identifier included in the third ARP entry is updated to the identifier of the first DR port, which is used to access the old master device.

5. The method according to any one of claims 3 or 4, characterized in that, The method further includes: According to the preset detection strategy, an ARP probe is initiated to the fifth network device indicated by the IP address marked as pending confirmation. If an ARP reply is received after any ARP probe within the probe count, then the pending confirmation status mark of the IP address is deleted. If multiple ARP responses are received after the probe count is reached, the IP address is added to the ARP isolation list, and a second alarm message is sent.

6. A communication device, characterized in that, An apparatus is applied to a first network device, which stores an ARP entry migration sequence table. The ARP entry migration sequence table sorts ARP entry entries according to their update time. The apparatus includes: The acquisition unit is used to acquire the interface identifiers included in each ARP migration sequence table entry belonging to the same IP address; The identification unit is used to identify whether the loop pattern formed by multiple interface identifiers meets the preset loop conditions. The sending unit is used to send the first alarm information if the conditions are met.

7. The apparatus according to claim 6, characterized in that, The first network device stores an ARP table, which includes at least one ARP entry. Each ARP entry includes an IP address and an interface identifier. The device further includes: A creation unit is used to create an ARP probe count counter for each IP address included in each ARP entry; The detection unit is configured to, if the first interface identifier included in the first ARP entry is updated to the IPP port according to the received first ARP packet, initiate an ARP probe to the second network device indicated by the first IP address included in the first ARP entry, and increment the value of the ARP probe count counter of the first IP address by 1; The maintenance unit is configured to, if the first interface identifier is updated to DR interface according to the received second ARP packet, not to initiate ARP probe to the second network device, and to maintain the value of the ARP probe count counter for the first IP address; The maintenance unit is further configured to: if the first interface identifier is updated to the IPP port again according to the received third ARP packet and the value of the ARP probe count counter is the first value, then not initiate an ARP probe to the second network device, and maintain the value of the ARP probe count counter for the first IP address.

8. The apparatus according to claim 6, characterized in that, The first network device stores an ARP table, which includes at least one ARP entry. Each ARP entry includes a MAC address, an IP address, and an interface identifier. The acquisition unit is further configured to acquire a second ARP entry from the ARP table after a preset time, wherein the interface identifier included in the second ARP entry indicates a first DR port, and the first DR port is used to access the old master device; The device further includes: a detection unit, configured to initiate an ARP probe to the third network device indicated by the IP address; A marking unit is used to mark the IP address as pending confirmation if multiple ARP replies are received. The maintenance unit is configured to maintain the interface identifier included in the second ARP entry as the identifier of the first DR port if an ARP reply is received and the MAC address included in the ARP reply is the same as the MAC address included in the second ARP entry. The update unit is configured to, if it receives an ARP reply and the MAC address included in the ARP reply is different from the MAC address included in the second ARP entry, update the MAC address included in the second ARP entry according to the MAC address included in the ARP reply, and update the interface identifier included in the second ARP entry to the identifier of the second DR port, the second DR port being used to access the new master device.

9. The apparatus according to claim 6, characterized in that, The first network device stores an ARP table, which includes at least one ARP entry. Each ARP entry includes a MAC address, an IP address, and an interface identifier. The acquisition unit is further configured to, after a preset time, acquire a third ARP entry from the ARP table, wherein the interface identifier included in the third ARP entry indicates a second DR port, and the second DR port is used to access a new master device; The device further includes: a detection unit, configured to initiate an ARP probe to the fourth network device indicated by the IP address; A marking unit is used to mark the IP address as pending confirmation if multiple ARP replies are received. A maintenance unit is configured to maintain the interface identifier included in the third ARP entry as the identifier of the second DR port if an ARP reply is received and the MAC address included in the ARP reply is the same as the MAC address included in the third ARP entry. An update unit is configured to, if an ARP reply is received and the MAC address included in the ARP reply is different from the MAC address included in the third ARP entry, update the MAC address included in the third ARP entry according to the MAC address included in the ARP reply, and update the interface identifier included in the third ARP entry to the identifier of the first DR port, the first DR port being used to access the old master device.

10. The apparatus according to any one of claims 8 or 9, characterized in that, The detection unit is also used to initiate ARP detection to the fifth network device indicated by the IP address marked as pending confirmation, according to a preset detection strategy. The device further includes: a deletion unit, used to delete the unacknowledged status mark of the IP address if an ARP reply is received after any ARP probe within the probe count; The sending unit is configured to add the IP address to the ARP isolation list and send a second alarm message if multiple ARP replies are received after the probe count has been reached.