Packet recovery method, device, system, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202310544920.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-05-15
AI Technical Summary
[0003]虽然引进上述技术会减少报文转发设备的丢包,但是无法使报文转发设备实现不丢包的目的
[0010]由以上技术方案可以看出,本公开一方面能够减少报文恢复所需的时间,提升了报文恢复的效率,另一方面不会对报文转发设备原有的报文转发流程作出较大调整,从而降低了使用成本,且使得转发失败的源报文变换为待恢复报文来继续转发,能够实现报文转发不丢包的目的。
Smart Images

Figure CN116684350B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and provides a message recovery method, apparatus, system, electronic device and readable storage medium. Background Technology
[0002] In Ethernet communication, packets may fail to forward due to various reasons. To reduce service failures caused by packet loss during forwarding, existing technologies typically introduce Link Aggregation (LAG) and / or Equal-Cost Multi-path Routing (ECMP) technologies into packet forwarding devices.
[0003] While introducing the above technologies will reduce packet loss in packet forwarding devices, it cannot make packet forwarding devices achieve zero packet loss. Summary of the Invention
[0004] According to a first aspect of this disclosure, a message recovery method is provided, comprising: receiving a source message and a first forwarding attribute corresponding to the source message sent by a message sending module in a message forwarding device; determining a target forwarding table according to the first forwarding attribute; wherein the source message is a message that the message forwarding device failed to forward; obtaining a message to be recovered according to the target forwarding table and the source message; sending the message to be recovered to the loopback port of the message forwarding device; receiving the message to be recovered and a second forwarding attribute corresponding to the message to be recovered sent by a message processing module in the message forwarding device; extracting the target forwarding table from the message to be recovered; removing the target forwarding table from the message to be recovered; setting the state of the target forwarding table to invalid; and sending the message to be recovered and the second forwarding attribute to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered according to the second forwarding attribute.
[0005] According to a second aspect of this disclosure, a message recovery apparatus is provided, comprising: a receiving unit, configured to receive a source message and a first forwarding attribute corresponding to the source message sent by a message sending module in a message forwarding device, and determine a target forwarding table based on the first forwarding attribute, wherein the source message is a message that the message forwarding device failed to forward; a first processing unit, configured to obtain a message to be recovered based on the target forwarding table and the source message; a first sending unit, configured to send the message to be recovered to the loopback port of the message forwarding device, and then receive the message to be recovered and a second forwarding attribute corresponding to the message to be recovered sent by the message processing module in the message forwarding device; a second processing unit, configured to extract the target forwarding table from the message to be recovered and then remove the target forwarding table from the message to be recovered; and a second sending unit, configured to set the state of the target forwarding table to invalid, and send the message to be recovered and the second forwarding attribute to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered based on the second forwarding attribute.
[0006] According to a third aspect of this disclosure, a message recovery system is provided, comprising a message receiving module, a message processing module, a message forwarding module, a message sending module, and a message recovery module; wherein the message recovery module performs the aforementioned message recovery method.
[0007] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described above.
[0008] According to a fifth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method described above.
[0009] According to a sixth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described above.
[0010] As can be seen from the above technical solutions, this disclosure can reduce the time required for message recovery and improve the efficiency of message recovery. On the other hand, it will not make significant adjustments to the original message forwarding process of the message forwarding device, thereby reducing the cost of use. Moreover, it can transform the source message that failed to forward into a message to be recovered and continue to forward, thus achieving the goal of message forwarding without packet loss.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0013] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure;
[0014] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure;
[0015] Figure 3 This is a schematic diagram according to the third embodiment of the present disclosure;
[0016] Figure 4 This is a schematic diagram according to the fourth embodiment of the present disclosure;
[0017] Figure 5 This is a schematic diagram according to the fifth embodiment of the present disclosure;
[0018] Figure 6 This is a schematic diagram according to the sixth embodiment of the present disclosure;
[0019] Figure 7 This is a schematic diagram according to the seventh embodiment of the present disclosure;
[0020] Figure 8 This is a block diagram of an electronic device used to implement the message recovery method of the embodiments of this disclosure. Detailed Implementation
[0021] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and mechanisms are omitted in the following description.
[0022] Figure 1 This is a schematic diagram based on the first embodiment of this disclosure. (See diagram below.) Figure 1 As shown, the message recovery method in this embodiment specifically includes the following steps:
[0023] S101. Receive the source message sent by the message sending module in the message forwarding device and the first forwarding attribute corresponding to the source message, and determine the target forwarding table according to the first forwarding attribute. The source message is a message that the message forwarding device failed to forward.
[0024] S102. Obtain the message to be recovered based on the target forwarding table and the source message;
[0025] S103. After sending the message to be recovered to the loopback port of the message forwarding device, receive the message to be recovered and the second forwarding attribute corresponding to the message to be recovered from the message processing module in the message forwarding device.
[0026] S104. After extracting the target forwarding table from the message to be recovered, remove the target forwarding table from the message to be recovered;
[0027] S105. Set the state of the target forwarding table to invalid, and send the message to be recovered and the second forwarding attribute to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered according to the second forwarding attribute.
[0028] The message recovery method in this embodiment, on the one hand, triggers the message recovery process based on the message that was not successfully forwarded, which can reduce the time required for message recovery and thus improve the efficiency of message recovery. On the other hand, it recovers the message to be recovered by resending the message containing the target forwarding table to the message forwarding device through the loopback port. This does not make significant adjustments to the original message forwarding process of the message forwarding device, thereby reducing the cost of use. Moreover, it transforms the source message that failed to forward into a message to be recovered for continued forwarding, which can achieve the goal of message forwarding without packet loss.
[0029] The message forwarding device in this embodiment is used for Ethernet communication and typically includes a message receiving module, a message processing module, a message forwarding module, and a message sending module.
[0030] The process of a message forwarding device when forwarding messages is described as follows: A message enters the message forwarding device through the ingress port. First, it passes through the message receiving module, which stores the message in the buffer of the message forwarding device and sends it to the message processing module. The message processing module parses / inspects the message, extracts the corresponding message characteristics (such as the destination address), and then sends the message to the message forwarding module. The message forwarding module determines the egress interface and the corresponding egress port based on the message characteristics (such as the destination address) and sends the message to the message sending module. The message sending module forwards the message out through the egress port.
[0031] In the process of forwarding packets, the packet forwarding device will also set an additional attribute field corresponding to the packet being forwarded. This attribute field is filled with the corresponding forwarding attributes. The forwarding attributes generally include two types of attributes: one is the original packet attributes, such as packet MAC address, VLAN information, IP information, etc., and the other is the module attributes recorded by each module, such as the ingress port recorded by the packet receiving module, the destination address recorded by the packet processing module, the egress interface and egress port recorded by the packet forwarding module, and the packet loss reason recorded by the packet sending module (recorded if the packet is not successfully forwarded).
[0032] It is understandable that each time a message enters the message forwarding device, in addition to the original attributes of the message, the various modules in the message forwarding device will re-record the module attributes corresponding to the current message.
[0033] The execution entity of the message recovery method in this embodiment can be a message recovery module, which can be located in the message forwarding device, that is, an additional message recovery module can be added to the message forwarding device; the message recovery module can also be located in other devices that are independent of the message forwarding device.
[0034] In this embodiment, the source message received in S101 is a message that the message forwarding device failed to forward. When the message sending module in the message forwarding device determines that the message forwarding has failed, it will record the reason for the forwarding failure in the forwarding attribute, namely the "reason for packet loss". Therefore, this embodiment determines the target forwarding table based on the reason for packet loss in the first forwarding attribute corresponding to the source message.
[0035] In this embodiment, the packet loss reason in the first forwarding attribute can only record information such as outgoing port congestion, outgoing port rate limiting, outgoing port failure, etc., or it can record the specific outgoing port where congestion, rate limiting, or failure occurs while recording the above information. For example, the packet loss reason in this embodiment can be "outgoing port port2 failure" or "outgoing port failure".
[0036] In this embodiment, when executing S101 to determine the target forwarding table based on the first forwarding attribute, the optional implementation method can be as follows: determine the target outgoing port (i.e., the abnormal outgoing port) based on the first forwarding attribute. In this embodiment, the outgoing port included in the packet loss reason can be used as the target outgoing port, or the outgoing port recorded by the packet forwarding module in the first forwarding attribute can be used as the target outgoing port; and the forwarding table corresponding to the target outgoing port is used as the target forwarding table.
[0037] In addition, when executing S101, this embodiment may also include the following: determining the packet loss category based on the packet loss reason in the first forwarding attribute; determining the recovery strategy based on the determined packet loss category; wherein the recovery strategy may be sent to the packet forwarding module together with the subsequent packets to be recovered, or it may be sent to the packet forwarding module separately, and the recovery strategy may also include the target forwarding table.
[0038] In this embodiment, when executing S101, the packet loss category corresponding to the packet loss cause can be determined through a first preset relationship table. The first preset relationship table contains different packet loss causes and the packet loss categories corresponding to different packet loss causes. The first preset relationship table can be obtained by the control module or by the local packet forwarding device.
[0039] For example, the packet loss category corresponding to the packet loss reasons "egress port congestion", "egress port rate limiting", and "egress port failure" is "egress port abnormality", and the packet loss category corresponding to the packet loss reasons "ARP (Address Resolution Protocol) table not found" and "ARP table outgoing interface error" is "ARP table error"; in this embodiment, the outgoing port can be "LAG (Link Aggregation) outgoing port" or "ECMP (Equal-Cost Multi-path Routing) outgoing port".
[0040] In this embodiment, when executing S101, the recovery strategy corresponding to the packet loss category can be determined through the second preset relationship table. The second preset relationship table contains different packet loss categories and the recovery strategies corresponding to different packet loss categories. The second preset relationship table can be obtained by the control module or by the local acquisition of the packet forwarding device.
[0041] For example, the recovery strategy corresponding to the packet loss category "outgoing port abnormality" can be "forwarding through other outgoing ports + forwarding table of invalid abnormal outgoing ports", and the recovery strategy corresponding to the packet loss category "ARP table error" can be "sending the packet to the control module". In this embodiment, the control module is located above the packet forwarding device. It can send a preset relationship table to the packet forwarding device and can also receive the source packet sent by the packet forwarding device.
[0042] It is understandable that if the target forwarding table cannot be determined when executing S101 in this embodiment, it indicates that the reason for the packet forwarding failure is not a problem with the outgoing port, but an error in the ARP table. In this embodiment, the source packet and the recovery policy "send the packet to the control module" can be sent directly to the packet forwarding module according to the recovery policy corresponding to "an error in the ARP table". Then, the packet forwarding module adds the port of the control module to the forwarding attributes of the source packet, so that the packet sending module sends the source packet to the control module through the port.
[0043] In this embodiment, after executing S101 to determine the target forwarding table based on the first forwarding attribute, S102 is executed to obtain the message to be recovered based on the target forwarding table and the source message.
[0044] In this embodiment, when executing S102, the message to be recovered can be obtained by inserting the target forwarding table into any position in the source message.
[0045] In this embodiment, the message typically consists of two parts: "ETHER" and "PAYLOAD". "ETHER" indicates the Ethernet type of the message, and "PAYLOAD" indicates the specific content of the message.
[0046] Therefore, in this embodiment, when executing S102, the target forwarding table can be inserted before "ETHER", between "ETHER" and "PAYLOAD", or after "PAYLOAD" in the source message, thereby obtaining the message to be recovered.
[0047] In this embodiment, when executing S102 to obtain the message to be recovered based on the target forwarding table and the source message, the following may also be included: obtaining preset identification information and extracting the outgoing interface from the first forwarding attribute; generating a recovery header (RH) based on the preset identification information, the outgoing interface and the target forwarding table; obtaining the message to be recovered based on the generated recovery header and the source message, for example, by inserting the recovery header into any position in the source message to obtain the message to be recovered.
[0048] In this embodiment, the recovery header generated by executing S102 includes the RH_ID (Recovery Header ID) field, the RH_LEN (Recovery Header Length) field, the RH_DST (Recovery Header Destination) field, and the OPTION (Options) field. Preset identification information is written into the RH_ID field, which is used to identify the recovery header in the packet. The length of the recovery header is written into the RH_LEN field. The outgoing interface extracted from the first forwarding attribute is written into the RH_DST field. The target forwarding table is written into the OPTION field, and the recovery policy can also be written together.
[0049] In other words, this embodiment can combine richer information to obtain the message to be recovered, thereby enabling faster identification of the recovery header in the message to be recovered, and then obtaining the various information encapsulated in the recovery header so that subsequent processes can continue.
[0050] In this embodiment, after obtaining the message to be recovered in S102, S103 is executed to send the message to be recovered to the loopback port of the message forwarding device, and to receive the message to be recovered and the second forwarding attribute of the corresponding message to be recovered from the message processing module in the message forwarding device; wherein, the loopback port in this embodiment is used to resend the message to be recovered (without forwarding attribute) sent to the port to the message forwarding device.
[0051] In this embodiment, when executing S103 to send the message to be recovered to the loopback port of the message forwarding device, the message to be recovered can be sent directly to the loopback port, or the message to be recovered can be sent to the message sending module, and then the message sending module sends the message to be recovered to the loopback port.
[0052] In this embodiment, after the message forwarding device receives the message to be recovered through the loopback port, the message receiving module records the attribute "ingress port is loopback port" in the second forwarding attribute corresponding to the message to be recovered. Then, when the message processing module determines that the ingress port in the second forwarding attribute is the loopback port, it records the target address in the second forwarding attribute and sends the message to be recovered and its corresponding second forwarding attribute to the message recovery module.
[0053] The second forwarding attribute corresponding to the message to be recovered contains only the module attributes recorded by the message receiving module and the message processing module, in addition to the original message characteristics; while the first forwarding attribute corresponding to the source message contains the module attributes recorded by the message receiving module, the message processing module, the message forwarding module, and the message sending module, in addition to the original message characteristics.
[0054] In this embodiment, after executing S103 to receive the message to be recovered and the second forwarding attribute of the corresponding message to be recovered sent by the message processing module, and then executing S104 to extract the target forwarding table from the message to be recovered, the target forwarding table in the message to be recovered is removed.
[0055] In this embodiment, when executing S104, the target forwarding table can be directly extracted from the corresponding position of the message to be recovered; alternatively, the recovery header contained in the message to be replied to can be determined according to the preset identification information, and after decapsulating the recovery header, the target forwarding table and the outgoing interface can be extracted.
[0056] If the outgoing interface is extracted from the message to be recovered when S104 is executed in this embodiment, the extracted outgoing interface can also be recorded in the second forwarding attribute. This way, after the second forwarding attribute is sent to the message forwarding module, the message forwarding module does not need to confirm the outgoing interface based on the destination address. Instead, the outgoing port can be determined directly based on the recorded outgoing interface, which further reduces the message recovery time and improves the efficiency of message recovery.
[0057] If the interface cannot be extracted from the message to be recovered in this embodiment after executing S104, the message forwarding module first determines the outgoing interface based on the destination address in the second forwarding attribute, and then determines the corresponding outgoing port based on the outgoing interface.
[0058] In this embodiment, after executing S104 to remove the target forwarding table from the text to be recovered, S105 is executed to set the state of the target forwarding table to invalid, and the message to be recovered and the second forwarding attribute are sent to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered according to the second forwarding attribute.
[0059] In this embodiment, when the message forwarding device forwards the message to be recovered according to the second forwarding attribute, the message forwarding module can first determine the outgoing port corresponding to the outgoing interface according to the second forwarding attribute (since the forwarding table (i.e., the target forwarding table) of the abnormal outgoing port has been invalidated, the message forwarding module will not find the abnormal outgoing port as the outgoing port corresponding to the outgoing interface this time). Then, the message forwarding module sends the message to be recovered and the second forwarding attribute containing the outgoing port to the message sending module, so that the message sending module forwards the message to be recovered through the outgoing port.
[0060] If the recovery header also contains a recovery policy, then in this embodiment, when executing S105, the message to be recovered, the second forwarding attribute, and the recovery policy can be sent together to the message forwarding module so that the message forwarding device can forward the message to be recovered according to the second forwarding attribute and the recovery policy.
[0061] This is because in some cases, if the message recovery module fails to successfully set the status of the target forwarding table to invalid, the message forwarding module in this embodiment will still select the abnormal outgoing port according to the outgoing interface, which will cause the forwarding of the message to be recovered to fail again. The message forwarding module in this embodiment can use recovery strategies, such as "forwarding through other outgoing ports", to achieve the purpose of no longer selecting the abnormal outgoing port, thereby further improving the forwarding success rate of the message to be recovered.
[0062] Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure. Figure 2The diagram shows a structural diagram of a message forwarding device including a message recovery module in this embodiment; the message forwarding device includes a message receiving module, a message processing module, a message forwarding module, a message sending module, and a message recovery module; Figure 2 The diagram shows that after a packet forwarding failure via port 2 is processed by the packet recovery module, the packet is then forwarded again via port 3; LB is the loopback port.
[0063] The message recovery module includes a packet loss analysis submodule, a policy recovery submodule, an encapsulation submodule, a decapsulation submodule, and an action execution submodule. The packet loss analysis submodule receives the source message and first forwarding attribute from the message sending module and determines the target forwarding table and packet loss category based on the first forwarding attribute. It also receives the message to be recovered and the second forwarding attribute from the message processing module. The policy recovery submodule determines the recovery policy based on the packet loss category. The encapsulation submodule encapsulates the preset identification information, target forwarding table, recovery policy, and outgoing interface from the first forwarding attribute into a recovery header. The action execution submodule obtains the message to be recovered based on the recovery header and the source message, sends the message to be recovered to the loopback port, invalidates the target forwarding table, and sends the message to be recovered along with the second forwarding attribute (or the recovery policy) to the message forwarding module. The decapsulation submodule decapsulates the recovery header in the message to be recovered, extracts information such as the target forwarding table, recovery policy, and outgoing interface, and removes the recovery header from the message to be recovered.
[0064] Figure 3 This is a schematic diagram according to the third embodiment of the present disclosure. Figure 3 The diagram shows the first flowchart of message recovery when handling LAG output port anomalies in this embodiment; wherein, the output interface corresponding to the destination address "address 1" is LAG1, and the output ports corresponding to the output interface LAG1 include PORT2, PORT3 and PORT4; Figure 3 The attribute in the forwarding attribute table corresponds to the first forwarding attribute, and the LoopBack port is the loopback port.
[0065] During the first forwarding, the packet forwarding device uses PORT2 as the outgoing port. However, due to a PORT2 failure (i.e., packet loss), the packet cannot be forwarded. Therefore, this packet is used as the source packet, and the packet sending module sends the source packet and the first forwarding attribute to the packet recovery module. After the packet recovery module records the determined packet loss type and recovery strategy (including the target forwarding table) in the first forwarding attribute, it generates a recovery header based on the outgoing interface and recovery strategy in the first forwarding attribute. The recovery header is then inserted after the source packet, and the packet to be recovered is sent to the loopback port to re-enter the packet forwarding device.
[0066] Figure 4This is a schematic diagram according to the fourth embodiment of the present disclosure. Figure 4 The diagram shows the second flowchart of message recovery in this embodiment when handling LAG output port anomalies; Figure 4 The attribute in the forwarding attribute table corresponds to the second forwarding attribute.
[0067] The message forwarding device receives the message to be recovered through the loopback port. After recording the ingress port and destination address in the second forwarding attribute, it sends the message to be recovered and the second forwarding attribute to the message recovery module. The message recovery module extracts the interface and recovery policy from the recovery header, invalidates the forwarding table corresponding to the abnormal outgress port (i.e., the forwarding table of PORT2 is invalid), and records the outgress interface in the second forwarding attribute. The message recovery module sends the message to be recovered and the second forwarding attribute to the message forwarding module, so that the message forwarding module determines the corresponding outgress port based on the outgress interface (excluding the abnormal PORT2 port), for example, determining PORT3 as the outgress port, so that the message sending module forwards the message to be recovered through PORT3.
[0068] Figure 5 This is a schematic diagram according to the fifth embodiment of the present disclosure. Figure 5 The diagram shows the first flowchart of message recovery when handling ECMP outgoing port anomalies in this embodiment; wherein, the outgoing interface corresponding to the destination address "address 1" is ECMP1, the next hop corresponding to ECMP1 includes next hop 1, next hop 2 and next hop 3, the outgoing port corresponding to next hop 1 is PORT2, the outgoing port corresponding to next hop 1 is PORT3, and the outgoing port corresponding to next hop 3 is PORT4. Figure 5 The attributes in the forwarding attribute table correspond to the first forwarding attribute, and the LoopBack port and LB are loopback ports.
[0069] Since the packet could not be forwarded due to a PORT2 failure (i.e. packet loss), the packet was used as the source packet. The packet sending module sent the source packet and the first forwarding attribute to the packet recovery module. After the packet recovery module recorded the determined packet loss category and recovery strategy in the first forwarding attribute, it generated a recovery header according to the outgoing interface and recovery strategy in the first forwarding attribute. The recovery header was inserted after the source packet, and the obtained packet to be recovered was sent to the loopback port to re-enter the packet forwarding device.
[0070] Figure 6 This is a schematic diagram according to the sixth embodiment of the present disclosure. Figure 6 The diagram shows the second flowchart of message recovery in this embodiment when handling ECMP output port anomalies; Figure 6 The attribute in the forwarding attribute table corresponds to the second forwarding attribute.
[0071] The message forwarding device receives the message to be recovered through the loopback port. After recording the ingress port and destination address in the second forwarding attribute, it sends the message to be recovered and the second forwarding attribute to the message recovery module. The message recovery module extracts the interface and recovery policy from the recovery header, invalidates the forwarding table corresponding to the abnormal outgress port (in this embodiment, specifically, the next hop 1 corresponding to PORT2 is set to invalid), and records the outgress interface in the second forwarding attribute. The message recovery module sends the message to be recovered and the second forwarding attribute to the message forwarding module, so that the message forwarding module determines the corresponding outgress port according to the outgress interface (excluding the abnormal PORT2 port and its corresponding next hop 1), for example, determining PORT3 corresponding to next hop 2 as the outgress port, so that the message sending module forwards the message to be recovered through PORT3.
[0072] Figure 7 This is a schematic diagram according to the seventh embodiment of this disclosure. (See diagram below.) Figure 7 As shown, the message recovery device 700 of this embodiment includes:
[0073] The receiving unit 701 is used to receive a source message and a first forwarding attribute corresponding to the source message sent by the message sending module in the message forwarding device, and to determine the target forwarding table according to the first forwarding attribute, wherein the source message is a message that the message forwarding device failed to forward.
[0074] The first processing unit 702 is used to obtain the message to be recovered based on the target forwarding table and the source message;
[0075] The first sending unit 703 is used to send the message to be recovered to the loopback port of the message forwarding device, and then receive the message to be recovered and the second forwarding attribute corresponding to the message to be recovered sent by the message processing module in the message forwarding device.
[0076] The second processing unit 704 is used to extract the target forwarding table from the message to be recovered, and then remove the target forwarding table from the message to be recovered.
[0077] The second sending unit 705 is used to set the status of the target forwarding table to invalid, and send the message to be recovered and the second forwarding attribute to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered according to the second forwarding attribute.
[0078] The message recovery device in this embodiment can be located in the message recovery module, which can be located in the message forwarding device, that is, an additional message recovery module can be added to the message forwarding device; the message recovery module can also be located in other devices that are independent of the message forwarding device.
[0079] The source message received by the receiving unit 701 is a message that the message forwarding device failed to forward. When the message sending module in the message forwarding device determines that the message forwarding has failed, it will record the reason for the forwarding failure in the forwarding attribute, namely the "reason for packet loss". Therefore, the receiving unit 701 determines the target forwarding table based on the reason for packet loss in the first forwarding attribute corresponding to the source message.
[0080] In this embodiment, the packet loss reason in the first forwarding attribute can only record information such as outgoing port congestion, outgoing port rate limiting, outgoing port failure, etc., or it can record the specific outgoing port where congestion, rate limiting, or failure occurs while recording the above information. For example, the packet loss reason in this embodiment can be "outgoing port port2 failure" or "outgoing port failure".
[0081] When the receiving unit 701 determines the target forwarding table based on the first forwarding attribute, the optional implementation method is as follows: determine the target outgoing port (i.e., the abnormal outgoing port) based on the first forwarding attribute; and use the forwarding table corresponding to the target outgoing port as the target forwarding table.
[0082] In addition, the receiving unit 701 may also include the following: determining the packet loss category based on the packet loss reason in the first forwarding attribute; determining the recovery strategy based on the determined packet loss category; wherein the recovery strategy may be sent to the packet forwarding module together with the subsequent messages to be recovered, or it may be sent to the packet forwarding module separately, and the recovery strategy may also include the target forwarding table.
[0083] The receiving unit 701 can determine the packet loss category corresponding to the packet loss cause through a first preset relationship table. The first preset relationship table contains different packet loss causes and the packet loss categories corresponding to different packet loss causes. The receiving unit 701 can obtain the first preset relationship table through the control module or through the local device of the packet forwarding device.
[0084] The receiving unit 701 can determine the recovery strategy corresponding to the packet loss category through the second preset relationship table. The second preset relationship table contains different packet loss categories and the recovery strategies corresponding to different packet loss categories. The receiving unit 701 can obtain the second preset relationship table through the control module or through the local device of the packet forwarding device.
[0085] Understandably, if the receiving unit 701 is unable to determine the target forwarding table, it indicates that the reason for the packet forwarding failure is not a problem with the outgoing port, but an error in the ARP table. The receiving unit 701 can directly send the source packet and the recovery policy "send the packet to the control module" to the packet forwarding module according to the recovery policy corresponding to "an error in the ARP table". Then, the packet forwarding module adds the port of the control module to the forwarding attributes of the source packet, so that the packet sending module sends the source packet to the control module through that port.
[0086] In this embodiment, after the receiving unit 701 determines the target forwarding table based on the first forwarding attribute, the first processing unit 702 obtains the message to be recovered based on the target forwarding table and the source message.
[0087] The first processing unit 702 can obtain the message to be recovered by inserting the target forwarding table into any position in the source message.
[0088] In this embodiment, the message typically consists of two parts: "ETHER" and "PAYLOAD". "ETHER" indicates the Ethernet type of the message, and "PAYLOAD" indicates the specific content of the message.
[0089] Therefore, the first processing unit 702 can insert the target forwarding table before "ETHER", between "ETHER" and "PAYLOAD", or after "PAYLOAD" in the source message to obtain the message to be recovered.
[0090] When the first processing unit 702 obtains the message to be recovered based on the target forwarding table and the source message, it may also include the following: obtaining preset identification information and extracting the outgoing interface from the first forwarding attribute; generating a recovery header based on the preset identification information, the outgoing interface and the target forwarding table; and obtaining the message to be recovered based on the generated recovery header and the source message.
[0091] The recovery header generated by the first processing unit 702 includes the RH_ID (recovery header ID) field, the RH_LEN (recovery header length) field, the RH_DST (recovery header destination) field, and the OPTION (option) field. Preset identification information is written into the RH_ID field to identify the recovery header in the packet; the length of the recovery header is written into the RH_LEN field; the outgoing interface extracted from the first forwarding attribute is written into the RH_DST field; and the target forwarding table is written into the OPTION field, which may also contain the recovery policy.
[0092] In other words, the first processing unit 702 can combine richer information to obtain the message to be recovered, thereby enabling it to identify the recovery header in the message to be recovered more quickly, and then obtain the various information encapsulated in the recovery header so that subsequent processes can continue.
[0093] In this embodiment, after the first processing unit 702 obtains the message to be recovered, the first sending unit 703 sends the message to be recovered to the loopback port of the message forwarding device, and receives the message to be recovered and the second forwarding attribute of the corresponding message to be recovered from the message processing module in the message forwarding device; wherein, the loopback port in this embodiment is used to resend the message to be recovered (without forwarding attribute) sent to the port to the message forwarding device.
[0094] When the first sending unit 703 sends the message to be recovered to the loopback port of the message forwarding device, it can send the message to be recovered directly to the loopback port, or it can send the message to be recovered to the message sending module, and then the message sending module sends the message to be recovered to the loopback port.
[0095] In this embodiment, after the message forwarding device receives the message to be recovered through the loopback port, the message receiving module records the attribute "ingress port is loopback port" in the second forwarding attribute corresponding to the message to be recovered. Then, when the message processing module determines that the ingress port in the second forwarding attribute is the loopback port, it records the target address in the second forwarding attribute and sends the message to be recovered and its corresponding second forwarding attribute to the message recovery module.
[0096] The second forwarding attribute corresponding to the message to be recovered contains only the module attributes recorded by the message receiving module and the message processing module, in addition to the original message characteristics; while the first forwarding attribute corresponding to the source message contains the module attributes recorded by the message receiving module, the message processing module, the message forwarding module, and the message sending module, in addition to the original message characteristics.
[0097] In this embodiment, after the first sending unit 703 receives the message to be recovered and the second forwarding attribute of the corresponding message to be recovered sent by the message processing module, the second processing unit 704 extracts the target forwarding table from the message to be recovered and then removes the target forwarding table from the message to be recovered.
[0098] The second processing unit 704 can directly extract the target forwarding table from the corresponding position of the message to be recovered; or it can determine the recovery header contained in the message to be replied to based on the preset identification information, decapsulate the recovery header, and then extract the target forwarding table and the outgoing interface.
[0099] If the second processing unit 704 extracts the outgoing interface from the message to be recovered, it can also record the extracted outgoing interface in the second forwarding attribute. This way, after the second forwarding attribute is sent to the message forwarding module, the message forwarding module does not need to confirm the outgoing interface based on the destination address. Instead, it can directly determine the outgoing port based on the recorded outgoing interface, which further reduces the message recovery time and improves the efficiency of message recovery.
[0100] If the second processing unit 704 fails to extract the interface from the message to be recovered, the message forwarding module first determines the outgoing interface based on the destination address in the second forwarding attribute, and then determines the corresponding outgoing port based on the outgoing interface.
[0101] In this embodiment, after the second processing unit 704 removes the target forwarding table from the text to be recovered, the second sending unit 705 sets the state of the target forwarding table to invalid and sends the message to be recovered and the second forwarding attribute to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered according to the second forwarding attribute.
[0102] In this embodiment, when the message forwarding device forwards the message to be recovered according to the second forwarding attribute, the message forwarding module can first determine the outgoing port corresponding to the outgoing interface according to the second forwarding attribute (since the forwarding table (i.e., the target forwarding table) of the abnormal outgoing port has been invalidated, the message forwarding module will not find the abnormal outgoing port as the outgoing port corresponding to the outgoing interface this time). Then, the message forwarding module sends the message to be recovered and the second forwarding attribute containing the outgoing port to the message sending module, so that the message sending module forwards the message to be recovered through the outgoing port.
[0103] If the recovery header also contains a recovery policy, the second sending unit 705 can send the message to be recovered, the second forwarding attribute, and the recovery policy together to the message forwarding module, so that the message forwarding device can forward the message to be recovered according to the second forwarding attribute and the recovery policy.
[0104] This is because in some cases, if the message recovery module fails to successfully set the status of the target forwarding table to invalid, the message forwarding module in this embodiment will still select the abnormal outgoing port according to the outgoing interface, which will cause the forwarding of the message to be recovered to fail again. The message forwarding module in this embodiment can use recovery strategies, such as "forwarding through other outgoing ports", to achieve the purpose of no longer selecting the abnormal outgoing port, thereby further improving the forwarding success rate of the message to be recovered.
[0105] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0106] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0107] like Figure 8 The diagram shown is a block diagram of an electronic device providing a message recovery method according to embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0108] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0109] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0110] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as providing a message recovery method. For example, in some embodiments, providing a message recovery method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808.
[0111] In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by computing unit 801, one or more steps of the message recovery method described above may be performed. Alternatively, in other embodiments, computing unit 801 may be configured to perform the message recovery method by any other suitable means (e.g., by means of firmware).
[0112] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0113] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a general-purpose computer, a special-purpose computer, or other programmable processor or controller that provides message recovery means, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0114] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0115] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for showing information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0116] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0117] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the management difficulties and weak business scalability inherent in traditional physical hosts and VPS (Virtual Private Server) services. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0118] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0119] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A message recovery method, comprising: The message forwarding device receives a source message sent by a message sending module and a first forwarding attribute corresponding to the source message. The target forwarding table is determined based on the first forwarding attribute. The source message is a message that the message forwarding device failed to forward. Based on the target forwarding table and the source message, the message to be recovered is obtained; After sending the message to be recovered to the loopback port of the message forwarding device, the message to be recovered and the second forwarding attribute corresponding to the message to be recovered are sent by the message processing module in the message forwarding device. After extracting the target forwarding table from the message to be recovered, remove the target forwarding table from the message to be recovered; The target forwarding table is set to invalid, and the message to be recovered and the second forwarding attribute are sent to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered according to the second forwarding attribute. The step of obtaining the message to be recovered based on the target forwarding table and the source message includes: Obtain the preset identification information and extract the interface from the first forwarding attribute; A recovery header is generated based on the preset identification information, the outgoing interface, and the target forwarding table. The preset identification information is used to identify the recovery header. The message to be recovered is obtained based on the recovery header and the source message.
2. The method according to claim 1, wherein, Determining the target forwarding table based on the first forwarding attribute includes: Based on the first forwarding attribute, determine the target outgoing port; The forwarding table corresponding to the target output port is used as the target forwarding table.
3. The method according to claim 1, wherein, The step of generating the recovery header based on the preset identification information, the outgoing interface, and the target forwarding table includes: Determine the recovery strategy; The recovery header is generated based on the preset identification information, the outgoing interface, the target forwarding table, and the recovery strategy.
4. The method according to claim 3, wherein, The determined recovery strategy includes: Determine the packet loss category based on the packet loss reason in the first forwarding attribute; Based on the packet loss category, determine the recovery strategy.
5. The method according to claim 1, wherein, The step of extracting the target forwarding table from the message to be recovered includes: Determine the recovery header in the message to be recovered; Extract the target forwarding table from the recovery head.
6. The method according to claim 1, wherein, The message forwarding module that sends the message to be recovered and the second forwarding attribute to the message forwarding device includes: Determine the output interface; The outgoing interface is recorded after the second forwarding attribute, and the message to be recovered and the second forwarding attribute are sent to the message forwarding module.
7. A message recovery device, comprising: The receiving unit is used to receive the source message and the first forwarding attribute corresponding to the source message sent by the message sending module in the message forwarding device, and to determine the target forwarding table according to the first forwarding attribute, wherein the source message is a message that the message forwarding device failed to forward; The first processing unit is used to obtain the message to be recovered based on the target forwarding table and the source message; The first sending unit is configured to send the message to be recovered to the loopback port of the message forwarding device, and then receive the message to be recovered and the second forwarding attribute corresponding to the message to be recovered from the message processing module in the message forwarding device. The second processing unit is used to extract the target forwarding table from the message to be recovered and then remove the target forwarding table from the message to be recovered. The second sending unit is used to set the status of the target forwarding table to invalid, and send the message to be recovered and the second forwarding attribute to the message forwarding module in the message forwarding device, so that the message forwarding device forwards the message to be recovered according to the second forwarding attribute; Specifically, when the first processing unit obtains the message to be recovered based on the target forwarding table and the source message, it performs the following: Obtain the preset identification information and extract the interface from the first forwarding attribute; A recovery header is generated based on the preset identification information, the outgoing interface, and the target forwarding table. The preset identification information is used to identify the recovery header. The message to be recovered is obtained based on the recovery header and the source message.
8. The apparatus according to claim 7, wherein, When the receiving unit determines the target forwarding table based on the first forwarding attribute, it specifically performs the following: Based on the first forwarding attribute, determine the target outgoing port; The forwarding table corresponding to the target output port is used as the target forwarding table.
9. The apparatus according to claim 7, wherein, When the first processing unit generates the recovery header based on the preset identification information, the outgoing interface, and the target forwarding table, it specifically performs the following: Determine the recovery strategy; The recovery header is generated based on the preset identification information, the outgoing interface, the target forwarding table, and the recovery strategy.
10. The apparatus according to claim 9, wherein, When determining the recovery strategy, the first processing unit specifically executes the following: Determine the packet loss category based on the packet loss reason in the first forwarding attribute; Based on the packet loss category, determine the recovery strategy.
11. The apparatus according to claim 7, wherein, When the second processing unit extracts the target forwarding table from the message to be recovered, it specifically performs the following: Determine the recovery header in the message to be recovered; Extract the target forwarding table from the recovery head.
12. The apparatus according to claim 7, wherein, When the second sending unit sends the message to be recovered and the second forwarding attribute to the message forwarding module in the message forwarding device, it specifically performs the following: Determine the output interface; The outgoing interface is recorded after the second forwarding attribute, and the message to be recovered and the second forwarding attribute are sent to the message forwarding module.
13. A message recovery system, comprising a message receiving module, a message processing module, a message forwarding module, a message sending module, and a message recovery module; in, The message recovery module performs the method described in any one of claims 1-6.
14. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
15. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.
16. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.
Citation Information
Patent Citations
Method and device for quickly switching links, electronic equipment and storage medium
CN115514702A