Message processing method and related device

By combining the routing parameters and hash key values ​​to determine the message transmission path in the data-side message forwarding process, the problem of long path switching time in the existing technology is solved, and rapid path switching and service flow recovery when a gray fault occurs.

WO2025051079A1PCT designated stage expired Publication Date: 2025-03-13HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/116201
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-07
Filing Date
2024-09-02
Publication Date
2025-03-13

AI Technical Summary

Technical Problem

The prior art takes a long time to achieve a circuit change when a gray fault occurs, and it cannot effectively mitigate the impact of gray faults on business flow.

Method used

By introducing route selection parameters during data-side message forwarding, and participating in the determination of message transmission path with hash key values, rapid route switching is achieved.

Benefits of technology

The changeover configuration work is simplified, and the changeover time overhead is reduced, so that the changeover time can be changed in time after a gray fault occurs, reducing the impact of gray faults on the business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024116201_13032025_PF_FP_ABST
    Figure CN2024116201_13032025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a message processing method and a related device. The method comprises: a first communication apparatus obtaining a hash key value on the basis of an obtained first message, and obtaining a first path selection parameter of a flow corresponding to the first message; and on the basis of the hash key value and the first path selection parameter, the first communication apparatus determining a first path for sending the first message, and sending the first message by means of the first path. In this way, when sensing that a message needs to be forwarded after a gray failure occurs, a first communication apparatus only needs to perform hash path selection by using, as parameters for the hash path selection, a path selection parameter of a flow to which a message to be forwarded belongs and a hash key value in said message, so as to realize, when the gray failure has occurred, rapid switching of forwarding paths of said message, so that a configuration operation that needs to be implemented for path switching is simplified, and the time overheads of path switching are reduced, and thus the path switching can be performed in a timely manner after the gray failure occurs, and the recovery time of a service flow is sufficiently short, thereby reducing the influence of the gray failure on services as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

A message processing method and related equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 7, 2023, with application number 202311155788.9 and invention name “A message processing method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of communication technology, and in particular to a message processing method and related equipment. Background Art

[0003] When a gray fault occurs in the network, a route switching operation is required to allow the service flow to bypass the gray fault location to ensure normal service operation.

[0004] Currently, routing operations are implemented in two ways: 1. The control plane updates the link state and notifies neighbors of the updated link state through a protocol, which in turn updates the routing to reroute the service flow on the data plane; 2. The data plane modifies the hash routing result to reroute the service flow on the data plane. While both of these methods can reroute service flows on the data plane, the reroute takes a long time and cannot mitigate the impact of gray failures on service flows.

[0005] Summary of the Invention

[0006] Based on this, the present application provides a message processing method and related equipment. By introducing routing parameters in the message forwarding process on the data plane, and participating in the determination of the message transmission path together with the hash key value, it is more convenient to implement fast routing and reduce the impact of gray failures on the flow to which the message belongs.

[0007] In a first aspect, the present application provides a message processing method, which may include, for example: a first communication device obtains a hash key value (hash_key) based on a first message obtained, and obtains a first routing parameter of a flow corresponding to the first message, whereby the first communication device determines a first path for sending the first message based on the hash key value and the first routing parameter, and sends the first message through the first path. The hash key value and the first routing parameter are both used by the first communication device to determine a path for sending the first message, and can be understood as parameters participating in hash routing. In this way, when the first communication device senses that a gray fault has occurred and needs to forward a message, it only needs to use the routing parameters of the flow to which the message to be forwarded belongs together with the hash_key in the message to be forwarded as the parameters for hash routing, and perform hash routing. This can achieve rapid switching of the forwarding path of the message to be forwarded when a gray fault occurs. There is no need to implement routing through protocol convergence on the control plane, nor is there any need to implement routing by locally modifying the hash routing result on the communication device on the data plane. This simplifies the configuration work required for routing, reduces the time overhead of routing, and enables timely routing after a gray fault occurs, so that the recovery time of the service flow is short enough, minimizing the impact of gray faults on the service.

[0008] In some implementations, the method may further include: the first communication device updates the first message based on the first routing parameter, the updated first message including the first routing parameter; then, the first communication device sends the first message via the first path, which may include, for example: the first communication device sends the updated first message via the first path. In this way, the first routing parameter, a parameter involved in hash routing, is carried in the first message, so that subsequent communication devices that support the method provided in this application can obtain the first routing parameter from the received first message and perform hash routing based on the first routing parameter and hash_key, thereby making it possible to quickly switch paths on the communication device.

[0009] As an example, for a second communication device included in the first path, if the second communication device supports the method provided in this application, then the second communication device may determine the forwarding path for forwarding the updated first message based on the first routing parameter and the hash key value in the updated first message. If the second communication device does not support the method provided in this application, then the second communication device may determine the forwarding path for forwarding the updated first message based on the hash key value in the updated first message.

[0010] As an example, for different types of first messages, the location where the first routing parameter is carried in the first message is also different. For example, if the updated first message is a Transmission Control Protocol (TCP) message, then the updated first message can carry the first routing parameter through the TCP header, such as the Reserved field of the TCP header of the first message carries the first routing parameter. For another example, if the updated first message is a Virtual Extensible Local Area Network (VXLAN) message, then the updated first message can carry the first routing parameter through the VXLAN header or the User Datagram Protocol (UDP) header, such as the UDP Src.Prot field of the UDP header of the first message or the Reserved field of the VXLAN header carries the first routing parameter. For another example, if the updated first message is a Remote Direct Memory Access (RDMA) message, then the updated first message carries the first routing parameter through a Base Transport Header (BTH), such as the Reserved field of the BTH of the first message carries the first routing parameter.

[0011] In some implementations, the method may further include: the first communication device obtains first indication information of the flow corresponding to the first message, and the first indication information is used to instruct the first communication device to modify the routing parameters; the first communication device updates the first message based on the first indication information, and the updated first message includes a switching identifier corresponding to the first indication information, and the switching identifier is used to instruct the third communication device to switch the path. The third communication device can be understood as the destination node of the first message, and the third communication device supports the method provided in this application. In this way, after the first communication device discovers that there is a gray fault in the path corresponding to the business flow, it notifies the opposite communication device (i.e., the third communication device) of the business flow to also perform a switching operation by carrying a switching identifier in a message of the business flow, so that the business flow avoids gray faults in both directions as much as possible, and the reliability of the network is guaranteed with a greater probability.

[0012] As an example, a first communication device obtains first indication information of a flow corresponding to a first message, which may include: the first communication device obtains the first indication information from a target flow table where the hash key value is located. Then, the method may further include: updating the first indication information in the target flow table to second indication information, where the second indication information is used to indicate that the first communication device has not modified the routing parameters. In this way, after the first indication information is included in the target flow table maintained by the first communication device, a rerouting indicator is added only to any message matching the target flow table based on the indication of the first indication information. Once the rerouting indicator is added to a message, the first communication device may update the first indication information in the target flow table to the second indication information, thereby avoiding the first communication device adding the rerouting indicator to multiple messages belonging to a service flow with a gray fault, causing the opposite end (i.e., the third communication device) to trigger multiple rerouting operations after receiving multiple messages carrying the rerouting indicator. This not only increases unnecessary network overhead, but also easily causes the third communication device to switch the service flow back to the location where the gray fault occurred after multiple rerouting operations.

[0013] In some implementations, if a target flow table is maintained on the first communication device, then the first communication device obtaining the first routing parameter of the flow corresponding to the first message may include: obtaining the first routing parameter from the target flow table.

[0014] In other implementations, the first communication device obtains the first routing parameter of the flow corresponding to the first message, which may also include: obtaining the first routing parameter based on the first message. In one case, if the first communication device is an ingress node of the first path, then the first communication device determines the first routing parameter based on the parameters carried by the first message. The specific parameters in the first message based on which the first routing parameter is determined and the method for determining the first routing parameter based on the parameters in the first message can be flexibly designed. In another case, if the first communication device is an intermediate node, then when the first message is processed at the ingress node, the ingress node can carry the first routing parameter in the first message. Then, after receiving the first message, the first communication device can obtain the first routing parameter by parsing the first message.

[0015] In some implementations, for the case where a target flow table is maintained on the first communication device, before the first communication device obtains the first message and obtains the first routing parameter of the flow corresponding to the first message, the method may also include: when the first communication device determines that there is a gray fault in the network that affects the flow corresponding to the first message, modifying the value of the routing parameter in the target flow table, the modified target flow table includes the first routing parameter, and the target flow table before modification includes the second routing parameter.

[0016] As an example, before the first communication device modifies the value of the routing parameter in the target flow table, the method may also include: the first communication device receives a second message, the second message and the first message belong to the same flow; the first communication device obtains a hash key value based on the second message; the first communication device obtains a second routing parameter of the flow corresponding to the second message, the second routing parameter is used by the first communication device to determine the path for sending the second message; the first communication device determines a second path for sending the second message based on the hash key value and the second routing parameter; the first communication device sends the second message through the second path. It can be seen that before the first communication device perceives the gray failure of the service flow, it can determine a second path different from the first path according to the hash routing method provided in this application, and forward the message of the service flow through the second path.

[0017] In a second aspect, the present application also provides a message processing method, which is applied to the opposite node of the first communication device, namely, a third communication device. The method may include, for example: the third communication device receives a first message from the first communication device, wherein the first message may include a hash key value, a first routing parameter, and a switching identifier, wherein the switching identifier is used to instruct the third communication device to switch the path; the third communication device modifies the routing parameter in the target flow table where the hash key value is located based on the switching identifier, wherein the modified target flow table includes the first routing parameter, and the first routing parameter in the target flow table is used by the third communication device to determine the path for sending the message belonging to the reverse flow of the first message. In this way, after the first communication device switches the path, the third communication device at the opposite end modifies the routing parameter in the local related flow table based on the indication of the switching identifier in the message, thereby preparing for the switching of the reverse service flow. Since it is difficult to locate the fault location when a gray fault occurs, the present application realizes timely bidirectional switching, which can make the service flow avoid the fault location in the network with a greater probability, thereby minimizing the impact of the gray fault on the service.

[0018] In some implementations, the method may further include: a third communication device obtaining a second message based on the first message, wherein the second message does not include the routing indicator and the first routing parameter in the second message is set to zero; and the third communication device forwarding the second message to a fourth communication device. In this way, the third communication device deletes or sets to zero the routing-related content in the first message before forwarding it, so that the fourth communication device after the third communication device will not perceive the modification of the message in the service flow caused by the routing operation, and thus the routing operation will not affect the fourth communication device's processing of the message in the service flow.

[0019] In some implementations, the third communication device modifies the routing parameters in the target flow table of the flow corresponding to the first message based on the routing identifier, which may include: if the routing identifier is valid, the third communication device obtains the modification time of the target flow table and the second routing parameter in the target flow table; if the modification time has exceeded the preset time threshold and the second routing parameter is different from the first routing parameter, the third communication device updates the second routing parameter in the target flow table to the first routing parameter.

[0020] As an example, for different types of first messages, the location where the first routing parameter is carried in the first message is also different. For example, if the first message is a TCP message, then the first message can carry the first routing parameter through the TCP header, such as the Reserved field of the TCP header of the first message carries the first routing parameter. For another example, if the first message is a VXLAN message, then the first message can carry the first routing parameter through the VXLAN header or the User Datagram Protocol, UDP header, such as the UDP Src.Prot field of the UDP header of the first message or the Reserved field of the VXLAN header. For another example, if the first message is an RDMA message, then the first message carries the first routing parameter through the BTH, such as the Reserved field of the BTH of the first message carries the first routing parameter.

[0021] In various possible implementations of the first aspect or the second aspect above, the first communication device may be, for example, a switch, a router, a service network card, or a virtual switch.

[0022] In the third aspect, the present application provides a message processing device, which is applied to a first communication device. The device may include, for example: a first obtaining unit, a second obtaining unit, a third obtaining unit, a first determining unit and a first forwarding unit. The first obtaining unit is used to obtain a first message; the second obtaining unit is used to obtain a hash key value based on the first message; the third obtaining unit is used to obtain a first routing parameter of a flow corresponding to the first message; the first determining unit is used to determine a first path for sending the first message based on the hash key value and the first routing parameter; and the first forwarding unit is used to send the first message through the first path. The hash key value and the first routing parameter are both used by the first communication device to determine the path for sending the first message, and can be understood as parameters participating in hash routing.

[0023] In some implementations, the apparatus may further include: a first updating unit configured to update the first message based on the first routing parameter, wherein the updated first message includes the first routing parameter; and a first forwarding unit configured to send the updated first message via the first path.

[0024] As an example, for a second communication device included in the first path, if the second communication device supports the method provided in this application, then the second communication device may determine the forwarding path for forwarding the updated first message based on the first routing parameter and the hash key value in the updated first message. If the second communication device does not support the method provided in this application, then the second communication device may determine the forwarding path for forwarding the updated first message based on the hash key value in the updated first message.

[0025] As an example, for different types of first messages, the location where the first routing parameter is carried in the first message is also different. For example, if the updated first message is a TCP message, then the updated first message can carry the first routing parameter through the TCP header, such as the Reserved field of the TCP header of the first message carries the first routing parameter. For another example, if the updated first message is a VXLAN message, then the updated first message can carry the first routing parameter through the VXLAN header or the UserDatagram Protocol, UDP header, such as the UDP Src.Prot field of the UDP header of the first message or the Reserved field of the VXLAN header. For another example, if the updated first message is an RDMA message, then the updated first message carries the first routing parameter through the BTH, such as the Reserved field of the BTH of the first message carries the first routing parameter.

[0026] In some implementations, the apparatus may further include: a fourth obtaining unit, configured to obtain first indication information of a flow corresponding to the first message, the first indication information being used to instruct the first communications apparatus to modify routing parameters; and a second updating unit, configured to update the first message based on the first indication information, the updated first message including a routing identifier corresponding to the first indication information, the routing identifier being used to instruct the third communications apparatus to switch routes.

[0027] As an example, the fourth obtaining unit is specifically configured to obtain the first indication information from the target flow table where the hash key value is located. The apparatus may further include a third updating unit. The third updating unit is configured to update the first indication information in the target flow table to second indication information, where the second indication information is configured to indicate that the first communication apparatus has not modified the routing parameters.

[0028] In some implementations, if a target flow table is maintained on the first communication device, the first obtaining unit is specifically configured to obtain the first routing parameter from the target flow table.

[0029] In some other implementations, the first obtaining unit is specifically configured to obtain a first routing parameter according to the first message.

[0030] In some implementations, for the case where a target flow table is maintained on the first communication device, the device may also include: a modification unit, which is used to modify the value of the routing parameter in the target flow table before obtaining the first routing parameter of the flow corresponding to the first message by obtaining the first message, when it is determined that there is a gray fault in the network that affects the flow corresponding to the first message, the modified target flow table includes the first routing parameter, and the target flow table before modification includes the second routing parameter.

[0031] As an example, the device may further include: a receiving unit, a fifth obtaining unit, a sixth obtaining unit, a second determining unit, and a second forwarding unit. The receiving unit is configured to receive a second message before modifying the value of the routing parameter in the target flow table, where the second message and the first message belong to the same flow; the fifth obtaining unit is configured to obtain a hash key value based on the second message; the sixth obtaining unit is configured to obtain a second routing parameter of the flow corresponding to the second message, where the second routing parameter is used by the first communication device to determine a path for sending the second message; the second determining unit is configured to determine a second path for sending the second message based on the hash key value and the second routing parameter; and the second forwarding unit is configured to send the second message via the second path.

[0032] It should be noted that the specific implementation method and technical effects achieved by the device provided in this application can be found in the method provided in the first aspect.

[0033] In a fourth aspect, the present application further provides a message processing device, which is applied to a third communication device. The device may include, for example, a receiving unit and a modifying unit. The receiving unit is configured to receive a first message from a first communication device, wherein the first message may include a hash key value, a first routing parameter, and a routing identifier, wherein the routing identifier is used to instruct the third communication device to perform routing; the modifying unit is configured to modify the routing parameters in the target flow table where the hash key value is located based on the routing identifier, wherein the target flow table includes the first routing parameter after modification, and the first routing parameter in the target flow table is used by the third communication device to determine a path for sending messages belonging to a reverse flow of the first message.

[0034] In some implementations, the apparatus may further include: an obtaining unit and a sending unit. The obtaining unit is configured to obtain a second message based on the first message, wherein the second message does not include the routing identifier and the first routing parameter in the second message is set to zero; and the sending unit is configured to forward the second message to a fourth communication device.

[0035] In some implementations, the modification unit is specifically used to: if the routing identifier is valid, obtain the modification time of the target flow table and the second routing parameter in the target flow table; if the modification time has exceeded a preset time threshold and the second routing parameter is different from the first routing parameter, update the second routing parameter in the target flow table to the first routing parameter.

[0036] As an example, for different types of first messages, the location where the first routing parameter is carried in the first message is also different. For example, if the first message is a TCP message, then the first message can carry the first routing parameter through the TCP header, such as the Reserved field of the TCP header of the first message carries the first routing parameter. For another example, if the first message is a VXLAN message, then the first message can carry the first routing parameter through the VXLAN header or the User Datagram Protocol, UDP header, such as the UDP Src.Prot field of the UDP header of the first message or the Reserved field of the VXLAN header. For another example, if the first message is an RDMA message, then the first message carries the first routing parameter through the BTH, such as the Reserved field of the BTH of the first message carries the first routing parameter.

[0037] It should be noted that the specific implementation method and technical effects achieved by the device provided in this application can be found in the method provided in the second aspect.

[0038] In various possible implementations of the third or fourth aspect above, the first communication device may be, for example, a switch, a router, a service network card, or a virtual switch.

[0039] In a fifth aspect, the present application provides a communication device, which includes a processor and a memory, the memory being used to store instructions or program codes, and the processor being used to call and run the instructions or program codes from the memory to execute the method in the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect.

[0040] In a sixth aspect, the present application provides a communication system, comprising a first communication device and a third communication device, the first communication device being used to execute the method in the first aspect or any possible implementation of the first aspect; the third communication device being used to execute the method in the second aspect or any possible implementation of the second aspect.

[0041] In the seventh aspect, the present application provides a storage medium comprising instructions, programs or codes, which, when executed on a processor, enables the processor to execute the method of the first aspect, any possible implementation of the first aspect, the second aspect or any possible implementation of the second aspect.

[0042] In an eighth aspect, the present application provides a program product comprising readable instructions, wherein the readable instructions are used to execute the method of the first aspect, any possible implementation of the first aspect, the second aspect, or any possible implementation of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] FIG1 is a schematic diagram of the architecture of a network 100 according to an embodiment of the present application;

[0044] FIG2 is a flow chart of a message processing method 100 according to an embodiment of the present application;

[0045] FIG3 is a schematic diagram of the structure of a TCP header in a first message in an embodiment of the present application;

[0046] FIG4 is a schematic diagram of the structure of a first message in an embodiment of the present application;

[0047] FIG5 is a schematic diagram of the structure of a BTH in a first message in an embodiment of the present application;

[0048] FIG6 is a schematic structural diagram of a message processing device 600 according to an embodiment of the present application;

[0049] FIG7 is a schematic structural diagram of another message processing device 700 according to an embodiment of the present application;

[0050] FIG8 is a schematic structural diagram of a communication device 800 according to an embodiment of the present application;

[0051] FIG9 is a schematic structural diagram of another communication device 900 according to an embodiment of the present application;

[0052] FIG10 is a schematic structural diagram of a communication system 1000 in an embodiment of the present application. DETAILED DESCRIPTION

[0053] During network operation, various failures may occur, affecting normal network operation. Among these failures, in addition to link failures and congestion, there are also some gray failures. Gray failures can be understood as follows: First, when a network fault detection tool observes that the network is healthy, but at least one application in the network observes that the network is unhealthy, a gray failure is considered to have occurred in the network; Second, a gray failure is a hardware failure that causes non-instantaneous packet loss of traffic forwarded on a communication device (such as a switch). Gray failures may include, but are not limited to, silent failures, misconfigurations, routing black holes, hardware failures, or physical port failures. Gray failures can manifest as, but are not limited to, random packet loss, performance degradation, or memory jitter. For example, a connectivity test may sometimes show connectivity and sometimes disconnection. Therefore, it is impossible to determine whether a fault exists through connectivity testing, but services in the network will be affected by packet loss (e.g., interruption).

[0054] Since gray faults are very common in the network and affect the normal operation of services in the network, in order to improve network performance, when a gray fault is found in the network, it is necessary to perform timely routing so that the service flow in the network can bypass the fault location of the gray fault and ensure the normal operation of the service. At present, there are two ways to implement routing when a gray fault occurs: one is to notify the updated link status through a protocol on the control plane, and the communication device receiving the notification updates the route based on the link status in the notification. In this way, when the service flow is transmitted in the network, it can be re-routed based on the updated route, thereby achieving path switching; the second is to modify the hash routing result on the data plane. In this way, when the service flow is transmitted in the network, the service flow is introduced into other forwarding paths based on the modified hash routing result, thereby achieving path switching.

[0055] While both of the above methods achieve the goal of route switching, the required route switching time is relatively long, which cannot meet the demand for fast route switching for gray faults. For example, in the above method 1, route switching requires full reliance on protocol convergence, which can take up to seconds, resulting in a significant impact of gray faults on service flows. Furthermore, because the protocol cannot detect gray faults related to routing path configuration, such as configuration errors and routing black holes, it is not suitable for route switching in the case of gray faults related to routing path configuration. The above method 2, which implements route switching by modifying the hash routing result, is equivalent to directly switching the service flow from one forwarding path to another. The problems include: 1. Load balancing cannot be guaranteed; 2. Because gray faults cannot be accurately located, it is easy for the forwarding path in a certain direction to switch from the normal path to the faulty path that includes the gray fault location after route switching; 3. The presence of communication devices in the network that do not support direct offset hash results makes this method unpopular in the network; 4. It requires additional control plane processing, which increases the time consumed by route switching.

[0056] Based on this, in order to be able to switch routes in a timely manner after a gray failure occurs, so that the recovery time of the service flow after the gray failure occurs is sufficiently short, thereby reducing the impact of the gray failure on the service, an embodiment of the present application provides a message processing method, in which a first communication device can obtain a hash_key based on a first message to be transmitted, and can also obtain a first routing parameter of the flow corresponding to the first message (hereinafter referred to as a seed), thereby determining a first path for sending the first message based on the hash_key and the seed, and sending the first message through the first path. Wherein, both the hash_key and the seed are used by the first communication device to determine the path for sending the first message. In this way, the communication device only needs to perform hash routing based on the hash_key in the message and the seed of the flow to which the message belongs when forwarding the message after sensing the occurrence of a gray fault, so as to achieve rapid path switching when a gray fault occurs. There is no need to implement routing through protocol convergence on the control plane, nor is there any need to implement routing by modifying the hash routing result locally on the communication device on the data plane. This simplifies the configuration work required for routing, reduces the time overhead of routing, and enables timely routing after a gray fault occurs, so that the recovery time of the service flow is short enough, minimizing the impact of gray faults on the service.

[0057] If the first communication device is an ingress node, in one case, the first communication device obtaining the first routing parameter for the flow corresponding to the first message may include: the first communication device determining the first routing parameter based on the parameters carried by the first message. Alternatively, in another case, the first communication device may locally maintain a flow table corresponding to each service flow, wherein the flow table includes the routing parameter. Then, the first communication device obtaining the first routing parameter for the flow corresponding to the first message may include: the first communication device determining, from the locally maintained flow table, a target flow table that matches the flow corresponding to the first message, and obtaining the first routing parameter from the target flow table.

[0058] If the first communication device is an intermediate node, then when the first message is processed at the ingress node, the ingress node may carry the first routing parameter in the first message. Then, upon receiving the first message, the first communication device can obtain the first routing parameter by parsing the first message. For example, each communication device locally maintains a flow table corresponding to different service flows, and the flow table may include at least a hash_key and a seed. Taking the ingress node receiving the first message as an example, the message processing method provided in an embodiment of the present application may include: the ingress node receives a first message that matches the value of the hash_key in a target flow table, where the seed value in the target flow table is a first value. The ingress node carries the first value in the first message to obtain an updated first message, and forwards the updated first message to the first communication device via the first path based on the hash_key value and the first value in the updated first message. In this way, the first communication device only needs to perform hash routing based on the hash_key value and the seed value carried in the received message, thereby achieving rapid path switching when a gray fault occurs.

[0059] In addition, an embodiment of the present application further provides a message processing method, corresponding to the sender of the first message described above, and the receiver of the first message (i.e., a third communication device), after receiving the first message from the first communication device, determines that the first message includes a hash_key, a first routing parameter, and a rerouting identifier, the rerouting identifier being used to instruct the third communication device to perform a rerouting. Based on the indication of the rerouting identifier, the routing parameter in the target flow table where the hash_key is located is modified. The modified target flow table includes the first routing parameter, which is used by the third communication device to determine a path for sending messages belonging to the reverse flow of the first message. Thus, after the first communication device switches the route, the third communication device at the opposite end modifies the seed value in the local related flow table based on the indication of the rerouting identifier in the message, thereby preparing for the rerouting of the reverse service flow. Since it is difficult to locate the fault location when a gray fault occurs, the embodiment of the present application implements timely bidirectional rerouting, which can increase the probability that the service flow will be transmitted in the network away from the fault location, thereby minimizing the impact of the gray fault on the service.

[0060] In order to make the technical solution provided by the embodiment of the present application clearer, the method of the embodiment of the present application is briefly introduced below in conjunction with the exemplary scenario shown in Figure 1.

[0061] FIG1 is a schematic diagram of the architecture of a network 100 provided in an embodiment of the present application. The network 100 may include at least: a communication device 11, a communication device 12, ... a communication device 1N (N is an integer greater than or equal to 1) and a communication device 21, a communication device 22, ... a communication device 2M (M is an integer greater than or equal to 1, M is greater than or equal to N), each of which is connected to a communication device 2j, where i = 1, 2, ..., N and j = 1, 2, ..., M. For example, the network 100 may be a data center network, where the communication device 1i corresponds to a spine node in the data center network, and the communication device 2j corresponds to a leaf node in the data center network.

[0062] Taking the example of two equal-cost paths (i.e., path 1 and path 2) from communication device 21 to communication device 2M, the hash routing process on each communication device in the current method and the embodiments of the present application is described. Path 1 sequentially passes through communication device 21, communication device 11, and communication device 2M, while path 2 sequentially passes through communication device 21, communication device 12, and communication device 2M.

[0063] At present, the communication device 21 can maintain the correspondence 1 between path 1 and hash_key 1 and the correspondence 2 between path 2 and hash_key 2. When a message to be transmitted has path 1 and path 2 as equivalent paths, the communication device 21 obtains the hash_key from the message to be transmitted. If the obtained hash_key is hash_key 1, then based on the obtained hash_key 1 matching the correspondence 1, it is determined that the message to be transmitted is forwarded based on the path 1 in the correspondence 1; if the obtained hash_key is hash_key 2, then based on the obtained hash_key 2 matching the correspondence 2, it is determined that the message to be transmitted is forwarded based on the path 2 in the correspondence 2. Among them, hash_key can be all or part of the characteristics of the business flow. The characteristics of the business flow can be, for example, the five-tuple of the business flow (i.e., source Internet Protocol (IP) address, source port, destination IP address, destination port and transport layer protocol). Then, hash_key can be the five-tuple or three-tuple of the business flow (for example, it can include source IP address, destination IP address and transport layer protocol).

[0064] In the method provided in the embodiments of the present application, the parameters involved in hash routing include not only the hash_key currently used for hash routing but also the seed. Communication device 21 maintains a flow table corresponding to each service flow. For example, communication device 21 may maintain flow table 1 that includes at least hash_key 1 and seed 1. Furthermore, communication device 21 may also maintain correspondences between each hash routing parameter and a path, such as correspondence 3 between hash_key 1 + seed 1 and path 1, and correspondence 4 between hash_key 1 + seed 2 and path 2. Taking the value of seed 1 in flow table 1 equal to 0 in the initial state as an example, if the communication device 21 does not perceive a gray fault, when there is a message 1 to be transmitted on the communication device 21, and the equivalent path for the transmission of the message 1 to be transmitted includes path 1, the communication device 21 obtains hash_key 1 from the message 1 to be transmitted, obtains seed 1 from the flow table 1, and matches the obtained hash_key 1+seed 1 to the corresponding relationship 3, and determines to forward the message 1 to be transmitted based on the path 1 in the corresponding relationship 3; if the communication device 21 perceives that a gray fault occurs in the service flow corresponding to hash_key 1, the communication device 21 modifies seed 1 in flow table 1 to seed 2 to obtain flow table 2, and flow table 2 at least includes hash_key 1 and seed2, the value of seed2 can be equal to 1, for example. When there is a message 2 to be transmitted on the communication device 21, and the equivalent path for transmitting the message 2 to be transmitted includes path 1, the communication device 21 carries seed2 in flow table 2 in the message 2 to be transmitted to obtain the message 3 to be transmitted. Thus, based on the hash_key1+seed2 matching the corresponding relationship 4, it is determined that the message 3 to be transmitted is forwarded based on path 2 in the corresponding relationship 4. In this way, by adding parameters participating in hash routing (i.e., adding seeds), the communication device locally maintains a flow table including all parameters participating in hash routing. When the communication device senses a gray fault, it modifies the value of the seed in the corresponding flow table. After receiving a message matching the flow table, the message carries the modified seed value in the flow table, and selects a path according to the updated hash_key+seed. This achieves the purpose of quickly switching paths when a gray fault occurs, making the recovery time of the service flow sufficiently short, and minimizing the impact of the gray fault on the service.

[0065] In addition, since it is impossible to locate the specific location of the fault, in order to further improve the reliability of the network, it is usually necessary to switch the bidirectional paths of the service flow after the gray fault is detected. In the embodiment of the present application, in addition to hash_key and seed, the flow table may also include a seed change (seed_changed) table item. Seed_changed is used to indicate whether the value of the seed in the flow table has changed. The value of seed_changed can also be used to determine whether to add a switching identifier to the message to be transmitted. For example, when the value of seed_changed is not equal to 0, it indicates that the value of the seed in the flow table has changed, and it is determined that a switching identifier needs to be added to the message to be transmitted. When the value of seed_changed is equal to 0, it indicates that the value of the seed in the flow table has not changed, and it is determined that there is no need to add a switching identifier to the message to be transmitted. Among them, the switching identifier can be, for example, a flag that can be defined in the message to be transmitted. The switching identifier is used to indicate whether the receiver of the message to be transmitted needs to switch routes. For example, if the value of the switching identifier in the message to be transmitted 1 is equal to 0, it indicates that the receiver (i.e., the communication device 2M) does not need to switch routes. That is, after the communication device 2M receives the message to be transmitted 1, it determines that no switching operation is required based on the switching identifier with a value of 0 in the message to be transmitted; if the value of the switching identifier in the message to be transmitted 3 is equal to 1, it indicates that the communication device 2M needs to switch routes. That is, after the communication device 2M receives the message to be transmitted 3, it determines to perform a switching operation based on the switching identifier with a value of 1 in the message to be transmitted.

[0066] In the embodiments of the present application, the communication device may sense a gray fault in a manner that may include, but is not limited to: Method 1, the communication device counts and compares the traffic in the inbound and outbound directions of each business flow to determine whether a gray fault corresponding to the business flow may exist; Method 2, the communication device counts and compares the number of requests and responses that occur to determine whether a gray fault corresponding to the business flow may exist; Method 3, the communication device senses events such as packet loss or whether a response is received within a certain period of time to determine whether a gray fault corresponding to the business flow may exist. Typically, the communication device detects whether a business flow corresponding to the hash_key has a gray fault based on the hash_key. Therefore, when the communication device senses a gray fault, it can determine the business flow associated with the gray fault.

[0067] In the embodiment of the present application, the execution subject can be any communication device that can transmit messages, for example, it can be an edge device of a data center network (such as a top of rack (TOR) switch). Referring to Figure 1, the communication device 21 can be, for example, a TOR switch 21, and the communication device 2M can be, for example, a TOR switch 2M. In the direction from the communication device 21 to the communication device 2M, the TOR switch 21 can be understood as a sender TOR switch, and the TOR switch 2M is a receiver TOR switch; in the direction from the communication device 2M to the communication device 21, the TOR switch 21 can be understood as a receiver TOR switch, and the TOR switch 2M is a sender TOR switch. Each communication device can correspond to different roles based on the position and direction on the transmission path of different traffic, but each communication device has the function of executing the method provided in the embodiment of the present application as a sender and a receiver.

[0068] It should be understood that Figure 1 only illustrates the communication devices and connection relationships in the network. The network may include any other number of communication devices and other connection relationships, and the embodiments of the present application are not limited to this. The network architecture shown in Figure 1 is only an example, and the application scenarios of the methods provided in the embodiments of the present application are not limited to the scenarios shown in Figure 1.

[0069] In the embodiment of the present application, the communication device can be a network device such as a switch, a router, a service network card or a virtual switch, or a terminal device such as a mobile phone or a laptop computer; it can also be a component of a network device or a terminal device, such as a single board or line card on the network device; it can also be a functional module on the network device or the terminal device; it can also be a chip used to implement the method provided in the embodiment of the present application, and the embodiment of the present application is not specifically limited. When the communication device is a chip, the transceiver unit used to implement the method can be, for example, an interface circuit of the chip, and the processing unit can be a processing circuit with processing functions in the chip. The communication devices can be directly connected, for example, but not limited to, via an Ethernet cable or an optical cable. For example, in Figure 1, the communication device 21 and the communication device 2M can be end-side devices of the service, such as the communication device 21 is the user equipment of the service and the communication device 2M is the server; for another example, the communication device 21 and the communication device 2M can also be network-side devices of the service, such as the communication device 21 is the entry network device of the service (also called the head node or entry node) and the communication device 2M is the exit network device of the service (also called the tail node or exit node).

[0070] In the embodiments of the present application, the communication device and the node have the same meaning and can be understood and used interchangeably.

[0071] In order to more clearly introduce the embodiment of the present application, the message processing method provided in the embodiment of the present application is described below with reference to FIG2 .

[0072] FIG2 is a flow chart of a message processing method 100 provided in an embodiment of the present application. In the method 100, the embodiment of the present application is introduced in the form of interaction between a first communication device and a third communication device. The first communication device and the third communication device can be any two communication devices in a network that can transmit messages. For example, they can be edge devices of the network. Corresponding to the scenario shown in FIG1, the first communication device can correspond to the communication device 21, and the third communication device can correspond to the communication device 2M.

[0073] As shown in FIG2 , the method 100 may include, for example, the following steps S101 to S107 :

[0074] S101: A first communication device obtains a first message.

[0075] As an example, if the first communication device is the first node supporting method 100 provided in an embodiment of the present application that the first message passes through, that is, the first communication device is the entry node of a subsequently determined first path, then the first message may not carry routing parameters. In this example, S101 may include: the first communication device receiving or generating the first message.

[0076] As another example, if the first communication device is not the first node supporting the method 100 provided in the embodiment of the present application that the first message passes through, that is, the first communication device is an intermediate node of a subsequently determined first path, then the first message may carry routing parameters. In this example, S101 may include: the first communication device receiving a first message sent from an ingress node of the first message, and obtaining the first message in S101 based on processing the received first message.

[0077] S102: The first communication device obtains a hash_key according to the first message. The hash_key is used by the first communication device to determine a path for sending the first message.

[0078] As an example, S102 may include: the first communication device parsing the first message and obtaining a hash_key from the first message. The hash_key may be, for example, all or part of a quintuple of the first message, and different messages of the same service flow may have the same quintuple or triple. The following description uses the service flow quintuple as an example for the hash_key.

[0079] S103: The first communication device obtains a first routing parameter of a flow corresponding to the first message. The first routing parameter is used by the first communication device to determine a path for sending the first message.

[0080] The routing parameters are parameters that participate in hash routing together with hash_key in the method provided in the embodiment of the present application. In one case, the routing parameters can be configured on the communication device that supports the method provided in the embodiment of the present application through a command line or the like, and the routing parameters on the communication device that supports the method provided in the embodiment of the present application can also be modified through a command line or the like (such as modifying the second routing parameter to the first routing parameter, or modifying the first routing parameter to the second routing parameter, the first routing parameter and the second routing parameter can be different values ​​of the same parameter, and the parameter can also be represented as a seed in the embodiment of the present application). In another case, the routing parameters can also be determined by one or more parameters in the service message (or data message), and the method of modifying the routing parameters can include: modifying the value of one or more parameters in the service message, and / or, modifying the calculation method for determining the routing parameters based on the one or more parameters.

[0081] As an example, S103 may include: the first communication device obtains the first routing parameter based on the first message. In one case, if the first communication device is the entry node of the first path, then the first communication device determines the first routing parameter based on the parameter carried by the first message. The parameter carried in the first message used to determine the first routing parameter can be flexibly selected based on demand, and the method of determining the first routing parameter based on the parameter carried in the first message can also be flexibly designed based on demand. In another case, if the first communication device is an intermediate node of the first path and supports the method provided in the embodiment of the present application, then when the first message is processed at the entry node of the first path, the entry node can carry the first routing parameter in the first message. Then, after receiving the first message, the first communication device can obtain the first routing parameter by parsing the first message.

[0082] As another example, S103 may include: the first communication device parses the first message to obtain a hash_key, determines a target flow table corresponding to the hash_key from a locally maintained flow table, and obtains a first routing parameter from the target flow table.

[0083] The following description takes the routing parameter as seed and the value of the seed corresponding to the first routing parameter as the first value as an example.

[0084] The first communication device maintains a flow table corresponding to each service flow. The traffic can at least include parameters participating in hash-based routing. In one case, the flow table includes the hash_key of the service flow. The seed can be understood as one of the parameters in the hash_key. The hash_key includes all the parameters for hash-based routing. In this case, the hash_key can, for example, include the five-tuple of the service flow + seed. In another case, the flow table includes the hash_key and seed of the service flow. The hash_key and seed are two parts of the parameters for hash-based routing. In the embodiments of this application, the case where the flow table includes the hash_key and seed is used as an example for illustration.

[0085] Taking the first communication device as the ingress node of the first path as an example, the target flow table is the flow table corresponding to the first service flow to which the first packet belongs among the multiple flow tables maintained on the first communication device. The first service flow includes a forward service flow and a reverse service flow. The target flow table maintained on the first communication device can be understood as the target flow table corresponding to the forward service flow in the first service flow, and the target flow table maintained on the third communication device can be understood as the target flow table corresponding to the reverse service flow in the first service flow. The hash_key in the target flow table can include the five-tuple of the first service flow. The value of the seed in the target flow table is determined by whether the first communication device perceives a grey failure and the rule for modifying the seed value after perceiving the grey failure.

[0086] As an example, the target flow table can be as shown in Table 1 below:

[0087] Table 1 Target Flow Table

[0088] In Table 1, SIP represents the source IP address, DIP represents the destination IP address, SPort represents the source port, DPort represents the destination port, and Protocol represents the transport layer protocol. The value of the hash_key in the target flow table is as shown in Table 1, which is <IP address 1, IP address 2, port 1, port 2, and protocol 1>, and the value of the seed is the first value, corresponding to the first routing parameter in S103.

[0089] After a gray fault is found in the path corresponding to a service flow, a certain packet of the service flow is used to notify the peer communication device of the service flow to also perform a path switching operation, so that the service flow can avoid the gray fault in both directions as much as possible, and the reliability of the network can be guaranteed with a higher probability. The flow table may further include seed_changed, where seed_changed is used to indicate whether the seed corresponding to the service flow has changed. If the value of seed_changed indicates that the seed corresponding to the service flow has changed, a path switching identifier may be carried in the packet transmitted by the communication device belonging to the service flow, and the path switching identifier is set to 1 to notify the peer communication device receiving the packet to perform a path switching operation.

[0090] As another example, the target flow table may be as shown in Table 2 below:

[0091] Table 2 Target Flow Table

[0092] In Table 2, the value of hash_key in the target flow table is <IP address 1, IP address 2, port 1, port 2, and protocol 1>, the value of seed is the first value, and the value of seed_changed is the second value.

[0093] When the first communication device senses that a gray fault occurs in the transmission path of the first service flow, it modifies the value of seed (or seed and seed_changed) in the target flow table to obtain the target flow table shown in Table 1 (or Table 2), and then performs the operation corresponding to S103. Before S103, method 100 may also include: when it is determined that there is a gray fault in the network that affects the flow corresponding to the first message, modifying the value of the routing parameter in the target flow table, and the modified target flow table includes the first routing parameter. Taking the table item seed_changed included in the target flow table, and the first routing parameter corresponding to the first value of seed as an example, when the first communication device determines that there is a gray fault in the network that affects the first service flow, it modifies the value of seed and the value of seed-changed in the target flow table corresponding to the first service flow, and the modified value of seed is the first value, and the modified value of seed-changed is the second value. Among them, modifying the seed value in the target flow table can be implemented based on any algorithm. For example, the seed value in the target flow table can be added by one to obtain the seed value in the modified target flow table. For another example, the seed value in the target flow table can be processed by the first formula to obtain the seed value in the modified target flow table. The first formula can be, for example: seed = 2*seed+3, where the seed before the equal sign represents the seed in the target flow table after modification, and the seed after the equal sign represents the seed in the target flow table before modification. Similarly, modifying the value of seed_changed in the target flow table can be implemented based on any algorithm. For example, the value of seed_changed in the target flow table can be incremented by one to obtain the modified value of seed_changed in the target flow table. For another example, the value of seed_changed in the target flow table can be calculated by applying a second formula to the value of seed_changed in the target flow table to obtain the modified value of seed_changed in the target flow table. The second formula can be, for example, seed_changed = 3*seed + 2, where the seed_changed before the equal sign represents the seed_changed in the target flow table after the modification, and the seed_changed after the equal sign represents the seed_changed in the target flow table before the modification. Alternatively, modifying the value of seed_changed in the target flow table can also be done by changing the value of seed_changed to a preset fixed value.

[0094] As an example, assuming that the target flow table before modification includes a second routing parameter, then before obtaining the target flow table shown in Table 2, method 100 may further include: S100a, the first communication device receives a second message, where the second message and the first message belong to the same flow; S100b, the first communication device obtains the hash key value based on the second message; S100c, the first communication device obtains the second routing parameter of the flow corresponding to the second message, where the second routing parameter is used by the first communication device to determine a path for sending the second message; S100d, the first communication device determines a second path for sending the second message based on the hash key value and the second routing parameter; S100e, the first communication device sends the second message via the second path. The following description takes the fourth value corresponding to the seed of the second routing parameter as an example.

[0095] Among them, the fourth value can be equal to 0, for example. During the execution of S100a to S100e, the value of seed_changed in the target flow table can be 0. When the first communication device does not perceive the existence of a gray fault corresponding to the first service flow, the first communication device determines that the hash routing result of the second message is the second path according to the hash_key and the fourth value in the second message. Corresponding to the embodiment shown in Figure 1 above, the second path can correspond to path 1, for example. When the first communication device perceives the existence of a gray fault corresponding to the first service flow, the first communication device can modify the value of seed in the target flow table from 0 to 1, that is, the first value is 1. When receiving the first message belonging to the first service flow, the hash routing result of the first message is determined to be the first path according to the hash_key and the first value. Corresponding to the embodiment shown in Figure 1 above, the second path can correspond to path 1 in Figure 1, for example, and the first path can correspond to path 2 in Figure 1, for example.

[0096] When the first communication device senses the existence of a gray fault corresponding to the first service flow, processing the received first message may include: the first communication device updates the first message based on the first routing parameter, and the updated first message includes the first routing parameter (i.e., the first value).

[0097] As an example, when the updated first message is a Transmission Control Protocol (TCP) message, the first communication device may carry the first value in any usable field in the TCP header of the first message. For example, the TCP header of the first message may include a reserved field, and the first value may be carried by the Reserved field. The applicable scenario in this example may be, for example, a non-virtual extended local area network (VXLAN) scenario. The structure of the TCP header in the first message can be shown in Figure 3. The TCP header may include: a source port field, a destination port field, a sequence number field, an acknowledgment number field, a data offset field, a Reserved field, URG, ACK, PSH, RST, SYN, FIN, a window field, a checksum field, an urgent pointer field, an option (variable length) field, and a padding field. The first communication device carries the first value in the Reserved field of the TCP header shown in Figure 3.

[0098] As another example, when the updated first message is a VXLAN message, the first communication device may carry the first value in any usable field in the VXLAN header or User Datagram Protocol (UDP) header of the first message. For example, the UDP header of the first message may include a UDP source port (UDP Src.Prot) field, and the first value may be carried by the UDP Src.Prot field; for another example, the VXALN header of the first message may include a Reserved field, and the first value may be carried by the Reserved field. The applicable scenario in this example may be, for example, a VXLAN scenario. The structure of the first message can be shown in Figure 4. The first message may include, from the outside to the inside, an outer Media Access Control (MAC) header, an outer IP header, a UDP header, a VXLAN header, and an original Layer 2 (Original L2) header. The UDP header may include a UDP Src.Prot field, and the VXLAN header may include a Reserved field. The first communication device carries the first value in the UDP Src.Prot field of the UDP header or the Reserved field of the VXLAN header shown in Figure 4.

[0099] As another example, when the updated first message is a Remote Direct Memory Access (RDMA) message, the first communication device may carry the first value in any usable field in the Base Transport Header (BTH) of the first message. For example, the BTH of the first message may include a Reserved field, and the first value may be carried in the Reserved field. The applicable scenario in this example may be, for example, an RDMA scenario. The structure of the first message can be shown in Figure 5. The BTH of the first message may include: Opcode field, S, M, Pad, Transport Header Version (TVer) field, Partition Key field, Reserved (abbreviated as rsvd) field, Destination Queue Pair (Destination QP) field, A and Packet Sequence Number (PSN) field, wherein the Opcode field is used to indicate the type of the first message or the higher-layer protocol type in the InfiniBand payload (IB payload); S is the abbreviation of Solicited Event, indicating that the responder should generate an event; M is the abbreviation of MigReq, which is generally used for migration status; Pad indicates how many extra bytes are filled into the IB payload; TVer indicates the version number of the first message; Partition Key is used to characterize the logical memory partition associated with the first message; Destination QP field indicates the sequence number of the destination queue pair; A is Acknowledge Request (PSN). The PSN is an abbreviation of a Reserved Request, indicating that the response to the first message can be scheduled by the responder; the PSN is used to detect lost or duplicate data packets. The first communication device carries a first value in the Reserved field of the BTH shown in FIG5 .

[0100] In some possible implementations, updating the first message by the first communication device based on the first routing parameter may include: the first communication device obtaining first indication information (corresponding to a second value) of a flow corresponding to the first message, the first indication information being used to instruct the first communication device to modify the routing parameter; and the first communication device updating the first message based on the first indication information, the updated first message including a routing indicator corresponding to the first indication information, the routing indicator being used to instruct a third communication device to perform a routing switch, the third communication device being the destination node of the first message. Obtaining the first indication information of the flow corresponding to the first message may include obtaining the first indication information from a target flow table where the hash key value is located. The method may further include updating the first indication information in the target flow table to second indication information (i.e., a third value), the second indication information being used to indicate that the first communication device has not modified the routing parameter. In this way, when the first communication device receives other messages belonging to the first service flow, the routing indicator is not added to the other messages, thereby preventing the third communication device from continuously receiving messages carrying the routing indicator and performing a routing switch operation if the first communication device detects a gray fault corresponding to the first service flow.

[0101] The following description is given by taking as an example the case where the value of seed-changed corresponding to the first indication information is the second value and the value of seed-changed corresponding to the second indication information is the fourth value.

[0102] If the target flow table also includes seed-changed, and the value of seed-changed is a second value, and the second value indicates that the value of seed in the target flow table has changed, then the first communication device carries the first value and the switching identifier in the first message based on the second value of seed-changed to obtain an updated first message, and the switching identifier is used to instruct the third communication device to switch. The second value can be any value greater than 0, for example, the second value can be equal to 1. When the value of seed-changed is not equal to the third value, the value of seed-changed is considered to be the second value. After the first communication device modifies the value of seed and the value of seed-changed in the target flow table, it only adds the switching identifier based on the indication of the second value to any message that matches the target flow table. Once the switching identifier is added to a message, the first communication device can modify the value of seed-changed in the target flow table to the third value. The third value can be equal to 0, for example. In this way, the first communication device is prevented from adding a switching identifier to multiple messages, causing the other end (i.e., the third communication device) to trigger multiple switching operations after receiving multiple messages carrying the switching identifier. This not only increases unnecessary network overhead, but also easily causes the third communication device to switch the first service flow back to the location where the gray fault occurs after multiple switching operations.

[0103] As an example, after the first communication device modifies the value of seed-changed in the target flow table to a third value, the method 100 may further include: the first communication device receives a third message, the third message matches the hash_key in the target flow table, and the target flow table also includes seed; the first communication device, based on the third value of seed-changed, carries the first value in the third message to obtain an updated third message; and the first communication device, based on the value of hash_key and the first value, forwards the updated third message to the third communication device via the first path. In this way, after the first communication device adds the route switching identifier to any one of the multiple messages, only the seed value (i.e., the first value) is added to the other messages, which not only saves network overhead but also avoids the third communication device from performing multiple route switching operations.

[0104] S104: The first communication device determines a first path for sending the first message according to the hash key value and the first routing parameter.

[0105] S105: The first communication device sends the first message through the first path.

[0106] It should be noted that the implementation method of S104 can refer to the current hash routing method. The difference is that the parameters participating in the hash routing in S104 include the value of hash_key carried in the first packet (i.e., <IP address 1, IP address 2, port 1, port 2, and protocol 1>) and the first routing parameter (i.e., the first value of seed).

[0107] After S104, the first communication device obtains the result of hash routing - the first path. Thus, the first packet is forwarded through the first path. Here, the first path can refer to, for example, a segment of the path starting from the first communication device on the total path from the first communication device to the fourth communication device. The egress node of the first path is the third communication device, and the fourth communication device is the destination host of the first packet or the destination node in the network.

[0108] In some possible implementation manners, if the intermediate node between the first communication device and the third communication device has the function of executing the method provided in the embodiments of the present application, then when the intermediate node receives the first packet, it can read the first value from the first packet, perform hash routing based on the first value + the value of hash_key, determine the forwarding path, and thus forward the packet based on the determined forwarding path. Taking the example that the second communication device is an intermediate node included in the first path, the second communication device determines the path for transmitting the first packet based on the first routing parameter and the hash key value in the updated first packet. The value of hash_key can be read from the first packet. That the intermediate node has the function of executing the method provided in the embodiments of the present application can be understood as that the intermediate node supports hash routing based on the value of seed + hash_key.

[0109] In other possible implementation manners, if the intermediate node between the first communication device and the third communication device does not have the function of executing the method provided in the embodiments of the present application, then when the intermediate node receives the first packet, it can perform hash routing based on the value of hash_key, determine the forwarding path, and thus forward the packet based on the determined forwarding path. The value of hash_key can be read from the first packet.

[0110] It should be noted that the intermediate node may not maintain a flow table, saving the configuration overhead of the intermediate node. Or, the intermediate node may also maintain a flow table, and the flow table may not include seed and the seed_changed option. If the target flow table is maintained on the intermediate node, then the intermediate node can also obtain the value of hash_key from the target flow table.

[0111] S106: The third communication device receives a first message from the first communication device. The first message includes a hash key value, a first routing parameter, and a routing identifier. The routing identifier is used to instruct the third communication device to perform routing.

[0112] S107, the third communication device modifies the routing parameters in the target flow table where the hash key value is located based on the route change identifier, and the modified target flow table includes the first routing parameter. The first routing parameter in the target flow table is used by the third communication device to determine the path for sending the message belonging to the reverse flow of the first message.

[0113] Taking the target flow table maintained on the first communication device as shown in Table 2 as an example, the target flow table maintained on the third communication device can be shown in Table 3 below:

[0114] Table 3 Target flow table

[0115] Alternatively, the target flow table maintained on the third communication device may be as shown in Table 4 below:

[0116] Table 4 Target flow table

[0117] It should be noted that the algorithm for modifying the value of seed and the algorithm for modifying the value of seed_changed and the modification timing, etc., can be considered to be the same on all communication devices in the network.

[0118] If the first communication device detects the gray fault earlier than the third communication device detects the gray fault, and the third communication device has not yet modified the target flow table based on the gray fault when S106 occurs, the target flow table maintained by the third communication device can be shown in Table 3 above, with the seed value in the target flow table being the fourth value, which is different from the first value in the first message. In this case, the third communication device can modify the seed value in the target flow table shown in Table 3. After the modification, the seed value in the target flow table can be the first value, which is consistent with the seed value in the second message.

[0119] If both the first communication device and the third communication device perceive a gray fault, and the third communication device has already modified the target flow table based on the gray fault when S106 occurs, the target flow table maintained by the third communication device may be as shown in Table 4 above, where the seed value in the target flow table is the first value, which is the same as the first value in the first message. In this case, to further verify whether the seed value in the target flow table on the third communication device was modified after the gray fault was perceived, it may be determined whether the time since the seed value in the target flow table was modified exceeds a time threshold. If not, it is assumed that the seed value in the target flow table on the third communication device was modified after the gray fault was perceived, and the third communication device may not modify the seed value in the target flow table shown in Table 4. If not, it is assumed that the seed value in the target flow table on the third communication device was modified before the gray fault was perceived, and the third communication device may modify the seed value in the target flow table shown in Table 4, so that the seed value in the target flow table after modification is not equal to the first value or the fourth value. That is, S107 may include, for example: the third communication device performs the step of modifying the seed value in the target flow table that matches the hash-key value based on the switching identifier and the target condition, wherein the target condition may include any one of the following conditions: the seed value in the target flow table is consistent with the seed value in the first message, and the time when the seed value in the target flow table is modified exceeds a time threshold; the seed value in the target flow table is inconsistent with the seed value in the first message. If the seed value in the target flow table is consistent with the seed value in the first message, and the time when the seed value in the target flow table is modified does not exceed the time threshold, then the third communication device does not perform the step of modifying the seed value in the target flow table that matches the hash-key value. Alternatively, it can also be understood that S107 may include: if the routing identifier is valid, the third communication device obtains the modification time of the target flow table and the second routing parameter in the target flow table; if the modification time has exceeded the preset time threshold and the second routing parameter is different from the first routing parameter, the third communication device updates the second routing parameter in the target flow table to the first routing parameter.

[0120] Through S107, the target flow table corresponding to the first service flow on the third communication device is modified, and preparations are made for switching the reverse service flow for the first service flow on the third communication device.

[0121] In some possible implementations, the third communication device processes and forwards the first message. That is, after S106, the method 100 may further include: the third communication device obtains a fourth message based on the first message, wherein the fourth message does not include a switching identifier and the seed value in the fourth message is zero; and the third communication device forwards the fourth message to a fourth communication device. The fourth communication device may be a terminal device such as a server connected to the third communication device. In this way, by deleting or setting zero to the switching-related content in the first message and then transmitting it backward, the fourth communication device after the third communication device will not perceive the modification of the message in the service flow caused by the switching operation, and thus the switching operation will not affect the fourth communication device's processing of the message in the service flow.

[0122] It can be seen that through this method 100, the communication device only needs to modify the seed value in the flow table related to the gray fault after sensing the occurrence of the gray fault. When forwarding the message, the communication device performs hash routing based on the hash_key value of the message to be forwarded and the seed value, so as to achieve rapid path switching when the gray fault occurs. There is no need to implement routing through protocol convergence on the control plane, nor is there any need to implement routing by modifying the hash routing result locally on the communication device on the data plane. This simplifies the configuration work required for routing, reduces the time overhead of routing, and enables timely routing after the gray fault occurs, so that the recovery time of the business flow is short enough, and minimizes the impact of the gray fault on the business. Moreover, after the first communication device switches the route, the third communication device at the opposite end modifies the value of the seed in the local related flow table based on the indication of the route switching identifier in the message, and prepares for the route switching of the reverse business flow. Since it is difficult to locate the fault location when a gray fault occurs, the embodiment of the present application realizes timely two-way route switching, which can make the business flow avoid the fault location in the network with a greater probability, thereby minimizing the impact of the gray fault on the business.

[0123] In the above method 100, the first communication device first perceives the gray fault corresponding to the first business flow as an example for description. In the embodiment of the present application, there is also a situation where the third communication device first perceives the gray fault corresponding to the first business flow. In this case, the first communication device can receive a fifth message from the third communication device, and the fifth message includes the value of the hash-key, the value of the seed, and the switching identifier; then, on the one hand, the first communication device modifies the value of the seed in the target flow table; on the other hand, the first communication device obtains a sixth message based on the fifth message, and the sixth message does not include the switching identifier and the seed value is zero. The first communication device forwards the sixth message to the fifth communication device. Among them, the fifth communication device can be a terminal device such as a server connected to the first communication device. In this way, the first communication device modifies the target flow table corresponding to the first business flow, and prepares for the switching of the forward business flow for the first business flow on the first communication device; moreover, by deleting or setting the content related to switching in the fifth message to 0 and then transmitting it backward, the fifth communication device after the first communication device will not perceive the modification of the message in the business flow caused by the switching operation, and thus the switching operation will not affect the processing of the message in the business flow by the fifth communication device.

[0124] It should be noted that the steps performed by the first communication device, the second communication device and the third communication device can be implemented independently of each other or implemented together as an overall process. As long as the effect of the fast switching design in the embodiment of the present application can be achieved, it can be regarded as an embodiment provided by the present application.

[0125] Accordingly, the embodiment of the present application further provides a message processing device 600, which is applied to a first communication device, as shown in FIG6 . The device 600 may include: a first obtaining unit 601, a second obtaining unit 602, a third obtaining unit 603, a first determining unit 604, and a first forwarding unit 605.

[0126] The first obtaining unit 601 is configured to obtain a first message. The first obtaining unit 601 may execute S101 shown in FIG2 .

[0127] The second obtaining unit 602 is configured to obtain a hash key value according to the first message, where the hash key value is used by the first communication device to determine a path for sending the first message. The second obtaining unit 602 may execute S102 shown in FIG2 .

[0128] The third obtaining unit 603 is configured to obtain a first routing parameter of the flow corresponding to the first message, where the first routing parameter is used by the first communication device to determine a path for sending the first message. The third obtaining unit 603 may execute S103 shown in FIG2 .

[0129] The first determining unit 604 is configured to determine a first path for sending the first message according to the hash key value and the first routing parameter. The first determining unit 604 may execute S104 shown in FIG2 .

[0130] The first forwarding unit 605 is configured to send the first message through the first path. The first forwarding unit 605 may execute S105 shown in FIG2 .

[0131] In some implementations, the apparatus 600 may further include: a first updating unit configured to update the first message based on the first routing parameter, wherein the updated first message includes the first routing parameter; and a first forwarding unit configured to send the updated first message via the first path.

[0132] As an example, for a second communication device included in the first path, if the second communication device supports the method provided in this application, then the second communication device may determine the forwarding path for forwarding the updated first message based on the first routing parameter and the hash key value in the updated first message. If the second communication device does not support the method provided in this application, then the second communication device may determine the forwarding path for forwarding the updated first message based on the hash key value in the updated first message.

[0133] As an example, for different types of first messages, the location where the first routing parameter is carried in the first message is also different. For example, if the updated first message is a TCP message, then the updated first message can carry the first routing parameter through the TCP header, such as the Reserved field of the TCP header of the first message carrying the first routing parameter. For another example, if the updated first message is a VXLAN message, then the updated first message can carry the first routing parameter through the VXLAN header or the User Datagram Protocol, UDP header, such as the UDP Src.Prot field of the UDP header of the first message or the Reserved field of the VXLAN header carrying the first routing parameter. For another example, if the updated first message is an RDMA message, then the updated first message carries the first routing parameter through the BTH, such as the Reserved field of the BTH of the first message carrying the first routing parameter.

[0134] In some implementations, the apparatus 600 may further include: a fourth obtaining unit, configured to obtain first indication information of a flow corresponding to the first message, the first indication information being used to instruct the first communications apparatus to modify routing parameters; and a second updating unit, configured to update the first message based on the first indication information, the updated first message including a routing identifier corresponding to the first indication information, the routing identifier being used to instruct the third communications apparatus to switch routes.

[0135] As an example, the fourth obtaining unit is specifically configured to obtain the first indication information from the target flow table where the hash key value is located. The apparatus may further include a third updating unit. The third updating unit is configured to update the first indication information in the target flow table to second indication information, where the second indication information is configured to indicate that the first communication apparatus has not modified the routing parameters.

[0136] In some implementations, if a target flow table is maintained on the first communication device, the first obtaining unit 601 is specifically configured to obtain the first routing parameter from the target flow table.

[0137] In some other implementations, the first obtaining unit 601 is specifically configured to obtain a first routing parameter according to the first message.

[0138] In some implementations, for the case where a target flow table is maintained on the first communication device, the device 600 may also include: a modification unit, which is used to modify the value of the routing parameter in the target flow table before obtaining the first routing parameter of the flow corresponding to the first message by obtaining the first message, when it is determined that there is a gray fault in the network that affects the flow corresponding to the first message, the modified target flow table includes the first routing parameter, and the target flow table before modification includes the second routing parameter.

[0139] As an example, the apparatus 600 may further include: a receiving unit, a fifth obtaining unit, a sixth obtaining unit, a second determining unit, and a second forwarding unit. The receiving unit is configured to receive a second message before modifying the value of the routing parameter in the target flow table, where the second message and the first message belong to the same flow; the fifth obtaining unit is configured to obtain a hash key value based on the second message; the sixth obtaining unit is configured to obtain a second routing parameter of the flow corresponding to the second message, where the second routing parameter is used by the first communication device to determine a path for sending the second message; the second determining unit is configured to determine a second path for sending the second message based on the hash key value and the second routing parameter; and the second forwarding unit is configured to send the second message via the second path.

[0140] It should be noted that, for the specific implementation method and technical effects achieved by the device 600 provided in this application, please refer to the relevant description of the implementation steps of the first communication device in the method 100 shown in Figure 2.

[0141] Accordingly, the embodiment of the present application further provides a message processing device 700, which is applied to a third communication device, as shown in FIG7 . The device 700 may include: a receiving unit 701 and a modifying unit 702.

[0142] The receiving unit 701 is configured to receive a first message from a first communication device, wherein the first message may include a hash key value, a first routing parameter, and a routing identifier, wherein the routing identifier is used to instruct the third communication device to perform routing. The receiving unit 701 may execute S106 shown in FIG2 .

[0143] A modification unit 702 is configured to modify, based on the routing identifier, a routing parameter in the target flow table containing the hash key value, such that after modification, the target flow table includes a first routing parameter, which is used by the third communication device to determine a path for sending a message belonging to a reverse flow of the first message. The modification unit 702 may execute S107 shown in FIG2 .

[0144] In some implementations, the apparatus 700 may further include: an obtaining unit and a sending unit. The obtaining unit is configured to obtain a second message based on the first message, wherein the second message does not include the routing identifier and the first routing parameter in the second message is set to zero; and the sending unit is configured to forward the second message to a fourth communication apparatus.

[0145] In some implementations, the modification unit 702 is specifically used to: if the routing identifier is valid, obtain the modification time of the target flow table and the second routing parameter in the target flow table; if the modification time has exceeded the preset time threshold and the second routing parameter is different from the first routing parameter, update the second routing parameter in the target flow table to the first routing parameter.

[0146] As an example, for different types of first messages, the location where the first routing parameter is carried in the first message is also different. For example, if the first message is a TCP message, then the first message can carry the first routing parameter through the TCP header, such as the Reserved field of the TCP header of the first message carries the first routing parameter. For another example, if the first message is a VXLAN message, then the first message can carry the first routing parameter through the VXLAN header or the User Datagram Protocol, UDP header, such as the UDP Src.Prot field of the UDP header of the first message or the Reserved field of the VXLAN header. For another example, if the first message is an RDMA message, then the first message carries the first routing parameter through the BTH, such as the Reserved field of the BTH of the first message carries the first routing parameter.

[0147] It should be noted that, for the specific implementation method and technical effects achieved by the device 700 provided in this application, reference can be made to the relevant description of the implementation steps of the third communication device in the method 100 shown in FIG. 2 .

[0148] In various possible implementations of the above-mentioned apparatus 600 and apparatus 700 , the first communication apparatus may be, for example, a switch, a router, a service network card, or a virtual switch.

[0149] Referring to Figure 8 , an embodiment of the present application provides a communication device 800. The communication device 800 may be any of the communication devices in any of the above embodiments, for example, the communication device 21, the communication device 11, or the notification information 2M in Figure 1 ; or, for example, the first communication device, the second communication device, or the third communication device in Figure 2 . The communication device 800 may implement the functions of the various communication devices in the above embodiments. The communication device 800 includes at least one processor 801, a bus system 802, a memory 803, and at least one communication interface 804.

[0150] The communication device 800 is a hardware device that can be used to implement the functional modules of the message processing device 600 shown in Figure 6. For example, those skilled in the art will appreciate that the second obtaining unit 602, the third obtaining unit 603, and the first determining unit 604 in the message processing device 600 shown in Figure 6 can be implemented by the at least one processor 801 calling code in the memory 803. Alternatively, the communication device 800 is a hardware device that can be used to implement the functional modules of the message processing device 700 shown in Figure 7. For example, those skilled in the art will appreciate that the modifying unit 702 in the message processing device 700 shown in Figure 7 can be implemented by the at least one processor 801 calling code in the memory 803.

[0151] Optionally, the communication device 800 may also be used to implement the functions of the network device in any of the above embodiments.

[0152] Optionally, the processor 801 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0153] The bus system 802 may include a path for transmitting information between the components.

[0154] The communication interface 804 is used to communicate with other devices or communication networks.

[0155] The above-mentioned memory 803 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.

[0156] The memory 803 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 801. The processor 801 is used to execute the application code stored in the memory 803, thereby realizing the functions of the method of the present application.

[0157] In a specific implementation, as an embodiment, the processor 801 may include one or more CPUs, such as CPU0 and CPU1 in FIG8 .

[0158] In a specific implementation, as an embodiment, the communication device 800 may include multiple processors, such as the processor 801 and the processor 807 in FIG8 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0159] Figure 9 is a schematic diagram of the structure of another communication device 900 provided in an embodiment of the present application. Communication device 900 may be any of the communication devices in any of the aforementioned embodiments, such as communication device 21, communication device 11, or notification information 2M in Figure 1 ; or the first communication device, second communication device, or third communication device in Figure 2 . Communication device 900 may implement the functions of any of the communication devices in the aforementioned embodiments.

[0160] The communication device 900 includes a main control board 910 and an interface board 930 .

[0161] Main control board 910 , also known as the main processing unit (MPU) or route processor card, controls and manages the various components in communication device 900 , including routing calculations, device management, device maintenance, and protocol processing. Main control board 910 includes a central processing unit (CPU) 911 and memory 912 .

[0162] The interface board 930 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients) interfaces. The interface board 930 includes a central processing unit (CPU) 931, a network processor (NPU) 932, a forwarding table memory (FMM) 934, and a physical interface card (PIC) 933.

[0163] The central processing unit 931 on the interface board 930 is used to control and manage the interface board 930 and communicate with the central processing unit 911 on the main control board 910 .

[0164] The network processor 932 is used to implement packet forwarding processing. The network processor 932 can be in the form of a forwarding chip. Specifically, the processing of uplink packets includes: processing of the packet input interface and forwarding table lookup; the processing of downlink packets includes: forwarding table lookup, etc.

[0165] The physical interface card 933 is used to implement the physical layer docking function. The original traffic enters the interface board 930 from this, and the processed message is sent from the physical interface card 933. The physical interface card 933 includes at least one physical interface, which is also called a physical port. The physical interface card 933 corresponds to the FlexE physical interface in the system architecture. The physical interface card 933, also known as a daughter card, can be installed on the interface board 930. It is responsible for converting the optical and electrical signals into messages and performing a validity check on the messages before forwarding them to the network processor 932 for processing. In some embodiments, the central processing unit 931 of the interface board 930 can also perform the functions of the network processor 932, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 932 is not required in the physical interface card 933.

[0166] Optionally, the communication device 900 includes multiple interface boards. For example, the communication device 900 further includes an interface board 940 . The interface board 940 includes a central processing unit 941 , a network processor 942 , a forwarding table memory 944 , and a physical interface card 943 .

[0167] Optionally, the communication device 900 further includes a switching fabric board 920. The switching fabric board 920 may also be referred to as a switch fabric unit (SFU). When the network device has multiple interface boards 930, the switching fabric board 920 is used to exchange data between the interface boards. For example, the interface board 930 and the interface board 940 can communicate via the switching fabric board 920.

[0168] The main control board 910 and the interface board 930 are coupled. For example, the main control board 910, the interface board 930, the interface board 940, and the switching network board 920 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 910 and the interface board 930, and communication between the main control board 910 and the interface board 930 is performed via the IPC channel.

[0169] Logically, the communication device 900 comprises a control plane and a forwarding plane. The control plane includes a main control board 910 and a central processing unit 931. The forwarding plane includes various components that perform forwarding, such as a forwarding table entry memory 934, a physical interface card 933, and a network processor 932. The control plane performs functions such as routing, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining device status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 932 forwards messages received by the physical interface card 933 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 934. In some embodiments, the control plane and the forwarding plane can be completely separate and not located on the same device.

[0170] If the communication device 900 is configured as a first communication device, the network processor 932 can trigger the physical interface card 933 to obtain a first message; the central processor 911 can obtain a hash key value based on the first message, obtain a first routing parameter of the flow corresponding to the first message, and determine a first path for sending the first message based on the hash key value and the first routing parameter; the network processor 932 can trigger the physical interface card 933 to send the first message through the first path.

[0171] It should be understood that the first obtaining unit 601, the first forwarding unit 605 in the message processing device 600, and the communication interface 804 in the communication device 800 can be equivalent to the physical interface card 933 or the physical interface card 943 in the communication device 900; the second obtaining unit 602, the third obtaining unit 603, the first determination unit 604 in the message processing device 600, and the processor 801 in the communication device 800 can be equivalent to the central processing unit 911 or the central processing unit 931 in the communication device 900.

[0172] It should be understood that the operations on the interface board 940 in the embodiments of the present application are consistent with those on the interface board 930 and, for the sake of brevity, will not be described in detail here. The communication device 900 of this embodiment may correspond to the message processing device 600 or the communication device 800 in the aforementioned embodiments. The main control board 910, interface board 930, and / or interface board 940 in the communication device 900 may implement the functions and / or various steps performed by the message processing device 600 or the communication device 800 in the aforementioned embodiments and, for the sake of brevity, will not be described in detail here.

[0173] If the communication device 900 is configured as a third communication device, the network processor 932 can trigger the physical interface card 933 to receive the first message from the first communication device; the central processor 911 can modify the routing parameters in the target flow table where the hash key value is located based on the switching identifier, and the target flow table after modification includes the first routing parameters, and the first routing parameters in the target flow table are used by the third communication device to determine the path for sending the message belonging to the reverse flow of the first message.

[0174] It should be understood that the receiving unit 701 in the message processing device 700 and the communication interface 804 in the communication device 800 can be equivalent to the physical interface card 933 or the physical interface card 943 in the communication device 900; the modification unit 702 in the message processing device 700 and the processor 801 in the communication device 800 can be equivalent to the central processing unit 911 or the central processing unit 931 in the communication device 900.

[0175] It should be understood that the operations on the interface board 940 in the embodiments of the present application are consistent with those on the interface board 930 and, for the sake of brevity, will not be further described. The communication device 900 of this embodiment may correspond to the message processing device 700 or the communication device 800 in the aforementioned embodiments. The main control board 910, interface board 930, and / or interface board 940 in the communication device 900 may implement the functions and / or various steps performed by the message processing device 700 or the communication device 800 in the aforementioned embodiments and, for the sake of brevity, will not be further described here.

[0176] It should be understood that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly achieve load sharing and redundant backup. In a centralized forwarding architecture, the network device may not need a switching network board, and the interface board is responsible for processing the business data of the entire system. In a distributed forwarding architecture, the network device can have at least one switching network board, which realizes data exchange between multiple interface boards through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices with a distributed architecture are greater than those of devices with a centralized architecture. Alternatively, a network device can consist of a single card, without a switching fabric board (SFB), integrating the functions of the interface board and the main control board. In this case, the CPUs on the interface board and the main control board can be combined into a single CPU, performing the combined functions of the two. This type of device has lower data exchange and processing capabilities (for example, low-end network devices such as switches or routers). The specific architecture used depends on the specific network deployment scenario.

[0177] In some possible embodiments, each of the above-mentioned network devices or network devices can be implemented as a virtualized device. For example, the virtualized device can be a virtual machine (English: Virtual Machine, VM) running a program for sending message functions, and the virtual machine is deployed on a hardware device (for example, a physical server). A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The virtual machine can be configured as each communication device in the embodiments of the present application. For example, each network device or network device can be implemented based on a general physical server in combination with Network Function Virtualization (NFV) technology. Each network device or network device is a virtual host, a virtual router or a virtual switch. Those skilled in the art can virtualize each network device or network device with the above-mentioned functions on a general physical server in combination with NFV technology by reading this application, and will not be repeated here.

[0178] It should be understood that the network devices in the various product forms mentioned above respectively have any functions of the network devices or communication devices in the above method embodiments, which will not be described in detail here.

[0179] The present application also provides a chip comprising a processor and an interface circuit, the interface circuit being configured to receive instructions and transmit them to the processor; the processor, which may be, for example, a specific implementation of the message processing device in the present application, being configured to execute the aforementioned routing method. The processor is coupled to a memory configured to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements the method in any of the aforementioned method embodiments.

[0180] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0181] Optionally, the memory in the chip system may be one or more memories. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in this application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. This application does not specifically limit the type of memory or the configuration of the memory and the processor.

[0182] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0183] In addition, an embodiment of the present application further provides a communication system 1000, as shown in FIG10 . The communication system 1000 may include a first communication device 1001 and a third communication device 1002. The first communication device 1001 is configured to execute the method executed by the first communication device in the embodiment shown in FIG2 ; the third communication device 1002 is configured to execute the method executed by the third communication device in the embodiment shown in FIG2 . The first communication device 1001 may correspond to the message processing device 600 shown in FIG6 , and the third communication device 1002 may correspond to the message processing device 700 shown in FIG7 .

[0184] In addition, an embodiment of the present application also provides a readable storage medium, which stores program code or instructions. When the program code or instructions are executed on a processor, the processor executes the method in any one of the implementation modes in the embodiment shown in Figure 2 above.

[0185] In addition, an embodiment of the present application also provides a program product, which, when executed on a processor, enables the processor to execute any one of the implementation methods of the aforementioned method 100.

[0186] It should be understood that "based on determining B according to A" mentioned in the embodiments of the present application does not mean that B is determined only according to A, but B can also be determined according to A and / or other information.

[0187] The "first" in the names of "first routing parameter" and "first message" mentioned in this application is only used as a name identifier and does not mean the first in order. The same rule applies to "second" and so on.

[0188] Through the description of the above embodiments, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a general hardware platform. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment or certain parts of the embodiments of the present application.

[0189] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments and device embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The device and system embodiments described above are merely schematic. The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without making any creative effort.

[0190] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. It should be noted that those skilled in the art may make several improvements and modifications without departing from the scope of protection of the present application, and such improvements and modifications should also be considered as within the scope of protection of the present application.

Claims

1. A message processing method, characterized in that: Applied to a first communication device, comprising: Obtaining a first message; Obtaining a hash key value according to the first message, where the hash key value is used by the first communication device to determine a path for sending the first message; Obtaining a first routing parameter of a flow corresponding to the first message, where the first routing parameter is used by the first communication device to determine a path for sending the first message; Determine a first path for sending the first message according to the hash key value and the first routing parameter; The first message is sent through the first path.

2. The method according to claim 1, characterized in that The method further comprises: updating the first message based on the first routing parameter, where the updated first message includes the first routing parameter; The sending the first message through the first path includes: The updated first message is sent through the first path.

3. The method according to claim 2, characterized in that The first path includes a second communication device, and the first routing parameter and the hash key value in the updated first message are used by the second communication device to determine the path.

4. The method according to claim 2 or 3, characterized in that: The updated first message is a Transmission Control Protocol TCP message, and the updated first message carries the first routing parameter through a TCP header; Alternatively, the updated first message is a virtual extended local area network VXLAN message, and the updated first message carries the first routing parameter through a VXLAN header or a user datagram protocol UDP header; Alternatively, the updated first message is a remote direct memory access RDMA message, and the updated first message carries the first routing parameter through a basic transmission header BTH.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtaining first indication information of a flow corresponding to the first message, where the first indication information is used to instruct the first communication device to modify a routing parameter; The first message is updated based on the first indication information, and the updated first message includes a path switching identifier corresponding to the first indication information, and the path switching identifier is used to instruct the third communication device to switch paths.

6. The method according to claim 5, characterized in that The obtaining first indication information of the flow corresponding to the first message includes: Obtaining the first indication information from the target flow table where the hash key value is located; The method further comprises: The first indication information in the target flow table is updated to second indication information, where the second indication information is used to indicate that the first communication device has not modified the routing parameters.

7. The method according to claim 6, characterized in that The obtaining a first routing parameter of a flow corresponding to the first message includes: The first routing parameter is obtained from the target flow table.

8. The method according to claim 7, characterized in that Before obtaining the first routing parameter of the flow corresponding to the first message, the method further includes: When it is determined that there is a gray fault in the network that affects the flow corresponding to the first message, the value of the routing parameter in the target flow table is modified, the modified target flow table includes the first routing parameter, and the target flow table before modification includes the second routing parameter.

9. The method according to claim 8, characterized in that Before modifying the value of the routing parameter in the target flow table, the method further includes: receiving a second message, where the second message and the first message belong to the same flow; Obtaining the hash key value according to the second message; Obtaining the second routing parameter of the flow corresponding to the second message, where the second routing parameter is used by the first communication device to determine a path for sending the second message; Determine a second path for sending the second message according to the hash key value and the second routing parameter; The second message is sent through the second path.

10. The method according to any one of claims 1 to 5, characterized in that: The obtaining a first routing parameter of a flow corresponding to the first message includes: The first routing parameter is obtained according to the first message.

11. A message processing method, characterized in that: Applied to a third communication device, the method includes: receiving a first message from a first communication device, wherein the first message includes a hash key value, a first routing parameter, and a routing identifier, wherein the routing identifier is used to instruct the third communication device to perform routing; Based on the switching identifier, the routing parameters in the target flow table where the hash key value is located are modified, and the target flow table after modification includes the first routing parameters. The first routing parameters in the target flow table are used by the third communication device to determine the path for sending messages belonging to the reverse flow of the first message.

12. The method according to claim 11, characterized in that The method further comprises: Obtaining a second message according to the first message, wherein the second message does not include the route switching identifier and the first route selection parameter in the second message is set to zero; Forward the second message to a fourth communication device.

13. The method according to claim 11 or 12, characterized in that: The modifying, based on the routing identifier, the routing parameters in the target flow table of the flow corresponding to the first message includes: If the routing identifier is valid, obtaining the modification time of the target flow table and the second routing parameter in the target flow table; If the modification time has passed a preset time threshold and the second routing parameter is different from the first routing parameter, the second routing parameter in the target flow table is updated to the first routing parameter.

14. The method according to any one of claims 11 to 13, characterized in that: The first message is a Transmission Control Protocol TCP message, and the first message carries the first routing parameter through a TCP header; Alternatively, the first message is a virtual extended local area network VXLAN message, and the first message carries the first routing parameter through a VXLAN header or a user datagram protocol UDP header; Alternatively, the first message is a remote direct memory access RDMA message, and the first message carries the first routing parameter through a basic transmission header BTH.

15. The method according to any one of claims 1 to 14, characterized in that: The first communication device is a switch, a router, a service network card or a virtual switch.

16. A communication device, characterized in that: include: A processing unit, configured to perform other operations except the receiving operation and the sending operation in the method according to any one of claims 1 to 15; A transceiver unit, used to perform the receiving operation and the sending operation in the method described in any one of claims 1-15.

17. A communication device, characterized in that: The communication device includes a memory and a processor; The memory is used to store instructions; The processor is used to execute the instructions in the memory and perform the method according to any one of claims 1 to 15.

18. A communication system, characterized in that: The communication system comprises a first communication device and a second communication device; The first communication device is used to execute the method described in any one of claims 1 to 10 or 15 above; The second communication device is used to execute the method described in any one of claims 11-15.

19. A storage medium, characterized in that: The storage medium includes instructions, and when the instructions are executed on a processor, the processor is caused to execute the method according to any one of claims 1 to 15.

20. A program product, characterized in that The method comprises readable instructions, wherein the readable instructions are used to implement the method according to any one of claims 1 to 15.

Citation Information

Patent Citations

  • Message processing method and related equipment

    CN119583440A

  • Method for avoiding Hash polarization in data center network and chip implementation device

    CN107682268A

  • Data packet transmission method and device, computer equipment and storage medium

    CN116527575A

  • MPLS network system

    US20030142669A1