CN116366544A - Address resolution protocol deleting method and device - Google Patents

Address resolution protocol deleting method and device Download PDF

Info

Publication number
CN116366544A
CN116366544A CN202310113137.7A CN202310113137A CN116366544A CN 116366544 A CN116366544 A CN 116366544A CN 202310113137 A CN202310113137 A CN 202310113137A CN 116366544 A CN116366544 A CN 116366544A
Authority
CN
China
Prior art keywords
message
message queue
pointer
resolution protocol
deleting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310113137.7A
Other languages
Chinese (zh)
Inventor
王丹
吴乐毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN202310113137.7A priority Critical patent/CN116366544A/en
Publication of CN116366544A publication Critical patent/CN116366544A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/66Layer 2 routing, e.g. in Ethernet based MAN's
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/901Buffering arrangements using storage descriptor, e.g. read or write pointers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to a method and a device for deleting an address resolution protocol. The method comprises the following steps: acquiring a deleting instruction, wherein the deleting instruction comprises a message with a preset structure; initializing a message queue and a pointer when the message meets preset conditions; writing the contents of the messages into the message queue one by one through the pointer; and calling a driving chip interface to delete the related content of the address resolution protocol based on the message queue. The method and the device for deleting the address resolution protocol can clear the content of the related table items of 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 table item resources of the address resolution protocol.

Description

Address resolution protocol deleting method and device
Technical Field
The disclosure relates to the field of computer information processing, and in particular relates to a method and a device for deleting an address resolution protocol.
Background
Three layers of equipment such as a host or a router in the local area network forwards the data message according to the IP address; and the three-layer device or the two-layer device transmits and receives the ethernet data frame according to the MAC (Medium Access Control ) address. The MAC address, also known as a physical address or a hardware address, is assigned to the ethernet interface at the time of manufacture of the device. The IP address and MAC address are independent of each other, and thus in a practical network, an address resolution mechanism is required to provide mapping for these two different address forms.
The method comprises the steps that broadcast ARP (Address Resolution Protocol ) detection messages are actively sent by three layers of equipment in a network to realize mutual learning of the mapping relation between IP addresses and MAC addresses among the equipment, wherein the ARP detection messages carry the IP addresses and the MAC addresses of the equipment to be detected by the three layers of equipment, so that the equipment receiving the ARP detection messages learns the mapping relation between the IP addresses and the MAC addresses of the three layers of equipment; when the equipment to be detected of the ARP detection message receives the ARP detection message, an ARP response message is sent to the three-layer equipment, and the ARP response message carries an IP address and an MAC address of the equipment for learning of the three-layer equipment.
The MAC forwarding table is not fixed, and when a host or a router in the network exits the network, in order to prevent the MAC entry corresponding to the MAC address from still occupying system resources, the two-layer switch device needs to delete the MAC entry in the MAC forwarding table periodically, and in general, if a message sent by taking the MAC address in the MAC entry as the source MAC address is not received within a few minutes, the two-layer switch device will delete the MAC entry.
Under static internet protocol (Internet Protocol, IP) address scene, after the terminal on line is off line, the access network equipment connected with the terminal can delete the ARP (address resolution protocol) list item corresponding to the terminal after the ARP list item reaches ageing duration, and then each convergent network equipment is informed to delete the route corresponding to the ARP list item, so that the route update of each convergent network equipment is realized.
In the method for updating the ARP table, ARP entries cannot be aged in time, the ARP entries need to be deleted after the ARP entries reach the aging time, if the ARP entries do not reach the aging time and another terminal uses the same IP address to be on line, two paths of the IP address are stored on each aggregation network device, so that an equivalent route is formed, if the aggregation network device receives a message of the equivalent route in matching and forwards the message to an access network device corresponding to a terminal that has been off line, the terminal on line cannot receive the message, packet loss occurs, and therefore network disconnection of the terminal is caused, and user experience is greatly affected.
Therefore, a new method and apparatus for deleting address resolution protocol are needed.
The above information disclosed in the background section is only for enhancement of understanding of the background of the application and therefore it may contain information that does not form the prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of this, the present application provides a method and apparatus for deleting an address resolution protocol, which can clear the content of an address resolution protocol related entry through an instruction, optimize the performance of clearing a queue, improve the working efficiency of a switch, and improve the utilization rate of the address resolution protocol entry resource.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned in part by the practice of the application.
According to an aspect of the present application, a method for deleting an address resolution protocol is provided, including: acquiring a deleting instruction, wherein the deleting instruction comprises a message with a preset structure; initializing a message queue and a pointer when the message meets preset conditions; writing the contents of the messages into the message queue one by one through the pointer; and calling a driving chip interface to delete the related content of the address resolution protocol based on the message queue.
In one exemplary embodiment of the present application, it includes: acquiring a deleting instruction for deleting the host table item; or acquiring a deletion instruction for batch deletion.
In an exemplary embodiment of the present application, initializing a message queue and a pointer when the message meets a preset condition includes: when the message length is not 0, judging whether the message content is empty or not; and initializing a message queue and a pointer when the message content is not empty.
In an exemplary embodiment of the present application, initializing a message queue and a pointer when the message meets a preset condition includes: initializing a structure of a message queue; the first pointer and the second pointer are initialized.
In an exemplary embodiment of the present application, when a delete instruction to delete a host entry is obtained, initializing a structure of a message queue includes: initializing the length of an ipv4 message, an ip address and a virtual route forwarding number in a message queue.
In an exemplary embodiment of the present application, when a deletion instruction of bulk deletion is acquired, initializing a structure body of a message queue includes: initializing ARP message length and next hop information in a message queue.
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 messages one by one; writing the content into a structure of a message queue based on the pointer; the value of the pointer is incremented.
In an exemplary embodiment of the present application, invoking the driver chip interface to delete address resolution protocol related content based on the message queue includes: enqueue the message queue; dequeuing the message queue; calling a driving chip interface to delete the related content of the address resolution protocol; releasing the pointer.
In an exemplary embodiment of the present application, when obtaining a deletion instruction for bulk deletion, after the driver chip interface is called to delete the address resolution protocol related content based on the message queue, the method further includes: and deleting the address resolution protocol table entry.
According to an aspect of the present application, there is provided an apparatus for deleting an address resolution protocol, including: the instruction module is used for acquiring a deleting instruction, wherein the deleting instruction comprises a message with a preset structure; the initialization module is used for initializing a message queue and a pointer when the message meets preset conditions; the writing module is used for writing the contents of the messages into the message queue one by one through the pointer; and the deleting module is used for calling a driving chip interface to delete the related content of the address resolution protocol based on the message queue.
According to an aspect of the present application, there is provided an electronic device including: one or more processors; a storage means 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 are caused to implement the methods as described above.
According to an aspect of the present application, a computer-readable medium is presented, on which a computer program is stored, which program, when being executed by a processor, implements a method as described above.
According to the method and the device for deleting the address resolution protocol, deleting instructions are obtained, wherein the deleting instructions comprise messages with preset structures; initializing a message queue and a pointer when the message meets preset conditions; writing the contents of the messages into the message queue one by one through the pointer; based on the mode that the message queue calls the driving chip interface to delete the related content of the address resolution protocol, the related list item content of 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 list item resource of the address resolution protocol is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The drawings described below are only some embodiments of the present application and other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
Fig. 1 is a system block diagram illustrating a method and apparatus for deleting an address resolution protocol according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of deleting an address resolution protocol according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a method of deleting an address resolution protocol according to another exemplary embodiment.
Fig. 4 is a flowchart illustrating a method of deleting an address resolution protocol according to another exemplary embodiment.
Fig. 5 is a block diagram illustrating a deletion apparatus of an address resolution protocol according to an exemplary embodiment.
Fig. 6 is a block diagram of an electronic device, according to an example embodiment.
Fig. 7 is a block diagram of a computer-readable medium shown according to an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments can be embodied in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and thus a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the present application. One skilled in the relevant art will recognize, however, that the aspects of the application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
It will 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 element from another element. Thus, a first component discussed below could be termed a second component without departing from the teachings of the present application concept. As used herein, the term "and/or" includes any one of the associated listed items and all combinations of one or more.
Those skilled in the art will appreciate that the drawings are schematic representations of example embodiments, and that the modules or flows in the drawings are not necessarily required to practice the present application, and therefore, should not be taken to limit the scope of the present application.
The technical abbreviations involved in this application are explained as follows:
ARP, address resolution protocol, is a TCP/IP protocol for obtaining physical address according to IP address. Broadcasting an ARP request containing a target IP address to all hosts on a local area network when the hosts send information, and receiving a return message so as to determine the physical address of the target; after receiving the return message, the IP address and the physical address are stored in the local ARP cache and kept for a certain time, and the ARP cache is directly inquired when the request is next time so as to save resources. The address resolution protocol is based on that each host computer in the network trusts each other, and the host computers on the local area network can autonomously send ARP response messages, and other host computers can record the response messages into the local ARP cache without detecting the authenticity of the messages when receiving the response messages. The ARP command may be used to query the correspondence between IP addresses and MAC addresses in the native ARP cache, add or delete static correspondences, etc.
ipv4 internet protocol version 4 (Internet Protocol version, ipv 4), also known as internet communication protocol version 4, is a connectionless protocol that operates on a link layer (e.g., ethernet) using packet switching. This protocol will make best effort to deliver the packets, i.e. it will not guarantee that any packets will reach the destination, nor will it guarantee that all packets arrive in the correct order without repetition. These aspects are handled by upper layer transport protocols (e.g., transmission control protocols).
IP: refers to the internetworking protocol (Internet Protocol), which is a network layer protocol in the TCP/IP architecture. The purpose of IP design is to improve network scalability: firstly, the problem of the Internet is solved, and the interconnection and intercommunication of large-scale heterogeneous networks are realized; and secondly, the coupling relation between the top network application and the bottom network technology is divided, so that the independent development of the top network application and the bottom network technology is facilitated. According to the end-to-end design principle, IP only provides a connectionless, unreliable, best effort packet transmission service for hosts.
MAC address (Media Access Control Address): a media access control Address, also known as a local area network Address (LAN Address), a MAC Address, an Ethernet Address (Ethernet Address) or a Physical Address (Physical Address), is an Address used to identify the location of a network device. In the OSI model, the third layer network layer is responsible for IP addresses, and the second layer data link layer is responsible for MAC addresses. The MAC address is used to uniquely identify a network card in the network, and if one or more network cards exist in a device, each network card needs and has a unique MAC address.
The applicant of the present application found through research that MAC (Medium Access Control ) addresses can be classified into broadcast MAC addresses, multicast MAC addresses, and unicast MAC addresses; when the two-layer exchanger equipment receives a message with a target MAC address being a broadcast MAC address or a multicast MAC address, broadcast copy forwarding is carried out on all other interfaces except the message receiving interface; when receiving a message with a target MAC address being a unicast MAC address, the two-layer switch equipment firstly inquires an built-in MAC forwarding table, each table entry in the MAC forwarding table records the corresponding relation between the MAC address and a forwarding interface, and the two-layer switch equipment obtains the forwarding interface corresponding to the target MAC address by inquiring the MAC forwarding table and forwards the message from the forwarding interface.
Routes are generally divided into host routes and network segment routes, and from the perspective of network topology, host routes generally refer to routes in which terminals are directly connected to switches, and network segment routes generally refer to routes in which routers are connected to routers; from a routing mask perspective, the mask length of the host route is 32 bits, while the mask length of the segment route is typically less than 32. There is also a segment route with a mask length of 32 in the network, which is not a true meaning route, but a route learned by the segment route by triggering ARP, and the priority of the route is higher than that of the host route, and the route can coexist with the host route.
In the existing method for deleting the related content of the ARP, a single ARP content is deleted, namely n packets are deleted, n message heads and n ARP contents are contained, the ARP list items are deleted after the aging time is required to be reached through message queue transmission.
When the ARP list item is cleared, the scheme adopted by the method is that the message is deleted one by one, if the deleted request is too large, the method may become a performance bottleneck, the overhead of queue transmission is increased, and the maintenance of the message queue is not facilitated; and n message heads are redundant, so that queue resources are occupied, and the pressure of queue processing is increased. The message header needs to be repeatedly confirmed, which greatly reduces the throughput and response time of the queue. The ARP list item is deleted when the aging time is reached, which is not beneficial to the management and maintenance of developers, and easily causes uncontrollable network problems, thereby greatly influencing the user experience.
In view of the technical defects in the prior art, the application provides a deleting method of an address resolution protocol, which can perform batch writing optimization, and greatly reduces the interaction times and the message transmission quantity by optimizing a plurality of messages into a message header form. Especially for high throughput and small load message entities, the network transmission capacity can be remarkably reduced by optimizing the form of the message header.
In the application, the ARP message header is confirmed, a plurality of messages are combined into a message body in batches, the message middleware only needs to confirm the batch messages once, the confirmation times are reduced, the throughput and the response time of the queue are reduced, and the message transmission performance is greatly improved.
In the method, ARP list items can be deleted in batches through one instruction, when the port of the switch is closed or manually cleared, the ARP list items under the port can be deleted in batches, the working efficiency of the switch is improved, and the utilization rate of ARP list item resources is optimized.
The following describes the content of the present application in detail with the aid of specific examples.
Fig. 1 is a system block diagram illustrating a method and apparatus for deleting an address resolution protocol according to an exemplary embodiment.
As shown in fig. 1, the system architecture 10 may include network devices 101, 102, 103, a network 104, and a server 105. The network 104 is the medium used to provide 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 fiber optic cables, among others.
The network devices 101, 102, 103 interact with the server 105 through the network 104 to receive or send command messages or the like. Various communication client applications, such as a message processing class application, a data forwarding class application, an instant messaging tool, a mailbox client, etc., may be installed on the network devices 101, 102, 103.
The network devices 101, 102, 103 may be a variety of electronic devices with data forwarding capabilities including, but not limited to, switches, servers, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server that correlates address resolution protocol entries in the network devices 101, 102, 103.
The server 105 may, for example, obtain a deletion instruction, where the deletion instruction includes a message with a preset structure; the server 105 may initialize a message queue and pointer, for example, when the message satisfies a preset condition; server 105 may write the contents of the message one by one into the message queue, for example, by the pointer; the server 105 may, for example, delete address resolution protocol related content based on the message queue call driver chip interface.
The server 105 may be an entity server, or may be a plurality of servers, for example, it should be noted that the method for deleting an address resolution protocol provided in the embodiment of the present application may be executed by the server 105, and accordingly, the deleting device of the address resolution protocol may be set in the server 105.
Fig. 2 is a flow chart illustrating a method of deleting an address resolution protocol according to an exemplary embodiment. The method 20 for deleting an address resolution protocol at least includes steps S202 to S208.
As shown in fig. 2, in S202, a deletion instruction is acquired, where the deletion instruction includes a message with a preset structure. The message structure body can comprise a message type flag bit, an ARP message length, ARP message content, an ipv4 message length and an ipv4 message content.
More specifically, the Ipv4 packet content structure includes an ip address, an ip address mask, and a virtual route forwarding number (vrf _id).
In one embodiment, the user may, for example, generate a delete instruction to delete the host entry, and the server side obtains the delete instruction to delete the host entry. The deletion instruction for deleting host table entry is used to delete the route table entry learned by network segment route trigger ARP and delete ARP table entry.
In one embodiment, the user may, for example, generate a bulk delete instruction, and the server side obtains the bulk delete instruction. The function of the batch delete instruction is to automatically clear the ARP entry using an instruction.
In S204, a message queue and a pointer are initialized when the message satisfies a preset condition. Judging whether the message content is empty or not when the message length is not 0, for example; and initializing a message queue and a pointer when the message content is not empty.
More specifically, when a message is received, firstly, the message is subjected to empty judging treatment, if the message is empty, the process is jumped out, and if not, whether the message is a route and ARP message which are learned by triggering ARP by network segment routes is judged according to the message type flag bit. If not, the deleting process is not carried out, otherwise, the route and ARP message which are learned by the network segment route triggering ARP are deleted successively.
In one embodiment, initializing the message queue and the pointer when the message meets a preset condition includes: initializing a structure of a message queue; the first pointer and the second pointer are initialized.
More specifically, the function of the present application may be implemented by two message queues, where the first message queue is used to delete a routing table entry learned by the network segment route trigger ARP, and the message queue includes an ipv4 message length, an ip address, and a virtual route forwarding number (vrf _id). The second message queue is used to delete ARP list item, and contains ARP message length and next hop information.
More specifically, when the server acquires a delete instruction to delete the host entry, initializing the structure of the message queue includes: initializing the length of an ipv4 message, an ip address and a virtual route forwarding number in a message queue. When the server acquires a deleting instruction for deleting the host table entry, only the first message queue is initialized.
More specifically, when the server acquires a deletion instruction for batch deletion, initializing a structure body of the message queue, including: initializing ARP message length and next hop information in a message queue. When the server acquires the deletion instruction of batch deletion, not only the first message queue but also the second message queue need to be initialized.
In S206, the contents of the message are written into the message queue one by one through the pointer. The content of the message can be read one by one, for example; writing the content into a structure of a message queue based on the pointer; the value of the pointer is incremented.
In S208, the driver chip interface is invoked to delete address resolution protocol related content based on the message queue. The message queue may be enqueued, for example; dequeuing the message queue; calling a driving chip interface to delete the related content of the address resolution protocol; releasing the pointer.
More specifically, when the server acquires a deletion instruction for batch deletion, after the driver chip interface is called to delete the related content of the address resolution protocol based on the message queue, the method further comprises: and deleting the address resolution protocol table entry through the message queue.
According to the deleting method of the address resolution protocol, deleting instructions are obtained, wherein the deleting instructions comprise messages with preset structures; initializing a message queue and a pointer when the message meets preset conditions; writing the contents of the messages into the message queue one by one through the pointer; based on the mode that the message queue calls the driving chip interface to delete the related content of the address resolution protocol, the related list item content of 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 list item resource of the address resolution protocol is improved.
It should be clearly understood that this application describes how to make and use particular examples, but the principles of this application are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
Fig. 3 is a flowchart illustrating a method of deleting an address resolution protocol according to another exemplary embodiment. The flow 30 shown in fig. 3 is a detailed description of the content related to "the server obtains the deletion instruction to delete host entry" in the flow shown in fig. 2.
As shown in fig. 3, in S302, a delete host entry instruction is acquired.
In S304, whether the message length satisfies the policy may, for example, determine whether the message length is between 1-100.
In S306, whether the message is empty.
In S308, initializing a first pointer and a second pointer, wherein the first pointer may be referred to as ip_addr, for example; the second pointer may be referred to as a ver_id, for example.
In S310, a message queue structure is initialized.
In S312, a count is initialized, i=0 may be set, for example.
In S314, i satisfies a condition. I may be, for example, less than the message length.
In S316, the first pointer ip_addr byte order is converted.
In S318, the message queue structure assigns a value.
In S320, the count is incremented, which may be, for example, i++.
In S322, the message is enqueued.
In S324, the message dequeues.
In S326, the driver chip interface is invoked.
In S328, the first pointer and the second pointer are released.
When the instruction for deleting the host list item is acquired, the message length is judged first, the maximum number of the message contents deleted at one time at present can be assumed to be 100, and if the message length is not between 1 and 100 or the message contents are empty, the process of processing and deleting is not carried out.
Initializing a first pointer ip_addr and a second pointer vrf _id pointer, which are used for receiving an ipv4 address and a forwarding number value, initializing a message queue structure body, circularly writing the contents of one message into the message queue structure body, and enqueuing and dequeuing the message.
And calling a chip bottom layer driving interface, and finally releasing the pointer of the previously received ipv4 address and forwarding number value to complete a complete process of deleting the host table entry.
Fig. 4 is a flowchart illustrating a method of deleting an address resolution protocol according to another exemplary embodiment. The flow 40 shown in fig. 4 is a detailed description of the content related to "the server acquires the deletion instruction of bulk deletion" in the flow shown in fig. 2.
As shown in fig. 4, in S402, a batch deletion instruction is acquired.
In S404, the host entry is deleted.
In S406, the ARP entry is deleted.
When a batch deleting instruction is acquired, the route list item and the ARP list item which are learned by triggering ARP are deleted in batches successively. The ARP deletion procedure is similar to the host table deletion procedure.
For example, in a batch delete instruction, the host entry is deleted first, then the first pointer ip_addr and the second pointer vrf _id pointer are initialized again to receive the ipv4 address and the forwarding number value, then the message queue structure is initialized, the message contents are written into the message queue structure in a cycle by cycle manner, and then the message is enqueued and dequeued.
And calling a chip bottom layer driving interface, and finally releasing the pointer of the previously received ipv4 address and forwarding number value to complete the process of one-time complete ARP table entry.
According to the method for deleting the address resolution protocol, a batch writing mode is optimized, n ARP messages, including n ARP message heads and n ARP message contents, are optimized into one ARP message head and n ARP message contents. By the method, the ARP message can be cleared by using one instruction, and the network problem caused by clearing ARP list items only when the aging time is reached can be effectively avoided.
Those skilled in the art will appreciate that all or part of the steps implementing the above described embodiments are implemented as a computer program executed by a CPU. When executed by a CPU, performs the functions defined by the above methods provided herein. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic disk or an optical disk, etc.
Furthermore, it should be noted that the above-described figures are merely illustrative of the processes involved in the method according to the exemplary embodiments of the present application, and are not intended to be limiting. It will be readily appreciated that the processes shown in the above figures do not indicate or limit the temporal order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, among a plurality of modules.
The following are device embodiments of the present application, which may be used to perform method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
Fig. 5 is a block diagram illustrating a deletion apparatus of an address resolution protocol according to an exemplary embodiment. As shown in fig. 5, the deletion apparatus 50 of the address resolution protocol includes: instruction module 502, initialization module 504, write module 506, delete module 508.
The instruction module 502 is configured to obtain a deletion instruction, where the deletion instruction includes a message with a preset structure; the instruction module 502 is further configured to obtain a delete instruction for deleting the host entry; the instruction module 502 is further configured to obtain a deletion instruction for batch deletion.
The initialization module 504 is configured to initialize a message queue and a pointer when the message meets a preset condition; the initialization module 504 is further configured to determine, when the message length is not 0, whether the message content is empty; and initializing a message queue and a pointer when the message content is not empty.
The writing module 506 is configured to write the contents of the message into the message queue one by one through the pointer; the writing module 506 is further configured to read the contents of the messages one by one; writing the content into a structure of a message queue based on the pointer; the value of the pointer is incremented.
The deletion module 508 is configured to invoke the driver chip interface to delete the address resolution protocol related content based on the message queue. The deletion module 508 is further configured to enqueue the message queue; dequeuing the message queue; calling a driving chip interface to delete the related content of the address resolution protocol; releasing the pointer.
According to the deleting device of the address resolution protocol, deleting instructions are obtained, wherein the deleting instructions comprise messages with preset structures; initializing a message queue and a pointer when the message meets preset conditions; writing the contents of the messages into the message queue one by one through the pointer; based on the mode that the message queue calls the driving chip interface to delete the related content of the address resolution protocol, the related list item content of 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 list item resource of the address resolution protocol is improved.
Fig. 6 is a block diagram of an electronic device, according to an example embodiment.
An electronic device 600 according to this embodiment of the present application is described below with reference to fig. 6. The electronic device 600 shown in fig. 6 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present application.
As shown in fig. 6, the electronic device 600 is in the form of a general purpose computing device. Components of electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one memory unit 620, a bus 630 connecting the different system components (including the memory unit 620 and the processing unit 610), a display unit 640, etc.
Wherein the storage unit stores program code that is executable by the processing unit 610 such that the processing unit 610 performs steps described in the present specification according to various exemplary embodiments of the present application. For example, the processing unit 610 may perform the steps as shown in fig. 2, 3, and 4.
The memory unit 620 may include readable media in the form of volatile memory units, such as Random Access Memory (RAM) 6201 and/or cache memory unit 6202, and may further include Read Only Memory (ROM) 6203.
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 or some combination of which may include an implementation of a network environment.
Bus 630 may be a local bus representing 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 using any of a variety of bus architectures.
The electronic device 600 may also communicate with one or more external devices 600' (e.g., keyboard, pointing device, bluetooth device, etc.), devices that enable a user to interact with the electronic device 600, and/or any devices (e.g., routers, modems, etc.) that the electronic device 600 can communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 650. Also, electronic device 600 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 over the bus 630. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 600, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, as shown in fig. 7, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, or a network device, etc.) to perform the above-described method according to the embodiments of the present application.
The software product may employ 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 can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, with readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A readable storage medium may also be any readable medium that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind 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., connected via the Internet using an Internet service provider).
The computer-readable medium carries one or more programs, which when executed by one of the devices, cause the computer-readable medium to perform the functions of: acquiring a deleting instruction, wherein the deleting instruction comprises a message with a preset structure; initializing a message queue and a pointer when the message meets preset conditions; writing the contents of the messages into the message queue one by one through the pointer; and calling a driving chip interface to delete the related content of the address resolution protocol based on the message queue.
Those skilled in the art will appreciate that the modules may be distributed throughout several devices as described in the embodiments, and that corresponding variations may be implemented in one or more devices that are unique to the embodiments. The modules of the above embodiments may be combined into one module, or may be further split into a plurality of sub-modules.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or in combination with the necessary hardware. Thus, the technical solutions according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and include several instructions to cause a computing device (may be a personal computer, a server, a mobile terminal, or a network device, etc.) to perform the methods according to the embodiments of the present application.
Exemplary embodiments of the present application are specifically illustrated and described above. It is to be understood that this application is not limited to the details of construction, arrangement or method of implementation described herein; on the contrary, the application is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A method for deleting an address resolution protocol, comprising:
acquiring a deleting instruction, wherein the deleting instruction comprises a message with a preset structure;
initializing a message queue and a pointer when the message meets preset conditions;
writing the contents of the messages into the message queue one by one through the pointer;
and calling a driving chip interface to delete the related content of the address resolution protocol based on the message queue.
2. The method of claim 1, wherein obtaining a delete instruction comprises:
acquiring a deleting instruction for deleting the host table item; or (b)
And acquiring a deletion instruction for batch deletion.
3. The method of claim 1, wherein initializing a message queue and a pointer when the message satisfies a preset condition comprises:
when the message length is not 0, judging whether the message content is empty or not;
and initializing a message queue and a pointer when the message content is not empty.
4. The method of claim 3, wherein initializing a message queue and a pointer comprises:
initializing a structure of a message queue;
the first pointer and the second pointer are initialized.
5. The method of claim 2 or 4, wherein upon obtaining a delete instruction to delete a host entry,
a fabric for initializing a message queue, comprising:
initializing the length of an ipv4 message, an ip address and a virtual route forwarding number in a message queue.
6. The method of claim 2 or 4, wherein upon obtaining a delete instruction for bulk delete,
a fabric for initializing a message queue, comprising:
initializing ARP message length and next hop information in a message queue.
7. The method of claim 1, wherein writing the contents of the message one by one into the message queue via the pointer comprises:
reading the contents of the messages one by one;
writing the content into a structure of a message queue based on the pointer;
the value of the pointer is incremented.
8. The method of claim 1, wherein invoking a driver chip interface based on the message queue to delete address resolution protocol related content comprises:
enqueue the message queue;
dequeuing the message queue;
calling a driving chip interface to delete the related content of the address resolution protocol;
releasing the pointer.
9. The method of claim 1, wherein when obtaining the deletion instruction of batch deletion, after calling a driver chip interface to delete the address resolution protocol related content based on the message queue, further comprising:
and deleting the address resolution protocol table entry through the message queue.
10. An address resolution protocol deletion apparatus, comprising:
the instruction module is used for acquiring a deleting instruction, wherein the deleting instruction comprises a message with a preset structure;
the initialization module is used for initializing a message queue and a pointer when the message meets preset conditions;
the writing module is used for writing the contents of the messages into the message queue one by one through the pointer;
and the deleting module is used for calling a driving chip interface to delete the related content of the address resolution protocol based on the message queue.
CN202310113137.7A 2023-02-15 2023-02-15 Address resolution protocol deleting method and device Pending CN116366544A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310113137.7A CN116366544A (en) 2023-02-15 2023-02-15 Address resolution protocol deleting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310113137.7A CN116366544A (en) 2023-02-15 2023-02-15 Address resolution protocol deleting method and device

Publications (1)

Publication Number Publication Date
CN116366544A true CN116366544A (en) 2023-06-30

Family

ID=86912051

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310113137.7A Pending CN116366544A (en) 2023-02-15 2023-02-15 Address resolution protocol deleting method and device

Country Status (1)

Country Link
CN (1) CN116366544A (en)

Similar Documents

Publication Publication Date Title
US20220255884A1 (en) System and method for facilitating efficient utilization of an output buffer in a network interface controller (nic)
US9350667B2 (en) Dynamically assigning packet flows
US10204070B2 (en) Method, device, system and storage medium for implementing packet transmission in PCIE switching network
US6799220B1 (en) Tunneling management messages over a channel architecture network
US20230155961A1 (en) Architecture for high performing data plane applications with smart network interface on compute servers
JP2000092118A (en) Programmable network
CN111801911B (en) Traffic function chain congestion tracking
CN113691589B (en) Message transmission method, device and system
WO2007133316A2 (en) Packet firewalls of particular use in packet switching devices
US6742075B1 (en) Arrangement for instigating work in a channel adapter based on received address information and stored context information
JP2004173267A (en) Cutoff period in communication with wireless device that has temporart network address
JP2006135574A (en) Packet transmitter
JP2002057719A (en) Method and system for packet re-assembling in communication switch
CN111698274B (en) Data processing method and device
US7363383B2 (en) Running a communication protocol state machine through a packet classifier
CN116366544A (en) Address resolution protocol deleting method and device
CN111147385A (en) Method and system for forwarding data plane of software defined data center network
JP2000235536A (en) Data communication system and device
CN113676409B (en) Message forwarding method and device, electronic equipment and storage medium
US7164658B1 (en) Distribution of data transfer load when transmitting layer-3 datagrams on a layer-2 network
CN116938851A (en) Message transmission method and related equipment
US7290055B2 (en) Multi-threaded accept mechanism in a vertical perimeter communication environment
CN116915370B (en) Data retransmission method, device and system based on remote direct data access
WO2002005494A1 (en) High speed packet processing architecture
CN114615187B (en) Logic interface data communication method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination