CN107147581B - Maintenance method and device for routing table entry - Google Patents
Maintenance method and device for routing table entry Download PDFInfo
- Publication number
- CN107147581B CN107147581B CN201710493247.5A CN201710493247A CN107147581B CN 107147581 B CN107147581 B CN 107147581B CN 201710493247 A CN201710493247 A CN 201710493247A CN 107147581 B CN107147581 B CN 107147581B
- Authority
- CN
- China
- Prior art keywords
- routing table
- table entry
- address
- mac address
- detail
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/02—Topology update or discovery
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
- H04L45/748—Address table lookup; Address filtering using longest matching prefix
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application provides a method and a device for maintaining a routing table entry, comprising the following steps: aiming at a message sent to a target device, searching a routing table item hit by a target IP address of the message in a local routing table based on a longest matching principle, and judging whether the routing table item is a direct routing table item or not; if the routing table entry is a direct routing table entry, judging whether the MAC address of the target device is stored in a local MAC address table according to the target IP address; if the MAC address is not stored, acquiring the MAC address of the target equipment based on an ARP request; configuring a detailed routing table item for the destination IP address based on the MAC address; the detail routing table entry includes the detail information of the target device, and the subnet mask length of the network segment information in the detail routing table entry is 32 bits. According to the technical scheme, the message processing efficiency can be improved, the message transmission rate is increased, and meanwhile, the message transmission is guaranteed not to be mistaken.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for maintaining a routing table entry.
Background
Routing is a basic function of the network device, and the routing table entry may include a direct routing table entry and a non-direct routing table entry. The non-direct-connection routing table item usually stores network segment information, outgoing interface information and a next hop IP address, and the direct-connection routing table item usually stores only the network segment information and the outgoing interface information.
When receiving a message sent to a target device, a network device may first search for a hit routing table entry in a local routing table according to a destination IP address of the message. If the destination IP address of the packet hits the direct routing table entry, the network device may continue to search for the next-hop MAC address in the local MAC address table according to the destination IP address of the packet. The subsequent network device can modify the destination MAC address of the message into the found next-hop MAC address, and send the message to the target device according to the egress interface information in the direct-connected routing table entry. Therefore, for the message of which the destination IP address hits the direct routing table entry, the network device needs to search forwarding information such as the next-hop MAC address of the message for many times, so that the processing efficiency of the network device on the message is low, and the transmission rate of the message is also affected.
Disclosure of Invention
In view of this, the present application provides a method and an apparatus for maintaining a routing table entry. Specifically, the method is realized through the following technical scheme:
in a first aspect, the present application provides a method for maintaining a routing table entry, where the method includes:
aiming at a message sent to a target device, searching a routing table item hit by a target IP address of the message in a local routing table based on a longest matching principle, and judging whether the routing table item is a direct routing table item or not;
if the routing table entry is a direct routing table entry, judging whether the MAC address of the target device is stored in a local MAC address table according to the target IP address;
if the MAC address is not stored, acquiring the MAC address of the target equipment based on an ARP request;
configuring a detailed routing table item for the destination IP address based on the MAC address;
the detail routing table entry includes the detail information of the target device, and the subnet mask length of the segment information in the detail routing table entry is 32 bits.
In a second aspect, the present application provides an apparatus for maintaining a routing table entry, where the apparatus includes:
the searching unit is used for searching a routing table item hit by a destination IP address of a message in a local routing table based on a longest matching principle aiming at the message sent to a target device and judging whether the routing table item is a direct connection routing table item or not;
a first determining unit, configured to determine, when the routing table entry is a direct routing table entry, whether an MAC address of the target device is stored in a local MAC address table according to the destination IP address;
an obtaining unit, configured to obtain, based on an ARP request, an MAC address of the target device when the MAC address is not stored;
a first configuration unit, configured to configure a detailed routing table entry for the destination IP address based on the MAC address;
the detail routing table entry includes the detail information of the target device, and the subnet mask length of the segment information in the detail routing table entry is 32 bits.
By analyzing the above technical scheme, the network device determines whether the destination IP address of the packet meets the requirement for configuring the detailed routing table entry, and configures the detailed routing table entry for the destination IP address meeting the requirement, so as to quickly obtain forwarding information such as the next-hop MAC address of the packet, instead of configuring the detailed routing table entry for the destination IP address not meeting the requirement, which can improve the packet processing efficiency of the network device, accelerate the packet transmission rate, and ensure that no error occurs in the packet transmission of the network device.
Drawings
Fig. 1 is a flowchart illustrating a method for maintaining a routing table entry according to an exemplary embodiment of the present application;
FIG. 2 is a flowchart illustrating another method for maintaining routing table entries according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart illustrating another method for maintaining routing table entries according to an exemplary embodiment of the present application;
FIG. 4 is a flowchart illustrating another method for maintaining routing table entries according to an exemplary embodiment of the present application;
fig. 5 is a hardware structure diagram of a device where a maintenance apparatus for a routing table entry is located according to an exemplary embodiment of the present application;
fig. 6 is a block diagram illustrating an apparatus for maintaining routing table entries according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to improve the message processing efficiency of the network device, in the related art, the routing table entry stored in the network device may be optimized, for example: detailed routing table entries may be configured for certain IP addresses within a directly connected segment of a network device. The detail routing table entry usually stores network segment information, egress interface information, and detail information of the target device. The length of the subnet mask of the network segment information is 32 bits, and the detail information of the target device may include, in addition to the next-hop IP address (i.e., the IP address of the target device), an association relationship between the detail routing table entry and the MAC address table entry corresponding to the next-hop IP address, where the association relationship may be an index value of the MAC address table entry in the local MAC address table; alternatively, the MAC address table entry may be a storage address in the memory. In practical applications, the detailed information of the target device may also include a next-hop IP address and a next-hop MAC address (i.e., a MAC address of the target device).
By adopting the mode, when the network equipment receives the message sent to the target equipment, if the target IP address of the message is found to hit the detailed routing table item in the local routing table based on the longest matching principle, the network equipment can directly determine the next hop IP address of the message through the detailed routing table item and quickly obtain the next hop MAC address of the message, and does not need to search the corresponding MAC address table item in the local MAC address table according to the target IP address of the message to obtain the next hop MAC address of the message, thereby improving the processing efficiency of the network equipment on the message and accelerating the transmission rate of the message.
For example, if the network device finds that the IP address 1.2.3.5 hits the network segment information of 1.2.3.0/24 and the outgoing interface information is the direct-connection routing table entry of the interface 1 in the local routing table based on the longest match principle when receiving the message addressed to the target device with the IP address 1.2.3.5, the network device may continue to find the MAC address of the target device in the local MAC address table according to the IP address 1.2.3.5. Assuming that the MAC address of the target device is found to be MAC address 1, the network device may modify the destination MAC address of the packet to MAC address 1, and then send the modified packet to the target device through the interface 1.
It is assumed that a detailed routing table entry is configured for the IP address 1.2.3.5, the network segment information of the detailed routing table entry is 1.2.3.5/32, the outgoing interface information is interface 1, and the detailed information of the target device includes the next-hop IP address 1.2.3.5 and the association relationship between the detailed routing table entry and the MAC address table entry corresponding to the IP address 1.2.3.5. As shown in table 1 below, is an example of a detailed routing table configured for IP address 1.2.3.5:
TABLE 1
The detail information of the target device includes an index value 50, which indicates a MAC address table entry associated with the detail routing table entry, and the index value in the local MAC address table is 50 (that is, the MAC address table entry is the 50 th table entry in the local MAC address table). Alternatively, the detail information of the target device may also include a storage address 1, which indicates a MAC address table entry associated with the detail routing table entry, and the storage address in the memory is the storage address 1.
After configuring the detailed routing table entry for the IP address 1.2.3.5, when the network device receives the message addressed to the target device with the IP address 1.2.3.5, the detailed routing table entry shown in table 1 in the IP address 1.2.3.5 can be found in the local routing table based on the longest matching principle. Through the detail routing table entry, the network device can directly determine that the next hop IP address of the packet is the IP address 1.2.3.5, and can also quickly determine that the IP address 1.2.3.5 corresponds to the 50 th MAC address table entry in the local MAC address table according to the index value 50 in the detail information of the target device. Assuming that the MAC address stored in the MAC address table entry is MAC address 1, the network device can quickly obtain that the MAC address of the target device is MAC address 1, without searching the MAC address of the target device in the local MAC address table entry according to the IP address 1.2.3.5. Subsequently, the network device may modify the destination MAC address of the packet to MAC address 1, and then send the modified packet to the target device through the interface 1.
However, in some special cases, it may be necessary to configure static routing table entries for some direct connection segments to guide forwarding based on traffic needs. The subnet mask length of the network segment information in the static routing table entry is greater than the subnet mask length of the network segment information in the direct routing table entry hit by the direct connection network segment, so that the network device can hit the static routing table entry based on the longest matching principle when receiving the message of which the destination IP address belongs to the direct connection network segment, and the message can be forwarded according to the static routing table entry.
Continuing with the above example as an example, assume that a static routing table entry is configured for the direct connection segment 1.2.3.0/24, the segment information of the static routing table entry is 1.2.3.0/28, the outgoing interface information is interface 3, the next-hop IP address is 5.6.7.8, and the MAC address of the target device with IP address 5.6.7.8 is MAC address 2. After configuring the static routing table entry for the direct connection segment 1.2.3.0/24, when the network device receives the message addressed to the IP address 1.2.3.5, based on the longest match principle, the network device may find out that the IP address 1.2.3.5 hits the static routing table entry in the local routing table. Subsequently, after modifying the destination MAC address of the packet to MAC address 2, the network device may send the modified packet to the destination device with IP address 5.6.7.8.
Under the above situation, if a detailed routing table entry is configured for the IP address 1.2.3.5, because the network device always follows the longest matching principle when searching for the routing table entry, when the network device receives a message with a destination IP address of 1.2.3.5, the network device searches for the routing table entry hit by the IP address 1.2.3.5 as the detailed routing table entry in the local routing table, and after modifying the destination MAC address of the message to the MAC address 1, sends the modified message to the target device with the IP address of 1.2.3.5. That is, at this time, the forwarding is not performed according to the configured static route, which results in an error problem in message transmission.
In order to avoid the above problem, the present application provides a method for maintaining a routing table entry, in which a network device first determines whether a certain IP address meets a requirement for configuring a detailed routing table entry, and then configures a detailed routing table entry for the IP address that meets the requirement. Referring to fig. 1, a flowchart of a method for maintaining a routing table entry according to an exemplary embodiment of the present application is shown, where the method may be applied to a network device, and includes the following steps:
step 101: aiming at a message sent to a target device, searching a routing table item hit by a target IP address of the message in a local routing table based on a longest matching principle, and judging whether the routing table item is a direct routing table item.
Step 102: and if the routing table entry is a direct routing table entry, judging whether the MAC address of the target equipment is stored in a local MAC address table according to the target IP address.
Step 103: and if the MAC address is not stored, acquiring the MAC address of the target equipment based on the ARP request.
Step 104: and configuring a detailed routing table item for the destination IP address based on the MAC address.
When receiving a message sent to a target device, a network device may search, based on a longest matching principle, a local routing table for a routing table entry hit by a destination IP address of the message, that is, a routing table entry hit by the destination IP address of the message and having a subnet mask with a longest length. After finding the routing table entry with the longest subnet mask length hit by the IP address, the network device may determine whether the routing table entry is a direct routing table entry. For example, the network device may determine whether the routing table entry is a direct routing table entry according to whether the routing table entry includes a next hop IP address.
If the network device determines that the routing table entry is a direct routing table entry, the network device may further determine whether the IP address meets the requirement for configuring a detailed routing table entry. Specifically, the network device may determine whether the IP address meets the requirement of configuring the detailed routing table entry according to whether a MAC address table entry corresponding to the IP address is stored in the local MAC address table, that is, whether the MAC address of the target device is stored.
Generally, when a network device transmits a message, it is necessary to determine a next-hop MAC address of the message, so as to modify a destination MAC address of the message into the next-hop MAC address. Thus, if the network device receives a message addressed to a certain target device, the MAC address of the target device is not found in the local MAC address table according to the destination IP address of the message, which indicates that the target device may be a network device such as a host or a router newly added to the networking, and a detailed routing table entry is not configured for the IP address of the target device before. In this case, the network device may determine that the IP address meets the requirements of the configuration detail routing table entry.
Or, if the network device needs to send a packet to a certain target device, and the MAC address of the target device is not found in the local MAC address table according to the IP address of the target device, it also indicates that the target device may be a network device such as a host or a router that newly joins a networking, and a detailed routing table entry has not been configured for the IP address of the target device before. In this case, the network device may also determine that the IP address meets the requirements for configuring detailed routing table entries.
The detail routing table entry usually stores network segment information, egress interface information, and detail information of the target device. The subnet mask of the network segment information has a length of 32 bits, and the detail information of the target device may include, in addition to the next hop IP address, an association relationship between the detail routing table entry and a MAC address table entry corresponding to the next hop IP address or the MAC address of the target device.
At this time, since the MAC Address of the target device is not stored in the local MAC Address table, the network device may send an ARP (Address Resolution Protocol) request packet to the target device to request the MAC Address of the target device. When receiving the ARP request message, the target device may return an ARP reply message to the network device to reply to its MAC address. When the network device receives the ARP response message, the MAC address of the target device can be obtained, and an MAC address table item comprising the corresponding relation between the IP address and the MAC address of the target device is generated and stored in a local MAC address table.
After the network device obtains the MAC address of the target device, it may configure a detailed routing table entry for the IP address of the target device based on the MAC address of the target device. The detailed routing table entry may be generated by the network device itself and stored in the local routing table, taking the IP address 1.2.3.5 as an example, assuming that the original IP address hits the network segment information of 1.2.3.0/24, the outgoing interface information is the direct routing table entry of interface 1, and assuming that the MAC address of the target device with the IP address of 1.2.3.5 is MAC address 1, the network device may generate the detailed routing table entry shown in table 2 below:
TABLE 2
Similar to the related art, in the detail routing table entry, the detail information of the target device may directly include the next hop MAC address, or may also include an association relationship between the detail routing table entry and the MAC address table entry corresponding to the next hop IP address. Wherein, the association relationship may be an index value of the MAC address table entry in the local MAC address table; alternatively, the MAC address table entry may be a storage address in the memory.
Through the association relationship between the detailed routing table entry and the MAC address table entry corresponding to the IP address in the detailed routing table entry configured for the IP address of the target device, or the directly stored MAC address of the target device, when the network device receives the message sent to the target device, the network device can quickly acquire forwarding information such as the next-hop MAC address of the message, so that the processing efficiency of the network device on such messages can be improved, and the transmission rate of such messages can be increased.
On the other hand, if the network device determines that the routing table entry hit by the destination IP address of the packet is not a direct routing table entry, for example: if the static routing table entry is hit, if a detailed routing table entry is configured for the destination IP address, an error in message forwarding may be caused. Therefore, the network device cannot configure the detailed routing table entry for the IP address, i.e., the IP address does not comply with the requirement of configuring the detailed routing table entry.
As can be seen from the above embodiments, the network device determines whether the destination IP address of the packet meets the requirement for configuring the detailed routing table entry, and configures the detailed routing table entry for the destination IP address meeting the requirement, so as to quickly obtain forwarding information such as the next-hop MAC address of the packet, instead of configuring the detailed routing table entry for the destination IP address that does not meet the requirement, which can improve the packet processing efficiency of the network device, accelerate the packet transmission rate, and ensure that no error occurs in the packet transmission of the network device.
Corresponding to the embodiment shown in fig. 1, please refer to fig. 2, which is a flowchart of another method for maintaining a routing table entry according to an exemplary embodiment of the present application, where the method may also be applied to a network device, and includes the following steps:
step 201: and judging whether the destination IP address hits a detailed routing table entry or not after the MAC address table entry corresponding to the destination IP address is aged.
Step 202: and if the destination IP address hits the detail routing table entry, deleting the detail routing table entry.
Generally, all MAC address table entries stored in a local MAC address table have aging time, and if the network device does not receive a message with a destination IP address being a certain IP address within a period of time, and does not send a message with the destination IP address being the IP address, the network device may delete the MAC address table entry after the MAC address table entry corresponding to the IP address reaches the aging time. In practical applications, after the MAC address table entry ages, the forwarding policy for the IP address may change, for example: after the MAC address table entry is aged, the MAC address of the target device may change.
With reference to the embodiment shown in fig. 1, after the MAC address table entry corresponding to the destination IP address is aged, the network device may determine whether the IP address hits the detailed routing table entry, that is, whether the detailed routing table entry is configured for the destination IP address before. For example, the network device may look up a routing table entry hit by the IP address in the local routing table based on a longest match rule, and detect whether the hit routing table entry is a detailed routing table entry. If a detailed routing table entry is configured for the IP address before, the network device may delete the detailed routing table entry hit by the IP address in order to avoid an error in packet transmission. Subsequently, when the network device receives the message with the destination IP address as the IP address again, it can judge whether the IP address meets the requirement of configuring the detailed routing table entry; or, the network device may also re-determine whether the IP address meets the requirement for configuring the detailed routing table entry when it is necessary to send a message whose destination IP address is the IP address.
Referring to fig. 3, a flowchart of another method for maintaining a routing table entry according to an exemplary embodiment of the present application is shown, where the method may also be applied to a network device, and includes the following steps:
step 301: and when a routing table entry is newly added, judging whether the IP address associated with the newly added routing table entry hits the detailed routing table entry.
Step 302: and if the IP address hits the detail routing table entry, deleting the detail routing table entry.
When a routing table entry is added to the local routing table, it indicates that the forwarding policy for the IP address associated with the newly added routing table entry may change, for example: before adding the routing table entry, the routing table entry hit by the IP address is a direct routing table entry, but after adding the routing table entry, the routing table entry hit by the IP address is changed into the added routing table entry. In this case, the network device may determine whether the IP address associated with the newly added routing table entry hits the detailed routing table entry, that is, whether each IP address included in the network segment information in the newly added routing table entry hits the detailed routing table entry.
If a certain IP address associated with the newly added routing table entry hits the detailed routing table entry, it indicates that the detailed routing table entry is configured for the IP address before, and the network device may delete the detailed routing table entry in order to avoid an error in packet transmission.
Referring to fig. 4, a flowchart of another method for maintaining a routing table entry according to an exemplary embodiment of the present application is shown, where the method may also be applied to a network device, and includes the following steps:
step 401: when the routing table entry is deleted, whether the IP address associated with the deleted routing table entry hits the direct routing table entry is judged.
Step 402: and if the IP address hits a direct routing table entry, configuring a detailed routing table entry for the IP address.
When a routing table entry is deleted from the local routing table, it also indicates that the forwarding policy for the IP address associated with the deleted routing table entry may change, for example: before deleting the routing table entry, the routing table entry hit by the IP address is a deleted routing table entry, but after deleting the routing table entry, the routing table entry hit by the IP address is changed into a direct routing table entry. In this case, the network device may determine whether the IP address associated with the deleted routing table entry hits in the direct routing table entry.
If a certain IP address associated with the deleted routing table entry hits in the direct routing table entry, the embodiment shown in fig. 1 is combined to explain that the IP address at this time meets the requirement of configuring the detailed routing table entry. That is, the network device can configure a detailed routing table entry for the IP address, so as to improve the message processing efficiency of the network device and accelerate the message transmission rate.
As can be seen from the embodiments shown in fig. 1, fig. 2, fig. 3, and fig. 4, under different conditions, the network device determines whether the destination IP address of the packet meets the requirement for configuring the detailed routing table entry, and configures the detailed routing table entry for the destination IP address meeting the requirement, so as to quickly obtain forwarding information such as the next-hop MAC address of the packet, instead of configuring the detailed routing table entry for the destination IP address that does not meet the requirement, thereby improving the packet processing efficiency of the network device, increasing the packet transmission rate, and ensuring that no error occurs in packet transmission of the network device.
Corresponding to the foregoing embodiment of the method for maintaining a routing table entry, the present application also provides an embodiment of a device for maintaining a routing table entry.
The embodiment of the maintenance device for the routing table entry can be applied to network equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the network device where the software implementation is located as a logical means. In terms of hardware, as shown in fig. 5, a hardware structure diagram of a network device where a maintenance apparatus for a routing table entry is located in the present application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 5, the network device where the apparatus is located in the embodiment may also include other hardware according to an actual function of maintenance of the routing table entry, which is not described again.
Referring to fig. 6, a device for maintaining a routing table entry according to an exemplary embodiment of the present application is shown, where the device may be applied to the network device shown in fig. 5, and includes:
a searching unit 601, configured to search, based on a longest matching principle, a routing table entry hit by a destination IP address of a packet in a local routing table for the packet sent to a target device, and determine whether the routing table entry is a direct-connection routing table entry;
a first determining unit 602, configured to determine, when the routing table entry is a direct routing table entry, whether an MAC address of the target device is stored in a local MAC address table according to the destination IP address;
an obtaining unit 603, configured to obtain, based on an ARP request, an MAC address of the target device when the MAC address is not stored;
a first configuring unit 604, configured to configure a detailed routing table entry for the destination IP address based on the MAC address;
the detail routing table entry includes the detail information of the target device, and the subnet mask length of the segment information in the detail routing table entry is 32 bits.
In an optional embodiment, the apparatus 600 may further include:
a generating unit 605, configured to generate a corresponding MAC address table entry after acquiring the MAC address of the target device;
the detail information of the target device includes the MAC address of the target device, or the association relationship between the detail routing table entry and the MAC address table entry.
In another optional embodiment, the apparatus 600 may further include:
a second determining unit 606, configured to determine whether the destination IP address hits in a detailed routing table entry after the MAC address table entry corresponding to the destination IP address is aged;
a first deleting unit 607, configured to delete a detail routing table entry when the destination IP address hits the detail routing table entry.
In another optional embodiment, the apparatus 600 may further include:
a third determining unit 608, configured to determine, when a new routing table entry is added, whether an IP address associated with the new routing table entry hits a detailed routing table entry;
a second deleting unit 609, configured to delete the detail routing table entry when the IP address associated with the newly added routing table entry hits the detail routing table entry.
In another optional embodiment, the apparatus 600 may further include:
a fourth determining unit 610, configured to determine whether an IP address associated with a deleted routing table entry hits in a direct routing table entry when the routing table entry is deleted;
the second configuration unit 611 is configured to configure a detailed routing table entry for the IP address when the IP address associated with the deleted routing table entry hits the direct routing table entry.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
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 (10)
1. A method for maintaining routing table entries, the method comprising:
aiming at a message sent to a target device, searching a routing table item hit by a target IP address of the message in a local routing table based on a longest matching principle, and judging whether the routing table item is a direct routing table item or not;
if the routing table entry is a direct routing table entry, judging whether the MAC address of the target device is stored in a local MAC address table according to the target IP address;
if the MAC address is not stored, acquiring the MAC address of the target equipment based on an ARP request;
configuring a detailed routing table entry for the destination IP address based on the MAC address so that the detailed routing table entry directly or indirectly indicates the MAC address;
wherein, the detail routing table entry includes the detail information of the target device, and the bit number of 1 in the subnet mask of the network segment information in the detail routing table entry is 32 bits.
2. The method of claim 1, further comprising:
generating a corresponding MAC address table item after acquiring the MAC address of the target equipment;
the detail information of the target device includes the MAC address of the target device, or the association relationship between the detail routing table entry and the MAC address table entry.
3. The method of claim 1, further comprising:
judging whether the destination IP address hits a detailed routing table entry or not after the MAC address table entry corresponding to the destination IP address is aged;
and if the destination IP address hits the detail routing table entry, deleting the detail routing table entry.
4. The method of claim 1, further comprising:
when a routing table entry is newly added, judging whether an IP address associated with the newly added routing table entry hits a detailed routing table entry;
and if the IP address associated with the newly-added routing table entry hits the detailed routing table entry, deleting the detailed routing table entry.
5. The method of claim 1, further comprising:
when deleting the routing table entry, judging whether the IP address associated with the deleted routing table entry hits the direct routing table entry;
and if the IP address associated with the deleted routing table entry hits the direct routing table entry, configuring a detailed routing table entry for the IP address.
6. An apparatus for maintaining routing table entries, the apparatus comprising:
the searching unit is used for searching a routing table item hit by a destination IP address of a message in a local routing table based on a longest matching principle aiming at the message sent to a target device and judging whether the routing table item is a direct connection routing table item or not;
a first determining unit, configured to determine, when the routing table entry is a direct routing table entry, whether an MAC address of the target device is stored in a local MAC address table according to the destination IP address;
an obtaining unit, configured to obtain, based on an ARP request, an MAC address of the target device when the MAC address is not stored;
a first configuration unit, configured to configure a detailed routing table entry for the destination IP address based on the MAC address, so that the detailed routing table entry directly or indirectly indicates the MAC address;
wherein, the detail routing table entry includes the detail information of the target device, and the bit number of 1 in the subnet mask of the network segment information in the detail routing table entry is 32 bits.
7. The apparatus of claim 6, further comprising:
the generating unit is used for generating a corresponding MAC address table item after the MAC address of the target equipment is obtained;
the detail information of the target device includes the MAC address of the target device, or the association relationship between the detail routing table entry and the MAC address table entry.
8. The apparatus of claim 6, further comprising:
a second judging unit, configured to judge whether the destination IP address hits in a detailed routing table entry after an MAC address table entry corresponding to the destination IP address is aged;
a first deleting unit, configured to delete a detail routing table entry when the destination IP address hits the detail routing table entry.
9. The apparatus of claim 6, further comprising:
the third judging unit is used for judging whether the IP address associated with the newly added routing table item hits the detailed routing table item or not when the routing table item is newly added;
and the second deleting unit is used for deleting the detail routing table entry when the IP address associated with the newly added routing table entry hits the detail routing table entry.
10. The apparatus of claim 6, further comprising:
the fourth judging unit is used for judging whether the IP address associated with the deleted routing table item hits the direct routing table item or not when the routing table item is deleted;
and the second configuration unit is used for configuring detailed routing table items for the IP address when the IP address associated with the deleted routing table item hits the direct routing table item.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710493247.5A CN107147581B (en) | 2017-06-26 | 2017-06-26 | Maintenance method and device for routing table entry |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710493247.5A CN107147581B (en) | 2017-06-26 | 2017-06-26 | Maintenance method and device for routing table entry |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107147581A CN107147581A (en) | 2017-09-08 |
CN107147581B true CN107147581B (en) | 2020-09-08 |
Family
ID=59782409
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710493247.5A Active CN107147581B (en) | 2017-06-26 | 2017-06-26 | Maintenance method and device for routing table entry |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107147581B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108418759B (en) * | 2018-05-31 | 2020-09-08 | 新华三技术有限公司 | MAC address table item processing method and device |
CN111479308B (en) * | 2020-04-09 | 2022-07-26 | 杭州涂鸦信息技术有限公司 | Route updating method, device, equipment and medium |
CN113489649B (en) * | 2021-06-29 | 2022-07-22 | 新华三信息安全技术有限公司 | Table entry storage method and device |
CN114900560A (en) * | 2022-04-01 | 2022-08-12 | 阿里云计算有限公司 | Control method, system, device and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1571384A (en) * | 2004-04-29 | 2005-01-26 | 中兴通讯股份有限公司 | A network equipment saving address resources and address planning method |
CN102325077A (en) * | 2011-05-25 | 2012-01-18 | 杭州华三通信技术有限公司 | Communication method among branches and egress routers of branches |
CN103078798A (en) * | 2012-12-28 | 2013-05-01 | 华为技术有限公司 | Method and equipment for establishing route table |
CN104748289A (en) * | 2013-12-27 | 2015-07-01 | 海尔集团公司 | Wireless multiple on-line inner and outer unit communication method and air conditioning system |
CN105721303A (en) * | 2016-03-31 | 2016-06-29 | 华为技术有限公司 | Routing control method, network device and controller |
-
2017
- 2017-06-26 CN CN201710493247.5A patent/CN107147581B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1571384A (en) * | 2004-04-29 | 2005-01-26 | 中兴通讯股份有限公司 | A network equipment saving address resources and address planning method |
CN102325077A (en) * | 2011-05-25 | 2012-01-18 | 杭州华三通信技术有限公司 | Communication method among branches and egress routers of branches |
CN103078798A (en) * | 2012-12-28 | 2013-05-01 | 华为技术有限公司 | Method and equipment for establishing route table |
CN104748289A (en) * | 2013-12-27 | 2015-07-01 | 海尔集团公司 | Wireless multiple on-line inner and outer unit communication method and air conditioning system |
CN105721303A (en) * | 2016-03-31 | 2016-06-29 | 华为技术有限公司 | Routing control method, network device and controller |
Non-Patent Citations (1)
Title |
---|
详解⽹络传输中的三张表,MAC地址表、ARP缓存表以及路由表;yun5277;《https://blog.51cto.com/dengqi/1223132》;20130616;第三页 路由表详解部分 * |
Also Published As
Publication number | Publication date |
---|---|
CN107147581A (en) | 2017-09-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108259347B (en) | Message transmission method and device | |
US10887233B2 (en) | System and method of loading an exact match table and longest prefix match table | |
CN107147581B (en) | Maintenance method and device for routing table entry | |
US8514714B2 (en) | Device and method for providing forwarding information and QOS information in flow based network environment | |
US10616175B2 (en) | Forwarding information to forward data to proxy devices | |
US9825861B2 (en) | Packet forwarding method, apparatus, and system | |
CN105991655B (en) | Method and apparatus for mitigating neighbor discovery-based denial of service attacks | |
CN110311866B (en) | Method and device for rapidly forwarding message | |
CN107547391B (en) | Message transmission method and device | |
CN107580079B (en) | Message transmission method and device | |
CN107547407B (en) | Message transmission method, device and implementation device | |
US10798000B2 (en) | Method and apparatus of compressing network forwarding entry information | |
US10630700B2 (en) | Probe counter state for neighbor discovery | |
US20180198643A1 (en) | Packet transmission method and apparatus | |
CN106921578B (en) | Method and device for generating forwarding table item | |
CN109921995B (en) | Method for configuring address table, FPGA and network equipment applying FPGA | |
US11558294B2 (en) | Dynamic forward information base prefix optimization | |
CN106803809B (en) | Message forwarding method and device | |
CN107547346B (en) | Message transmission method and device | |
CN106470158A (en) | Message forwarding method and device | |
CN114268584A (en) | Method and related device for forwarding message | |
CN107690004B (en) | Method and device for processing address resolution protocol message | |
US20210203695A1 (en) | Anti-spoofing attack check method, device, and system | |
CN112187636B (en) | ECMP route storage method and device | |
US20230041395A1 (en) | Method and Device for Processing Routing Table Entries |
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 |