PFC deadlock detection method
By maintaining a record area for each queue in the data center network and utilizing a clear buffer, rapid detection and efficient release of PFC deadlock is achieved, which solves the problem of low deadlock detection timeliness and unlocking efficiency in the existing technology. issues, improving network performance and availability.
Patent Information
- Application Number
- CN202410979969.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-10-11
AI Technical Summary
The existing technology has problems such as poor timeliness, too many missed nodes, and low unlocking efficiency when detecting and handling PFC deadlocks. Especially in large-scale data center networks, it is difficult to quickly and accurately detect and remove deadlocks, which affects Network performance and availability.
By maintaining the local record area and advantage record area in each incoming queue of the network device, generating, electing, propagating and invalidating impact records, achieving efficient transmission of impact information to the upstream, and utilizing headroom buffers and loop forwarding to transfer deadlocks Data frames on the ring flow along the ring, reducing buffer occupancy to relieve deadlocks.
It achieves fast and efficient deadlock detection and release, reduces the impact of deadlock on the network, improves network performance and availability, and avoids interference with other links and traffic.
Smart Images

Figure HDA0004955753470000011 
Figure HDA0004955753470000021 
Figure HDA0004955753470000031
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data center network technology, in particular to the field of remote direct memory access, and more particularly to a PFC deadlock detection method. Background Art
[0002] Remote Direct Memory Access (RDMA) technology has become the de facto standard for high-speed data transmission in modern data center networks due to its advantages of high throughput, low latency and low CPU overhead.
[0003] RoCEv2 (RDMA over Converged Ethernet version 2) is an important branch of RDMA and has been widely deployed and applied in storage, computing, distributed transaction processing, and large-scale artificial intelligence training.
[0004] RoCEv2 uses a priority-based flow control protocol (Priority Flow Control, referred to as PFC protocol) to effectively manage the transmission of data frames by setting the pause threshold (Xoff) and the resume threshold (Xon). In simple terms, when the length of a certain in-queue of the switch exceeds the pause threshold (Xoff), the system will send a pause frame (PFC Pause frame) to the upstream to temporarily stop sending data frames to the in-queue; and when the length of the in-queue falls below the resume threshold (Xon), it will send a resume frame (PFC Resume frame) to restart the process of sending data frames to the in-queue from the upstream. The PFC protocol ensures that when the buffer of a certain in-queue of the downstream switch is saturated, the influx of upstream data frames is suspended, thereby avoiding frame loss caused by buffer overflow. For example, when the buffer (Buffer) of the nth priority in-queue of port K of a switch reaches the preset pause threshold (Xoff), it will send a pause frame (PAUSE, carrying information of the nth priority) to the upstream switch, thereby requesting the upstream device to stop sending data frames to the nth priority in-queue of port K. Data transmission will not be resumed until the occupancy of the buffer of the priority queue drops below the recovery threshold (Xon).
[0005] However, the PFC protocol may cause a RoCEv2 network based on lossless Ethernet to deadlock in some cases. The "priority" of the PFC protocol is reflected in the following: for each port of the switch, there are multiple queues implemented in hardware. These queues are divided into multiple priorities, so it is called "priority" flow control (for PFC switches, there are generally 8 priority queues). The "flow control" of PFC is reflected in that each in-queue can individually pause the out-queue of the same priority of the corresponding port of its upstream device. Deadlock is caused by this "downstream back pressure upstream" mechanism: when a certain priority in-queue of all switches in a loop happens to pause its upstream switch from continuing to send data to it, deadlock will occur.
[0006] like Figure 1 As shown in the figure, a typical deadlock loop structure in a data center is given, in which the traffic direction is: switch 1 → switch 2 → switch 3 → switch 4 → switch 1. At the same time, each switch has traffic entering the loop and traffic leaving the loop. When the sum of the traffic entry rates of multiple ingress ports is greater than the corresponding single egress port traffic sending rate, the relevant ingress queue lengths of these switches will become longer and longer, thereby exceeding the pause threshold of the PFC protocol, and they will send PFC pause frames to the upstream (such as switch 1 → switch 4, switch 2 → switch 1, switch 3 → switch 2, switch 4 → switch 3). When these switches trigger a pause to their upstream switches at the same time, a deadlock will occur.
[0007] When a loop is deadlocked, it can seriously affect network performance and availability. The deadlocked switch may also send pause frames to other innocent links and devices, potentially affecting the entire network. Therefore, it is necessary to efficiently detect whether a deadlock has occurred.
[0008] PFC deadlock detection mainly includes control plane-based detection and data plane-based detection:
[0009] A common method for detecting deadlock is to have the control plane periodically check the port status and centrally determine the deadlock: the control program of each switch periodically reports the port status to a centralized controller, which determines whether a circular buffer dependency has occurred based on the port status on each switch, thereby determining the deadlock. However, due to the inherent communication delay between the control plane and the data plane, the delay in synchronizing detection messages to the centralized controller, and the delay in centralized decision-making, it is challenging to achieve fast deadlock detection. In addition, the method of determining deadlock by checking the existence of circular buffer dependency (CBD) may lead to false positives because CBD is a necessary condition for deadlock, but not a sufficient condition.
[0010] Another method based on the control plane is that the control plane periodically detects the status of the data plane port. If it finds that 1) the port's transmission rate is 0; 2) the port's queue length is not 0, it suspects that the port may be deadlocked. The switch sends a detection data packet from the port to the other end, which contains an ID unique to the entire network. The control plane CPU of the other end switch processes the data packet and updates the local ID according to the status of the switch. If the information can eventually be returned to the sender, it means that a deadlock has been detected. However, this method is also a control plane-based solution with poor performance and slow unlocking speed. Moreover, the solution requires the ID of each port of the switch in the entire network to be divided in advance, which is difficult on a large-scale deployed network and will face problems such as complex calculations and slow convergence.
[0011] Recently, some studies have used the ability of programmable data plane to resolve deadlock. This method only runs in the data plane, so it has higher performance, but low stability. For example, see patent document with publication number CN114157609A, which discloses a PFC deadlock detection method, which can detect deadlock in the data plane; however, it has the following disadvantages:
[0012] 1) The loop detection is started only after the network device receives a preset number of PFC pause frames, and the timeliness of deadlock loop detection is not strong;
[0013] 2) A specific preset time duration is set for receiving messages carrying the routing tag corresponding to this device. If messages carrying the routing tag corresponding to this device are received only within the specific preset time duration, it is determined that this device forms a loop with other network devices. However, some loops contain more nodes, and the time for the routing tag to be transmitted back is longer, so loops with more nodes may be missed.
[0014] Therefore, it is necessary to improve the prior art.
[0015] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. The relevant information is submitted and disclosed together with the present invention solution. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention
[0016] Therefore, the object of the present invention is to overcome the defects of the prior art and provide a PFC deadlock detection method.
[0017] The objective of the present invention is achieved through the following technical solutions:
[0018] According to a first aspect of the present invention, a PFC deadlock detection method is provided, which is applied to a network device configured with a priority-based flow control protocol, the method comprising executing a preset PFC deadlock detection mechanism, the mechanism comprising performing the following operations for each incoming queue: maintaining two record areas for each incoming queue, namely a local record area and a dominant record area, each record area being capable of storing an impact record and a status value marking whether the impact record is valid; when the length of the incoming queue exceeds a pause threshold, generating an impact record stored in the local record area and setting the impact record to be valid, the impact record containing incoming queue identity information indicating the generation record and identification information for distinguishing different records; in the dominant record area, storing the most dominant impact record selected from the observed impact records according to a preset election rule, wherein the source range of the observed impact record includes the local record area, advantage record area and newly received detection frame; whenever the effective impact record in the advantage record area is updated or an election is completed, and the length of the incoming queue is above the pause threshold, the impact record in the advantage record area is encapsulated into the detection frame and sent to the upstream network device; when the length of the incoming queue falls below the recovery threshold, the impact records in the local record area and the advantage record area are invalidated, and an invalidation frame carrying the impact record in the advantage record area is sent to the upstream network device; when the invalidation frame is received, the received invalidation frame is relayed to the upstream network device, and when the impact record in the advantage record area is the same as the impact record in the received invalidation frame, the impact record in the advantage record area is invalidated; when the impact record in the received detection frame is the same as the effective impact record in the local record area, it is considered that the network device to which the current incoming queue belongs forms a deadlock loop with other network devices.
[0019] Optionally, the impact record includes an entry queue global ID and identification information for indicating the identity information of the entry queue; the preset election rules include: if only one valid impact record is currently observed at the same entry queue, then the impact record is used as the most advantageous impact record; if multiple valid impact records are observed at the same entry queue, the most advantageous impact record is determined according to the size of the identification information contained in each of the multiple valid impact records, and if the identification information is equal, the newly received impact record is considered to be more advantageous.
[0020] Optionally, the impact record is in the form of a triple: {network device ID to which the entry queue belongs, local ID of the entry queue in the network device to which it belongs, identification information}, wherein the global ID of the entry queue is represented by the network device ID and the local ID.
[0021] Optionally, the identification information is a random number, and the smaller the identification information contained in the election, the more advantageous the impact record will have.
[0022] Optionally, the identification information is a random number, and the greater the identification information contained in the election, the more advantageous the impact record will have.
[0023] Optionally, the identification information is a timestamp, and the smaller the identification information contained in the election, the more advantageous the impact record will have.
[0024] Optionally, the detection frame or the invalidation frame is sent in the form of a PFC pause frame or a PFC resume frame, wherein, when the entry queue that needs to send the detection frame or the invalidation frame is in the back pressure upstream, the entry queue sends the detection frame or the invalidation frame in the form of a PFC pause frame; when the entry queue that needs to send the detection frame or the invalidation frame does not have a back pressure upstream, the entry queue sends the detection frame or the invalidation frame in the form of a PFC resume frame.
[0025] Optionally, the mechanism also includes performing the following operations for each outbound queue: maintaining a bitmap of the outbound queue, the bitmap including N bits for recording the relationship between the outbound queue and N inbound queues of the same priority within the network device to which the outbound queue belongs, and when the outbound queue contains a data frame from an inbound queue, setting the corresponding bit in the bitmap to a first value indicating an association; when the outbound queue receives a detection frame or an invalidation frame, the network device associates the impact record received in the detection frame or the invalidation frame with the associated inbound queue indicated by the bitmap, and regards it as an impact record received by the associated inbound queue.
[0026] Optionally, the network device is a switch, and the method is deployed on a switch chip and runs on the data plane.
[0027] According to the second aspect of the present invention, a processing method for PFC deadlock is provided, the processing method comprising: when a deadlock loop is detected according to the method of the first aspect, multiple network devices on the deadlock loop are determined; a loop forwarding table corresponding to the deadlock loop is constructed for the multiple network devices, the loop forwarding table indicating the path of the data frame on the deadlock loop forwarded along the loop; using the available space of the net buffer of the network device and the loop forwarding table, the data frame on the deadlock loop flows along the loop, wherein when any data frame flows along the loop to a network device, the network device determines whether there is an opportunity to forward the data frame out of the loop according to the original forwarding table, if so, the data frame is forwarded out of the loop according to the original forwarding table, if not, the data frame continues to be forwarded along the loop. After the deadlock is efficiently detected by a PFC deadlock detection method of the present invention, it is received according to a processing method for PFC deadlock of the present invention, which can effectively reduce the impact of the deadlock on the entire network.
[0028] According to a third aspect of the present invention, an electronic device is provided, comprising: one or more processors; and a memory, wherein the memory is used to store executable instructions; the one or more processors are configured to implement the steps of the method described in the first aspect or the second aspect by executing the executable instructions.
[0029] Compared with the prior art, the advantages of the present invention are:
[0030] The method of the present invention constructs a preset deadlock detection mechanism, and executes a unified operation process for each queue entry of a network device. First, two record areas are maintained for each queue entry, namely a local record area and a dominant record area, each record area can store an impact record and a state value marking whether the impact record is valid; secondly, a unified rule for generating, recording, electing, propagating and invalidating impact records is constructed, so that the impact of the queue entry on the upstream during the state change process can be appropriately transmitted to the upstream; finally, when the impact record in the received detection frame is the same as the valid impact record in the local record area, it is considered that the network device to which the current queue entry belongs forms a deadlock loop with other network devices; thereby, the network device can transmit the impact record that may form a deadlock during the normal data transmission process, and when the deadlock actually occurs, the deadlock loop is efficiently detected to deal with the problem of deadlock detection failure and missed detection caused by complex state changes that may occur in the network device during the deadlock formation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0032] Figure 1 A schematic diagram for illustrating a deadlock loop structure in a data center;
[0033] Figure 2 A schematic diagram of operations included in a PFC deadlock detection method according to an embodiment of the present invention;
[0034] Figure 3 A schematic diagram illustrating the principle of deadlock detection according to an example of the present invention;
[0035] Figure 4 A flowchart of a method for processing PFC deadlock according to an embodiment of the present invention;
[0036] Figure 5 A schematic diagram of collecting global IDs of multiple network devices on a deadlock loop according to a method of an embodiment of the present invention;
[0037] Figure 6 A schematic diagram of sending global IDs of multiple network devices to a downstream network device according to a method of an embodiment of the present invention;
[0038] Figure 7 A schematic diagram of the principle of allowing data frames on a ring to flow through a credit value according to a method of an embodiment of the present invention;
[0039] Figure 8 A schematic diagram for illustrating a buffer management strategy according to an embodiment of the present invention;
[0040] Fig. 9 A schematic diagram for illustrating that data frames may be out of order according to an embodiment of the present invention;
[0041] Fig.10 is a schematic diagram of the results of comparative experiment 1 according to an embodiment of the present invention;
[0042] Fig.11 Schematic diagram of the results of comparative experiment 2 according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0044] As mentioned in the background technology section, the prior art CN114157609A has the problem that the timeliness of deadlock loop detection is not strong and loops with many nodes may be missed.
[0045] To this end, the method of the present invention constructs a preset deadlock detection mechanism, and executes a unified operation process for each incoming queue of the network device. First, two record areas are maintained for each incoming queue, namely a local record area and a dominant record area, each record area can store an impact record and a state value marking whether the impact record is valid; secondly, a unified rule for generating, recording, electing, propagating and invalidating impact records is constructed, so that the impact of the incoming queue on the upstream during the state change process can be appropriately transmitted to the upstream; finally, when the impact record in the received detection frame is the same as the valid impact record in the local record area, it is considered that the network device to which the current incoming queue belongs forms a deadlock loop with other network devices; thereby, the network device can transmit the impact record that may form a deadlock during the normal data sending process, and when the deadlock actually occurs, the deadlock loop is efficiently detected to deal with the problem of deadlock detection failure and missed detection caused by complex state changes that may occur in the network device during the deadlock formation process.
[0046] Before specifically introducing the embodiments of the present invention, some of the terms used therein are explained as follows:
[0047] A network device refers to a device configured with a priority flow control protocol (Priority Flow Control, referred to as PFC protocol). For example, a switch based on RoCEv2. Of course, if other types of network devices (such as routers) also transmit data based on the PFC protocol, the method of the present invention can also be used on other types of network devices.
[0048] The inbound queue is the queue that receives data from the upstream network device.
[0049] Out-queue refers to sending the data in the in-queue of the network device to the queue of the downstream network device. There may be data from different in-queues in an out-queue.
[0050] For inbound and outbound queues, taking a RoCEv2-based switch as an example, each switch has multiple ports, among which the port that performs the function of sending data is called an outbound port, and the port that performs the function of receiving data is called an inbound port; when supporting duplex mode, the same port can be reused as an inbound port and an outbound port. Under the PFC protocol, multiple priority inbound queues (also called inbound port queues or ingress queues, usually 8 priority inbound queues) are maintained for each inbound port; similarly, multiple priority outbound queues (also called outbound port queues or egress queues) are maintained for each egress port.
[0051] The pause threshold (Xoff) is a preset threshold. When the length of a certain in-queue of a network device (referring to the amount of data queued in the queue) exceeds the pause threshold, a PFC pause frame (PFC Pause frame) needs to be sent to the upstream network device of the in-queue to notify the upstream network device to pause sending data to the in-queue to prevent data overflow.
[0052] The recovery threshold (Xon) is a preset threshold. When the length of an incoming queue of a network device (referring to the amount of data queued in the queue) falls below the recovery threshold, a PFC recovery frame (PFC Resume frame) needs to be sent to the upstream network device to notify the upstream network device to resume sending data to the incoming queue to prevent data overflow.
[0053] The solutions of the present invention are described below by means of some embodiments.
[0054] Example 1
[0055] According to an embodiment of the present invention, a PFC deadlock detection method is provided, which is applied to a network device configured with a priority-based flow control protocol, and the PFC deadlock detection method includes executing a preset PFC deadlock detection mechanism. Figure 2 , the PFC deadlock detection mechanism includes the following operations for each incoming queue:
[0056] An operation is performed to maintain two record areas for each entry queue: a local record area and a superior record area, each of which can store an impact record and a status value indicating whether the impact record is valid. The impact record includes an entry queue global ID and identification information used to indicate the identity information of the entry queue. The impact record can be set in the form of a triple. For example: {network device ID to which the entry queue belongs, local ID of the entry queue in the network device to which it belongs, identification information}, wherein the global ID of the entry queue indicating the identity information of the entry queue through the network device ID to which the entry queue belongs and the local ID can determine the source of an impact record, and different impact records generated by the same entry queue can be distinguished through the identification information. Schematically, the network device ID can use the MAC address of the device, and the local ID can be determined by the port number of the port where the entry queue is located and the priority of the entry queue. The status value is valid when the first value is valid, and invalid when the second value is invalid. The first value is different from the second value, for example: the first value is 1 and the second value is 0; or the first value is 0 and the second value is 1.
[0057] Operations of generating and storing local impact records: when the length of an incoming queue exceeds the pause threshold, an impact record is generated and stored in the local record area and the impact record is set to be valid. The impact record contains the incoming queue identity information indicating the generation record and identification information for distinguishing different records. In this embodiment, the identification information is a random number. Illustratively, if the length of an incoming queue with a local ID of 1 in a network device with an ID of 1 exceeds the pause threshold, an impact record is generated for it, such as {1,1,2}, where 2 is the value randomly generated this time. In addition, in order to avoid generating the same random number for the same incoming queue twice in a row, which affects the accuracy of detection, further improvements can be made. Preferably, when a random number used as identification information is generated for an incoming queue, it is determined whether the currently generated random number is the same as the identification information in the previous impact record of the incoming queue. If so, a new random number is generated.
[0058] Operation of electing and storing the most advantageous influence record: in the advantageous record area, the most advantageous influence record elected from the observed influence records according to the preset election rule is stored and set to be effective, wherein the source range of the observed influence record includes the local record area, the advantageous record area and the newly received detection frame. In this embodiment, the preset election rule includes:
[0059] If only one valid impact record is currently observed for the same entry queue, the impact record is used as the most advantageous impact record; possible situations include: situation 1: currently only one valid impact record generated locally by the network device exists in the local record area, and no impact record sent by other devices is received, then the impact record in the local record area is directly copied to the advantageous record area; situation 2: the impact record in the current local record area is invalid, and currently only one impact record carried in the detection frame sent by the downstream network device is received, then the currently received impact record is used as the most advantageous impact record and stored in the advantageous record area; situation 3: previously both the local record area and the advantageous record area recorded a valid impact record, but the two impact records are different from each other, and when the impact record in the advantageous record area is set to invalid and no new impact record is received, then the impact record in the local record area is copied to the advantageous record area and set to valid;
[0060] If multiple valid impact records are observed at the same entry queue, the most advantageous impact record is determined based on the size of the identification information contained in each of the multiple valid impact records. The impact record with the smaller identification information is more advantageous during the election. If the identification information is equal, the newly received impact record is considered to be more advantageous. For example, assuming that the two impact records to be elected are {1,1,2} and {4,1,5}, and the impact record with the smaller identification information is more advantageous, {1,1,2} is considered to be the most advantageous impact record; assuming that the two impact records to be elected are {3,1,2} recorded in the local record area and {1,1,2} newly received, and the identification information size of the two is the same, but {1,1,2} is the newly received impact record, then {1,1,2} is considered to be the most advantageous impact record. When determining the most advantageous influence record based on the size of the identification information contained in each of multiple valid influence records, possible situations include: Situation 1: There are no valid influence records in the local record area and the advantageous record area, and two or more new influence records are received, then the most advantageous influence record is selected from the two or more received influence records according to the election rules; Situation 2: The influence records stored in the advantageous record area are valid, and at least one new influence record is received, then the most advantageous influence record is selected from the valid influence records stored in the advantageous record area and the at least one new received influence record according to the election rules.
[0061] The operation of timely transmitting the most advantageous influence record: whenever the effective influence record in the advantage record area is updated and the queue length exceeds the pause threshold, the influence record in the advantage record area is encapsulated into a detection frame and sent to the upstream network device. When the effective influence record in the advantage record area corresponding to an entry queue is updated, but the queue length of the entry queue does not exceed the pause threshold at this time, it means that the entry queue can still receive data sent by the upstream network device at this time, and will not affect the deadlock. The time to send the most advantageous influence record has not arrived, and the influence record in the advantage record area will not be encapsulated into the detection frame and sent to the upstream network device temporarily; and the subsequent queued data of the entry queue gradually increases, and the queue length exceeds the pause threshold, then the influence record in the advantage record area can be encapsulated into the detection frame and sent to the upstream network device. Of course, there may be other situations; for example: when the queue length has exceeded the pause threshold, an influence record in the advantage record area is updated to another effective influence record (such as updated from {1,1,2} to {3,1,2}), then the other influence record is encapsulated into the detection frame and sent to the upstream network device. The embodiment of the present invention adopts the operation of timely transmitting the most advantageous impact record, which can timely and efficiently transmit the impact record that is useful for deadlock formation on the data plane, thereby improving the accuracy and efficiency of deadlock detection. However, the prior art, such as the patent document mentioned in the background technology, relays the routing mark regardless of the situation of the queue, and can detect loops, but may cause the detected loop to not actually deadlock, affecting the accuracy of deadlock loop detection.
[0062] Start the operation of eliminating the influence: When the length of the incoming queue falls below the recovery threshold, the influence records in the local record area and the advantage record area are invalidated, and an invalidation frame carrying the influence record in the advantage record area is sent to the upstream network device. When the length of the incoming queue falls below the recovery threshold, it indicates that the influence of the incoming queue on the formation of the deadlock loop is temporarily eliminated. Therefore, at this time, the incoming queue starts the operation of eliminating the influence. On the one hand, it is necessary to invalidate the influence records in the local record area and the advantage record area corresponding to the incoming queue. On the other hand, since the influence record in the advantage record area has been sent to the upstream, it is also necessary to send an invalidation frame carrying the influence record in the advantage record area to the upstream network device. By starting the operation of eliminating the influence, the state change of the incoming queue can be updated to the corresponding local record area and the advantage record area in time, and the relevant influence records in the upstream device can be invalidated in time, so as to avoid these influence records in the intermediate routing devices from continuing to consume resources and improve the efficiency of deadlock detection.
[0063] Relay operation to eliminate the impact: When an invalidation frame is received, the received invalidation frame is relayed to the upstream network device, and when the impact record in the advantage record area is the same as the impact record in the received invalidation frame, the impact record in the advantage record area is set to invalid. For an entry queue, when an invalidation frame is received, it indicates that the relevant entry queue of the downstream network device can continue to receive data, and its impact on the deadlock loop needs to be eliminated. Therefore, on the one hand, the received invalidation frame is immediately relayed to the upstream network device to notify the upstream network device to eliminate the impact; on the other hand, if the impact record in the advantage record area of an entry queue is the same as the impact record in the received invalidation frame, the impact record in the advantage record area is set to invalid to eliminate the impact at the entry queue position.
[0064] Operation of detecting deadlock loop: When the impact record in the newly received detection frame is the same as the valid impact record in the local record area, it is considered that the network device to which the entry queue belongs forms a deadlock loop with other network devices. When the impact record of the newly received detection frame is the same as the impact record in the local record area of an entry queue and the impact record in the local record area is valid, it means that the valid record is issued by the entry queue and has been unanimously elected by multiple intermediate network devices. The relevant entry queues of these intermediate network devices are also in a suspended reception state, indicating that the network device to which the entry queue belongs forms a deadlock loop with other network devices. Therefore, when a new impact record is received from the detection frame, the following processing is performed: determine whether the impact information is generated by the current entry queue through the entry queue identity information contained in the impact record. If so, the consistency of the impact record in the newly received detection frame and the valid impact record in the local record area is judged. If they are the same, it indicates that a deadlock loop is formed. If they are different, it indicates that no deadlock is formed; if not, the impact record in the newly received detection frame is used as the observed impact record and an election is performed according to the election rules. If after the consistency judgment, it is considered that no deadlock loop has been formed, the impact record in the newly received detection frame for the consistency judgment will be discarded. For example, when the newly received impact record is the same as the impact record in the local record area of an entry queue but the impact record in the local record area is invalid, the newly received impact record will be discarded; because although the newly received impact record is issued by the entry queue, the state of the entry queue has changed (for example: the entry queue has resumed to allow the upstream to continue sending data, or it may also resume to allow the upstream to continue sending data and then pause to allow the upstream to continue sending data), the effect of the previously issued impact record on the formation of the deadlock loop may change. In order to ensure the accuracy of the deadlock loop, in this case, it cannot be considered that the network device to which the entry queue belongs forms a deadlock loop with other network devices. However, the prior art, such as the patent literature mentioned in the background technology, considers that a loop is detected as long as a network device receives its own routing tag regardless of whether the situation of the entry queue has changed, which will affect the accuracy of the deadlock loop detection.
[0065] In the actual operation process, the detection frame or invalidation frame is actually received by the egress port of the network device, so the network device needs to associate the detection frame or invalidation frame received at the egress port with the ingress queue with data dependency. Preferably, the PFC deadlock detection mechanism also includes the following operations for each egress port: maintaining a bitmap for each egress queue contained therein, the bitmap including N bits for recording the dependency relationship between the egress queue and the ingress queues of the same priority in the N ingress ports of the network device to which the egress queue belongs, when the egress queue contains a data frame from an ingress queue, the corresponding bit in the bitmap is set to a first value indicating data dependency (or causal association) (such as set to 1), otherwise it is set to a second value (such as set to 0); when a certain egress queue receives a detection frame or invalidation frame, the ingress queue with data dependency is located through the bitmap, and it is considered that the ingress queue with data dependency receives the impact record in the detection frame or invalidation frame. In this embodiment, the ingress queue with data dependency is indicated by the bitmap, so that the relevant impact record is effectively transferred to the relevant ingress queue to better detect the deadlock loop.
[0066] When sending a detection frame or an invalidation frame, an alternative situation is to use a data frame, which is also feasible in principle, such as using a data frame to send a detection frame or an invalidation frame from a higher or highest priority channel. However, in order to ensure the efficiency of deadlock loop detection, preferably, the detection frame or the invalidation frame is sent in the form of a PFC pause frame or a PFC resume frame, wherein, when the in-queue that needs to send the detection frame or the invalidation frame is in the back pressure upstream, the in-queue sends the detection frame or the invalidation frame in the form of a PFC pause frame; when the in-queue that needs to send the detection frame or the invalidation frame does not have a back pressure upstream, the in-queue sends the detection frame or the invalidation frame in the form of a PFC resume frame.
[0067] Example 2
[0068] The difference between this embodiment and embodiment 1 is that the operation of timely transmitting the most advantageous influence record is different. In this embodiment, the operation of timely transmitting the most advantageous influence record is: whenever an election is completed and the length of the incoming queue exceeds the pause threshold, the influence record in the advantageous record area is encapsulated into a detection frame and sent to the upstream network device.
[0069] In order to more vividly illustrate the principle of the method of the present invention, see Figure 3, a simplified example is given. In this example, the network device is a switch. Assume that there are 4 switches, namely switches 1 to 4. A switch data structure for distributed data plane deadlock detection is maintained on each switch. The data structure includes two record areas maintained on each inbound queue of the switch, namely the local record area and the advantage record area. T1 is recorded in the local record area, and T2 is recorded in the advantage record area. The newly received impact record is called T. Among them, 1) T1 represents the impact record (or pause information) generated by the switch itself, which is actively generated because the corresponding inbound queue of the switch itself triggers a pause. 2) T2 represents the most advantageous impact record currently observed by this switch. When each new impact record is observed, the switch will conduct an election to select the most advantageous impact record and cache it in T2. To simplify, Figure 3 Only two connected rectangular boxes are used at each switch to show two record areas related to an entry queue, where the upper rectangular box represents the local record area, and the lower rectangular box represents the dominant record area. A rectangular box in green means that the impact record therein is valid, otherwise it means that the impact record therein is invalid. The numbers in the rectangular box in the form of {a, b, c} are impact records, a is the switch ID, b is the local ID of the entry queue in switch a, and c is the identification information for distinguishing different records. In this example, a random number is used. The smaller the identification information contained in the election, the more advantageous the impact record. t0~t9 represent some schematic moments. It should be noted that in actual situations, the number of switches constituting the network is large, each switch has multiple ports (such as 32, 64, etc.), and each entry port has multiple queues (such as 8). Therefore, the execution process of the PFC deadlock detection mechanism is relatively complicated. In addition, the operation of timely transmitting the most advantageous impact record is: whenever an election is completed and the length of the entry queue exceeds the pause threshold, the impact record in the dominant record area is encapsulated into a detection frame and sent to the upstream network device.
[0070] To simplify the illustration, the following only focuses on Figure 3 The switch shown and the corresponding inbound queues in the rectangular box are used for illustration:
[0071] At t0, switches 1, 2, and 4 trigger PFC pauses at the same time (the length of the incoming queue exceeds the pause threshold), and deadlock has not yet been fully formed. The impact records generated are sent upstream along with the PFC frame (called the detection frame). For example: switch 4 generates an impact record {4,1,5}, which is stored in the local record area. In addition, since no impact record is received, the advantage record area also stores the impact record {4,1,5}. Switches 1 and 2 are similar and will not be described in detail.
[0072] At t1, the impact records are received on switches 1, 3, and 4 (here, it actually means that the inbound queues corresponding to the rectangular boxes shown on the right side of switches 1, 3, and 4 have received the impact records, and similarly, the following) and an election is conducted, and the election results are stored in T2. Among them, the impact record in the local record area of switch 4 is {4,1,5}, and the impact record received is {1,1,2}. The identification information 2 in the impact record {1,1,2} is less than 5 in the impact record {4,1,5}. Then {1,1,2} is the most advantageous impact record, and the election result of switch 4 causes its T2 to be updated, so it synchronizes the update to switch 3 through a PFC pause frame (called a detection frame) carrying T2. The impact record {2,1,8} newly received by switch 1 will not cause the corresponding T2 to be updated.
[0073] At t2, switch 3 receives T={1,1,2} from switch 4, and updates T2 to {1,1,2} through election. However, since the corresponding incoming queue length has not exceeded the pause threshold at this time, the condition is not met at this time: whenever the valid impact record in the advantage record area is updated and the incoming queue length exceeds the pause threshold, the impact record in the advantage record area is encapsulated into a detection frame and sent to the upstream network device; therefore, it does not notify the upstream temporarily and will not send a detection frame carrying {1,1,2} to the upstream. Figure 3 In the middle position ①, switch 1 may make the in-queue length fall below the recovery threshold due to reasons such as the decrease in shared buffer occupancy, and become a non-paused switch, so its T1 and T2 become invalid. At this time, it sends an "invalidation frame" to switch 4, so that the invalidation frame carries the most advantageous impact record T2 = {1,1,2}.
[0074] At t3, Figure 3 Position ②: Switch 4 receives T carried in the invalidation frame, and checks to find that the local T2 is equal to T, so it sets T2 to invalid and continues to notify switch 3. Then, T2 of switch 4 is updated to the corresponding T1{4,1,5}, and notified to switch 3 in the form of a PFC pause frame (for the sake of clarity, the sending of {4,1,5} to switch 3 is split into the next moment). Switch 3 also happens to trigger the PFC pause, generating T1={3,1,2}. It first conducts an election with the locally cached T2 and finds that its newly generated T1 is not advantageous enough, so it maintains T2 unchanged and notifies T2={1,1,7} to the upstream switch 2. Figure 3 Middle position ③: Switch 1 triggers a new round of PFC pause, generating T1 = {1,1,7}. It first elects with T2 in the local cache, assigns its newly generated T1 to T2 according to the election rules, and notifies it to the upstream switch 4.
[0075] At t4, Figure 3 Position ④: Switch 4 first executes the operation of "sending {4,1,5} to switch 3" in the previous step, that is, assigning the local T1 to T2, making it valid, and propagating T2 = {4,1,5} upstream. Subsequently, it receives the frame T = {1,1,7} sent to it from switch 1 at time T, and conducts an election. However, the advantage of T is less than T2, so T2 maintains {4,1,5} unchanged. Figure 3 Middle position ⑤: Switch 3 receives the invalidation frame from switch 4, invalidates its own T2, and updates its own T2 with its own T1{3,1,2}, making it valid and relaying the invalidation frame to the upstream (for clarity, the same as above, in Figure 3 The data packet is sent from switch 3 to switch 2 during the period from t5 to t6. Switch 2 receives the detection frame, performs election update T2 and continues to propagate upstream.
[0076] At t5, Figure 3 Switch 3 at position ⑥ first executes the operation of "notifying switch 2 of {3,1,2}" in the previous step, that is, assigning the local T1={3,1,2} to T2, making it valid, and propagating T2={3,1,2} upstream. Subsequently, it receives the frame T={4,1,5} sent to it by switch 4 at t4. T and T2 elect each other, and the result is that T2 remains unchanged. Figure 3 At position ⑧, switch 2 receives the invalidation frame, checks and invalidates the local T2, and sends an invalidation frame to switch 1. Then, it sets its own T2 to T1 ({2,1,8}), makes it valid, and notifies the upstream (for the sake of clarity, the same as above, in the picture, it is reflected as the data packet sent from switch 2 to switch 1 from time t6 to t7). Figure 3 Although switch 1 in position ⑦ received the pause frame it sent, the random number is different, which means that the switch triggered PFC recovery after the last impact record was sent, and the causal relationship cannot be proved. Therefore, switch 1 only conducts an election and selects {1,1,7} to pass it upstream.
[0077] At t6, Figure 3 Position ⑨: Switch 4 receives T = {1,1,7} and conducts an election. However, since the original T2 is more advantageous, the content of T2 remains unchanged and the most advantageous pause message {4,1,5} is passed to the upstream. Figure 3Middle position ⑩: Switch 2 first executes the operation in the previous step of "setting its own T2 to T1({2,1,8}), setting it valid and notifying the upstream", that is, assigning the local T1={2,1,8} to T2, setting it valid, and propagating T2={2,1,8} upstream. Subsequently, it receives the frame T={3,1,2} sent to it by switch 3 at t5. T and T2 elect each other, and as a result, T2 is updated to {3,1,2} and propagated upstream. Switch 1 receives the "invalidate frame" (carrying T={1,1,2}), but after local inspection, although it is the impact record generated by switch 1, it is different from the current valid impact record T2={1,1,7}, and it cannot be considered that a deadlock loop has been formed at this time. Moreover, the T={1,1,2} received at this time cannot invalidate the current T2, and T2 is still T={1,1,7}.
[0078] At t7, Figure 3 Middle position Switch 1 receives T = {3, 1, 2} and conducts an election (the election result is to update T2 to {3, 1, 2}), and notifies the upstream of the election result. Switch 3 receives T = {4, 1, 5} and conducts an election, but the advantage of T is low, so T2 is not updated. At t8, Figure 3 Middle position Switch 4 receives T={3,1,2} and conducts an election, updates T2 to T, and notifies it upstream.
[0079] At t9, Figure 3 Middle position Switch 3 conducts an election and observes a probe frame from itself, with T and T1 being exactly the same. This indicates that a deadlock loop is observed on Switch 3.
[0080] Example 3
[0081] The difference between this embodiment and Embodiment 1 or 2 is that the representation form of the impact record is different.
[0082] Optionally, the impact record is a four-tuple, expressed as {network device ID to which the entry queue belongs, port ID of the entry queue in the network device to which it belongs, priority number of the entry queue, identification information}, wherein the global ID of the entry queue is represented by the network device ID to which the entry queue belongs, the port ID of the entry queue in the network device to which it belongs, and the priority number of the entry queue, and the local ID is equivalent to the port ID of the entry queue in the network device to which it belongs and the priority number of the entry queue.
[0083] Optionally, the impact record is a tuple, expressed as {incoming queue global ID, identification information}. For example, a unique incoming queue global ID may be allocated to all incoming queues of all network devices in the network.
[0084] Example 4
[0085] The difference between this embodiment and embodiment 1, 2 or 3 is that the identification information is not a random number but a timestamp, and the current timestamp is obtained as the identification information when generating the impact record. When the timestamp is used, the impact record with smaller identification information can be considered to have more advantages during the election, that is, the smaller the timestamp, the more advantages the election is conducted.
[0086] In general, the inventor believes that the control plane-based solution has a natural disadvantage due to the inherent problem of large communication delay. In principle, the performance of the solution based on direct detection of the data plane is higher, but the existing solution does not analyze the complex instantaneous state in the deadlock generation process sufficiently and is not compatible enough, so it cannot effectively deal with deadlocks in various formation processes. After research, the inventor believes that to solve the deadlock problem based on the data plane, it is necessary to fully analyze the state of the switch in the deadlock formation process, consider the possible state changes of the switch in the deadlock formation process, and the changes in the impact on other upstream and downstream switches, and design a more stable, more robust, and applicable to deadlocks caused by various reasons. The distributed PFC deadlock detection method designed in the embodiment of the present invention can be deployed on the switch chip, or can be compiled and deployed on a programmable device with the help of the programmable capability of the switch, so that it can run completely on the data plane, and use the short transmission delay between single hops of the data center switch to achieve more efficient deadlock detection. At the same time, the method of the present invention can stably detect deadlocks in the complex deadlock formation process, thereby ensuring its effectiveness.
[0087] In addition, after detecting a deadlock loop, you can also consider how to better resolve the deadlock.
[0088] There are different solutions in academia and industry to resolve PFC deadlock. Here are some existing solutions:
[0089] (1) Link reset. In practice, a common deadlock resolution solution is that when the control plane detects a deadlock through a deadlock detection algorithm, it will discard the data frames in the corresponding queue in the deadlock loop by resetting the queue, port, or switch node. This method is simple and easy to use; however, it is very disruptive to the flow corresponding to the discarded data frame, which is both destructive and inelegant.
[0090] (2) Data frames of large-volume elephant flows are discarded first. A recently proposed solution deploys a sketch data structure (Sketch structure) for flow size discrimination in the programmable data plane, which detects the size of each flow and discards data frames in the elephant flows first. This can minimize the number of flows affected by packet loss, thereby reducing the impact of data frame loss in a statistical sense, but it cannot completely eliminate this impact.
[0091] (3) Adaptive forwarding path. The main idea of this solution is that when a deadlock is detected, the information of the data frames in the deadlock queue is recalculated through the control module to a new forwarding path that does not cause deadlock, and the data frames are forwarded along the new forwarding path. When other switch nodes receive these data frames, since there is no forwarding information about these data frames before, other switches will also go to the control plane (module) to calculate a new path for the data frame until the data frame is sent to the destination. This solution needs to calculate the forwarding path on the control plane hop by hop, so the overhead is relatively large and the delay is relatively large; and because this solution mainly uses the idea of Software Defined Network (SDN), it is highly proprietary and is mainly used in private network protocols (such as Infiniband network). In addition, although the adaptive forwarding path will not cause data frame loss, it will forward the data frame to other links, thereby interfering with other innocent traffic.
[0092] (4) Reconfigure the buffer size. The academic community has also proposed a buffer reconfiguration method to deal with deadlock. The core idea is that when the switch control plane detects the occurrence of deadlock, it monitors the free size of the shared buffer and finds an available buffer from it. This space is dynamically added to the deadlock queue. The available length of the queue increases, and the PFC recovery threshold also increases, so that the queue triggers PFC recovery and the deadlock is resolved. However, this solution still has the following problems: 1) Dynamic buffer reconfiguration still requires the help of the control plane and may cause data frames to be lost in the chip buffer; 2) Buffer reconfiguration either requires finding a large enough buffer space on a single switch to restore the flow of the entire loop, or requires all switches on the deadlock loop to perform this operation, otherwise the phenomenon of "although the downstream switch triggers the PFC recovery frame to the upstream, the upstream will be re-paused by the downstream after sending a few data frames" will occur, and thus the unlocking will not be successful; 3) This solution will have an adverse impact on other queues that share the buffer with the deadlock queue. It not only occupies the buffer space that can be used by other queues, but also often fails to allocate enough space from the shared buffer, resulting in 100% unlocking success. Moreover, if the same switch node carries multiple different deadlock loops, each loop requires a separate free queue, which will put pressure on the buffer allocation of the switch. In addition, the operation of taking away available space from the shared buffer will reduce the number of unused shared buffers, making it easier for other queues to trigger PFC pauses.
[0093] In general, the prior art has the following problems:
[0094] Although the packet loss solution (link resetting, preferentially discarding elephant flows with large data volumes, etc.) is simple, it will cause packet loss to the data flow, thereby affecting the performance of the flow.
[0095] The adaptive routing solution needs to recalculate the routing path at each hop, resulting in poor forwarding performance. In addition, the solution will interfere with other traffic and is generally used in private networks.
[0096] The solution based on reconfiguring the buffer size requires control over the reconfiguration of the buffer, which is inefficient; it will occupy the buffer space that can be used by other queues, thus affecting other traffic. Moreover, this solution will fluctuate with the different occupancy of the buffer, and cannot guarantee 100% deadlock relief;
[0097] The above prior art either discards part or all of the data frames on the deadlock loop, which has a significant impact on the original data flow; or forwards the data frames on the deadlock loop to other switches outside the deadlock loop, which has a significant impact on innocent traffic.
[0098] It can be seen that the existing technology either discards some or all data frames on the deadlock loop, which has a great impact on the original data flow; or forwards the data frames on the deadlock loop to other network devices outside the deadlock loop, which has a great impact on innocent traffic. When the inventor was conducting research on the RDMA network in the data center, he found that the existing deadlock release technology was not efficient enough and lacked a deep understanding of the network devices and networks that support RoCE lossless networks.
[0099] The inventor believes that the overall idea of the current existing solutions is to schedule the data frames on the deadlock loop out of the loop, but there are different focuses in the specific implementation. For the packet loss solution, the focus is on the length of the data frame queue itself, and it is believed that the flow of the deadlock loop can be restored by reducing the number of queued data frames. This is essentially to find a new data frame cache space outside the network. But this ignores the business carried on it, that is, the data frame itself. For the adaptive forwarding path solution, its essence is to find a space that can accommodate the data frames in the deadlock on the network device outside the deadlock loop, and schedule the data frames therein to reduce the number of data frames queued in the deadlock queue. However, the method of finding cache space on other network devices will affect other network devices. For the buffer reconfiguration solution, they find a buffer in the shared buffer of the network device to increase the maximum queue length of the deadlock queue, thereby reducing the relative value of the actual queue length relative to the maximum queue length, thereby releasing the deadlock. However, this idea requires the help of the control plane, and the space that needs to be found is large enough, and it will inevitably affect other queues on the network device that use the shared buffer.
[0100] The inventor believes that the core idea to solve the deadlock is to find a new buffer space to schedule data frames until the actual length of the queue is reduced to below the maximum value of the queue that allows the resumption of transmission. However, where to find the buffer, how big the buffer should be, and how to schedule the data frames transmitted by the upper layer to this buffer are the differences between different methods and are also the key to determining the final effect of these methods.
[0101] Through their research, the inventors noticed two key insights that had not been used in previous work:
[0102] The first key insight is that for data frames that are already queued in the deadlock loop, the only thing they need to do is to forward them hop by hop along the determined forwarding path (forwarding table) until they reach a network device on the loop, where they can be forwarded out of the loop. In this way, data frames can be dispatched out of the loop in a lossless manner, the queue length can be reduced, and the deadlock problem can be solved.
[0103] The second key insight is that the headroom buffer of network devices is usually configured larger than its theoretical value, and the headroom buffer can be used to solve the deadlock problem. The inbound queue of RDMA network devices supporting RoCE lossless network is divided into three parts: guaranteed minimum buffer (Gmin), shared buffer (shared), and headroom buffer (hdrm). The minimum guaranteed buffer is used to reserve the minimum buffer space for each queue to prevent queue starvation; the space of the shared buffer is dynamically requested from the buffer of the network device to absorb the data frame accumulation generated by the queue with higher load. The headroom buffer is used to absorb the data frames that continue to arrive after the PFC pause frame is sent upstream on each port until the pause frame reaches the upstream network device and stops its transmission. Although the size of the headroom buffer can be calculated in theory, it is complicated to obtain the metrics required for calculation. For example, metrics such as port transmit and receive delay and higher-level delay depend on the vendor and specific implementation. Therefore, in practice, the headroom buffer space is usually configured slightly larger to accommodate the needs of "plug and play", as the default settings provided by network equipment manufacturers. In most cases, this additionally configured redundant headroom buffer space may actually still have idle space when a deadlock loop occurs, and can be used to better resolve the deadlock problem.
[0104] In this regard, in the method of the present invention, when it is detected that a deadlock loop based on PFC exists in the RoCE network, multiple network devices in the deadlock loop are first determined as a basis for constructing a loop forwarding table; then, a loop forwarding table corresponding to the deadlock loop is constructed for the multiple network devices to determine the path for forwarding data frames along the deadlock loop; finally, the available space of the net buffer of the network device and the loop forwarding table are used to allow the data frames on the deadlock loop to flow along the loop, and during the flow process, it is determined according to the original forwarding table whether there is an opportunity to forward the data frame out of the loop, if so, the data frame is forwarded out of the loop according to the original forwarding table, if not, the data frame continues to be forwarded along the loop; thereby, some data frames may reach the exit originally on the deadlock loop during the flow process and be forwarded out of the loop, thereby reducing the occupancy of the buffer, thereby creating conditions for releasing the deadlock. The method of the present invention utilizes the available space of the clear buffer and the loop forwarding table to create a flow of data frames along the deadlock loop and find opportunities to flow out of the deadlock loop according to the original forwarding table during the flow process. The data frames on the deadlock loop are not discarded, and the data frames on the deadlock loop are not directly transferred to innocent links, thereby reducing the impact on the original data flow and other links related to the deadlock loop during the unlocking process, and improving the performance of the RoCE network.
[0105] According to one embodiment of the present invention, see Figure 4, a method for processing PFC deadlock is provided, including: S1, S2, S3. In order to better understand the present invention, each step is described in detail below in combination with specific embodiments.
[0106] Step S1: when a deadlock loop is determined to be formed according to a preset PFC deadlock detection method, a plurality of network devices in the deadlock loop are determined.
[0107] According to one embodiment of the present invention, a method for determining multiple network devices in a deadlock loop includes: selecting a network device from the deadlock loop as a coordinator; starting from the coordinator, the network devices in the deadlock loop send a customized first data frame to the upstream network device one by one, requesting the addition of the network device's own global ID, wherein the first data frame sent by the coordinator is inserted with the coordinator's own global ID; when any network device receives the first data frame, it inserts its own global ID into the first data frame in sequence, obtains an updated first data frame, and sends it to the upstream network device; when the coordinator receives the returned first data frame from the upstream network device, it records the sequentially arranged global IDs of multiple network devices in the deadlock loop.
[0108] In order to explain how network devices collect global IDs of network devices on the loop, it is necessary to briefly introduce the structure of network devices. In an RDMA network, each network device has multiple ports, among which the port that performs the function of sending data is called an egress port, and the port that performs the function of receiving data is called an ingress port; when supporting duplex mode, the same port can be reused as an ingress port and an egress port. Under the PFC mechanism, multiple priority queues are maintained for each egress port (which can be called an egress port queue or an egress queue, such as a RoCEv2 network with 8 priority queues); similarly, multiple priority queues are maintained for each ingress port (which can be called an ingress port queue or an ingress queue).
[0109] In order to recover from the deadlock state and allow the data frames of the deadlock loop to be sent to the downstream network devices, multiple network devices on the deadlock loop should be determined, which represent the topological structure of the deadlock loop. A scheme can be designed to accumulate the global IDs of the network devices on the deadlock loop in order, which represents the topological structure of the deadlock loop. The data frames in the outgoing queue of a certain priority of a certain port of the deadlock loop may come from the ingoing queues of the corresponding priorities of its different ingoing ports. It should be determined which of these ingoing queues is in the deadlock loop. This will ensure that the data frame scheduling during the deadlock release is limited to the queues within the deadlock loop. For this purpose, a bitmap with a length equal to the number of network device ports N is used on the outgoing queue of each network device to record the correlation between the ingoing port and the outgoing port in a network device. When the network device is running, a bitmap is constructed for each outgoing port queue. If an outgoing port queue contains a data frame from a certain ingoing port, the bit representing the ingoing port in the corresponding bitmap is assigned a value of 1, otherwise it is assigned a value of 0.
[0110] like Figure 5 As shown, as an example, a custom data frame header can be used (Note: the data frame is referred to as a "custom data frame" in the following text. The specific format of the frame header is not limited, but it should have different characteristics from other data frames in certain specified fields, so that the network device can customize the data frame by identifying certain specified fields of the frame header). The frame header of the custom data frame will carry a node quantity field (VarLen field), a credit field (Credit field) and an operation code field (Opcode field). The node quantity field is used to record the number of global IDs (NodeId, i.e., node ID, such as MAC address or other globally unique identification) currently accumulated in the data frame (the initial value is 0), the credit field is used to record the credit value assigned by the downstream to the upstream (for data frame scheduling in subsequent steps), and the operation code field is used for the operation that the network device currently needs to perform on the data frame. After the frame header, a variable-length node ID field (NodeId field) is carried. Each time a global ID is accumulated in the NodeId field, the VarLen field is incremented by one; each time a global ID is removed, the VarLen field is decremented by one (the specific names of the fields can be different, as long as the same effect is achieved. The specific values of the operation code field can also have different definitions, as long as the corresponding operations are the same).
[0111] Based on the first data frame above, multiple network devices in the deadlock loop can be collected to obtain loop forwarding path information: Figure 5As shown, a network device is selected as a coordinator (e.g., network device S1) on the deadlock loop at random or according to the rules preset by the implementer. It will send a custom data frame (called the first data frame for distinction) with varLen=1 and opcode=1 in the opposite direction of normal traffic (i.e., the direction of PFC frame propagation), in which the nodeId field carries the global ID of the network device. When a certain output port of any network device receives and parses the data frame with opcode=1, it will insert its own global ID into the first data frame in sequence according to the protocol; for example, they insert their own global network device ID after the frame header and before the global ID of other network devices, and query the bitmap to find the input port related to the output port (i.e., the input port with bit 1), and relay the data frame from these input ports to the output port of the upstream network device. This process continues until the custom first data frame is returned to the coordinator, which means that the information required to establish the loop forwarding table has been collected. Figure 5 In the figure, 1, 2, 3, and 4 are used to simplify the global IDs of network devices S1, S2, S3, and S4, and Hdr represents the frame header. Hdr1 is the first data frame sent by network device S1 as the coordinator. When S4 on the loop receives it, it inserts its own global ID after the frame header and before other global IDs. The first data frame is updated to Hdr41 and sent to its upstream network device. The cycle continues, and finally S1 receives the first returned data frame, namely Hdr2341. Multiple network devices in the deadlock loop are collected, namely network devices S1, S2, S3, and S4.
[0112] It should be noted that Figure 5 It is only a simplified illustration to illustrate the process of collecting the global IDs of multiple network devices on the loop. However, in the process of collection, the global IDs of all network devices on the loop are not actually known. Therefore, when each network device forwards the first data frame to the upstream, it is not only sent to the upstream network device on the loop. According to the above-mentioned query bitmap method, it may also be sent to the upstream network device on the non-loop. However, since the network device on the non-loop is not on the loop, the corresponding first data frame will not be returned to the coordinator although it has accumulated the global ID of the relevant non-loop.
[0113] Step S2: constructing a loop forwarding table corresponding to the deadlock loop for the plurality of network devices, wherein the loop forwarding table indicates a path along which data frames on the deadlock loop are forwarded.
[0114] According to one embodiment of the present invention, the method of constructing the loop forwarding table includes: constructing the loop forwarding table according to the global ID and the global ID-local port mapping table arranged in order, the loop forwarding table includes the inbound port and the outbound port connected to the network device and the upstream and downstream network devices in the loop. Preferably, the data frame on the deadlock loop refers to the data frame in the inbound queue of the inbound port and the outbound queue of the outbound port on the deadlock loop, and the inbound queue of the inbound port and the outbound queue of the outbound port are queues of the same priority.
[0115] After collecting the global IDs in order, a loop forwarding table needs to be constructed on the network device on the deadlock loop (ie, the network device should know who its ingress port and egress port on the deadlock loop are respectively).
[0116] like Figure 6 As shown, once the coordinator receives a custom data frame with opcode=1 from itself, it modifies the opcode to 2, and inserts its own global ID again after the frame header and before other global IDs, and then sends the custom data frame (to distinguish, it can be called the second data frame) to the downstream along the deadlock loop with different priorities. When other network devices on the loop receive the custom data frame with opcode=2, they will parse the first and third global IDs from the front to the back of the nodeId field to obtain the global ID of the network device downstream of the loop of this network device; then, it will query the network device global ID-local port mapping table statically determined when building the network to identify which ports are the inbound and outbound ports connected to the upstream and downstream network devices in the loop. Then, the network device discards the first global ID in the nodeId field, reduces the varLen field by one, and sends the custom data frame downstream from their outbound ports in the loop. As for the coordinator, when it receives a data frame with opcode=1, it can identify its own egress port in the deadlock loop by parsing the first global ID in the nodeId field; when the coordinator finally receives a data frame with opcode=2, it will also identify its own ingress port in the deadlock loop by parsing the first global ID in the nodeId field. Figure 6 For example, the network device S2 receives the data frame Hdr12341 with opcode=2. The first and third global IDs in the nodeId field are 1 and 3 respectively, which means that the upstream network device S1 and the downstream network device S3 are in the deadlock loop. The other network devices are similar and will not be described here. However, the coordinator is different. For example, the network device S1 can receive the first data frame Hdr2341 (see Figure 5 ) in the nodeId field to know that its upstream network device is S2, and through the received second data frame Hdr41 (see Figure 6) knows that its downstream network device is S4. In the above way, each network device in the deadlock loop can know its upstream and downstream ports in the deadlock loop. Although from a global perspective, the data frame is of variable length (due to the insertion and deletion of nodeId), for a single network device, it only needs to process the specified part of the data frame because the parsing, insertion and deletion of the nodeId field in the custom data frame are all performed at a fixed position. This saves the data frame header vector (PHV) resources required by the network device and simplifies the implementation.
[0117] The above Varlen field can be used only for counting, so the implementer can choose whether to set the Varlen field as needed. Of course, the implementer can also specify other functions of the VarLen field, such as for the coordinator to quickly determine its upstream and downstream network devices or for verification, to form other implementation methods. Schematically, when the coordinator is used to quickly determine its upstream and downstream network devices, when the coordinator receives the returned first data frame, the first global ID and the second-to-last global ID can be extracted in sequence from the first data frame (the specific position of the second-to-last global ID in the nodeId field is known through the length of the varLen field) as its upstream and downstream network devices. When used for verification, the coordinator can verify whether the number of nodes recorded in its nodeID field is consistent with the number of global IDs currently remaining in the varLen field when receiving a data frame with opcode=2, so as to avoid the intermediate network device not correctly discarding the first global ID in the nodeId field before sending the second data frame.
[0118] Step S3: utilizing the available space of the clear buffer of the network device and the loop forwarding table to allow the data frames on the deadlock loop to flow along the loop, wherein when any data frame flows along the loop to a network device, the network device determines according to the original forwarding table whether there is an opportunity to forward the data frame out of the loop; if so, the data frame is forwarded out of the loop according to the original forwarding table; if not, the data frame continues to be forwarded along the loop.
[0119] According to one embodiment of the present invention, the process of allowing data frames on a deadlock loop to flow along the loop includes: each network device maintains multiple entry queues and multiple exit queues, and the network device on the deadlock loop grants the available space of the clear buffer of the entry queue corresponding to the deadlock loop as a credit value to the upstream network device; the upstream network device maintains the credit value granted by the downstream network device to limit the sending of data frames to the entry queue corresponding to the network device that grants the credit value, and suspends the sending of data frames when the remaining credit value is insufficient to send the next data frame, wherein the maintenance includes: deducting the amount of data sent from the credit value each time a data frame is sent, and when the granted credit value is received again, accumulating it with the remaining credit value to update the remaining credit value. The technical solution of this embodiment can at least achieve the following beneficial technical effects: the network device informs the upstream of the size of the available space in the clear buffer of the incoming queue corresponding to the deadlock loop, thereby "pulling" data frames from the upstream, allowing each data frame in the loop to flow on the loop and be forwarded hop by hop to the network device that can leave the loop, thereby having the opportunity to leave the loop; thereby, the amount of data frames queued in the incoming queue on the deadlock loop can be reduced to resolve the deadlock.
[0120] In the above embodiments, redundant part of the clear buffer space is used to restore data frame transmission in a lossless manner. The core idea is that the downstream network device informs the upstream of the free clear buffer space corresponding to the queue after the deadlock occurs, and pulls the data frame from the upstream in the producer-consumer mode and puts it into its own free clear buffer space.
[0121] like Figure 7 As shown, after the loop forwarding table is established, each network device on the deadlock loop maintains a register for storing credit values for its downstream network device, and the register of the upstream network device is first initialized to 0. A data frame scheduling module can be set at the egress port of the upstream network device, and an HDMI monitoring module can be set at the ingress port of the downstream network device. Among them, the HDMI monitoring module of the downstream network device will send a custom data frame with opcode=3 to the upstream (for distinction, it can be called the third data frame), and its Credit field carries the credit value representing the available space of the clear buffer (or the available HDMI space size). The data frame scheduling module will increase the value of the register according to the credit value parsed from the custom data frame. When a data frame is dequeued, the value of the register will decrease, and the decreased value is equal to the size of the data frame sent. As long as the value of the register is greater than or equal to the maximum transmission unit (MTU), the data frame dequeuing process will continue, and the data frame will be sent downstream.
[0122] For a deadlocked network device, when a data frame is dequeued and sent downstream, the corresponding ingress queue length will also decrease, and the available space in its net buffer will increase. This will cause it to send more credits upstream, and its upstream network device will receive more credits, further facilitating the transmission of deadlocked data frames downstream.
[0123] It is important to note that when a data frame is sent to a downstream network device, it first follows the original forwarding table to determine the next hop. If the destination of the next hop is not a network device in the loop, the data frame can escape the deadlock loop, thereby reducing the queue length.
[0124] According to an embodiment of the present invention, when data frames on a deadlock loop go around the loop, the multiple network devices all suspend their upstream network devices from sending data frames outside the deadlock loop into the loop. In order to prevent data on a non-loop from entering the deadlock loop during the unlocking process, the network devices on the loop can suspend their upstream network devices from sending data frames outside the deadlock loop into the loop, unless the coordinator determines that the deadlock has been solved or needs to use other existing unlocking methods.
[0125] According to one embodiment of the present invention, the method further includes: after a data frame on a deadlock loop flows along the loop for one circle, determining whether the deadlock is resolved, if so, invalidating the loop forwarding table to restore the conventional forwarding rules, if not, allowing the data frame on the deadlock loop to flow along the loop again or enabling other deadlock resolution methods. In extreme cases, it is possible that the data frame on the deadlock loop cannot leave the loop after flowing along the loop for multiple circles, affecting the overall performance. In this regard, a maximum number of times a data frame on the deadlock loop flows along the loop can be set. If the deadlock is still not unlocked after exceeding the maximum number, an existing deadlock resolution method can be used instead, such as any one of the prior arts described in the background technology, so as to explain the use of an existing deadlock resolution method in extreme cases to ensure the timeliness of unlocking.
[0126] In the above unlocking process, the existing buffer management strategy can be used to determine the occupancy of various buffers in the queue. However, the inventor believes through research that in the unlocking process, the management strategy of the internal buffer of the network device will still affect the efficiency of unlocking.
[0127] Indicatively, current data center network devices often use "dynamic threshold" as the buffer management strategy of network devices, in which the order of buffer occupancy deduction is clear buffer, shared buffer and minimum guaranteed buffer. Figure 8As shown in the figure, data frames of different colors and lowercase letters represent different flows, such as blue for flow a, green for flow b, orange for flow c, and red for flow d. The full name of EQ is Egress Queue, which stands for egress queue (outbound queue). Similarly, the English name of the ingress queue is Ingress Queue; the "flow-destination" table in the middle represents which flow's data frame should be forwarded to which outbound port. In addition, the buffer of the ingress queue is divided into three parts, from left to right: clear buffer, shared buffer, and minimum guaranteed buffer. Assume that ingress queue 1 and outgress queue 1 are in a deadlock loop. However, the data frame at the head of the current outgress queue 1 (data frame of flow c) comes from ingress queue 2. When outgress queue 1 dequeues a data frame, the clear buffer occupancy of ingress queue 2 outside the deadlock loop decreases, while the available space of the clear buffer of ingress queue 1 remains unchanged, and it is impossible to make room for further data frame scheduling, resulting in the problem of "false fullness". The root cause of this problem is that Enqueue 1 and Enqueue 2 do not share the space of the headroom buffer, so the headroom buffer space released by Enqueue 2 cannot be utilized by Enqueue 1.
[0128] In view of the above problem, the characteristic of "virtual statistical queue" used by network equipment can be utilized to solve this problem. According to one embodiment of the present invention, the method further includes: while allowing data frames on the deadlock loop to flow along the loop, allowing the network equipment on the deadlock loop to execute the buffer management strategy during the unlocking period, and the buffer management strategy during the unlocking period includes: when the outbound queue located on the deadlock loop forwards a data frame out of the loop according to the original forwarding table, first deduct the occupied space of the data frame from the shared buffer of the inbound queue corresponding to the data frame. Minor adjustments are made to the buffer management strategy to coordinate the buffers between queues and ensure that the actual queued data frames are not affected: when the outbound queue sends a data frame from the inbound queue outside the loop, the size of the data frame is first deducted from the shared buffer of the inbound queue, and then deducted from the reserved clear buffer space, thereby ensuring that the inbound queue in the deadlock loop can actively obtain more space from the shared buffer. Still with Figure 8For example, under the buffer management strategy during unlocking, after outbound queue 1 sends a data frame of flow c, the size of data frame c is first removed from the corresponding shared buffer of inbound queue 2. Since the size of the shared buffer of inbound queue 1 and inbound queue 2 is shared, the shared buffer of inbound queue 1 will be idle at this time, and the data frame a in the empty buffer of inbound queue 1 can be moved to the shared buffer of inbound queue 1, so that the empty buffer of inbound queue 1 can be freed up to give more credit value to its upstream. This minor modification makes efficient use of the idle buffer and ensures that there is enough buffer space along the loop, thereby ensuring the continuous buffer coordination scheduling between network devices before the deadlock is resolved until the data frame is scheduled out of the loop. It should be noted that this modification is only effective during the deadlock resolution period and will not affect the behavior of network devices when there is no deadlock. By modifying the algorithm of the virtual statistical queue, the data frames in the deadlock loop can always have sufficient space to accommodate the data frames from the deadlock upstream, thereby realizing a continuous and robust deadlock release process.
[0129] In the above unlocking process, although the data frames can flow along the loop, it is difficult to determine the position of the original data frames on each network device on the loop, and the order of the data frames is also difficult to guarantee, which will have a serious impact on end-to-end performance. Because RoCE uses Go-Back-N retransmission to maintain reliable transmission, which is very sensitive to packet loss or out-of-order data frames. When existing solutions are applied to RoCE's lossless network, they cannot maintain the order of data frames, resulting in reduced network performance. Although modern Infiniband networks or certain specified network cards (such as NVIDIACX6) support a certain range of out-of-order transmission, it is unrealistic to assume that all network cards have this capability in a RoCE-based data center composed of heterogeneous network cards.
[0130] Indicatively, see Fig. 9 , assume that the forwarding path of a flow may have one or more segments overlapping with the deadlock loop. For example, the deadlock loop consists of network devices S1→S2→S3→S4→S1. The flow represented by the dotted line (yellow) has only one segment overlapping with the loop, namely segment S1→S2→S3→S4, while the flow represented by the solid line (green) has two segments, namely segment S1→S2 and S3→S4. If the data frames of the flow on each segment can find an opportunity to forward out of the loop from the nearest egress network device according to its original forwarding table, the order of the data frames can be maintained. However, when a flow enters and leaves the loop multiple times, the situation becomes complicated. For example, Fig. 9The flow represented by the solid line (green) has two ports on the loop that can send it out of the loop, namely port 1 on network device S2 and port 2 on network device S4. When deadlock occurs, its data frames 3-5 (green) are naturally blocked and cannot enter network device S3. Assuming that the data frames from network device S2 continue to arrive at network device S5, they will eventually saturate the in-queue of network device S5, thereby pausing port 1. In this case, data frame 6 (green) of the flow represented by the solid line cannot be forwarded out of the loop through port 1 (its nearest egress port), that is, although it can be forwarded out of the loop through port 1 according to the original forwarding table, port 1 has been paused, and there is no opportunity to forward it out of the loop through the nearest port 1. In order to ensure the scheduling of other flows in the loop, this solution needs to continue to schedule these data frames along the loop according to the loop forwarding table. Therefore, data frame 6 will eventually leave the loop from port 2. Data frames 3-5 can only be resumed after the deadlock is resolved, and they will be forwarded out of the loop from port 2 after passing through network devices S3 and S4. This results in data frames being sent to the downstream and receiving end in an out-of-order manner (green data frames 1, 2, 6, 3, 4, 5).
[0131] In view of the above problems, the forwarding mode of the data frames on the loop during the barrier data and unlocking period can be set to solve them. According to one embodiment of the present invention, the method further includes: before the data frame of each network device starts to flow along the loop, a barrier data frame is first added in front of the data frame at the head of the queue; the network device sets the forwarding mode of the data frame on the deadlock loop during the unlocking period, wherein the forwarding mode of the barrier data frame is set to forward along the loop forwarding table, and the forwarding mode of the non-barrier data frame is set to forward out of the loop only from the designated out-of-loop network device, the designated out-of-loop network device is the network device closest to the non-barrier data frame before it flows along the loop, and the original forwarding table of the network device has a port that allows the non-barrier data frame to leave the deadlock loop; when the network device recognizes the barrier data frame it has sent, it suspends sending the received barrier data frame and the subsequent data frames to the downstream network device on the loop.
[0132] The above scheme is equivalent to designing a data frame order-preserving scheduling mechanism to maintain the order in which data frames are sent to the receiving end. The core principle is that data frames are only allowed to leave the loop from the egress port (called the egress port) of the network device closest to them that can forward them out of the loop (called the egress network device). If the data frames cannot be forwarded out of the loop from the port because the port is paused, they will not leave the loop from other network devices on the loop. On the contrary, they will return to the original network device where they were when the deadlock occurred. In this way, the order of data frames can be maintained because this does not violate the core design principles.
[0133] Indicatively, first, for those data frames that miss the nearest ring exit port, they can be marked by setting the reserved bit of the Type of Service (ToS) field in their IP field to 1. This will not introduce additional bits to expand the buffer. Data frames with ToS=1 will be directly forwarded to their downstream network devices in the ring according to the ring forwarding table. Eventually, these data frames will return to their starting network devices.
[0134] Secondly, it is necessary to ensure that these data frames can accurately stop at the network device where the deadlock occurs. This can be achieved by introducing a barrier data frame: after the loop forwarding table is established, the network device will not directly transmit the normal deadlock data frame, but first generate and send a barrier data frame, for example, a custom data frame with opcode=4 (to distinguish, it can be called the fourth data frame) can be used to isolate the data frames on different network devices, and can only be forwarded in the loop according to the loop forwarding table. The barrier data frame circulates along the deadlock loop, followed by the normal data frame from the same network device. The data frame scheduling module monitors each data frame that is dequeued from the dequeue. Once a data frame is identified as a barrier data frame generated by itself, the dequeue process will stop. When the barrier data frame and the subsequent data frames are suspended from flowing along the loop, if it is determined that the deadlock is resolved, the network device discards the barrier data frame; if the deadlock is not resolved and the data frames on the deadlock loop need to flow along the loop again, the barrier data frame is used. Of course, if the overhead is not considered, after a network device receives its barrier data frame, it can discard the barrier data frame first, and if it needs to let the data frame flow along the ring again, it can add the barrier data frame again. This mechanism ensures that all data frames that miss the correct ring exit port can be returned to the network device where they are located when the deadlock occurs. In this way, it can be guaranteed that the data frames can be forwarded to the receiving end in their original order, ensuring the order between data frames, thereby avoiding the retransmission of N frames in the RoCE network, and better ensuring the end-to-end network performance.
[0135] After all barrier data frames have traveled around the loop, the coordinator can send a check message along the loop to confirm whether the deadlock has been resolved. For example, the check message is a custom data frame with opcode=5 (to distinguish, it can be called the fifth data frame), and its Credit field is initially set to 1. At each network device on the loop, if the length of any incoming queue on the loop is less than the threshold (X) for the network device to resume PFC transmission, ON ), the Credit field of the fifth data frame will be modified to 0. If the coordinator receives a check message with credit = 0, it means that the deadlock has been resolved and the data frame can be resumed. Otherwise, the coordinator can try to perform another round of deadlock release operation, that is, to let the data frames on the deadlock loop flow along the loop again.
[0136] It should be noted that it is meaningful to allow the data frame on the deadlock loop to flow along the loop again. Schematically, assuming that in the flow of the first loop, when a data frame arrives at the designated out-of-loop network device, the original forwarding table of the out-of-loop network device contains a port that allows the data frame to leave the deadlock loop and the port that leaves the deadlock loop is not suspended by the downstream network device, it indicates that there is an opportunity to forward the data frame out of the loop, and the data frame can be forwarded out of the loop; and for another data frame, in the flow of the first loop, assuming that when another data frame arrives at the designated out-of-loop network device, the original forwarding table of the out-of-loop network device contains a port that allows the other data frame to leave the deadlock loop, but the port that leaves the deadlock loop is suspended by the downstream network device, indicating that there is no opportunity to forward the non-barrier data frame out of the loop in the flow of the first loop. However, if the data frame on the deadlock loop is allowed to flow along the loop again, the port that the other data frame leaves the deadlock loop may have been restored by the downstream network device, and it is still possible to forward the other data frame out of the loop in the flow of the second loop.
[0137] In order to verify the effect of the method of the present invention, the inventors conducted two comparative experiments.
[0138] For the results of comparative experiment 1, see Fig.10 :
[0139] Fig.10 In the figure, the horizontal axis is the number of data frames sent (Number of packets sent), and the vertical axis is the sender's send sequence number (Seq num at sender). It can be seen that since the existing comparison scheme (named Lossy) will cause the disorder of data frames (or packet loss), the sender's send sequence number (SEQ) will continue to roll back, causing the sequence number (ACK) of the effective transmission to often stagnate; while the method of the present invention (named Roundabout) will not cause data frame loss or disorder, and thus can maintain the effective transmission that keeps growing.
[0140] For the results of comparative experiment 2, see Fig.11 :
[0141] Fig.11 In the figure, the horizontal axis is the amount of data frames sent (Packet TX count), and the vertical axis is the normalized goodput. It can be seen that the scheme of packet loss or disorder will cause N frames to be retransmitted, which will cause a lot of useless transmissions and reduce the effective throughput. However, the method of the present invention does not cause disorder, so there is no invalid transmission, so that the normalized goodput is always maintained at a high level.
[0142] It should be noted that although the above describes the various steps in a specific order, it does not mean that the steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0143] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0144] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.
[0145] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A PFC deadlock detection method, applied to a network device configured with a priority-based flow control protocol, the method comprising executing a preset PFC deadlock detection mechanism, the mechanism comprising performing the following operations for each incoming queue: Two record areas are maintained for each incoming queue, namely the local record area and the advantage record area. Each record area can store an impact record and a status value marking whether the impact record is valid; When the length of the incoming queue exceeds the pause threshold, an impact record is generated and stored in the local record area and the impact record is set to be valid, wherein the impact record contains the incoming queue identity information indicating the generated record and the identification information for distinguishing different records; In the advantage record area, the most advantageous influence record selected from the observed influence records according to the preset election rules is stored. in, The observed sources of impact records range from the local recording area, the dominant recording area, and the newly received detection frames; Whenever a valid impact record in the dominant record area is updated or an election is completed, and the length of the incoming queue exceeds the pause threshold, the impact record in the dominant record area is encapsulated into a detection frame and sent to the upstream network device; When the length of the incoming queue falls below the recovery threshold, the impact records in the local record area and the advantage record area are set to be invalid, and an invalidation frame carrying the impact records in the advantage record area is sent to the upstream network device; When receiving the invalidation frame, relaying the received invalidation frame to the upstream network device, and when the impact record in the advantage record area is the same as the impact record in the received invalidation frame, setting the impact record in the advantage record area to invalid; When the impact record in the received detection frame is the same as the valid impact record in the local record area, it is considered that the network device to which the current entry queue belongs forms a deadlock loop with other network devices.
2. The method according to claim 1, It is characterized in that The impact record includes an entry queue global ID and identification information for indicating the entry queue identity information; The preset election rules include: If only one valid impact record is currently observed for the same entry queue, then this impact record is taken as the most advantageous impact record; If multiple valid impact records are observed at the same entry queue, the most advantageous impact record is determined according to the size of the identification information contained in each of the multiple valid impact records. If the identification information is equal, the newly received impact record is considered to be more advantageous.
3. The method according to claim 2, It is characterized in that The impact record is in the form of a triple: {network device ID to which the entry queue belongs, local ID of the entry queue in the network device to which it belongs, identification information}, wherein the global ID of the entry queue is represented by the network device ID and the local ID.
4. The method according to claim 2, It is characterized in that The identification information is a random number, and the smaller the identification information contained in the election, the more advantageous the influence record; or The identification information is a random number, and the larger the identification information contained in the election, the more advantageous the influence record; or The identification information is a timestamp, and the smaller the identification information contained in the election, the more advantageous the impact record will have.
5. The method according to any one of claims 1 to 4, It is characterized in that The detection frame or invalidation frame is sent in the form of a PFC pause frame or a PFC resume frame, where: When an in-queue that needs to send a probe frame or invalidate a frame is back-pressuring the upstream, the in-queue sends the probe frame or invalidate a frame in the form of a PFC pause frame; When an in-queue that needs to send a probe frame or invalidate frame has no back pressure upstream, the in-queue sends the probe frame or invalidate frame in the form of a PFC recovery frame.
6. The method according to any one of claims 1 to 4, It is characterized in that The mechanism also includes performing the following operations for each outgoing queue: Maintaining a bitmap of the outgoing queue, the bitmap comprising N bits for recording a relationship between the outgoing queue and N incoming queues of the same priority in the network device to which the outgoing queue belongs, and setting a corresponding bit in the bitmap to a first value indicating an association when the outgoing queue contains a data frame from an incoming queue; When the outbound queue receives a detection frame or an invalidation frame, the network device associates the impact record received in the detection frame or the invalidation frame with the associated inbound queue indicated by the bitmap, and regards it as the impact record received by the associated inbound queue.
7. The method according to any one of claims 1 to 4, It is characterized in that The network device is a switch, and the method is deployed on a switch chip and runs on a data plane.
8. A method for handling PFC deadlock, It is characterized in that The processing method comprises: When a deadlock loop is detected according to the method of any one of claims 1 to 7, determining a plurality of network devices that are in the deadlock loop; Constructing a loop forwarding table corresponding to the deadlock loop for the plurality of network devices, the loop forwarding table indicating a path along which data frames on the deadlock loop are forwarded; The available space of the clear buffer of the network device and the loop forwarding table are utilized to allow the data frames on the deadlock loop to flow along the loop. When any data frame flows along the loop to a network device, the network device determines whether there is an opportunity to forward the data frame out of the loop according to the original forwarding table. If so, the data frame is forwarded out of the loop according to the original forwarding table. If not, the data frame continues to be forwarded along the loop.
9. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method according to any one of claims 1 to 8.
10. An electronic device, It is characterized in that include: one or more processors; as well as A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of any one of claims 1-8 by executing the executable instructions.
Citation Information
Cited By
Deadlock releasing method in network equipment and electronic equipment
CN121619289A
