Method and device for deleting address resolution protocol

By deleting ARP entries in batches, the problem of equal-cost routing caused by too long aging time of ARP entries is solved, the working efficiency and resource utilization of the switch are improved, and packet loss and terminal disconnection are avoided.

CN116366544BActive Publication Date: 2024-09-17HANGZHOU DPTECH TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310113137.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-15
Publication Date
2024-09-17
Estimated Expiration
2043-02-15

AI Technical Summary

Technical Problem

In the existing technology, the aging time of ARP entries is too long and cannot be deleted in time, resulting in the formation of equal-cost routes, causing packet loss and terminal disconnection, affecting user experience.

Method used

By obtaining the deletion instruction, initializing the message queue and pointer, writing the message contents into the message queue one by one, and calling the driver chip interface based on the message queue to delete the address resolution protocol-related contents, batch deletion of ARP entries is achieved.

Benefits of technology

Optimizes the performance of clearing queues, improves switch efficiency and utilization of address resolution protocol entry resources, and avoids packet loss and terminal disconnection problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366544B
    Figure CN116366544B
Patent Text Reader

Abstract

The present application relates to a method and device for deleting an address resolution protocol. The method includes: obtaining a deletion instruction, wherein the deletion instruction includes a message of a preset structure; initializing a message queue and a pointer when the message meets a preset condition; writing the contents of the message into the message queue one by one through the pointer; and calling a driver chip interface based on the message queue to delete the contents related to the address resolution protocol. The method and device for deleting the address resolution protocol involved in the present application can clear the contents of table items related to the address resolution protocol through one instruction, optimize the performance of clearing the queue, improve the working efficiency of the switch, and improve the utilization rate of the address resolution protocol table item resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer information processing, and in particular to a method and device for deleting an address resolution protocol. Background Art

[0002] In a local area network, a host or a router, etc., a layer 3 device forwards data packets based on an IP address; a layer 3 device or a layer 2 device sends and receives Ethernet data frames based on a MAC (Medium Access Control) address. The MAC address is also called a physical address or hardware address, which is assigned to the Ethernet interface when the device is manufactured. IP addresses and MAC addresses are independent of each other, so in an actual network, an address resolution mechanism is needed to provide mapping for these two different address formats.

[0003] In the network, three-layer devices actively send broadcast ARP (Address Resolution Protocol) detection messages to realize mutual learning of the mapping relationship between IP addresses and MAC addresses between devices. The ARP detection message carries its IP address and MAC address, as well as the IP address of the device to be detected by the three-layer device, so that the device receiving the ARP detection message learns the mapping relationship between the IP address and MAC address of the three-layer device; when the device to be detected by the ARP detection message receives the ARP detection message, it sends an ARP reply message to the three-layer device, and the ARP reply message carries its own IP address and MAC address for the three-layer device to learn.

[0004] The MAC forwarding table is not fixed. When a host or router in the network leaves the network, in order to prevent the MAC table entry corresponding to its MAC address from still occupying system resources, the Layer 2 switch device needs to regularly delete the MAC table entry in its MAC forwarding table. Generally, if no message is received with the MAC address in the MAC table entry as the source MAC address within a few minutes, the Layer 2 switch device will delete the MAC table entry.

[0005] In the static Internet Protocol (IP) address scenario, when an online terminal goes offline, the access network device to which the terminal is connected will delete the ARP entry corresponding to the terminal after the aging time has expired, and then notify each aggregation network device to delete the route corresponding to the ARP entry, thereby implementing route updates for each aggregation network device.

[0006] In the above ARP table update method, the ARP table entry cannot be aged in time and needs to be deleted after the ARP table entry reaches the aging time. If the aging time is not reached and another terminal uses the same IP address to go online, the two paths of the IP address will be saved on each aggregation network device to form an equal-cost route. If the aggregation network device receives a message matching the equal-cost route and forwards it to the access network device corresponding to the offline terminal, the online terminal cannot receive the message, which will cause packet loss, causing the terminal to be disconnected from the network, greatly affecting the user experience.

[0007] Therefore, a new method and device for deleting an address resolution protocol is needed.

[0008] The above information disclosed in the Background section is only for enhancement of understanding of the background of the present application and therefore it may contain information that does not constitute the prior art that is already known to a person of ordinary skill in the art. Summary of the invention

[0009] In view of this, the present application provides a method and device for deleting an address resolution protocol, which can clear the content of address resolution protocol related table items through one instruction, optimize the performance of clearing queues, improve the working efficiency of switches, and improve the utilization rate of address resolution protocol table item resources.

[0010] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0011] According to one aspect of the present application, a method for deleting an address resolution protocol is proposed, the method comprising: obtaining a deletion instruction, the deletion instruction including a message of a preset structure; initializing a message queue and a pointer when the message meets a preset condition; writing the contents of the message into the message queue one by one through the pointer; and calling a driver chip interface based on the message queue to delete content related to the address resolution protocol.

[0012] In an exemplary embodiment of the present application, it includes: obtaining a deletion instruction for deleting a host table entry; or obtaining a deletion instruction for batch deletion.

[0013] In an exemplary embodiment of the present application, the message queue and pointer are initialized when the message meets the preset conditions, including: when the message length is not 0, determining whether the message content is empty; when the message content is not empty, initializing the message queue and pointer.

[0014] In an exemplary embodiment of the present application, when the message meets a preset condition, the message queue and the pointer are initialized, including: initializing a structure of the message queue; initializing a first pointer and a second pointer.

[0015] In an exemplary embodiment of the present application, when a deletion instruction for deleting a host table entry is obtained, a structure of an initialized message queue is configured, including: an IPv4 message length, an IP address, and a virtual routing forwarding number in the initialized message queue.

[0016] In an exemplary embodiment of the present application, when a delete instruction for batch deletion is obtained, a structure of a message queue is initialized, including: initializing the ARP message length and next hop information in the message queue.

[0017] In an exemplary embodiment of the present application, writing the contents of the message into the message queue one by one through the pointer includes: reading the contents of the message one by one; writing the contents into the structure of the message queue based on the pointer; and increasing the value of the pointer.

[0018] In an exemplary embodiment of the present application, calling a driver chip interface to delete content related to the address resolution protocol based on the message queue includes: enqueuing the message queue; dequeuing the message queue; calling a driver chip interface to delete content related to the address resolution protocol; and releasing the pointer.

[0019] In an exemplary embodiment of the present application, when a deletion instruction for batch deletion is obtained, after calling a driver chip interface to delete the address resolution protocol related content based on the message queue, it also includes: deleting the address resolution protocol table entry.

[0020] According to one aspect of the present application, a device for deleting an address resolution protocol is proposed, which includes: an instruction module for obtaining a deletion instruction, wherein the deletion instruction includes a message of a preset structure; an initialization module for initializing a message queue and a pointer when the message meets a preset condition; a writing module for writing the contents of the message one by one into the message queue through the pointer; and a deletion module for calling a driver chip interface based on the message queue to delete content related to the address resolution protocol.

[0021] According to one aspect of the present application, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.

[0022] According to one aspect of the present application, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.

[0023] According to the method and device for deleting the address resolution protocol of the present application, by obtaining a deletion instruction, the deletion instruction includes a message of a preset structure; initializing a message queue and a pointer when the message meets a preset condition; writing the contents of the message into the message queue one by one through the pointer; and calling a driver chip interface based on the message queue to delete the content related to the address resolution protocol, the content of the table items related to the address resolution protocol can be cleared through one instruction, the performance of clearing the queue is optimized, the working efficiency of the switch is improved, and the utilization rate of the address resolution protocol table item resources is improved.

[0024] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and other objects, features and advantages of the present application will become more apparent by describing in detail the exemplary embodiments thereof with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative effort.

[0026] Figure 1 The present invention is a system block diagram showing a method and device for deleting an address resolution protocol according to an exemplary embodiment.

[0027] Figure 2 The present invention is a flowchart of a method for deleting an address resolution protocol according to an exemplary embodiment.

[0028] Figure 3 The present invention is a flowchart of a method for deleting an address resolution protocol according to another exemplary embodiment.

[0029] Figure 4 The present invention is a flowchart of a method for deleting an address resolution protocol according to another exemplary embodiment.

[0030] Figure 5 The present invention is a block diagram of a device for deleting an address resolution protocol according to an exemplary embodiment.

[0031] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.

[0032] Figure 7 It is a block diagram of a computer-readable medium according to an exemplary embodiment. DETAILED DESCRIPTION

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this application will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0034] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0035] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0036] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0037] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.

[0038] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present application, and therefore cannot be used to limit the scope of protection of the present application.

[0039] The technical abbreviations involved in this application are explained as follows:

[0040] ARP: Address Resolution Protocol is a TCP / IP protocol that obtains physical addresses based on IP addresses. When a host sends information, it broadcasts an ARP request containing the target IP address to all hosts on the local network and receives a return message to determine the target's physical address. After receiving the return message, the IP address and physical address are stored in the local ARP cache and retained for a certain period of time. The next request directly queries the ARP cache to save resources. The Address Resolution Protocol is based on mutual trust among hosts in the network. Hosts on the local network can send ARP reply messages autonomously. When other hosts receive the reply message, they will not detect the authenticity of the message and will record it in the local ARP cache. The ARP command can be used to query the correspondence between IP addresses and MAC addresses in the local ARP cache, add or delete static correspondences, etc.

[0041] ipv4: Internet Protocol version 4 (IPv4), also known as the fourth version of the Internet Communication Protocol, is a connectionless protocol that operates on a link layer (such as Ethernet) that uses packet switching. This protocol will do its best to deliver data packets, which means that it does not guarantee that any data packet can be delivered to the destination, nor does it guarantee that all data packets will arrive in the correct order without duplication. These aspects are handled by the upper layer transport protocol (such as the Transmission Control Protocol).

[0042] IP: refers to Internet Protocol, which is the network layer protocol in the TCP / IP system. The purpose of designing IP is to improve the scalability of the network: first, to solve Internet problems and realize the interconnection of large-scale, heterogeneous networks; second, to separate the coupling relationship between top-level network applications and bottom-level network technologies to facilitate the independent development of the two. According to the end-to-end design principle, IP only provides a connectionless, unreliable, best-effort data packet transmission service for the host.

[0043] MAC address (Media Access Control Address): Media Access Control Address, also known as LAN Address, MAC Address, Ethernet Address or Physical Address, is an address used to identify the location of a network device. In the OSI model, the third layer, the network layer, is responsible for the IP address, and the second layer, the data link layer, is responsible for the MAC address. The MAC address is used to uniquely identify a network card in the network. If a device has one or more network cards, each network card needs and will have a unique MAC address.

[0044] The applicant of this application has discovered through research that MAC (Medium Access Control) addresses can be divided into broadcast MAC addresses, multicast MAC addresses and unicast MAC addresses; when a layer-2 switch device receives a message whose destination MAC address is a broadcast MAC address or a multicast MAC address, it will broadcast, copy and forward it on all other interfaces except the message receiving interface; when a message whose destination MAC address is a unicast MAC address is received, the layer-2 switch device first queries its built-in MAC forwarding table, and each entry in the MAC forwarding table records the correspondence between the MAC address and the forwarding interface. By querying the MAC forwarding table, the layer-2 switch device obtains the forwarding interface corresponding to the destination MAC address and forwards the message from the forwarding interface.

[0045] Routes are generally divided into host routes and network segment routes. From the perspective of network topology, host routes usually refer to routes that directly connect terminals to switches, while network segment routes generally refer to routes that connect routers to routers. From the perspective of route masks, the mask length of host routes is 32 bits, while the mask length of network segment routes is usually less than 32. There is also a network segment route with a mask length of 32 bits in the network. This route is not a real route, but a route learned by ARP triggered by network segment routes. This route has a higher priority than host routes and can coexist with host routes.

[0046] In the existing method of deleting ARP related content, generally a single ARP content is deleted, that is, n packets are deleted, including n message headers and n ARP contents, which are transmitted through a message queue. The ARP table entry needs to be deleted after the aging time is reached.

[0047] This method uses the scheme of deleting messages one by one when clearing ARP entries. If the number of deletion requests is too large, it may become a performance bottleneck, increase the overhead of queue transmission, and be detrimental to the maintenance of message queues. In addition, n message headers are redundant, occupying queue resources and increasing the pressure of queue processing. Message headers need to be confirmed repeatedly, which will greatly reduce the throughput and response time of the queue. Deleting ARP entries only after the aging time is reached is not conducive to the management and maintenance of developers, and is likely to cause uncontrollable network problems, greatly affecting the user experience.

[0048] In view of the technical defects in the prior art, this application proposes a deletion method of the address resolution protocol, which can perform batch write optimization and greatly reduce the number of interactions and message transmission volume by optimizing multiple messages into a message header. Especially for high-throughput and small-load message entities, optimizing the message header format can significantly reduce network transmission volume.

[0049] In this application, after the ARP message header is confirmed, multiple messages are batched into one message body. The message middleware only needs to confirm the batch message once, reducing the number of confirmations, reducing the queue throughput and response time, which will greatly improve the message transmission performance.

[0050] In this application, ARP entries can be deleted in batches through one instruction. When the switch port is closed or manually cleared, the ARP entries under the port can be deleted in batches, which improves the working efficiency of the switch and optimizes the utilization of ARP entry resources.

[0051] The content of this application is described in detail below with the help of specific embodiments.

[0052] Figure 1 The present invention is a system block diagram showing a method and device for deleting an address resolution protocol according to an exemplary embodiment.

[0053] like Figure 1 As shown, the system architecture 10 may include network devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the network devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables.

[0054] The network devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send command messages, etc. Various communication client applications may be installed on the network devices 101, 102, 103, such as message processing applications, data forwarding applications, instant messaging tools, email clients, etc.

[0055] The network devices 101, 102, 103 may be various electronic devices with a data forwarding function, including but not limited to switches, servers, laptop computers, desktop computers, and the like.

[0056] The server 105 may be a server that provides various services, such as a background management server that associates address resolution protocol table entries in the network devices 101 , 102 , and 103 .

[0057] The server 105 may, for example, obtain a deletion instruction, which includes a message of a preset structure; the server 105 may, for example, initialize a message queue and a pointer when the message meets a preset condition; the server 105 may, for example, write the contents of the message into the message queue one by one through the pointer; the server 105 may, for example, call a driver chip interface based on the message queue to delete the content related to the address resolution protocol.

[0058] Server 105 may be a physical server, or may be composed of multiple servers. It should be noted that the address resolution protocol deletion method provided in the embodiment of the present application may be executed by server 105, and accordingly, the address resolution protocol deletion device may be set in server 105.

[0059] Figure 2 The flowchart of a method for deleting an address resolution protocol according to an exemplary embodiment is shown. The method 20 for deleting an address resolution protocol at least includes steps S202 to S208.

[0060] like Figure 2 As shown, in S202, a deletion instruction is obtained, and the deletion instruction includes a message of a preset structure. The message structure may include a message type flag, an ARP message length, an ARP message content, an ipv4 message length, and an ipv4 message content.

[0061] More specifically, the IPv4 message content structure includes an IP address, an IP address mask and a virtual routing forwarding number (vrf_id).

[0062] In one embodiment, the user may generate a deletion instruction for deleting the host table entry, and the server obtains the deletion instruction for deleting the host table entry. The deletion instruction for deleting the host table entry is used to delete the route table entry learned by ARP triggered by the network segment routing, and to delete the ARP table entry.

[0063] In one embodiment, the user may generate a batch deletion instruction, and the server obtains the batch deletion instruction. The batch deletion instruction is used to automatically clear the ARP table entries using one instruction.

[0064] In S204, the message queue and the pointer are initialized when the message meets the preset condition. For example, when the message length is not 0, it is determined whether the message content is empty; when the message content is not empty, the message queue and the pointer are initialized.

[0065] More specifically, when receiving a message, firstly check whether the message is empty. If it is empty, then exit the process. Otherwise, according to the message type flag, check whether it is the route and ARP message learned by ARP triggered by the network segment route. If not, then do not enter the deletion process. Otherwise, delete the route and ARP message learned by ARP triggered by the network segment route in sequence.

[0066] In one embodiment, when the message meets a preset condition, the message queue and the pointer are initialized, including: initializing the structure of the message queue; initializing the first pointer and the second pointer.

[0067] More specifically, the functions of this application can be implemented through two message queues. The first message queue is used to delete the routing table items learned by ARP triggered by the network segment routing. The message queue contains the ipv4 message length, ip address and virtual routing forwarding number (vrf_id). The second message queue is used to delete the ARP table items. The message queue contains the ARP message length and next hop information.

[0068] More specifically, when the server obtains a deletion instruction to delete the host table entry, the structure of the message queue is initialized, including: the length of the ipv4 message, the ip address and the virtual routing forwarding number in the initialization message queue. When the server obtains a deletion instruction to delete the host table entry, only the first message queue is initialized.

[0069] More specifically, when the server obtains a batch deletion instruction, it initializes the structure of the message queue, including: initializing the ARP message length and next hop information in the message queue. When the server obtains a batch deletion instruction, it needs to initialize not only the first message queue but also the second message queue.

[0070] In S206, the contents of the message are written into the message queue one by one through the pointer. For example, the contents of the message are read one by one; the contents are written into the structure of the message queue based on the pointer; and the value of the pointer is increased.

[0071] In S208, based on the message queue, the driver chip interface is called to delete the address resolution protocol related content. For example, the message queue can be added to the queue; the message queue can be dequeued; the driver chip interface is called to delete the address resolution protocol related content; and the pointer is released.

[0072] More specifically, when the server obtains a batch deletion instruction, after deleting the address resolution protocol related content by calling the driver chip interface based on the message queue, the method further includes: deleting the address resolution protocol table item through the message queue.

[0073] According to the address resolution protocol deletion method of the present application, by obtaining a deletion instruction, the deletion instruction includes a message of a preset structure; initializing a message queue and a pointer when the message meets a preset condition; writing the contents of the message into the message queue one by one through the pointer; and calling a driver chip interface based on the message queue to delete the address resolution protocol related contents. The address resolution protocol related table item contents can be cleared through one instruction, the performance of clearing the queue is optimized, the working efficiency of the switch is improved, and the utilization rate of the address resolution protocol table item resources is improved.

[0074] It should be clearly understood that the present application describes how to form and use specific examples, but the principles of the present application are not limited to any details of these examples. On the contrary, based on the teaching of the content disclosed in the present application, these principles can be applied to many other embodiments.

[0075] Figure 3 The present invention is a flowchart of a method for deleting an address resolution protocol according to another exemplary embodiment. Figure 3 The process 30 shown is for Figure 2 A detailed description of the content related to "the server obtains the deletion instruction for deleting the host table entry" in the process shown.

[0076] like Figure 3 As shown, in S302, an instruction to delete a host entry is obtained.

[0077] In S304, whether the message length satisfies the policy may be determined, for example, by determining whether the message length is between 1 and 100.

[0078] In S306, whether the message is empty.

[0079] In S308 , a first pointer and a second pointer are initialized, wherein the first pointer may be called, for example, ip_addr; and the second pointer may be called, for example, ver_id.

[0080] In S310, the message queue structure is initialized.

[0081] In S312, the count is initialized, and i=0 may be set, for example.

[0082] In S314, it is determined whether i satisfies a condition, for example, i is smaller than the message length.

[0083] In S316, the byte order of the first pointer ip_addr is converted.

[0084] In S318, the message queue structure is assigned a value.

[0085] In S320, the count is increased, for example, i++.

[0086] In S322, the message is queued.

[0087] In S324, the message is dequeued.

[0088] In S326, the driver chip interface is called.

[0089] In S328 , the first pointer and the second pointer are released.

[0090] When the host table entry deletion instruction is obtained, the message length is first determined. It can be assumed that the maximum number of message contents that can be deleted at one time is 100. If the message length is not between 1 and 100, or the message content is empty, the deletion process will not be entered.

[0091] Initialize the first pointer ip_addr and the second pointer vrf_id pointer to receive the ipv4 address and forwarding number value, then initialize the message queue structure, and write the message content one by one into the message queue structure in a loop, and then queue and dequeue the message.

[0092] The chip's underlying driver interface is called, and finally the pointer to the previously received IPv4 address and forwarding number value is released, completing a complete process of deleting the host table entry.

[0093] Figure 4 The present invention is a flowchart of a method for deleting an address resolution protocol according to another exemplary embodiment. Figure 4 The process 40 shown is for Figure 2 A detailed description of the content related to "the server obtains the deletion instruction for batch deletion" in the process shown.

[0094] like Figure 4 As shown, in S402, a batch deletion instruction is obtained.

[0095] In S404, the host entry is deleted.

[0096] In S406, the ARP entry is deleted.

[0097] When receiving the batch deletion instruction, the routing table entries and ARP table entries learned by triggering ARP are deleted in batches. The ARP deletion process is similar to the host table deletion process.

[0098] For example, in a batch deletion instruction, the host table entry is deleted first, and then the first pointer ip_addr and the second pointer vrf_id pointer are initialized again to receive the ipv4 address and forwarding number value, and then the message queue structure is initialized, and the message content is written into the message queue structure in a loop, and then the message is queued and dequeued.

[0099] The chip's underlying driver interface is called, and finally the pointer to the previously received IPv4 address and forwarding number value is released, completing a complete ARP table entry process.

[0100] According to the address resolution protocol deletion method of the present application, the batch writing method is optimized, and n ARP messages, including n ARP message headers and n ARP message contents, are optimized into one ARP message header and n ARP message contents. Through the method in the present application, one instruction can be used to clear the ARP message, which can effectively avoid the network problem caused by clearing the ARP table entry only when the aging time is reached.

[0101] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided in the present application are executed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.

[0102] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0103] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0104] Figure 5 FIG. 1 is a block diagram of a device for deleting an address resolution protocol according to an exemplary embodiment. Figure 5 As shown, the address resolution protocol deletion device 50 includes: an instruction module 502 , an initialization module 504 , a writing module 506 , and a deletion module 508 .

[0105] The instruction module 502 is used to obtain a deletion instruction, which includes a message of a preset structure; the instruction module 502 is also used to obtain a deletion instruction for deleting a host table entry; the instruction module 502 is also used to obtain a deletion instruction for batch deletion.

[0106] The initialization module 504 is used to initialize the message queue and pointer when the message meets the preset conditions; the initialization module 504 is also used to determine whether the message content is empty when the message length is not 0; and initialize the message queue and pointer when the message content is not empty.

[0107] The writing module 506 is used to write the contents of the message into the message queue one by one through the pointer; the writing module 506 is also used to read the contents of the message one by one; write the contents into the structure of the message queue based on the pointer; and increase the value of the pointer.

[0108] The deletion module 508 is used to call the driver chip interface based on the message queue to delete the address resolution protocol related content. The deletion module 508 is also used to add the message queue to the queue; remove the message queue from the queue; call the driver chip interface to delete the address resolution protocol related content; and release the pointer.

[0109] According to the address resolution protocol deletion device of the present application, by obtaining a deletion instruction, the deletion instruction includes a message of a preset structure; initializing a message queue and a pointer when the message meets a preset condition; writing the contents of the message into the message queue one by one through the pointer; and calling a driver chip interface based on the message queue to delete the address resolution protocol related contents, the address resolution protocol related table items can be cleared through one instruction, the performance of clearing the queue is optimized, the working efficiency of the switch is improved, and the utilization rate of the address resolution protocol table item resources is improved.

[0110] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.

[0111] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present application is described. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0112] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0113] The storage unit stores a program code, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps described in this specification according to various exemplary embodiments of the present application. For example, the processing unit 610 can perform the following steps: Figure 2 , Figure 3 , Figure 4 Follow the steps shown in .

[0114] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0115] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.

[0116] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0117] The electronic device 600 may also communicate with one or more external devices 600' (e.g., keyboards, pointing devices, Bluetooth devices, etc.) to enable a user to communicate with the electronic device 600, and / or any device (e.g., routers, modems, etc.) that the electronic device 600 can communicate with one or more other computing devices. Such communication may be performed via an input / output (I / O) interface 650. In addition, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0118] Through the above description of the implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Figure 7 As shown, the technical solution according to the implementation mode of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation mode of the present application.

[0119] The software product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0120] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0121] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0122] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by a device, the computer-readable medium realizes the following functions: obtaining a deletion instruction, the deletion instruction includes a message of a preset structure; initializing a message queue and a pointer when the message meets preset conditions; writing the contents of the message into the message queue one by one through the pointer; calling the driver chip interface based on the message queue to delete the content related to the address resolution protocol.

[0123] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0124] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present application.

[0125] The exemplary embodiments of the present application are specifically shown and described above. It should be understood that the present application is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present application is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A method for deleting an address resolution protocol, characterized in that: include: Obtain a deletion instruction for deleting a host table entry or a deletion instruction for batch deletion, wherein the deletion instruction includes a message of a preset structure; Initializing a message queue and a pointer when the message meets a preset condition, initializing the message queue and the pointer includes: initializing a first pointer and a second pointer, the first pointer and the second pointer are used to receive an ipv4 address and a forwarding number value, respectively, the message queue includes a first message queue and a second message queue, the first message queue is used to delete a routing table item learned by ARP triggered by a network segment route, the message queue includes an ipv4 message length, an ip address and a virtual routing forwarding number, the second message queue is used to delete an ARP table item, the message queue includes an ARP message length and next hop information, wherein when a deletion instruction to delete a host table item is obtained, the first message queue is initialized, and when a deletion instruction for batch deletion is obtained, the first message queue and the second message queue are initialized; Writing the contents of the messages into the message queue one by one through the pointer; The driver chip interface is called based on the message queue to delete the address resolution protocol related content.

2. The method according to claim 1, characterized in that Initializing a message queue and a pointer when the message meets a preset condition includes: When the message length is not 0, determining whether the message content is empty; When the message content is not empty, the message queue and the pointer are initialized.

3. The method according to claim 1, characterized in that Writing the contents of the messages into the message queue one by one through the pointer comprises: Read the contents of the messages one by one; Writing the content into a structure of a message queue based on the pointer; Increment the value of the pointer.

4. The method according to claim 1, characterized in that Calling the driver chip interface based on the message queue to delete the address resolution protocol related content includes: Enqueue the message queue; Dequeue the message queue; Call the driver chip interface to delete the address resolution protocol related content; Releases the pointer.

5. The method according to claim 1, characterized in that When obtaining a deletion instruction for batch deletion, after calling the driver chip interface based on the message queue to delete the address resolution protocol related content, it also includes: Delete the address resolution protocol table entry through the message queue.

6. A device for deleting an address resolution protocol, characterized in that: include: An instruction module, used to obtain a deletion instruction for deleting a host table entry or a deletion instruction for batch deletion, wherein the deletion instruction includes a message of a preset structure; An initialization module, used to initialize a message queue and a pointer when the message meets a preset condition, wherein the initialization of the message queue and the pointer includes: initializing a first pointer and a second pointer, wherein the first pointer and the second pointer are used to receive an ipv4 address and a forwarding number value, respectively, wherein the message queue includes a first message queue and a second message queue, wherein the first message queue is used to delete a routing table item learned by ARP triggered by a network segment route, wherein the message queue includes an ipv4 message length, an ip address and a virtual routing forwarding number, and the second message queue is used to delete an ARP table item, wherein the first message queue is initialized when a deletion instruction for deleting a host table item is obtained, and the first message queue and the second message queue are initialized when a deletion instruction for batch deletion is obtained; A writing module, used for writing the contents of the messages into the message queue one by one through the pointer; The deletion module is used to call the driver chip interface based on the message queue to delete the address resolution protocol related content.