CN107317755B - Hardware forwarding table entry error correction method and device and computer readable storage medium - Google Patents

Hardware forwarding table entry error correction method and device and computer readable storage medium Download PDF

Info

Publication number
CN107317755B
CN107317755B CN201710730929.3A CN201710730929A CN107317755B CN 107317755 B CN107317755 B CN 107317755B CN 201710730929 A CN201710730929 A CN 201710730929A CN 107317755 B CN107317755 B CN 107317755B
Authority
CN
China
Prior art keywords
hardware
forwarding
table entry
layer
routing
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
CN201710730929.3A
Other languages
Chinese (zh)
Other versions
CN107317755A (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.)
TP Link Technologies Co Ltd
Original Assignee
TP Link 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 TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN201710730929.3A priority Critical patent/CN107317755B/en
Publication of CN107317755A publication Critical patent/CN107317755A/en
Application granted granted Critical
Publication of CN107317755B publication Critical patent/CN107317755B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/742Route cache; Operation thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the field of network communication, and provides a method and a device for correcting errors of hardware forwarding table entries and a computer readable storage medium, which are used for automatically repairing errors of the hardware forwarding table entries and shortening service interruption time as much as possible. The method comprises the following steps: generating a hardware forwarding table entry, wherein the hardware forwarding table entry comprises hardware routing forwarding related information; caching the hardware routing forwarding related information; detecting a hardware forwarding table entry according to the cached hardware routing forwarding related information; and repairing the detected error hardware forwarding table entry according to the detection result. The technical scheme provided by the invention can automatically repair the error of the hardware forwarding table entry without manual intervention, thereby avoiding service interruption or shortening the service interruption time to the maximum extent.

Description

Hardware forwarding table entry error correction method and device and computer readable storage medium
Technical Field
The present invention relates to the field of network communications, and in particular, to a method and an apparatus for error correction of a hardware forwarding table entry, and a computer readable storage medium.
Background
In order to achieve the linear speed forwarding of data and reduce the burden of a CPU, the existing three-layer switch device mainly forwards an IP packet based on a hardware forwarding table entry. The forwarding mechanism is mainly maintained by a software forwarding table entry and a hardware forwarding table entry, wherein the software forwarding table entry includes forwarding Information table entries (FIB) and Address Resolution Protocol (ARP) table entries, and the hardware forwarding table entry includes routing table entries, MAC Address forwarding Data table entries (FDB), next hop (nexthop) table entries and three-layer interface table entries.
The existing three-layer switching equipment processes the IP data message and comprises the following steps: when the IP data message is received, the hardware forwarding table entry is searched, and the IP data message is modified and forwarded according to the content of the hardware forwarding table entry. If the hardware forwarding table entry does not have correct routing information, the IP data message is sent to the CPU for processing due to the lack of the forwarding table entry, the corresponding routing table entry is learned through software and sent to the hardware forwarding chip, and the subsequent IP data message sent to the same destination can be forwarded through hardware, so that the linear speed forwarding is achieved. Another way to process the IP datagram may be to discard it directly instead of sending it to the CPU for processing if the hardware forwarding entry does not have the correct routing information.
Although the existing method can learn the routing information by sending the IP data message to the CPU to trigger the software when the hardware forwarding table entry does not exist, the problem of the linear speed forwarding of the IP data message is solved. However, when the hardware forwarding table entry exists but some contents are incorrect, the IP datagram may be directly discarded or forwarded to the wrong port. Because the message is not sent to the CPU, the software cannot be triggered to correct or relearn the routing table entry, so that the network is abnormal. In order to restore the network to normal, either the three-layer switching device is restarted, or the network interface related to the service interruption is restarted after being closed by an administrator, however, in any processing mode, manual intervention is required, and the service interruption is inevitably caused
The above technical problems need to be solved in the industry.
Disclosure of Invention
The invention provides a method and a device for correcting errors of hardware forwarding table entries and a computer readable storage medium, which are used for automatically repairing errors of the hardware forwarding table entries and shortening the service interruption time as much as possible.
A first aspect of the present invention provides a method for correcting errors in hardware forwarding table entries, where the method includes:
generating a hardware forwarding table entry, wherein the hardware forwarding table entry comprises hardware routing forwarding related information;
caching the hardware routing forwarding related information;
detecting a hardware forwarding table entry according to the cached hardware routing forwarding related information;
and repairing the detected error hardware forwarding table entry according to the detection result.
A second aspect of the present invention provides an error correction apparatus for a hardware forwarding table entry, where the apparatus includes:
the route learning module is used for generating a hardware forwarding table item, and the hardware forwarding table item comprises hardware route forwarding related information;
the cache module is used for caching the relevant information forwarded by the hardware route;
the detection module is used for detecting the hardware forwarding table entry according to the cached hardware routing forwarding related information;
and the repair module is used for repairing the detected wrong hardware forwarding table entry according to the detection result.
A third aspect of the present invention provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
generating a hardware forwarding table entry, wherein the hardware forwarding table entry comprises hardware routing forwarding related information;
caching the hardware routing forwarding related information;
detecting a hardware forwarding table entry according to the cached hardware routing forwarding related information;
and repairing the detected error hardware forwarding table entry according to the detection result.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the steps of:
generating a hardware forwarding table entry, wherein the hardware forwarding table entry comprises hardware routing forwarding related information;
caching the hardware routing forwarding related information;
detecting a hardware forwarding table entry according to the cached hardware routing forwarding related information;
and repairing the detected error hardware forwarding table entry according to the detection result.
According to the technical scheme provided by the invention, the hardware forwarding table entry is detected according to the cached hardware routing forwarding related information by caching the hardware routing forwarding related information, and the detected wrong hardware forwarding table entry is repaired.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram illustrating an implementation flow of a hardware forwarding entry error correction method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a hardware forwarding entry error correction apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a hardware forwarding entry error correction apparatus according to another embodiment of the present invention;
fig. 4 is a schematic structural diagram of a hardware forwarding entry error correction apparatus according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a hardware forwarding entry error correction apparatus according to another embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 is a schematic diagram of an implementation flow of the hardware forwarding entry error correction method according to the embodiment of the present invention, which mainly includes the following steps S101 to S104, and is described in detail as follows:
s101, generating a hardware forwarding table entry.
In the embodiment of the invention, after the route learning module acquires the route forwarding related information through the FIB table, the ARP table and the FDB table, the route learning module issues the route forwarding related information to the hardware layer to generate the hardware forwarding table, and acquires the hardware route forwarding related information from the hardware forwarding table.
S102, caching the relevant information of hardware route forwarding.
S103, detecting the hardware forwarding table entry according to the cached hardware routing forwarding related information.
As an embodiment of the present invention, detecting the hardware forwarding table entry according to the cached related information of the hardware routing forwarding may be implemented by the following steps S1031 and S0132:
and S1031, periodically traversing the cached hardware route forwarding related information, and acquiring an index of a hardware table entry required for forwarding.
In the embodiment of the present invention, the hardware routing forwarding related information includes an index (index) of a hardware entry required for forwarding, a three-layer routing entry, that is, a destination IP address and a mask, etc., an MAC address of a three-layer interface entry, a next-hop entry related field, that is, a next-hop IP address, an MAC address and a port of a two-layer FDB entry, etc.
S1032, according to the index of the hardware table entry needed by forwarding, the three-layer routing table entry, the three-layer interface table entry, the two-layer forwarding data table entry and the next-hop table entry are detected in sequence, and after the error is detected and found, the error information is sent for correction.
Specifically, the implementation of step S1032 can be realized by the following steps S1 to S5:
s1, reading the three-layer routing table item corresponding to the index.
The three-layer routing table entry mainly comprises information such as a destination IP address, a mask code and the like, and the three-layer routing table entry corresponding to the index can be read from the hardware forwarding table entry according to the index of the three-layer routing table entry.
S2, whether the three-layer routing table entry is correct is detected.
In the embodiment of the invention, the detection of the correctness of the three-layer routing table entry mainly comprises the detection of the correctness of information such as a destination IP address, a mask code and the like.
S3, if the three-layer routing list item is wrong, the information of the three-layer routing list item detection mistake is sent for correction.
If the three-layer routing table entry is wrong, sending information of the three-layer routing table entry detection error to the repair module so that the repair module can correct the error.
And S4, if the three-layer routing table entry is correct, continuously detecting whether the three-layer interface table entry and the two-layer forwarding data table entry are correct.
If the three-layer routing table entry is correct, the three-layer interface table entry and the two-layer forwarding data table entry can be obtained through the correct three-layer routing table entry, so that whether the three-layer interface table entry (mainly the MAC address of the three-layer interface table entry) and the two-layer forwarding data table entry (mainly the MAC address of the two-layer forwarding data table entry) are correct or not is detected.
And S5, if the three-layer interface table entry and the two-layer forwarding data table entry are wrong, sending the information of the detection error of the three-layer interface table entry and the two-layer forwarding data table entry for correction.
If the three-layer interface table entry and the two-layer forwarding data table entry are wrong as detected by S4, the information of the detection error of the three-layer interface table entry and the two-layer forwarding data table entry is sent to the repair module, so that the repair module can correct the errors.
And S104, repairing the detected error hardware forwarding table entry according to the detection result in the step S103.
Specifically, according to the result detected in step S103, repairing the detected erroneous hardware forwarding entry may be implemented through the following steps S1041 to S1044:
and S1041, classifying the detection result according to the error property.
S1042, if the error hardware forwarding table entry belongs to the error-repairable hardware forwarding table entry, the error-repairable routing table entry is directly repaired.
In the embodiment of the present invention, a simple error hardware forwarding table entry, for example, a three-layer flag bit, a next-hop MAC address, and the like of a two-layer forwarding data table entry "belongs to a recoverable error hardware forwarding table entry, and such an error can be directly repaired.
And S1043, if the error hardware forwarding table entry belongs to the unrepairable error hardware forwarding table entry, deleting the address resolution protocol table entry.
S1044, notifying the route learning module to learn the relevant information of the route again.
For example, if the error hardware forwarding entry belongs to the unrepairable error hardware forwarding entries such as the IP address and the mask of the three-layer routing entry as detected in step S1041, the address resolution protocol entry is deleted, and the route learning module is notified to learn the routing related information again.
As can be seen from the above-mentioned hardware forwarding table entry error correction method illustrated in fig. 1, the hardware forwarding table entry is detected by caching the hardware routing forwarding related information according to the cached hardware routing forwarding related information, and the detected error hardware forwarding table entry is repaired.
Fig. 2 is a schematic diagram of a hardware forwarding entry error correction apparatus according to an embodiment of the present invention, which mainly includes a route learning module 201, a cache module 202, a detection module 203, and a repair module 204, and the following details are described as follows:
a route learning module 201, configured to generate a hardware forwarding entry, where the hardware forwarding entry includes hardware route forwarding related information, and the hardware route forwarding related information includes a routing entry, an MAC address forwarding data entry (FDB), a next hop (nexthop) entry, and a three-layer interface entry;
a caching module 202, configured to cache the hardware route forwarding related information generated by the route learning module 201;
the detecting module 203 is configured to detect a hardware forwarding table entry according to the hardware routing forwarding related information cached by the caching module 202;
and a repairing module 204, configured to repair the detected hardware forwarding entry with the error according to the result detected by the detecting module 203.
It should be noted that, since the apparatus provided in the embodiment of the present invention is based on the same concept as the method embodiment of the present invention, the technical effect brought by the apparatus is the same as the method embodiment of the present invention, and specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
The detection module 203 illustrated in fig. 2 may include an obtaining unit 301 and an error detecting unit 302, such as the hardware forwarding table entry error correction apparatus illustrated in fig. 3, where:
an obtaining unit 301, configured to periodically traverse the hardware route forwarding related information cached by the caching module 202, and obtain an index of a hardware table entry required for forwarding;
an error detection unit 302, configured to detect, according to an index of a hardware entry required for forwarding, a three-layer routing entry, a three-layer interface entry, a two-layer forwarding data entry, and a next-hop entry in sequence, and send error information for correction after detecting an error.
The error detecting unit 302 illustrated in fig. 3 may include a reading unit 401, a first detecting unit 402, a first sending unit 403, a second detecting unit 404, and a second sending unit 405, such as the hardware forwarding table entry error correcting apparatus illustrated in fig. 4, where:
a reading unit 401, configured to read a three-layer routing table entry corresponding to the index;
a first detecting unit 402, configured to detect whether a three-layer routing table entry is correct;
a first sending unit 403, configured to send information of a three-layer routing table entry detection error for correction if the three-layer routing table entry is erroneous;
a second detecting unit 404, configured to, if the three-layer routing table entry is correct, continue to detect whether the three-layer interface table entry and the two-layer forwarding data table entry are correct;
a second sending unit 405, configured to send information of the detection error of the three-layer interface table entry and the two-layer forwarding data table entry for correction if the three-layer interface table entry and the two-layer forwarding data table entry are in error.
The repair module 204 illustrated in fig. 2 may include a classification unit 501, a direct repair unit 502, a deletion unit 503, and a notification unit 504, such as the hardware forwarding table entry error correction apparatus illustrated in fig. 5, where:
a classification unit 501, configured to classify a detection result according to a property of the error;
a direct repair unit 502, configured to directly repair the error-repairable hardware forwarding entry if the error-repairable hardware forwarding entry belongs to the error-repairable hardware forwarding entry;
a deleting unit 503, configured to delete the address resolution protocol entry if the error routing entry belongs to the unrepairable error hardware forwarding entry;
a notifying unit 504, configured to notify the route learning module to relearn the route related information.
Fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present invention. As shown in fig. 6, the terminal device 6 of this embodiment includes: a processor 60, a memory 61, and a computer program 62, such as a program of a hardware forwarding entry error correction method, stored in the memory 61 and operable on the processor 60. When executing the computer program 62, the processor 60 implements the steps in the above-mentioned embodiment of the hardware forwarding entry error correction method, such as steps S101 to S104 shown in fig. 1. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the route learning module 201, the caching module 202, the detection module 203, and the repair module 204 shown in fig. 2.
Illustratively, the computer program 62 of the hardware forwarding entry error correction method mainly includes: generating a hardware forwarding table entry, wherein the hardware forwarding table entry comprises key field information required for forwarding and a routing entry; caching the hardware forwarding table entry; when the equipment receives the IP data message, detecting a routing table entry according to the cached hardware forwarding table entry; and repairing the detected wrong routing table entry according to the detection result. The computer program 62 may be divided into one or more modules/units, which are stored in the memory 61 and executed by the processor 60 to implement the present invention. One or more of the modules/units may be a series of computer program instruction segments capable of performing specific functions that describe the execution of computer program 62 on computing device 6. For example, the computer program 62 may be divided into functions of the route learning module 201, the caching module 202, the detection module 203, and the repair module 204 (modules in the virtual device), and the specific functions of each module are as follows: a route learning module 201, configured to generate a hardware forwarding table entry, where the hardware forwarding table entry includes hardware route forwarding related information; a caching module 202, configured to cache the hardware route forwarding related information; a detecting module 203, configured to detect a hardware forwarding table entry according to the hardware routing forwarding related information cached by the caching module 202; a repairing module 204, configured to repair the detected hardware forwarding entry with the error according to the result detected by the detecting module 203.
Terminal device 6 may include, but is not limited to, processor 60, memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a terminal device 6 and does not constitute a limitation of terminal device 6 and may include more or less components than those shown, or some components may be combined, or different components, e.g., the terminal device may also include input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6. The memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk provided on the terminal device 6, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 61 may also include both an internal storage unit of the terminal device 6 and an external storage device. The memory 61 is used for storing computer programs and other programs and data required by the terminal device. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the method according to the embodiments of the present invention may also be completed by instructing the relevant hardware through a computer program, where the computer program of the hardware forwarding table entry error correction method may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the steps in the embodiments of the method may be implemented, that is, generating a hardware forwarding table entry, where the hardware forwarding table entry includes the hardware routing forwarding related information; caching the hardware routing forwarding related information; detecting a hardware forwarding table entry according to the cached hardware routing forwarding related information; and repairing the detected error hardware forwarding table entry according to the detection result. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals. The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A method for correcting errors of hardware forwarding table entries, the method comprising:
generating a hardware forwarding table entry, wherein the hardware forwarding table entry comprises hardware routing forwarding related information, and the specific process comprises the following steps: after acquiring routing forwarding related information through an FIB (focused information) table, an ARP (address resolution protocol) table and an FDB (fully drawn) table, a routing learning module issues the routing forwarding related information to a hardware layer to generate a hardware forwarding table, and acquires the hardware routing forwarding related information from the hardware forwarding table;
caching the hardware routing forwarding related information;
detecting a hardware forwarding table entry according to the cached hardware routing forwarding related information;
repairing the detected error hardware forwarding table entry according to the detection result;
wherein, the detecting the hardware forwarding table entry according to the cached relevant information of the hardware routing forwarding comprises:
periodically traversing the cached hardware routing forwarding related information to obtain an index of a hardware table entry required for forwarding;
and detecting the three-layer routing table entry, the three-layer interface table entry, the two-layer forwarding data table entry and the next-hop table entry in sequence according to the index of the hardware table entry required for forwarding, and sending error information for correction after detecting and finding errors.
2. The method as claimed in claim 1, wherein the detecting three-layer routing table entries, three-layer interface table entries, two-layer forwarding data table entries and next-hop table entries in sequence according to the index of the hardware table entry required for forwarding, and sending information of the detected error for correction after detecting and finding the error, comprises:
reading a three-layer routing table entry corresponding to the index;
detecting whether the three-layer routing table entry is correct or not;
if the three-layer routing table entry is wrong, sending information of the detection error of the three-layer routing table entry for correction;
if the three-layer routing table entry is correct, continuously detecting whether the three-layer interface table entry and the two-layer forwarding data table entry are correct;
if the three-layer interface table entry and the two-layer forwarding data table entry are wrong, sending the information of the detection error of the three-layer interface table entry and the two-layer forwarding data table entry for correction.
3. The method for correcting errors in hardware forwarding entries according to claim 1, wherein the repairing the detected erroneous hardware forwarding entries according to the detection result comprises:
classifying the results of said detection according to the nature of the error;
if the error hardware forwarding table entry belongs to the error-repairable hardware forwarding table entry, directly repairing the error-repairable hardware forwarding table entry;
if the error hardware forwarding table entry belongs to the unrepairable error hardware forwarding table entry, deleting the address resolution protocol table entry;
and informing the route learning module to relearn the route related information.
4. An apparatus for correcting error of a hardware forwarding entry, the apparatus comprising:
a route learning module, configured to generate a hardware forwarding table entry, where the hardware forwarding table entry includes hardware route forwarding related information, and the specific process is as follows: after acquiring routing forwarding related information through an FIB (focused information) table, an ARP (address resolution protocol) table and an FDB (fully drawn) table, the routing learning module issues the routing forwarding related information to a hardware layer to generate a hardware forwarding table and acquires the hardware routing forwarding related information from the hardware forwarding table;
the cache module is used for caching the relevant information forwarded by the hardware route;
the detection module is used for detecting the hardware forwarding table entry according to the cached hardware routing forwarding related information;
the repair module is used for repairing the detected wrong hardware forwarding table entry according to the detection result;
wherein the detection module comprises:
the acquisition unit is used for periodically traversing the cached hardware routing forwarding related information and acquiring an index of a hardware table entry required for forwarding;
and the error detection unit is used for detecting the indexes of the hardware table items required by forwarding, sequentially detecting a three-layer routing table item, a three-layer interface table item, a two-layer forwarding data table item and a next-hop table item, and sending error information for correction after detecting and finding errors.
5. The hardware forwarding entry error correction apparatus of claim 4 wherein said error detection unit comprises:
a reading unit, configured to read a three-layer routing table entry corresponding to the index;
a first detecting unit, configured to detect whether the three-layer routing table entry is correct;
a first sending unit, configured to send information of a three-layer routing table entry detection error for correction if the three-layer routing table entry is erroneous;
a second detection unit, configured to, if the three-layer routing table entry is correct, continue to detect whether the three-layer interface table entry and the two-layer forwarding data table entry are correct;
and the second sending unit is used for sending the information of the detection errors of the three-layer interface table entry and the two-layer forwarding data table entry for correction if the three-layer interface table entry and the two-layer forwarding data table entry are wrong.
6. The hardware forwarding entry error correction apparatus of claim 4, wherein the repair module comprises:
a classification unit for classifying the detection result according to the nature of the error;
a direct repair unit, configured to directly repair the error-repairable hardware forwarding entry if the error hardware forwarding entry belongs to the error-repairable hardware forwarding entry;
a deleting unit, configured to delete the address resolution protocol entry if the erroneous hardware forwarding entry belongs to an uncorrectable erroneous hardware forwarding entry;
and the notification unit is used for notifying the route learning module to relearn the route related information.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 3 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 3.
CN201710730929.3A 2017-08-23 2017-08-23 Hardware forwarding table entry error correction method and device and computer readable storage medium Active CN107317755B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710730929.3A CN107317755B (en) 2017-08-23 2017-08-23 Hardware forwarding table entry error correction method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710730929.3A CN107317755B (en) 2017-08-23 2017-08-23 Hardware forwarding table entry error correction method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107317755A CN107317755A (en) 2017-11-03
CN107317755B true CN107317755B (en) 2020-07-31

Family

ID=60176512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710730929.3A Active CN107317755B (en) 2017-08-23 2017-08-23 Hardware forwarding table entry error correction method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107317755B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110365599B (en) * 2019-07-12 2023-05-23 中国电信集团工会上海市委员会 Openflow switch forwarding channel rapid updating system and method thereof
CN111683309B (en) * 2020-05-29 2021-12-21 烽火通信科技股份有限公司 OLT equipment dual-uplink service main and standby protection method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1172493C (en) * 2002-10-14 2004-10-20 港湾网络有限公司 Method for optimazed configuration of third layer exchange chip of network exchange apparatus
CN100450068C (en) * 2006-07-18 2009-01-07 杭州华三通信技术有限公司 Multicast group maintaining method
JP4734374B2 (en) * 2008-06-04 2011-07-27 アラクサラネットワークス株式会社 Network relay device and network relay device method
CN101610266A (en) * 2009-07-28 2009-12-23 杭州华三通信技术有限公司 A kind of method and device that detects ARP message validity
CN102904685B (en) * 2012-09-29 2016-04-27 杭州华三通信技术有限公司 A kind of processing method of hardware table item check errors and device
CN103560968B (en) * 2013-10-30 2017-01-11 神州数码网络(北京)有限公司 Switch hardware host routing table updating method and device and switch
CN106776107B (en) * 2016-11-30 2019-07-16 迈普通信技术股份有限公司 A kind of parity error correction method and the network equipment

Also Published As

Publication number Publication date
CN107317755A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
US10091137B2 (en) Apparatus and method for scalable and flexible wildcard matching in a network switch
US10116506B2 (en) Method for upgrading version of network device and network device
CN113079097B (en) Message processing method and device
US10218643B2 (en) Apparatus and method for scalable and flexible access control list lookup in a network switch
US10652145B2 (en) Managing data frames in switched networks
JP2005117171A (en) Packet transfer apparatus
CN107317755B (en) Hardware forwarding table entry error correction method and device and computer readable storage medium
US11005785B2 (en) Segmentation and reassembly of network packets for switched fabric networks
US10880119B2 (en) Method for removing data frame redundancy in network environment, and device and computer program for carrying out same
CN110430135A (en) A kind of message processing method and device
US10205813B2 (en) Method and system for detecting abnormal contact information and server
CN104821916A (en) Reducing the size of IPv6 routing tables by using bypass tunnels
JP5889218B2 (en) Data transfer apparatus and data transfer method
CN110601985B (en) Interface configuration information switching method, device, equipment and storage medium
CN114826906B (en) Flow control method, device, electronic equipment and storage medium
CN102457430B (en) Network package processing method and routing equipment
CN112637053B (en) Method and device for determining backup forwarding path of route
US8160074B1 (en) Optimal reading of forwarding database from hardware
CN111294280B (en) Message duplicate checking method and device, and data forwarding method, device and system
JP5249859B2 (en) Switching device and switching method
CN113992566B (en) Message broadcasting method and device
US20180145892A1 (en) Methods and devices for monitoring overlapped ip addresses in a multi-tenancy environment
CN104506331A (en) Multicast message transmission method and multi-core network equipment
KR101369151B1 (en) Network Video Recoder with a built-in L2 hub and packet routing method thereof
JP2016100621A (en) Transmission device, transmission system and transmission method

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