CN109274781B - ARP table item refreshing method and device - Google Patents

ARP table item refreshing method and device Download PDF

Info

Publication number
CN109274781B
CN109274781B CN201810911499.XA CN201810911499A CN109274781B CN 109274781 B CN109274781 B CN 109274781B CN 201810911499 A CN201810911499 A CN 201810911499A CN 109274781 B CN109274781 B CN 109274781B
Authority
CN
China
Prior art keywords
arp
entry
address
source
table entry
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.)
Active
Application number
CN201810911499.XA
Other languages
Chinese (zh)
Other versions
CN109274781A (en
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.)
New H3C Technologies Co Ltd
Original Assignee
New H3C 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 New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201810911499.XA priority Critical patent/CN109274781B/en
Publication of CN109274781A publication Critical patent/CN109274781A/en
Application granted granted Critical
Publication of CN109274781B publication Critical patent/CN109274781B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5053Lease time; Renewal aspects

Abstract

The application provides an ARP table entry refreshing method and device. In the application, the ARP table entry matched with the source IP address and the source MAC address of the data message can be dynamically refreshed according to the source IP address and the source MAC address of the received data message, so that even if the ARP message actively sent by the network equipment is submerged, the ARP table entry matched with the source IP address and the source MAC address of the data message can be refreshed according to the source IP address and the source MAC address of the received data message, the situation that the ARP table entry cannot be refreshed because the network equipment cannot receive an ARP response message within the set time after the network equipment sends the ARP request message is avoided, and the forwarding interruption of the data message is prevented.

Description

ARP table item refreshing method and device
Technical Field
The present application relates to network communication technologies, and in particular, to a method and an apparatus for Address Resolution Protocol (ARP) refresh.
Background
The ARP entry is a mapping entry from an Internet Protocol (IP) address to a Media Access Control (MAC) address, and is used for forwarding a message. The ARP table entry may be aged or refreshed. The following describes how the network device ages and refreshes ARP entries. Examples of the network device herein are a router, a three-layer switch, a gateway device, etc. in the network.
The network equipment actively sends an ARP request message at a certain time point before the aging time of the ARP table entry is reached, wherein the target MAC address of the ARP request message is the MAC address in the ARP table entry, and the target IP address is the IP address in the ARP table entry. Here, the aging time of the ARP entry refers to a time for maintaining the ARP entry from an entry generation time stamp of the ARP entry, and the entry generation time stamp of the ARP entry is a time stamp for generating the ARP entry.
The network equipment receives the ARP response message corresponding to the ARP request message within the set time after sending the ARP request message (at the moment, the aging time of the ARP table entry does not reach), the table entry generation timestamp of the ARP table entry is updated to the current timestamp (namely, the ARP table entry is refreshed) so as to realize that the ARP table entry maintains the aging time from the current timestamp, otherwise, the ARP table entry is deleted (namely, the ARP table entry is aged) when the aging time of the ARP table entry reaches.
The above describes how a network device ages and refreshes ARP entries.
However, when a large amount of data packets are transmitted in the network, the ARP packet actively sent by the network device may be submerged, which may cause the network device to delete the ARP entry because the ARP reply packet cannot be received within a set time after sending the ARP request packet, so that the data packets forwarded by the deleted ARP entry are temporarily interrupted to be forwarded.
Disclosure of Invention
The application provides an ARP table item refreshing method and device, which are used for preventing ARP table items from being deleted because ARP messages actively sent by network equipment are submerged when a large number of data messages are transmitted.
The technical scheme provided by the application comprises the following steps:
an ARP table item refreshing method is applied to network equipment and comprises the following steps:
receiving a data message, wherein the data message carries a source IP address and a source MAC address;
if the route from the network equipment to the source equipment of the data message is a direct route, searching a first ARP table item matched with the source IP address and the source MAC address in a local ARP table, wherein the source equipment is equipment corresponding to the source IP address;
and updating the table entry generation timestamp of the first ARP table entry, wherein the table entry generation timestamp is the timestamp for generating the first ARP table entry.
An ARP table entry refreshing device is applied to network equipment and comprises the following steps:
a receiving unit, configured to receive a data packet, where the data packet carries a source IP address and a source MAC address;
a table matching unit, configured to search, when a route from the network device to a source device of the data packet is a direct route, a first ARP table that matches the source IP address and the source MAC address in a local ARP table, where the source device is a device corresponding to the source IP address;
and the table entry refreshing unit is used for updating the table entry generation timestamp of the first ARP table entry, and the table entry generation timestamp is the timestamp for generating the first ARP table entry.
According to the technical scheme, the ARP table entries matched with the source IP address and the source MAC address of the data message can be dynamically refreshed according to the source IP address and the source MAC address of the received data message, so that even if the ARP message actively sent by the network equipment is submerged, the ARP table entries matched with the source IP address and the source MAC address of the data message can be refreshed according to the source IP address and the source MAC address of the received data message, the ARP table entries are prevented from being deleted because the ARP message actively sent by the network equipment is submerged when a large amount of data messages are transmitted, and data message forwarding interruption is avoided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart of a method provided herein;
FIG. 2 is a diagram of example 1 application networking provided herein;
fig. 3 is a flowchart illustrating an ARP entry refresh process during a non-direct route according to the present application;
FIG. 4 is a diagram of example 2 application networking provided herein;
FIG. 5 is a block diagram of the apparatus provided in the present application;
fig. 6 is a schematic hardware structure diagram of the apparatus shown in fig. 5 provided in the present application.
Detailed Description
In the existing ARP application, the refreshing of the ARP entry recorded by the network device (specifically, the entry generation timestamp updating of the ARP entry) depends on the ARP reply message received by the network device after the network device actively sends the ARP request message, but as described in the last paragraph of the background art, when a large amount of data messages are transmitted in the network, the ARP message actively sent by the network device may be submerged, which may cause the network device not to receive the ARP reply message within the set time after sending the ARP request message, and further cause the ARP entry not to be refreshed, and may be deleted when the aging time arrives, causing the data message forwarded depending on the deleted ARP entry to be temporarily interrupted and forwarded.
In order to prevent the ARP entry from being deleted due to the ARP message actively sent by the network device being submerged when a large amount of data messages are transmitted, the present application provides the flow shown in fig. 1.
Referring to fig. 1, fig. 1 is a flow chart of a method provided by the present application. The process is applied to network devices, and the network devices herein generally refer to devices such as routers and three-layer switches.
As shown in fig. 1, the process may include the following steps:
step 101, receiving a data message, wherein the data message carries a source IP address and a source MAC address.
Step 102, if the route from the network device to the source device of the data message is a direct route, finding a first ARP entry matched with the source IP address and the source MAC address in a local ARP table.
Here, the source device of the data packet refers to a device corresponding to the source IP address. As an embodiment, in the present application, whether a route from the network device to the source device of the data packet is a direct route may be determined in the following manner: and searching a route with a destination address as the source IP address in a local routing table, if the next hop of the searched route is the source IP address of the data message, determining that the route from the network equipment to the source equipment is a direct connection route, and otherwise, determining that the route from the network equipment to the source equipment is a non-direct connection route.
In routing protocols, a so-called direct route is a route of a subnet to which a local interface of a network device is connected. The direct connection route is discovered by a link layer protocol, generally refers to a path of a network segment where an interface address to a network device is located, the path information does not need to be maintained by a network administrator, and the path information does not need to be obtained by calculation of the network device through a certain algorithm. As for the non-direct routing, it will be described below, and will not be described herein again.
When the route from the network device to the source device is a direct route, as described in step 101, the network device may search for an ARP entry including the keyword in a local ARP table using the source IP address and the source MAC address as keywords, and record the found ARP entry as the first ARP entry.
Step 103, updating the entry generation timestamp of the first ARP entry, where the entry generation timestamp is the timestamp for generating the first ARP entry.
As an embodiment, in the present application, the entry generation timestamp for updating the first ARP entry may be: and updating the table entry generation timestamp of the first ARP table entry into the current timestamp. Once the entry generation timestamp of the first ARP entry is updated, the first ARP entry begins to age from the updated entry generation timestamp (current timestamp), which is equivalent to refreshing the first ARP entry.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, in the present application, the ARP entry matching the source IP address and the source MAC address of the data packet may also be dynamically refreshed according to the source IP address and the source MAC address of the received data packet, so that even if the ARP packet actively sent by the network device is submerged, the ARP entry matching the source IP address and the source MAC address of the data packet may be refreshed according to the source IP address and the source MAC address of the received data packet, thereby preventing the ARP entry from being refreshed because the network device cannot receive an ARP reply packet within a set time after sending the ARP request packet, and preventing the data packet from being interrupted in forwarding.
It should be noted that, in the application, ARP entry refresh is a software behavior. Thus, when the network device is a device for forwarding a data packet based on software, such as a low-end router, the network device may complete the refresh of the ARP entry (specifically, update of the entry generation timestamp of the ARP entry) in the process of forwarding the data packet.
When the network device is a device forwarded based on a hardware chip, such as a three-layer switch, the hardware chip and the CPU need to cooperate with each other to complete the refresh of the ARP entry (specifically, update of the entry generation timestamp of the ARP entry), which is described below by a specific embodiment:
referring to fig. 2, fig. 2 is a networking diagram of the application of embodiment 1 provided in the present application. In fig. 2, the network device 200 is a hardware chip forwarding-based device, where the hardware chip may be a Network Processor (NP). The network device 200 further includes: a CPU.
In fig. 2, the network device 200 locally records an ARP entry (denoted as ARP entry 2_1) corresponding to the Host (Host) 201. The ARP entry 2_1 is obtained by the network device 200 through learning based on a message sent by the Host201, such as an ARP request message, and may specifically include: the IP address 10.152.8.150 of Host201, and the MAC address 0001-ff34-5678 of Host 201.
As shown in FIG. 2, network device 200 local interface Port10 (not shown in FIG. 2) receives a data packet (denoted as packet 200_ a) from Host201 to Host 202. The source IP address of the message 200_ a is the IP address 10.152.8.150 of Host201, and the source MAC address is the MAC address 0001-ff34-5678 of Host 201.
The network device 200 copies a packet 200_ a when the local hardware chip NP checks that an ACL entry matching the source IP address and the source MAC address of the packet 200_ a exists in the local Access Control List (ACL). For convenience of description, the copied message is denoted as message 200_ b. In this embodiment, the ACL may be specified by the user according to the ARP table locally recorded by the network device 200, or may be dynamically generated by software in the network device 200, such as a CPU, according to the ARP table locally recorded by the network device 200, and this embodiment is not particularly limited.
It should be noted that, in the present embodiment, 200_ b is to be sent to the CPU, which is specifically described below. In order to reduce the impact of a large number of messages on the CPU, in this embodiment, the local hardware chip NP of the network device 200 may sample the messages to be copied at a specified sampling rate, for example, copy one data message matching the ACL every 10000 data messages matching the ACL.
The network device 200 finds a routing table entry for forwarding the packet 200_ a in the local routing table by the local hardware chip NP, and forwards the packet 200_ a according to the found routing table entry. For one embodiment, the routing table may be a Forwarding Information database (FIB), and the routing table entry is correspondingly a FIB table entry.
The network device 200 local hardware chip NP sends the message 200_ b to the CPU. The CPU finds that the next hop from the local device to the routing entry of the source device Host201 of the message 200_ a in the local routing table is the source device Host201 of the message 200_ a, and if the local network device 200 is directly connected to the source device Host201, finds out an ARP entry 2_1 matching with the source IP address 10.152.8.150 and the source MAC address 0001-ff34-5678 of the message 200_ a in the local ARP table, and updates the entry generation timestamp of the ARP entry 2_1 to be the current timestamp. So far, the ARP entry 2_1 starts to age again from the current timestamp until the aging time is over.
The description of embodiment 1 is completed so far.
The above description takes the case where the route from the network device to the source IP address of the data packet is a direct route as an example, and the following description describes the case where the route from the network device to the source IP address of the data packet is a non-direct route.
Here, the non-direct routes are classified into Static routes (Static) and Dynamic routes (Dynamic).
The static routing is routing information configured on the network device by a network planner according to a network topology by using a command, the static routing information guides message transmission, and a static routing mode does not need the network device to calculate, but the static routing mode completely depends on the network planner.
The dynamic routing is routing information automatically calculated by the network equipment according to a routing protocol and adapts to the change of a network topological structure. Examples of the Routing Protocol include an Open Shortest Path First (OSPF) Protocol, a Routing Information Protocol (RIP) Protocol, and the like, for an Autonomous System (AS).
In the application, the ARP table entry associated with the dynamic route (the IP address of the next hop of the route is the IP address in the ARP table entry) does not depend on the data message refresh, while the ARP table entry associated with the static route (the IP address of the next hop of the route is the IP address in the ARP table entry) has the static route reference attribute set for the table entry attribute, and relies on the data message refresh when the table entry state is the state to be deleted. Here, the entry state of the ARP entry associated with the static route is a to-be-deleted state, which is described below.
How to rely on data message refresh when the entry state is to-be-deleted state of the ARP entry (the IP address of the next hop of the route is the IP address in the ARP entry) associated with the static route is described below:
with reference to step 101 shown in fig. 1, if the route from the network device to the source device in step 102 is a non-direct route, as shown in fig. 3, the method may further include the following steps:
step 301, finding out a second ARP entry matching the source MAC address of the data packet in a local ARP table.
Here, the second ARP entry is named for convenience of description only and is not intended to be limiting.
Step 302, if the entry attribute of the second ARP entry is a static route reference attribute and the entry state of the second ARP entry is set to a to-be-deleted state, updating the entry generation timestamp of the second ARP entry.
Here, if the entry attribute of the second ARP entry is a static route reference attribute, it means that the route whose next hop IP address is the IP address in the second ARP entry is a static route. The entry state of the second ARP entry is set to a to-be-deleted state on the premise that the entry generation timestamp of the second ARP entry is not updated when the aging time of the second ARP entry is reached.
It should be noted that, in step 302, even if the entry attribute of the second ARP entry is the static route reference attribute, if the entry state of the second ARP entry is not set to the state to be deleted (for example, to be a normal state), the entry generation timestamp of the second ARP entry is not updated at this time.
As can be seen from fig. 3, when the route from the network device to the source IP address of the data packet is a non-direct route, if the entry attribute of the second ARP entry matched with the source MAC address of the data packet is a static route reference attribute and the entry state of the second ARP entry is set to a to-be-deleted state, the entry of the second ARP entry is updated to generate a timestamp, so that the ARP entry corresponding to the static route can also be refreshed according to the data packet (specifically, the entry of the ARP entry generates the timestamp is updated).
In this application, for any ARP entry associated with a static route (including the second ARP entry, which is described as an example), a delay aging manner is adopted to delay aging, specifically: and when the aging time of the second ARP table entry recorded locally is monitored to be reached and the table entry generation timestamp of the second ARP table entry is not updated, maintaining the second ARP table entry (which can be continuously used) and setting the table entry state of the second ARP table entry to be a state to be deleted. Here, that the entry generation timestamp of the second ARP entry has not been updated means that: after the ARP request message sent before the aging time of the second ARP table entry reaches, the ARP response message is not received yet.
In the application, the network equipment sends the ARP request message within the preset time after the table entry state of a second ARP table entry is set to be a state to be deleted, wherein the ARP request message can be sent regularly, the target IP address of the ARP request message is the IP address in the second ARP table entry, and the target MAC address is the MAC address in the second ARP table entry;
if an ARP reply message of the ARP request message is received within the preset time, the IP address of the sending end of the ARP reply message is the IP address in the second ARP table entry, and the MAC address of the sending end is the MAC address in the second ARP table entry, updating the table entry of the second ARP table entry to generate a timestamp, and updating the table entry state of the second ARP table entry from the state to be deleted to the normal state, otherwise, deleting the second ARP table entry when the preset time is over.
In this application, the ARP entry (denoted as the third ARP entry) associated with the dynamic route is refreshed depending on the routing protocol packet, which specifically includes:
the network equipment receives a routing protocol message; the routing protocol message is sent by the neighbor equipment;
searching a third ARP table item matched with the source IP address and the source MAC address of the routing protocol message in a local ARP table;
and updating the table entry generation timestamp of the third ARP table entry.
Here, as an embodiment, the entry generation timestamp for updating the third ARP entry may be: and updating the table entry generation timestamp of the third ARP table entry to be the current timestamp. Once the entry generation timestamp of the third ARP entry is updated, the third ARP entry begins to age from the updated entry generation timestamp (current timestamp), which is equivalent to refreshing the third ARP entry.
The above describes how to refresh the ARP entry when the non-direct route is routed, and the following describes through an example embodiment:
referring to fig. 4, fig. 4 is a graph of example 2 application networking provided by the present application. In fig. 4, network device 402 serves as an access gateway for Host400, and network device 401 is not directly connected to Host 400. For the network device 401, the data packet reaching the Host400 needs to reach the Host400 through the following routes: network device 401- > network device 402- > Host 400.
The network device 401 does not locally have the ARP entry of Host400, and there is an ARP entry (denoted as ARP entry 4_2) of the neighboring device, i.e., network device 402. The ARP entry 4_2 includes an IP address of 2.2.2.20 for network device 402 and a MAC address of 0001-ff34-0001 for network device 402. Table 1 shows ARP table entry 4_ 2:
IP address MAC address
2.2.2.20 0001-ff34-0001
TABLE 1
Network device 401 has a routing entry (denoted as routing entry 4_0) to Host 400. The IP address of the routing table entry 4_0 is the IP address 10.152.8.150 of Host400 and the next hop is the IP address 2.2.2.20 of network device 402. Table 2 shows the routing table entry 4_ 0:
IP address Next hop
10.152.8.150 2.2.2.20
TABLE 2
The route (denoted as route 1_0) from the network device 401 to the Host400 may be issued by the network device 402 to the network device 401 through a routing protocol, or may be configured at the network device 401. The following are described separately:
1): route 1_0 is issued by network device 402 to network device 401 via a routing protocol:
in this application, the network device 402 periodically issues a route 1_0 to the network device 401 through a routing protocol packet, where a source IP address of the routing protocol packet is the IP address 2.2.2.20 of the network device 402, and a source MAC address is the MAC address 0001-ff34-0001 of the network device 402.
When the network device 401 receives a routing protocol message, finding out an ARP table entry 4_2 matched with a source IP address 2.2.2.20 and a source MAC address 0001-ff34-0001 of the routing protocol message in a local ARP table; and updating the table entry generation timestamp of the ARP table entry 4_2 to be the current timestamp. To this end, the ARP entry 4_2 starts to age again from the current timestamp until the aging time is over.
2): route 1_0 is configured at network device 401:
if the route 1_0 is configured in the network device 401, the network device 402 will not issue the route 1_0 to the network device 401 through the routing protocol packet, in this case, the ARP entry 4_2 associated with the route 1_0 (the IP address of the ARP entry 4_2 is the next hop of the route 1_0) is found first in this embodiment, and the entry attribute of the ARP entry 4_2 is set as the static route reference attribute.
Then, before the aging time of the ARP entry 4_2 reaches (for example, the previous 1 minute), the network device 401 may send an ARP request message, and if the network device 401 does not receive an ARP reply message of the ARP request message when the aging time of the ARP entry 4_2 reaches, the network device 401 does not delete the ARP entry 4_2, but delays the aging of the ARP entry 4_2, and allows the ARP entry 4_2 to be used continuously, but needs to set the entry state of the ARP entry 4_2 to a state to be deleted.
After the entry state of the ARP entry 4_2 is set to the to-be-deleted state, if the network device 401 receives a data packet and the source MAC address of the data packet is the MAC address 0001-ff34-0001 of the network device 402, and the network device 401 finds that the entry state of the ARP entry 4_2 matching the data packet is set to the to-be-deleted state, the entry generation timestamp of the ARP entry 4_2 is updated.
In the application, within a preset time after the entry state of the ARP entry 4_2 is set to the state to be deleted, the network device 401 sends an ARP request message at regular time and waits for a response;
if the ARP response message is received within the preset time, the list item of the ARP list item 4_2 is updated to generate a time stamp, and the list item state of the ARP list item 4_2 is updated from the state to be deleted to the normal state.
And if the ARP response message is not received within the preset time, deleting the ARP table entry 4_ 2.
Thus, the description of the embodiments of the present application is completed.
The method provided by the present application is described above, and the device provided by the present application is described below:
referring to fig. 5, fig. 5 is a diagram illustrating a structure of the apparatus according to the present invention. The device is applied to network equipment and comprises:
a receiving unit, configured to receive a data packet, where the data packet carries a source IP address and a source MAC address;
a table matching unit, configured to search, when a route from the network device to a source device of the data packet is a direct route, a first ARP table that matches the source IP address and the source MAC address in a local ARP table, where the source device is a device corresponding to the source IP address;
and the table entry refreshing unit is used for updating the table entry generation timestamp of the first ARP table entry, and the table entry generation timestamp is the timestamp for generating the first ARP table entry.
As an embodiment, when a route from the local network device to the source device of the data packet is a non-direct route, the entry matching unit further searches a second ARP entry matching the source MAC address in a local ARP table, and updates an entry generation timestamp of the second ARP entry if the entry attribute of the second ARP entry is a static route reference attribute and the entry state of the second ARP entry is set to a to-be-deleted state.
As an embodiment, the entry refreshing unit further maintains the second ARP entry and sets the entry state of the second ARP entry to a state to be deleted when it is monitored that the locally recorded aging time of the second ARP entry arrives and the entry generation timestamp of the second ARP entry is not updated.
As an embodiment, the entry refreshing unit further sends an ARP request message within a predetermined time after the entry state of the second ARP entry is set to a to-be-deleted state, where a destination IP address of the ARP request message is an IP address in the second ARP entry, and a destination MAC address is an MAC address in the second ARP entry;
if an ARP reply message of the ARP request message is received within the preset time, the IP address of the sending end of the ARP reply message is the IP address in the second ARP table entry, and the MAC address of the sending end is the MAC address in the second ARP table entry, updating the table entry of the second ARP table entry to generate a timestamp, and updating the table entry state of the second ARP table entry from the state to be deleted to the normal state, otherwise, deleting the second ARP table entry when the preset time is over.
As an embodiment, the receiving unit further receives a routing protocol packet;
the table item matching unit further searches a third ARP table item which is matched with the source IP address and the source MAC address of the routing protocol message in a local ARP table;
and the table entry refreshing unit further updates the table entry generation timestamp of the third ARP table entry.
Thus, the apparatus configuration diagram shown in fig. 5 is completed.
Referring to fig. 6, fig. 6 is a schematic diagram of a hardware structure of the apparatus shown in fig. 5 provided in the present application. As shown in fig. 6, the hardware architecture may include a processor, a machine-readable storage medium having stored thereon machine-executable instructions. The processor and the machine-readable storage medium may communicate via a system bus. The machine-readable storage medium stores machine-executable instructions capable of being executed by the processor, and the processor can implement the ARP entry refreshing method by loading and executing the machine-executable instructions stored in the machine-readable storage medium.
The present application also provides a machine-readable storage medium comprising machine-executable instructions, for example, which store the machine-executable instructions. The machine executable instructions, when invoked and executed by a processor, cause the processor to implement the ARP entry refresh method described above.
A machine-readable storage medium as referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be volatile memory, non-volatile memory, or similar storage medium. In particular, the machine-readable storage medium may be a RAM (random Access Memory), a flash Memory, a storage drive, a solid state drive, any type of storage disk, or similar storage medium, or a combination thereof.
It should be noted that, in the present application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (8)

1. An ARP table entry refreshing method is applied to network equipment and comprises the following steps:
receiving a data message, wherein the data message carries a source IP address and a source MAC address;
if the route from the network equipment to the source equipment of the data message is a direct route, searching a first ARP table item matched with the source IP address and the source MAC address in a local ARP table, wherein the source equipment is equipment corresponding to the source IP address, updating a table item generation timestamp of the first ARP table item, and the table item generation timestamp is the timestamp for generating the first ARP table item;
if the route from the network equipment to the source equipment of the data message is a non-direct route, searching a second ARP table item matched with the source MAC address in a local ARP table, and if the table item attribute of the second ARP table item is a static route reference attribute and the table item state of the second ARP table item is set to be a state to be deleted, updating the table item of the second ARP table item to generate a timestamp.
2. The method of claim 1, further comprising:
and when the aging time of the second ARP table entry recorded locally is monitored to be reached and the table entry generation timestamp of the second ARP table entry is not updated, maintaining the second ARP table entry and setting the table entry state of the second ARP table entry to be a state to be deleted.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
sending an ARP request message within a preset time after the table entry state of the second ARP table entry is set to be a state to be deleted, wherein the target IP address of the ARP request message is the IP address in the second ARP table entry, and the target MAC address is the MAC address in the second ARP table entry;
if an ARP response message of the ARP request message is received within the preset time, the IP address of the sending end of the ARP response message is the IP address in the second ARP table entry, and the MAC address of the sending end is the MAC address in the second ARP table entry, updating the table entry of the second ARP table entry to generate a timestamp, and updating the table entry state of the second ARP table entry from the state to be deleted to the normal state, otherwise, deleting the second ARP table entry when the preset time is over.
4. The method of claim 1, further comprising:
receiving a routing protocol message;
searching a third ARP table item matched with the source IP address and the source MAC address of the routing protocol message in a local ARP table;
and updating the table entry generation timestamp of the third ARP table entry.
5. An ARP table entry refreshing device is applied to a network device and comprises:
a receiving unit, configured to receive a data packet, where the data packet carries a source IP address and a source MAC address;
a table matching unit, configured to search, when a route from the network device to a source device of the data packet is a direct route, a first ARP table that matches the source IP address and the source MAC address in a local ARP table, where the source device is a device corresponding to the source IP address;
the table entry refreshing unit is used for updating a table entry generation timestamp of the first ARP table entry, wherein the table entry generation timestamp is the timestamp for generating the first ARP table entry;
the entry matching unit is further configured to, when a route from the network device to the source device of the data packet is a non-direct route, find a second ARP entry matching the source MAC address in a local ARP table, and update an entry generation timestamp of the second ARP entry if the entry attribute of the second ARP entry is a static route reference attribute and the entry state of the second ARP entry is set to a state to be deleted.
6. The apparatus according to claim 5, wherein the entry refreshing unit further maintains the second ARP entry and sets the entry status of the second ARP entry to a to-be-deleted status when it is monitored that the locally recorded aging time of the second ARP entry is reached and the entry generation timestamp of the second ARP entry is not updated.
7. The apparatus according to claim 5 or 6, wherein the entry refreshing unit further sends an ARP request message within a predetermined time after the entry status of the second ARP entry is set to a to-be-deleted status, where a destination IP address of the ARP request message is an IP address in the second ARP entry, and a destination MAC address is an MAC address in the second ARP entry;
if an ARP reply message of the ARP request message is received within the preset time, the IP address of the sending end of the ARP reply message is the IP address in the second ARP table entry, and the MAC address of the sending end is the MAC address in the second ARP table entry, updating the table entry of the second ARP table entry to generate a timestamp, and updating the table entry state of the second ARP table entry from the state to be deleted to the normal state, otherwise, deleting the second ARP table entry when the preset time is over.
8. The apparatus of claim 5, wherein the receiving unit further receives a routing protocol packet;
the table item matching unit further searches a third ARP table item which is matched with the source IP address and the source MAC address of the routing protocol message in a local ARP table;
and the table entry refreshing unit further updates the table entry generation timestamp of the third ARP table entry.
CN201810911499.XA 2018-08-10 2018-08-10 ARP table item refreshing method and device Active CN109274781B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810911499.XA CN109274781B (en) 2018-08-10 2018-08-10 ARP table item refreshing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810911499.XA CN109274781B (en) 2018-08-10 2018-08-10 ARP table item refreshing method and device

Publications (2)

Publication Number Publication Date
CN109274781A CN109274781A (en) 2019-01-25
CN109274781B true CN109274781B (en) 2022-04-26

Family

ID=65153395

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810911499.XA Active CN109274781B (en) 2018-08-10 2018-08-10 ARP table item refreshing method and device

Country Status (1)

Country Link
CN (1) CN109274781B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113810511B (en) * 2021-08-06 2024-03-19 锐捷网络股份有限公司 ARP table updating method and device
CN116032824A (en) * 2022-12-16 2023-04-28 中国联合网络通信集团有限公司 Processing method, gateway component, server, medium and system for routing data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101909065A (en) * 2010-08-13 2010-12-08 北京中创信测科技股份有限公司 Network equipment and aging update method of ARP (Address Resolution Protocol) table in same
CN101938533A (en) * 2010-09-10 2011-01-05 中兴通讯股份有限公司 Method and device for processing address resolution
US9118608B2 (en) * 2013-02-08 2015-08-25 Canon Kabushiki Kaisha Communication apparatus, control method therefor, and computer-readable storage medium
CN106161461A (en) * 2016-08-29 2016-11-23 东软集团股份有限公司 A kind of processing method and processing device of ARP message

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101909065A (en) * 2010-08-13 2010-12-08 北京中创信测科技股份有限公司 Network equipment and aging update method of ARP (Address Resolution Protocol) table in same
CN101938533A (en) * 2010-09-10 2011-01-05 中兴通讯股份有限公司 Method and device for processing address resolution
US9118608B2 (en) * 2013-02-08 2015-08-25 Canon Kabushiki Kaisha Communication apparatus, control method therefor, and computer-readable storage medium
CN106161461A (en) * 2016-08-29 2016-11-23 东软集团股份有限公司 A kind of processing method and processing device of ARP message

Also Published As

Publication number Publication date
CN109274781A (en) 2019-01-25

Similar Documents

Publication Publication Date Title
US8204060B2 (en) Method and system for facilitating forwarding a packet in a content-centric network
US9686194B2 (en) Adaptive multi-interface use for content networking
US9525631B2 (en) Packet forwarding method, apparatus, and system
CN107800625B (en) Message forwarding method and device
US20150326526A1 (en) Keeping a terminal access location record alive
US20190342258A1 (en) Forwarding information to forward data to proxy devices
CN110505621B (en) Terminal migration processing method and device
CN106878288B (en) message forwarding method and device
CN101820397A (en) Network convergence method and device in virtual private local area network
JP5625121B2 (en) Prioritizing routing information updates
CN109274781B (en) ARP table item refreshing method and device
CN108540386B (en) Method and device for preventing service flow interruption
CN110430131B (en) Message forwarding method and device
WO2022048646A1 (en) Virtual ip management method and apparatus, electronic device and storage medium
US8254383B2 (en) Method and system for routing using multi-stage route entry lookup
US20230093310A1 (en) Methods for updating route, access device, and convergence device
CN109862137B (en) Message transmission method and device
JP2000332813A (en) Selection method for start point address in communication network system, selector and storage medium recording this method
CN113839895B (en) Message forwarding method and device
CN111556179B (en) ARP (Address resolution protocol) table entry updating method and device
JP4365869B2 (en) ROUTE INFORMATION CHANGE METHOD, ROUTE INFORMATION CHANGE DEVICE, AND ROUTE INFORMATION CHANGE PROGRAM
JPWO2005020525A1 (en) Protocol acceleration device
JP2017005516A (en) Communication device, control method for the same, and computer program
CN107547406B (en) Method and device for establishing FIB table in distributed EVPN gateway networking
CN111954102B (en) Routing control method and device in DHCPV6 PD scene

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
GR01 Patent grant
GR01 Patent grant