Message processing method and related equipment
By introducing the path selection parameters and hash key values in the forwarding of data-side message, the problem of long traffic switching time caused by gray failure in the prior art is solved, and rapid traffic switching and rapid recovery of traffic flow are achieved.
Patent Information
- Application Number
- CN202311155788.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-07
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2043-09-07
AI Technical Summary
The prior art cannot quickly realize the switching of business flows when gray failure occurs, resulting in a greater impact on business flows.
During the forwarding of data-side message, the route selection parameters are introduced and hash key values are used to determine the message transmission path to achieve rapid path switching.
It simplifies the configuration of the route change, reduces the time overhead of the route change, reduces the impact of gray failures on the service flow, and ensures the rapid recovery of the service flow.
Smart Images

Figure CN119583440A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message processing method and related equipment. Background Art
[0002] When a gray fault occurs in the network, a switching operation is required to allow the service flow to bypass the fault location of the gray fault and ensure the normal operation of the service.
[0003] At present, the implementation methods of switching operations include: Method 1, the control plane updates the link status and notifies the updated link status to the neighbors through the protocol, and then updates the route to achieve the switching of the service flow on the data plane; Method 2, the data plane modifies the hash routing result to achieve the switching of the service flow on the data plane. Although the above two methods can achieve the switching of service flows on the data plane, the switching time is relatively long and cannot reduce the impact of gray failures on service flows. Summary of the invention
[0004] Based on this, the present application provides a message processing method and related equipment, which introduces routing parameters in the message forwarding process on the data plane, and participates in the determination of the message transmission path together with the hash key value, making it more convenient to implement fast routing and reducing the impact of gray failures on the flow to which the message belongs.
[0005] In the 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) according to a first message obtained, and obtains a first routing parameter of a stream corresponding to the first message, so that the first communication device determines a first path for sending the first message according to the hash key value and the first routing parameter, and sends the first message through the first path. Among them, 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 that both participate in hash routing. In this way, when the first communication device senses that a message needs to be forwarded after a gray fault occurs, 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 of the 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 modifying the hash routing result locally on the communication device on the data plane. This simplifies the configuration work required for routing switching and reduces the time overhead for routing switching, so that routing can be switched in time after a gray fault occurs, so that the recovery time of the service flow is short enough, and the impact of gray faults on the service is minimized.
[0006] In some implementations, the method may further 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; then, the first communication device sends the first message through the first path, for example, it may include: the first communication device sends the updated first message through the first path. In this way, the first routing parameter, which is a parameter involved in hash routing, is carried in the first message, so that the communication device that supports the method provided by the present application after the first communication device 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 implement fast path switching on the communication device.
[0007] As an example, for the second communication device included in the first path, if the second communication device supports the method provided in the present application, then the second communication device can 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 the present application, then the second communication device can determine the forwarding path for forwarding the updated first message based on the hash key value in the updated first message.
[0008] 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.
[0009] In some implementations, the method may also 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 the present application. In this way, after the first communication device finds that there is a gray fault in the path corresponding to the service flow, it notifies the opposite communication device (i.e., the third communication device) of the service flow to also perform a switching operation by carrying a switching identifier in a message of the service flow, so that the service flow avoids gray faults in both directions as much as possible, and the reliability of the network is guaranteed with a greater probability.
[0010] As an example, the first communication device obtains the first indication information of the flow corresponding to the first message, which may include: the first communication device obtains the first indication information from the target flow table where the hash key value is located. Then, the method may also include: updating the first indication information in the target flow table to the second indication information, and 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 switching identifier is added only in any message matching the target flow table based on the indication of the first indication information. Once the switching identifier is added to a certain message, the first communication device can update the first indication information in the target flow table to the second indication information, so as to avoid the first communication device from adding the switching identifier to multiple messages belonging to the service flow where the gray fault occurs, causing the opposite end (i.e., the third communication device) to trigger multiple switching operations after receiving multiple messages carrying the switching identifier, which not only increases the unnecessary network overhead, but also easily causes the third communication device to switch the service flow back to the location where the gray fault occurs after multiple switching operations.
[0011] 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.
[0012] In some 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 according to the first message. In one case, if the first communication device is an entry node of the first path, then the first communication device determines the first routing parameter according to the parameters carried by the first message. Specifically, the parameters in the first message are used to determine the first routing parameter, 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 entry node, 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.
[0013] In some implementations, in 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.
[0014] 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 the 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.
[0015] In the second aspect, the present application also provides a message processing method, which is applied to the opposite node of the first communication device, namely, the third communication device. The method may include, for example: the third communication device receives a first message from the first communication device, and the first message may include a hash key value, a first routing parameter and a switching identifier, and 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, and 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 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, and prepares for the switching of the reverse service flow. Since it is difficult to locate the location of the fault 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, and minimize the impact of the gray fault on the service.
[0016] In some implementations, the method may further include: a third communication device obtains a second message according to the first message, the second message does not include the switching identifier and the first routing parameter in the second message is set to zero; the third communication device forwards the second message to a fourth communication device. In this way, the third communication device deletes or sets the content related to switching in the first message to zero and then transmits it backward, so that the fourth communication device after the third communication device will not perceive the modification of the message in the service flow by the switching operation, and thus the switching operation will not affect the processing of the message in the service flow by the fourth communication device.
[0017] 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 passed 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.
[0018] 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 carries the first routing parameter. 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.
[0019] 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.
[0020] 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. Among them, the first obtaining unit is used to obtain a first message; the second obtaining unit is used to obtain a hash key value according to the first message; the third obtaining unit is used to obtain a first routing parameter of a stream corresponding to the first message; the first determining unit is used to determine a first path for sending the first message according to the hash key value and the first routing parameter; the first forwarding unit is used to send the first message through the first path. Among them, 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, which can be understood as parameters participating in hash routing.
[0021] In some implementations, the device may further include: a first updating unit. The first updating unit is configured to update the first message based on the first routing parameter, wherein the updated first message includes the first routing parameter. A first forwarding unit is specifically configured to send the updated first message through the first path.
[0022] As an example, for the second communication device included in the first path, if the second communication device supports the method provided in the present application, then the second communication device can 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 the present application, then the second communication device can determine the forwarding path for forwarding the updated first message based on the hash key value in the updated first message.
[0023] 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 carries 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 carries the first routing parameter.
[0024] In some implementations, the device may further include: a fourth obtaining unit and a second updating unit. The fourth obtaining unit is used to obtain first indication information of a flow corresponding to the first message, and the first indication information is used to instruct the first communication device to modify a routing parameter; the second updating unit is used to update 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.
[0025] As an example, the fourth obtaining unit is specifically used to: obtain the first indication information from the target flow table where the hash key value is located. Then, the device may also include: a third updating unit. The third updating unit is used to update the first indication information in the target flow table to the second indication information, and the second indication information is used to indicate that the first communication device has not modified the routing parameters.
[0026] In some implementations, if a target flow table is maintained on the first communication device, then the first obtaining unit is specifically configured to obtain the first routing parameter from the target flow table.
[0027] In some other implementations, the first obtaining unit is specifically configured to obtain a first routing parameter according to the first message.
[0028] 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, for modifying 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, wherein the modified target flow table includes the first routing parameter, and the target flow table before modification includes the second routing parameter.
[0029] As an example, the device may also 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 used to receive a second message before modifying the value of the routing parameter in the target flow table, and the second message and the first message belong to the same flow; the fifth obtaining unit is used to obtain a hash key value according to the second message; the sixth obtaining unit is used to obtain a second routing parameter of the flow corresponding to the second message, and the second routing parameter is used by the first communication device to determine the path for sending the second message; the second determining unit is used to determine the second path for sending the second message according to the hash key value and the second routing parameter; the second forwarding unit is used to send the second message through the second path.
[0030] It should be noted that the specific implementation method and technical effect achieved by the device provided in this application can refer to the method provided in the first aspect.
[0031] In a fourth aspect, the present application further provides a message processing device, which is applied to a third communication device, and the device may include, for example: a receiving unit and a modifying unit. The receiving unit is used to receive a first message from a first communication device, and the first message may include a hash key value, a first routing parameter and a switching identifier, and the switching identifier is used to instruct the third communication device to switch the path; the modifying unit is used to modify the routing parameter in the target flow table where the hash key value is located based on the switching identifier, and 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 the path for sending messages belonging to the reverse flow of the first message.
[0032] In some implementations, the device may further include: an obtaining unit and a sending unit. The obtaining unit is configured to obtain a second message according to the first message, wherein the second message does not include the switching 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.
[0033] 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 passed 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.
[0034] 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 carries the first routing parameter. 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.
[0035] It should be noted that the specific implementation method and technical effect achieved by the device provided in this application can refer to the method provided in the second aspect.
[0036] In various possible implementations of the third aspect or the fourth aspect, the first communication device may be, for example, a switch, a router, a service network card, or a virtual switch.
[0037] In a fifth aspect, the present application provides a communication device, comprising 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.
[0038] 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.
[0039] 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 in the first aspect, any possible implementation of the first aspect, the second aspect or any possible implementation of the second aspect.
[0040] In an eighth aspect, the present application provides a program product comprising readable instructions, wherein the readable instructions are used 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0042] Figure 1 A schematic diagram of the architecture of a network 100 in an embodiment of the present application;
[0043] Figure 2 A flowchart of a message processing method 100 in an embodiment of the present application;
[0044] Figure 3 This is a schematic diagram of the structure of a TCP header in a first message in an embodiment of the present application;
[0045] Figure 4 This is a schematic diagram of the structure of a first message in an embodiment of the present application;
[0046] Figure 5 This is a schematic diagram of the structure of BTH in a first message in an embodiment of the present application;
[0047] Figure 6 This is a structural diagram of a message processing device 600 in an embodiment of the present application;
[0048] Figure 7 Schematic diagram of the structure of another message processing device 700 in an embodiment of the present application;
[0049] Figure 8 This is a schematic diagram of the structure of a communication device 800 in an embodiment of the present application;
[0050] Fig. 9 This is a schematic diagram of the structure of another communication device 900 in an embodiment of the present application;
[0051] Fig.10 Schematic diagram of the structure of a communication system 1000 in an embodiment of the present application. DETAILED DESCRIPTION
[0052] During the operation of the network, various faults may occur, affecting the normal operation of the network. Among the many faults, in addition to link failures and congestion, there are also some gray failures. The understanding of gray failures can include: Understanding 1, when the fault detection tool in the network observes that the network is healthy, but at least one application in the network observes that the network is unhealthy, it is considered that a gray failure has occurred in the network; Understanding 2, 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 pseudo-death. The manifestations of gray failures may include but are not limited to: random packet loss, performance degradation, or memory jitter. Taking random packet loss as an example, connectivity detection sometimes shows connected and sometimes shows disconnected. Therefore, it is impossible to determine whether there is a fault through connectivity detection, but the services in the network will be affected by packet loss (such as interruption).
[0053] 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 switch the route in time 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 achieve route switching when a gray fault occurs: Method 1, the control plane notifies the updated link status through the protocol, 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; Method 2, by modifying 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.
[0054] Although the above two methods achieve the purpose of switching, the switching time required is relatively long, which cannot meet the requirements of fast switching for gray faults. For example, in the above method 1, switching needs to rely entirely on protocol convergence, which may take seconds, making the gray fault have a greater impact on the service flow. Moreover, since the protocol cannot detect gray faults related to the routing path configuration such as configuration errors and routing black holes, it is not suitable for switching in the case of gray faults related to the routing path configuration; the above method 2, that is, modifying the hash routing result to achieve switching, is equivalent to directly switching the service flow from one forwarding path to another forwarding path. The existing problems include: 1. The load balance cannot be guaranteed; 2. Since the gray fault cannot be accurately located, it is easy to switch the forwarding path in a certain direction from the normal path to the fault path including the fault location of the gray fault after switching; 3. The existence of communication devices in the network that do not support direct offset hash results makes this method unable to be popularized in the network; 4. It needs to be implemented through additional control plane processing, which will increase the time consumed by switching.
[0055] Based on this, in order to be able to switch paths in time after a gray failure occurs, so that the recovery time of the service flow after a gray failure occurs is short enough to reduce the impact of the gray failure on the service, an embodiment of the present application provides a message processing method, in which the first communication device can obtain a hash_key for a first message to be transmitted according to the first message, and can also obtain a first routing parameter (hereinafter referred to as seed) of the flow corresponding to the first message, thereby determining a first path for sending the first message according to 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 failure, so as to quickly switch the path when a gray failure 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 in the communication device on the data plane. This simplifies the configuration work required for routing switching and reduces the time overhead of routing switching, so that routing can be switched in time after a gray failure occurs, so that the recovery time of the service flow is short enough, and the impact of gray failures on the service is minimized.
[0056] If the first communication device is an ingress node, in one case, the first communication device obtains the first routing parameter of the flow corresponding to the first message, which may include: the first communication device determines the first routing parameter according to the parameter carried by the first message. Alternatively, in another case, the first communication device can locally maintain a flow table corresponding to each service flow, and the flow table includes the routing parameter. Then, the first communication device obtains the first routing parameter of the flow corresponding to the first message, which may include: the first communication device determines a target flow table matching the flow corresponding to the first message from the locally maintained flow table, and obtains the first routing parameter from the target flow table.
[0057] If the first communication device is an intermediate node, then when the first message is processed on the entry node, 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. For example, each communication device maintains a flow table corresponding to different service flows locally, and the flow table may include at least hash_key and seed. Taking the entry node receiving the first message as an example, the message processing method provided by the embodiment of the present application may include: the entry node receives a first message that matches the value of hash_key in the target flow table, and the value of seed in the target flow table is the first value, then, the entry node carries the first value in the first message to obtain the updated first message, and forwards the updated first message to the first communication device through the first path based on the value of hash_key and the first value in the updated first message. In this way, the first communication device only needs to perform hash routing according to the value of hash_key and the value of seed carried in the received message, so as to achieve rapid path switching when a gray failure occurs.
[0058] In addition, the embodiment of the present application also provides a message processing method, corresponding to the sending end of the above-mentioned first message, the receiving end of the first message (i.e., the third communication device), after receiving the first message from the first communication device, it is determined that the first message includes a hash_key, a first routing parameter and a switching identifier, and the switching identifier is used to instruct the third communication device to switch the path, then based on the indication of the switching identifier, the routing parameter in the target flow table where the hash_key is located is modified, and 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 of 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 value of the seed in the local related flow table based on the indication of the switching identifier in the message, and prepares for the switching of the reverse service flow. Since it is difficult to locate the location of the fault when a gray fault occurs, the embodiment of the present application realizes timely bidirectional switching, which can make the service flow avoid the fault location in the network with a greater probability, and minimize the impact of the gray fault on the service.
[0059] In order to make the technical solution provided by the embodiments of the present application clearer, Figure 1 The exemplary scenario shown briefly introduces the method of the embodiment of the present application.
[0060] Figure 1 It is a schematic diagram of the architecture of a network 100 provided in an embodiment of the present application. The network 100 may at least include: 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), and the communication devices 1i are respectively connected to each communication device 2j, wherein i=1, 2, ..., N, j=1, 2, ..., M. For example, the network 100 may be a data center network, 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.
[0061] Taking the case where there are two equivalent paths (i.e., path 1 and path 2) from communication device 21 to communication device 2M as an example, the process of hash routing on each communication device in the current method and the embodiment of the present application is described. Path 1 passes through communication device 21, communication device 11, and communication device 2M in sequence, and path 2 passes through communication device 21, communication device 12, and communication device 2M in sequence.
[0062] 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 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 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 quintuple 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 a quintuple or a triplet of the business flow (for example, it can include the source IP address, destination IP address and transport layer protocol).
[0063] In the method provided in the embodiment of the present application, the parameters involved in hash routing include seed in addition to the hash_key of the current hash routing. The communication device 21 maintains a flow table corresponding to each service flow. For example, the communication device 21 can maintain flow table 1 including at least hash_key 1 and seed 1. In addition, the communication device 21 can also maintain the corresponding relationship between each hash routing parameter and the path, for example, the corresponding relationship 3 between hash_key 1+seed 1 and path 1 and the corresponding relationship 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 flow table 1, and matches the corresponding relationship 3 based on the obtained hash_key 1+seed 1, and determines to forward the message 1 to be transmitted based on 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 includes at least hash_key 1 and seed 2, and the value of seed 2 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 the transmission of the message 2 to be transmitted includes path 1, the communication device 21 modifies seed 1 in flow table 2 to seed 2 to obtain flow table 2, and flow table 2 includes at least hash_key 1 and seed 2, and the value of seed 2 can be equal to 1, and when there is a message 2 to be transmitted on the communication device 21, and the equivalent path for the transmission of the message 2 to be transmitted includes path 1, the communication device 21 modifies seed 1 in flow table 2 to seed 2 to obtain flow table 2, and the ... 2 is carried in the to-be-transmitted message 2 to obtain the to-be-transmitted message 3, thereby, based on the hash_key 1+seed 2, matching the corresponding relationship 4, it is determined that the to-be-transmitted message 3 is forwarded based on the 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, and when the communication device senses a gray fault, it modifies the seed value in the corresponding flow table, and 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, thereby achieving the purpose of quickly switching the path when a gray fault occurs, making the recovery time of the service flow short enough, and minimizing the impact of the gray fault on the service.
[0064] In addition, since it is impossible to locate the specific location where the fault occurs, 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 sensed. 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, and the value of seed_changed can also be used to determine whether to add a switching mark in the message to be transmitted. For example, when the value of seed_changed is not equal to 0, it indicates that the value of seed in the flow table has changed, and it is determined that a switching mark needs to be added in the message to be transmitted. When the value of seed_changed is equal to 0, it indicates that the value of seed in the flow table has not changed, and it is determined that there is no need to add a switching mark in 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, and the switching identifier is used to indicate whether the receiver of the message to be transmitted needs to switch routes. For example, the value of the switching identifier in the message to be transmitted 1 is equal to 0, which 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; the value of the switching identifier in the message to be transmitted 3 is equal to 1, which 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.
[0065] In the embodiment of the present application, the communication device senses the gray fault in a manner that may include, but is not limited to: Mode 1, the communication device counts and compares the traffic in the inbound and outbound directions of each service flow to determine whether there may be a gray fault corresponding to the service flow; Mode 2, the communication device counts and compares the number of requests and responses that occur to determine whether there may be a gray fault corresponding to the service flow; Mode 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 there may be a gray fault corresponding to the service flow. Usually, the communication device detects whether there is a gray fault in the service flow corresponding to the hash_key based on the hash_key, so when the communication device senses a gray fault, it can determine the service flow associated with the gray fault.
[0066] In the embodiment of the present application, the execution subject may be any communication device capable of transmitting messages, for example, it may be an edge device of a data center network (such as a top of rack (TOR) switch), see 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 performing the method provided in the embodiment of the present application as a sender and a receiver.
[0067] It should be understood that Figure 1 The communication devices and connection relationships in the network are only shown as examples. 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. Figure 1 The network architecture shown is only an example. The application scenarios of the method provided in the embodiment of the present application are not limited to Figure 1 The scene shown.
[0068] In the embodiments of the present application, the communication device may 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 may also be a part of a component on a network device or a terminal device, such as a single board or a line card on a network device; it may also be a functional module on a network device or a terminal device; it may also be a chip used to implement the method provided in the embodiments of the present application, and the embodiments of the present application do not make specific limitations. When the communication device is a chip, the transceiver unit used to implement the method may be, for example, an interface circuit of the chip, and the processing unit may be a processing circuit with processing functions in the chip. Communication devices may be directly connected, for example, but not limited to, via Ethernet cables or optical cables. For example, Figure 1 In the figure, 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).
[0069] In the embodiments of the present application, the communication device and the node have the same meaning and can be understood and used interchangeably.
[0070] In order to more clearly introduce the embodiments of the present application, Figure 2The message processing method provided in the embodiment of the present application is described.
[0071] Figure 2 A flowchart 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 a manner in which a first communication device and a third communication device interact. 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 Figure 1 In the scenario shown, the first communication device may correspond to the communication device 21, and the third communication device may correspond to the communication device 2M.
[0072] like Figure 2 As shown, the method 100 may include, for example, the following S101 to S107:
[0073] S101: A first communication device obtains a first message.
[0074] As an example, if the first communication device is the first node that the first message passes through and supports the method 100 provided in the embodiment of the present application, that is, the first communication device is the entry node of the first path determined subsequently, then the first message may not carry the routing parameter. In this example, S101 may include: the first communication device receives or generates the first message.
[0075] As another example, if the first communication device is not the first node that the first message passes through and supports the method 100 provided in the embodiment of the present application, that is, the first communication device is an intermediate node of the first path determined subsequently, then the first message can carry the routing parameter. In this example, S101 may include: the first communication device receives a first message sent from an ingress node of the first message, and obtains the first message in S101 according to the processing of the received first message.
[0076] S102: The first communication device obtains a hash_key according to the first message, where the hash_key is used by the first communication device to determine a path for sending the first message.
[0077] As an example, S102 may include: the first communication device parses the first message, obtains a hash_key from the first message, and the hash_key may be, for example, all or part of a quintuple of the first message, and the quintuples or triples of different messages of the same service flow are the same. The following description is made by taking the quintuple of the service flow as an example.
[0078] S103: The first communication device obtains 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.
[0079] 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 some parameters in the service message (or data message), and the method of modifying the routing parameters can include: modifying the value of one or some parameters in the service message, and / or, modifying the operation method of determining the routing parameters based on the one or some parameters.
[0080] As an example, S103 may include: the first communication device obtains the first routing parameter according to 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 according to the parameter carried by the first message, and the parameter carried in the first message used to determine the first routing parameter can be flexibly selected based on demand, and the method for determining the first routing parameter based on the parameter carried in the first message can also be flexibly designed according to 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.
[0081] 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.
[0082] The following description is made by taking the routing parameter as seed and the value of the first routing parameter corresponding to seed as the first value as an example.
[0083] 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 include, for example, the five-tuple of the service flow + the seed. In another case, the flow table includes the hash_key and the seed of the service flow. The hash_key and the 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 the seed is used as an example for illustration.
[0084] 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, and the value of the seed in the target flow table is determined by whether the first communication device perceives a gray failure and the rule for modifying the seed value after perceiving the gray failure.
[0085] As an example, the target flow table can be as shown in Table 1 below:
[0086] Table 1 Target Flow Table
[0087]
[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, in order to notify the peer communication device of the service flow to also perform a path switching operation through a certain packet of the service flow, so that the service flow can avoid the gray fault in both directions as much as possible and ensure the reliability of the network 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]
[0093] 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.
[0094] When the first communication device senses that a gray fault occurs in the transmission path of the first service flow, after modifying 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), the operation corresponding to S103 is performed. 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, modify 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, the value of seed and the value of seed-changed in the target flow table corresponding to the first service flow are modified, and the value of seed after modification is the first value, and the value of seed-changed after modification is the second value. Among them, modifying the value of seed in the target flow table can be implemented based on any algorithm. For example, the value of seed in the target flow table can be added by one to obtain the value of seed in the modified target flow table. For another example, the value of seed in the target flow table can be processed by the first formula to obtain the value of seed in the modified target flow table. The first formula can be, for example: seed = 2*seed+3, the seed before the equal sign represents the seed in the modified target flow table, 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 added by one to obtain the value of seed_changed in the modified target flow table. For another example, the value of seed_changed in the target flow table can be executed by the second formula to obtain the value of seed_changed in the modified target flow table. The second formula can be: seed_changed = 3*seed+2, seed_changed before the equal sign represents seed_changed in the modified target flow table, and seed_changed after the equal sign represents seed_changed in the target flow table before modification. Alternatively, modifying the value of seed_changed in the target flow table can also be to modify the value of seed_changed to a preset fixed value.
[0095] 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, the method 100 may also include: S100a, the first communication device receives a second message, and the second message and the first message belong to the same flow; S100b, the first communication device obtains the hash key value according to the second message; S100c, the first communication device obtains the second routing parameter of the flow corresponding to the second message, and the second routing parameter is used by the first communication device to determine the path for sending the second message; S100d, the first communication device determines the second path for sending the second message according to the hash key value and the second routing parameter; S100e, the first communication device sends the second message through the second path. The following description is taken as an example that the value of the seed corresponding to the second routing parameter is the fourth value.
[0096] The fourth value may be equal to 0, for example. During the execution of S100a to S100e, the value of seed_changed in the target flow table may be 0. When the first communication device does not sense the existence of a gray fault corresponding to the first service flow, the first communication device determines the hash routing result of the second message as the second path according to the hash_key and the fourth value in the second message. Figure 1 Corresponding to the embodiment shown, the second path may correspond to path 1, for example. When the first communication device senses that there is a gray fault corresponding to the first service flow, the first communication device may 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. Figure 1 Corresponding to the embodiment shown, the second path may correspond to Figure 1 Path 1, the first path may correspond to Figure 1 Path 2.
[0097] 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 (ie, the first value).
[0098] 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 seen in Figure 3 As shown, 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 Figure 3 The Reserved field of the TCP header is shown carrying a first value.
[0099] 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 the 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 through 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 through the Reserved field. The applicable scenario in this example may be, for example, a VXLAN scenario. The structure of the first message can be found in Figure 4 As shown, the first message may include an outer media access control (MAC) header, an outer IP header, a UDP header, a VXLAN header, and an original layer 2 header from the outside to the inside, the UDP header may include a UDP Src.Prot field, the VXLAN header may include a Reserved field, and the first communication device may include a VXLAN header. Figure 4 The UDP Src.Prot field of the UDP header or the Reserved field of the VXLAN header shown carries a first value.
[0100] 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 by the Reserved field. The applicable scenario in this example may be, for example, an RDMA scenario. The structure of the first message can be seen in Figure 5 As shown, the BTH of the first message may include: Opcode field, S, M, Pad, Transport Header Version (TVer) field, PartitionKey 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 (type) of the first message or the higher-level protocol type in the invalid bandwidth payload (InfiniBand payload, IBpayload); 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 additional 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; the Destination QP field indicates the sequence number of the destination queue pair; A is the Acknowledgement Request (Acknowledgement Request PSN is an abbreviation of PSN Request, indicating that the response to the first message can be scheduled by the responder; PSN is used to detect lost or duplicated data packets. Figure 5 The Reserved field of the BTH is shown to carry a first value.
[0101] In some possible implementations, the first communication device updating the first message based on the first routing parameter may include, for example: the first communication device obtains the first indication information (corresponding to the second value) of the flow corresponding to the first message, the first indication information is used to instruct the first communication device to modify the routing parameter; the first communication device updates the first message based on the first indication information, the updated first message includes a switching identifier corresponding to the first indication information, the switching identifier is used to instruct the third communication device to switch the path, and the third communication device is the destination node of the first message. Wherein, obtaining the first indication information of the flow corresponding to the first message may include: obtaining the first indication information from the target flow table where the hash key value is located. Then, the method may also include: updating the first indication information in the target flow table to the second indication information (i.e., the third value), the second indication information is 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 switching identifier will not be added to the other messages, so as to avoid the first communication device from continuously receiving messages carrying the switching identifier when the gray fault corresponding to the first service flow is sensed once, thereby continuously performing the switching operation.
[0102] The following description is given by taking 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 as an example.
[0103] 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 flag in the first message based on the second value of seed-changed to obtain an updated first message, and the switching flag is used to instruct the third communication device to switch. Among them, 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 in the target flow table and the value of seed-changed, it only adds a switching flag based on the indication of the second value in any message that matches the target flow table. Once the switching flag is added in 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.
[0104] 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 also 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 carries the first value in the third message based on the third value of seed-changed to obtain an updated third message; the first communication device forwards the updated third message to the third communication device through the first path based on the value of hash_key and the first value. In this way, after the first communication device adds a switching identifier to any one of the multiple messages, only the value of seed (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 switching operations.
[0105] 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.
[0106] S105: The first communication device sends the first message through the first path.
[0107] It should be noted that the implementation 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 message (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).
[0108] After S104, the first communication device obtains the result of hash routing - the first path. Thus, the first message is forwarded through the first path. Among them, the first path can refer to, for example, a section of the path starting from the first communication device on the total path from the first communication device to the fourth communication device. The exit node of the first path is the third communication device, and the fourth communication device is the destination host of the first message or the destination node in the network.
[0109] 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 message, it can read the first value from the first message, perform hash routing based on the first value + the value of hash_key, determine the forwarding path, and thus forward the message based on the determined forwarding path. Taking the example that the second communication device is an intermediate node on the first path, the second communication device determines the path for transmitting the first message based on the first routing parameter and the hash key value in the updated first message. Among them, the value of hash_key can be read from the first message. 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.
[0110] In some 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 message, it can perform hash routing based on the value of hash_key, determine the forwarding path, and thus forward the message based on the determined forwarding path. Among them, the value of hash_key can be read from the first message.
[0111] 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.
[0112] S106, the third communication device receives a first message from the first communication device, where the first message includes a hash key value, a first routing parameter, and a routing identifier, where the routing identifier is used to instruct the third communication device to perform routing.
[0113] 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 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.
[0114] 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:
[0115] Table 3 Target flow table
[0116]
[0117] Alternatively, the target flow table maintained on the third communication device may refer to the following Table 4:
[0118] Table 4 Target flow table
[0119]
[0120] 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 each communication device in the network.
[0121] In the case where the first communication device senses the gray fault earlier than the third communication device senses the gray fault, and the third communication device has not modified the target flow table based on the gray fault when S106 occurs, the target flow table maintained on the third communication device can refer to the above Table 3, and the value of seed in the target flow table is the fourth value, which is different from the first value in the first message. In this case, the third communication device can modify the value of seed in the target flow table shown in Table 3, and the value of seed in the modified target flow table can be the first value, which is consistent with the value of seed in the second message.
[0122] In the case where both the first communication device and the third communication device perceive a gray fault, and the third communication device has modified the target flow table based on the gray fault when S106 occurs, the target flow table maintained on the third communication device can refer to the above Table 4, and the value of seed in the target flow table is the first value, which is the same as the first value in the first message. In this case, in order to further verify whether the value of seed in the target flow table on the third communication device is modified after the gray fault is perceived this time, it can also be determined whether the time when the value of seed in the target flow table is modified exceeds the time threshold. If it does not exceed, it is considered that the value of seed in the target flow table on the third communication device is modified after the gray fault is perceived this time, and the third communication device may not modify the value of seed in the target flow table shown in Table 4; if it exceeds, it is considered that the value of seed in the target flow table on the third communication device is modified before the gray fault is perceived this time, and the third communication device may modify the value of seed in the target flow table shown in Table 4, and the value of seed in the modified target flow table is not equal to the first value and the fourth value. That is, S107 may include, for example: the third communication device performs the step of modifying the value of the seed in the target flow table that matches the value of the hash-key based on the switching identifier and the target condition, wherein the target condition may include any one of the following conditions: the value of the seed in the target flow table is consistent with the value of the seed in the first message, and the time when the value of the seed in the target flow table is modified exceeds the time threshold; the value of the seed in the target flow table is inconsistent with the value of the seed in the first message. If the value of the seed in the target flow table is consistent with the value of the seed in the first message, and the time when the value of the seed 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 value of the seed in the target flow table that matches the value of the hash-key. 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 passed 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.
[0123] Through S107, the target flow table corresponding to the first service flow on the third communication device is modified, so that preparations are made for switching the reverse service flow for the first service flow on the third communication device.
[0124] In some possible implementations, the third communication device processes and forwards the first message, that is, after S106, the method 100 may also include: the third communication device obtains a fourth message based on the first message, the fourth message does not include a switching identifier and the value of seed in the fourth message is zero; the third communication device forwards the fourth message to the 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 the switching-related content in the first message to 0 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, so that the switching operation will not affect the processing of the message in the service flow by the fourth communication device.
[0125] It can be seen that through this method 100, the communication device only needs to modify the value of seed 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 value of hash_key of the message to be forwarded and the value of seed, so as to achieve rapid switching of paths 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 switching and reduces the time overhead of routing switching, so that routing can be switched in time after a gray fault occurs, so that the recovery time of the business flow is short enough, and the impact of gray faults on the business is minimized. Moreover, after the first communication device switches the route, the third communication device at the other 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 gray faults on the business.
[0126] In the above method 100, the first communication device first senses the gray fault corresponding to the first service flow as an example for description. In the embodiment of the present application, there is also a situation where the third communication device first senses the gray fault corresponding to the first service 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 value of the seed is zero, and 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, so that the switching operation will not affect the processing of the message in the business flow by the fifth communication device.
[0127] 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.
[0128] Accordingly, the embodiment of the present application further provides a message processing device 600, which is applied to a first communication device, such as Figure 6 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. Wherein:
[0129] The first obtaining unit 601 is used to obtain a first message. The first obtaining unit 601 can execute Figure 2 S101 shown.
[0130] The second obtaining unit 602 is used to obtain a hash key value according to the first message, and 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 can be executed Figure 2 S102 shown.
[0131] 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. Figure 2S103 shown.
[0132] 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 be executed Figure 2 S104 shown.
[0133] The first forwarding unit 605 is configured to send the first message through the first path. The first forwarding unit 605 may execute Figure 2 S105 shown.
[0134] In some implementations, the apparatus 600 may further include: a first updating unit. The first updating unit is configured to update the first message based on the first routing parameter, wherein the updated first message includes the first routing parameter. A first forwarding unit is specifically configured to send the updated first message through the first path.
[0135] As an example, for the second communication device included in the first path, if the second communication device supports the method provided in the present application, then the second communication device can 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 the present application, then the second communication device can determine the forwarding path for forwarding the updated first message based on the hash key value in the updated first message.
[0136] 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 carries 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 carries the first routing parameter.
[0137] In some implementations, the device 600 may further include: a fourth obtaining unit and a second updating unit. The fourth obtaining unit is used to obtain first indication information of a 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 second updating unit is used to update 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.
[0138] As an example, the fourth obtaining unit is specifically used to: obtain the first indication information from the target flow table where the hash key value is located. Then, the device may also include: a third updating unit. The third updating unit is used to update the first indication information in the target flow table to the second indication information, and the second indication information is used to indicate that the first communication device has not modified the routing parameters.
[0139] In some implementations, if a target flow table is maintained on the first communication device, then the first obtaining unit 601 is specifically configured to obtain the first routing parameter from the target flow table.
[0140] In some other implementations, the first obtaining unit 601 is specifically configured to obtain a first routing parameter according to the first message.
[0141] 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, for modifying 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, wherein the modified target flow table includes the first routing parameter, and the target flow table before modification includes the second routing parameter.
[0142] As an example, the device 600 may also 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 used to receive a second message before modifying the value of the routing parameter in the target flow table, and the second message and the first message belong to the same flow; the fifth obtaining unit is used to obtain a hash key value according to the second message; the sixth obtaining unit is used to obtain a second routing parameter of the flow corresponding to the second message, and the second routing parameter is used by the first communication device to determine the path for sending the second message; the second determining unit is used to determine the second path for sending the second message according to the hash key value and the second routing parameter; the second forwarding unit is used to send the second message through the second path.
[0143] It should be noted that the specific implementation method and technical effects of the device 600 provided in this application can be found in Figure 2Related descriptions of the steps implemented by the first communication device in the method 100 are shown.
[0144] Accordingly, the embodiment of the present application further provides a message processing device 700, which is applied to a third communication device, such as Figure 7 The device 700 may include: a receiving unit 701 and a modifying unit 702. Wherein:
[0145] 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 switching identifier, wherein the switching identifier is used to instruct the third communication device to switch the routing. The receiving unit 701 may execute Figure 2 S106 shown.
[0146] A modification unit 702 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 a 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 a message belonging to a reverse flow of the first message. The modification unit 702 may be executed Figure 2 S107 shown.
[0147] In some implementations, the device 700 may further include: an obtaining unit and a sending unit. The obtaining unit is configured to obtain a second message according to the first message, wherein the second message does not include the switching 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.
[0148] 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 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.
[0149] 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 carries the first routing parameter. 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.
[0150] It should be noted that the specific implementation method and technical effects of the device 700 provided in this application can be found in Figure 2 Related descriptions of the steps implemented by the third communication device in the method 100 are shown.
[0151] In various possible implementations of the above-mentioned apparatus 600 and apparatus 700, the first communication device may be, for example, a switch, a router, a service network card, or a virtual switch.
[0152] See also 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, Figure 1 The communication device 21, the communication device 11 or the notification information 2M; for example, it may also be Figure 2 The communication device 800 can implement the functions of 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.
[0153] The communication device 800 is a hardware structure device that can be used to implement Figure 6 The functional modules in the message processing device 600 shown in FIG. Figure 6 The second obtaining unit 602, the third obtaining unit 603 and the first determining unit 604 in the message processing device 600 shown in the figure can be implemented by the at least one processor 801 calling the code in the memory 803. Alternatively, the communication device 800 is a hardware structure device that can be used to implement Figure 7 The functional modules in the message processing device 700 are shown. For example, those skilled in the art may think of Figure 7 The modification unit 702 in the message processing device 700 shown can be implemented by the at least one processor 801 calling the code in the memory 803.
[0154] Optionally, the communication device 800 may also be used to implement the functions of the network device in any of the above embodiments.
[0155] 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.
[0156] The bus system 802 may include a path for transmitting information between the components.
[0157] The communication interface 804 is used to communicate with other devices or communication networks.
[0158] 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.
[0159] The memory 803 is used to store the 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, so as to realize the functions in the method of the present application.
[0160] In a specific implementation, as an embodiment, the processor 801 may include one or more CPUs, such as Figure 8 CPU0 and CPU1 in.
[0161] In a specific implementation, as an embodiment, the communication device 800 may include multiple processors, such as Figure 8 801 and processor 807 in the embodiment of the present invention. Each of these processors may be a single-CPU processor or a 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).
[0162] Fig. 9 is a schematic diagram of the structure of another communication device 900 provided in an embodiment of the present application. The communication device 900 may be any of the communication devices in any of the above embodiments, for example, Figure 1 The communication device 21, the communication device 11 or the notification information 2M; for example, it may also be Figure 2 The communication device 900 can implement the functions of each communication device in the above embodiments.
[0163] The communication device 900 includes a main control board 910 and an interface board 930 .
[0164] The main control board 910 is also called a main processing unit (MPU) or a route processor card. The main control board 910 controls and manages various components in the communication device 900, including route calculation, device management, device maintenance, and protocol processing functions. The main control board 910 includes: a central processing unit 911 and a memory 912.
[0165] The interface board 930 is also called a line processing unit (LPU), a line card or a service board. The interface board 930 is used to provide various service interfaces and realize the forwarding of data packets. The service interface includes but is not limited to an Ethernet interface, a POS (Packet over SONET / SDH) interface, etc., and the Ethernet interface is, for example, a Flexible Ethernet Service Interface (Flexible Ethernet Clients, FlexE Clients). The interface board 930 includes: a central processing unit 931, a network processor 932, a forwarding table entry memory 934 and a physical interface card (ph9sical interface card, PIC) 933.
[0166] The central processor 931 on the interface board 930 is used to control and manage the interface board 930 and communicate with the central processor 911 on the main control board 910 .
[0167] The network processor 932 is used to implement message forwarding processing. The network processor 932 may be in the form of a forwarding chip. Specifically, the processing of uplink messages includes: message inbound interface processing, forwarding table search; the processing of downlink messages: forwarding table search, etc.
[0168] The physical interface card 933 is used to implement the docking function of the physical layer, from which the original traffic enters the interface board 930, 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, and is responsible for converting the optical signal into a message and forwarding the message to the network processor 932 for processing after checking the legitimacy of the message. In some embodiments, the central processor 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.
[0169] Optionally, the communication device 900 includes a plurality of interface boards. For example, the communication device 900 further includes an interface board 940 . The interface board 940 includes a central processor 941 , a network processor 942 , a forwarding table entry memory 944 , and a physical interface card 943 .
[0170] 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 complete data exchange between the interface boards. For example, the interface board 930 and the interface board 940 may communicate via the switching fabric board 920.
[0171] The main control board 910 is coupled to the interface board 930. 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 through a system bus to achieve intercommunication. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 910 and the interface board 930, and the main control board 910 and the interface board 930 communicate through the IPC channel.
[0172] Logically, the communication device 900 includes 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 for performing 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 a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the status of the device. The control plane sends the generated forwarding table to the forwarding plane. On the forwarding plane, the network processor 932 forwards the message received by the physical interface card 933 based on the forwarding table sent by the control plane. The forwarding table 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 separated and not on the same device.
[0173] 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 a 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.
[0174] 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 determining unit 604, and the processor 801 in the message processing device 600 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 operation on the interface board 940 in the embodiment of the present application is consistent with the operation of the interface board 930, and for the sake of brevity, it will not be repeated. The communication device 900 of this embodiment can correspond to the message processing device 600 or the communication device 800 in the above-mentioned embodiments. The main control board 910, the interface board 930 and / or the interface board 940 in the communication device 900 can implement the functions and / or various steps implemented in the message processing device 600 or the communication device 800 in the above-mentioned embodiments, and for the sake of brevity, it will not be repeated here.
[0176] 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 a 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 messages belonging to the reverse flow of the first message.
[0177] 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.
[0178] It should be understood that the operation on the interface board 940 in the embodiment of the present application is consistent with the operation of the interface board 930, and for the sake of brevity, it will not be repeated. The communication device 900 of this embodiment can correspond to the message processing device 700 or the communication device 800 in the above-mentioned embodiments. The main control board 910, the interface board 930 and / or the interface board 940 in the communication device 900 can implement the functions and / or various steps implemented in the message processing device 700 or the communication device 800 in the above-mentioned embodiments, and for the sake of brevity, it will not be repeated here.
[0179] 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 realize load sharing and redundant backup. Under a centralized forwarding architecture, the network device may not need a switching network board, and the interface board is responsible for the processing function of the business data of the entire system. Under a distributed forwarding architecture, the network device may have at least one switching network board, and the switching network board is used to realize data exchange between multiple interface boards, 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. Optionally, the network device may have only one board, that is, no switching board, and the functions of the interface board and the main control board are integrated on the board. In this case, the central processor on the interface board and the central processor on the main control board can be combined into one central processor on the board to perform the functions of the two. This type of device has low data exchange and processing capabilities (for example, low-end switches or routers and other network devices). The specific architecture to be adopted depends on the specific networking deployment scenario.
[0180] In some possible embodiments, each of the above-mentioned network devices or network devices can be implemented as a virtualized device. For example, a virtualized device can be a virtual machine (English: Virtual Machine, VM) running a program for sending a message function, 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, which will not be repeated here.
[0181] It should be understood that the network devices in the above-mentioned various product forms have any functions of the network devices or communication devices in the above-mentioned method embodiments, which will not be repeated here.
[0182] The embodiment of the present application also provides a chip, including a processor and an interface circuit, the interface circuit is used to receive instructions and transmit them to the processor; the processor, for example, can be a specific implementation form of the message processing device in the embodiment of the present application, and can be used to execute the above-mentioned routing method. Wherein, the processor is coupled with a memory, and the memory is used to store programs or instructions. When the program or instruction is executed by the processor, the chip system implements the method in any of the above-mentioned method embodiments.
[0183] Optionally, the processor in the chip system may be one or more. The processor may be implemented by hardware or by software. When implemented by hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented by software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0184] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be separately provided with the processor, which is not limited in the present application. Exemplarily, 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 may be provided on different chips. The present application does not specifically limit the type of memory and the arrangement of the memory and the processor.
[0185] 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.
[0186] In addition, the embodiment of the present application also provides a communication system 1000, such as Fig.10 As shown, the communication system 1000 may include a first communication device 1001 and a third communication device 1002. The first communication device 1001 is used to perform the above Figure 2The method performed by the first communication device in the embodiment shown; the third communication device 1002 is used to perform the above Figure 2 The method executed by the third communication device in the embodiment shown. The first communication device 1001 may correspond to the above Figure 6 The message processing device 600 shown in FIG. 1 , then the third communication device 1002 corresponds to the above Figure 7 The message processing device 700 is shown.
[0187] In addition, the embodiment of the present application also provides a readable storage medium, in which a program code or instruction is stored, and when the program code or instruction is executed on the processor, the processor executes the above Figure 2 A method under any one of the implementation modes in the illustrated embodiments.
[0188] 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.
[0189] 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.
[0190] The "first" in the names of "first routing parameter", "first message", etc. 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.
[0191] Through the description of the above implementation methods, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above-mentioned embodiment method can be implemented by means of software plus a general hardware platform. Based on such an 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., including a number of instructions for 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 of the present application or some parts of the embodiments.
[0192] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and 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, and the relevant parts can be referred to the partial description of the method embodiment. The device and system embodiments described above are merely schematic, in which 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 they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0193] The above is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. It should be noted that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the present application, and these improvements and modifications should also be regarded as the protection scope 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
Method fro dynamic load balance in distributed system based on session origination protocol
CN101166176A
Secure routing method for reconnecting disconnected nodes in wireless sensor network (WSN)
CN102711103A
Cloud computing router platform DDoS attack defense method based on VHSAP
CN105100016A
Method and device for improving equal-cost multi-path routing path selection
CN112134793A
Data packet transmission method and device, computer equipment and storage medium
CN116527575A
Cited By
Distributed ipfix data stream processing method, device and electronic equipment
CN122698527A
Message processing method and related device
EP4757272A1
Message processing method and related device
WO2025051079A1