Flow table aging method based on RoCEv2 message and application thereof
By analyzing the Remote QPN field in the RoCEv2 disconnection request message, dynamically aging the flow table of the RoCEv2 network device, solving the problem of untimely aging of the flow table and improving system performance and resource management efficiency.
Patent Information
- Application Number
- CN202411410336.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-10-10
AI Technical Summary
When the existing RoCEv2 network equipment is disconnected or communication is interrupted, the flow table does not age in time, resulting in wasted device resources and reducing system performance.
By parsing the Remote QPN field in the RoCEv2 disconnection request message, as a key identifier, search and delete the corresponding flow table entries, and dynamic aging of the flow table is realized, avoiding relying on a fixed timeout mechanism.
提高了流表管理的灵活性和效率,减少了资源占用,提升了系统整体处理性能,避免了资源浪费。
Smart Images

Figure CN119299370A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer communications, and in particular relates to a flow table aging method based on RoCEv2 messages and an application thereof. Background Art
[0002] In today's rapidly developing data centers and high-performance computing fields, RDMA (Remote Direct Memory Access) technology has gradually become one of the important technologies in network transmission due to its low latency and high throughput characteristics. RDMA technology bypasses the operating system kernel and directly transmits data between applications, reducing processor intervention and memory copy operations in traditional transmission methods, thereby greatly improving transmission efficiency. Based on RDMA technology, RoCE (RDMA over Converged Ethernet) allows RDMA functions to be implemented through standard Ethernet, and RoCEv2 has further developed into a protocol that can work in a three-layer network environment. RoCEv2 uses UDP (User Datagram Protocol) for encapsulation, enabling it to cross routers and different broadcast domains, thereby expanding the scope of application.
[0003] Although RDMA and RoCEv2 have been widely used in high-performance computing and large-scale data centers, there are still some urgent problems to be solved when managing and maintaining the flow tables of these high-speed data flows in actual network environments. Existing RoCEv2 network devices need to maintain a large number of flow tables, each of which records the detailed information of a specific flow, including source and destination addresses, queue pair number (QPN), sequence number, etc. However, in the case of disconnection or communication interruption, these flow tables often cannot be aged or deleted in time, resulting in a waste of device resources and reducing the overall performance of the system.
[0004] Therefore, it is necessary to provide a new solution to the above technical problems. Summary of the invention
[0005] The object of the present invention is to provide a flow table aging method based on RoCEv2 messages and its application, which can solve the problem that the current aging time of the flow table based on Rocev2 messages is fixed and inflexible.
[0006] To achieve the above purpose, the technical solution provided by the present invention is as follows:
[0007] In a first aspect, the present invention provides a flow table aging method based on RoCEv2 messages, which includes:
[0008] Extract the Remote QPN field of the RoCEv2 disconnect request message; use the Remote QPN field as a key identifier to search for flow table information; if the Remote QPN field matches the destination queue pair field of the flow table entry in the flow table, delete the flow table entry to achieve flow table aging of the RoCEv2 message.
[0009] In one or more embodiments, the method further includes: receiving and parsing a RoCEv2 message to extract a characteristic field of the RoCEv2 message; if the characteristic field of the RoCEv2 message meets a preset condition, the RoCEv2 message is a RoCEv2 disconnection request message.
[0010] In one or more embodiments, the method includes: if the UDP destport of the RoCEv2 message is 4791, the opcode of BTH is 100, and the Attribute ID of the MAD Header is 21, then the RoCEv2 message is a RoCEv2 disconnection request message.
[0011] In one or more embodiments, the method further includes: if the RoCEv2 message is a RoCEv2 disconnect request message, performing IPFIX processing.
[0012] In one or more embodiments, the method also includes: parsing the received RoCEv2 message and extracting the destination queue pair field; using the destination queue pair field as a key identifier for searching the flow table, searching for a corresponding flow table entry in the stored flow table; if no matching flow table entry is found, performing a flow table learning operation, recording the destination queue pair field in the flow table, and generating a new flow table entry; if a matching flow table entry is found, updating the information of the flow table entry.
[0013] In one or more embodiments, the method further includes: if the Remote QPN field does not match the destination queue of the flow table entry in the flow table, then no processing is performed on the flow table entry.
[0014] In one or more embodiments, the RoCEv2 disconnection request message includes an ETH field, an IP field, a UDP field, a BTH field, a DETH field, a MAD field, a CM field, and an ICRC&CRC field.
[0015] In a second aspect, the present invention provides a flow table aging device based on RoCEv2 messages, which includes:
[0016] An extraction module is used to extract the Remote QPN field of the RoCEv2 disconnection request message; a search module is used to use the Remote QPN field as a key identifier to search for flow table information; a deletion module is used to delete the flow table entry in the flow table when the destination queue pair field of the flow table entry matches the Remote QPN field, so as to realize flow table aging of the RoCEv2 message.
[0017] In a third aspect, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the flow table aging method as described above when executing the program.
[0018] In a fourth aspect, the present invention provides a computer-readable medium, wherein the computer-readable medium carries computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the flow table aging method as described above.
[0019] Compared with the prior art, the flow table aging method based on RoCEv2 messages and its application provided by the present invention can accurately determine that a connection has been disconnected and directly trigger the aging operation of the flow table by parsing the key fields in the message after receiving the RoCEv2 disconnection request message; it no longer relies on a fixed timeout mechanism, but performs flow table aging based on actual network events, making the management of the flow table more intelligent and dynamic, thereby reducing resource usage and improving the overall processing efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A schematic diagram of the Rocev2 message interaction process in an embodiment of the present invention;
[0022] Figure 2 This is a flow chart of a flow table aging method in one embodiment of the present invention;
[0023] Figure 3 This is a structural diagram of a RoCEv2 disconnection request message in an embodiment of the present invention;
[0024] Figure 4 A schematic diagram of a flow meter aging device in one embodiment of the present invention;
[0025] Figure 5FIG. 4 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] The flow table aging mechanism in the prior art is mainly based on a fixed aging time, that is, when the last data packet of a flow is transmitted, the device will set a timeout period. If no new data packet arrives during the timeout period, the flow table entry will be deleted. However, this aging mechanism based on a fixed time has significant defects. In some scenarios, the communication has been disconnected, but the flow table entry has not aged in time, causing the flow table to occupy the memory resources of the device. This situation is particularly serious in high-speed networks. The long-term retention of flow table entries not only wastes valuable resources, but may also affect the establishment of other new connections.
[0028] The invention arises from the fact that in network environments such as high-performance computing and data centers, the existing technology has significant deficiencies in the management of flow table aging. In the RoCEv2 protocol, network devices manage different data flows through flow tables, and the timely aging of flow tables is crucial to the effective use of system resources. However, the existing flow table aging mechanism often relies on a fixed time threshold, that is, the flow table will not be deleted until it times out. This approach shows great limitations in practical applications, especially in the face of high-frequency connection and disconnection operations, the fixed aging time easily causes the flow table entries to occupy system resources for a long time, affecting the performance of the device. In addition, in some cases, even if the connection has been disconnected, the flow table is not deleted in time, which further aggravates the problem of resource waste.
[0029] To address this problem, the present invention proposes a flow table aging method based on RoCEv2 messages, which dynamically adjusts the timing of flow table aging by parsing specific messages, thereby improving the flexibility of flow table management. The core of the technical implementation idea is that after receiving the RoCEv2 disconnection request message, the device can accurately determine that a connection has been disconnected by parsing the key fields in the message, and directly trigger the aging operation of the flow table. Unlike the prior art, the present invention no longer relies on a fixed timeout mechanism, but performs flow table aging based on actual network events, making the management of flow tables more intelligent and dynamic, thereby reducing resource usage and improving the overall processing efficiency of the system.
[0030] This method parses the RoCEv2 message to quickly update or delete the flow table when the flow connection is disconnected. This event-driven flow table aging mechanism enables the device to release flow table resources in a timely manner according to changes in network status, avoiding the waste of resources caused by unreasonable timeout settings in traditional methods.
[0031] Please refer to Figure 1 FIG. 1 is a schematic diagram of the Rocev2 message interaction process in an exemplary application scenario of the present invention. Figure 1 In the scenario shown, RoCEv2 message interaction is mainly carried out through RDMA (Remote Direct Memory Access) operations.
[0032] The client sends a Connect Request message to the server, indicating that the client wants to establish an RDMA connection with the server. The request usually carries relevant information of the client, such as the Queue Pair (QP) number, connection parameters, etc., so that the server can perform matching and resource allocation.
[0033] After receiving the connection request from the client, the server will perform necessary verification and resource configuration. If the verification is successful, the server will send a Connect Reply message to confirm the connection request and provide the server's connection information, such as the server's QP number. At this point, the RoCEv2 connection between the client and the server has been initially established, ready for subsequent data transmission operations.
[0034] After receiving the connection reply from the server, the client will send a ReadyToUse message to confirm that the connection is ready. This message indicates that the client is ready to receive or send RDMA data, and the connection enters the available state. After receiving this message, the server will also enter the ready state for data transmission, and both parties can perform RDMA operations.
[0035] After the connection is established and ready, the client can start sending RDMA Write messages to write data directly to the server's memory. The biggest advantage of RDMA Write is that data is directly transferred to the server's memory, bypassing the intervention of the operating system and reducing the processor's burden and latency. During the data transmission process, the client can send multiple RDMA Write messages continuously to write a large amount of data to the server.
[0036] When the client completes the data transmission, it will send a Disconnect Request message to the server to request to disconnect the RDMA connection with the server. This request usually carries relevant information about the connection, notifying the server that the current connection is about to be disconnected, and the flow table can be updated or aged accordingly.
[0037] After receiving the disconnect request, the server sends a Disconnect Reply message to confirm the disconnection. At this point, the RDMA connection between the client and the server is officially disconnected, resources are released, and flow table entries can also be deleted or aged.
[0038] Please refer to Figure 2 FIG. 1 is a flow chart of a flow table aging method based on RoCEv2 messages in an embodiment of the present invention. The flow table aging method based on RoCEv2 messages specifically includes the following steps:
[0039] S201: Extract the Remote QPN field of the RoCEv2 disconnection request message.
[0040] Remote QPN is a key queue pair identifier, which is used to identify the queue pair number of the remote device. During the communication process of RoCEv2, each connection between the client and the server is uniquely identified by QPN (Queue Pair Number). Therefore, by parsing the Remote QPN field of the disconnect request message, the device can directly obtain the information related to the connection that needs to be aged or deleted. The device can accurately lock the flow table entry corresponding to the disconnected connection to avoid mishandling other active connections.
[0041] When implementing step S201, the device (such as a switch) will first receive a RoCEv2 CM Disconnect Request message from the client or server. This message is used to notify the remote device that the current connection has completed data transmission and is about to be disconnected. After the message arrives at the device, the device parses the header information of the message, especially extracts the Remote QPN field. In RDMA communication, each queue pair (Queue Pair, QP) has a unique number, and QPN is used to identify the session associated with the connection. Therefore, by extracting the Remote QPN, the device can determine which remote end's connection is about to be disconnected.
[0042] In one embodiment, it is assumed that client A and server B perform data transmission through a switch, and client A writes data into the memory of server B by sending an RDMA Write message. When the data transmission is completed, client A sends a Disconnect Request message to server B to notify it that the current session is over. This message contains the RemoteQPN number of server B, for example, QPN=12345. When the switch receives this message, it needs to parse the message and extract Remote QPN=12345, indicating that this is the queue pair number of server B. By extracting this field, the switch can know that the connection numbered 12345 is about to be disconnected.
[0043] By parsing the Remote QPN field in the message, the network device can directly know which remote device has been disconnected. This is different from the traditional timeout mechanism, which sets a fixed time period and considers the connection disconnected if no new data packet is received within the time period. In the present invention, the device directly learns the connection status by receiving the disconnection request message, thereby avoiding the delay and uncertainty caused by the fixed timeout mechanism.
[0044] In an exemplary embodiment, after receiving a RoCEv2 message, the device will perform flow table learning, which specifically includes: parsing the received RoCEv2 message and extracting the destination queue pair field; using the destination queue pair field as a key identifier for searching the flow table, and searching for the corresponding flow table entry in the stored flow table; if no matching flow table entry is found, performing a flow table learning operation, recording the destination queue pair field in the flow table, and generating a new flow table entry; if a matching flow table entry is found, updating the information of the flow table entry.
[0045] After receiving the RoCEv2 message, the network device parses the header information of the message and extracts the destination queue pair field (Destination Queue Pair). In RDMA communication, each communication session has a unique queue pair (QueuePair, QP) to identify the source and destination of the data flow. Therefore, the destination queue pair field is the core field for determining the target device and connection of the message. By extracting this field, the device can clearly identify the receiving target of the data flow.
[0046] Next, the device uses the extracted destination queue pair field as the key identifier to search for matching flow table entries in the existing flow table. A flow table is a table used by network devices to track and manage the status of each data flow in the network. Each flow table entry records the key information of a data flow, such as source address, destination address, source QPN, destination QPN, etc. The significance of searching with the destination QPN as the key identifier is that it can accurately identify which existing data flow the message belongs to, thereby determining how to handle the message.
[0047] If no matching flow table entry is found, it means that this is a new data flow and the device has not yet recorded the information of the data flow. In this case, the device will perform a flow table learning operation. Flow table learning refers to adding new data flow information to the flow table to generate a new flow table entry. Specifically, the device will record the destination QPN field extracted from the message in the flow table and assign it a new entry to ensure that subsequent messages of the same data flow can be quickly found. This flow table learning mechanism allows network devices to dynamically adapt and record information when faced with new data flows, thereby enhancing the device's flow table management capabilities.
[0048] If a matching flow table entry is found, it means that the data flow already existed in the flow table. At this point, the device will update the information of the flow table. The update operation may include updating the status of the flow table entry (such as the active status of the flow), adjusting statistical data (such as the amount of data transmitted, the duration of the flow, etc.), or updating the device's processing strategy for the data flow. Flow table updates ensure that the entry information in the flow table is always kept up to date, thereby helping the device better manage ongoing network communications.
[0049] For example, suppose client A communicates with server B through a switch based on a RoCEv2 network. A sends a data write request to B, and the switch first parses the RoCEv2 message and extracts the destination queue pair field in the message (assuming QPN=5678). The device checks the flow table to see if there is already an entry related to QPN=5678. If there is no matching flow table entry, the device creates a new entry and records QPN=5678 in the flow table, so that subsequent messages of the same data flow can be quickly found. If the switch finds that there is already an entry with QPN=5678, it will update the entry, such as increasing the flow's transmission volume statistics or updating the flow's active status.
[0050] In an exemplary embodiment, the method further includes: receiving and parsing a RoCEv2 message to extract a characteristic field of the RoCEv2 message; if the characteristic field of the RoCEv2 message meets a preset condition, the RoCEv2 message is a RoCEv2 disconnection request message.
[0051] After receiving a RoCEv2 message, a device (such as a switch) will parse the message and extract the characteristic fields in the message. The characteristic field is important information in the message used to identify the message type, usually including the UDP destination port number, the operation code (Opcode) in the BTH (Base Transport Header), the Attribute ID in the MAD Header, etc. In the RoCEv2 network, there are many types of messages, such as data transmission messages, connection establishment messages, and disconnection request messages. In order to distinguish different types of messages, the device needs to make judgments based on the characteristic fields.
[0052] The device compares the extracted feature fields with the preset conditions. If the extracted feature fields meet the preset conditions, that is, the fields of the message match the standard format of the disconnect request message, the device determines that the message is a disconnect request message. The purpose of this step is to ensure that the device can accurately identify the disconnect request message and perform the corresponding resource management operation. For example, after determining that the message is a disconnect request, the device can start to perform flow table aging operations, delete the flow table entries related to the connection, and release system resources.
[0053] Specifically, if the UDP destport of the RoCEv2 message is 4791, the opcode of BTH is 100, and the Attribute ID of MADHeader is 21, then the RoCEv2 message is a RoCEv2 disconnection request message.
[0054] The UDP destination port number (UDP destport) is one of the important bases for determining the type of message. In the RoCEv2 communication protocol, the UDP destination port number of the message is usually 4791, which is a port number specially reserved in the RoCEv2 standard communication and is used to distinguish RoCEv2 messages from other types of network traffic. By checking whether the UDP destination port number is 4791, the device can quickly and preliminarily determine whether the message is part of the RoCEv2 communication.
[0055] Next, the device checks the operation code (Opcode) of BTH (Base Transport Header). In the RoCEv2 message, BTH is the base transport header, which contains key information for control and operation messages, and the Opcode field is used to identify the operation type of the message. For the disconnect request message, the value of the Opcode field of BTH is 100. This value indicates that the current message is a communication management operation, especially a request for disconnection. By parsing the Opcode field of BTH, the device can further confirm whether the message is part of the disconnect operation.
[0056] In addition, the Attribute ID field in the MAD (Management Datagram) Header of the message is also a key field. The MAD message is used to carry management information, and the Attribute ID is used to specifically describe the function or attribute of the current message. In the RoCEv2 disconnect request message, the value of the Attribute ID is usually 21, which indicates that the message is a management operation requesting to disconnect the RDMA connection. By checking the Attribute ID field, the device can accurately determine whether the message is related to connection management, especially a request to disconnect.
[0057] Through the comprehensive judgment of these three fields, that is, the UDP destination port number is 4791, the Opcode of BTH is 100, and the Attribute ID of MADHeader is 21, the device can determine that the current message is a RoCEv2 disconnect request message. Ensure that the device recognizes the status change of the connection in a timely manner, especially in a high-performance network environment. Accurately judging the disconnection of the connection can effectively avoid the retention of flow table resources, thereby improving system performance.
[0058] Furthermore, if the RoCEv2 message is a RoCEv2 disconnect request message, IPFIX processing is performed. Through the IPFIX (IP Flow Information Export) protocol, the flow information in the network is collected and analyzed, and the data is exported to the relevant monitoring and management system to realize dynamic monitoring and management of network flow.
[0059] The RoCEv2 disconnect request message is used to notify the remote device that a connection has been completed or needs to be disconnected. In the flow table management of RoCEv2 of the present invention, the disconnect request message is the trigger point for flow table aging or deletion. Therefore, after the device receives the message, in addition to the flow table aging process, it is also necessary to perform further flow information recording and processing. The introduction of IPFIX processing is to collect, record and export the flow data related to the disconnect message for analysis and statistics by the system.
[0060] In an exemplary embodiment, please refer to Figure 3 As shown, the RoCEv2 disconnection request message includes an ETH field, an IP field, a UDP field, a BTH field, a DETH field, a MAD field, a CM field, and an ICRC&CRC field.
[0061] The ETH field (Ethernet Header) is the outermost encapsulation part of the message and is located in the data link layer of the OSI model. The ETH field contains information such as the source MAC address and the destination MAC address, and is used to transmit messages in an Ethernet environment. Through the ETH field, RoCEv2 messages can be transmitted between different network devices through Ethernet and determine the source and destination devices of the message. The Ethernet header ensures that RoCEv2 messages can be transmitted point-to-point in a three-layer network.
[0062] The IP field (IP Header) is used to encapsulate the source IP address and the destination IP address at the network layer. This field ensures that RoCEv2 messages can be transmitted across multiple routers and between different network segments. The existence of the IP field enables RoCEv2 to be routed through a three-layer network and achieve cross-domain communication. Therefore, in large-scale network deployments, the IP field is crucial for the flexible transmission of RoCEv2 messages, especially for communication between different subnets within a data center.
[0063] The UDP header is located at the transport layer and encapsulates information such as the source port number, destination port number, and data length. RoCEv2 uses the UDP protocol for encapsulation, and the UDP destination port number of the RoCEv2 message is usually 4791. The lightweight nature of UDP ensures efficient and low latency data transmission, and the port number is used to determine the direction of data flow at the application layer. When processing a RoCEv2 disconnect request message, the device will identify whether the message is a RoCEv2 protocol message based on the destination port number in the UDP header.
[0064] The BTH field (Base Transport Header) is the basic transport header of the RoCEv2 message, which contains key fields such as the operation code (Opcode). For the disconnect request message, the Opcode field value of BTH is usually 100, which indicates that the message is a management operation for disconnection. The BTH field is responsible for defining the transmission behavior of the RoCEv2 message to ensure that network devices can accurately understand the type and purpose of the message. In the disconnect request scenario, the device uses the BTH header to identify the operation type of the message and perform corresponding resource release and flow table aging operations.
[0065] The DETH field (Datagram Extended Transport Header) is an extended transport header in the RoCEv2 message, which is mainly used to further carry the extended information of the data message. The DETH field usually contains additional control information to help devices perform more sophisticated control and management during the transmission process.
[0066] The MAD field (Management Datagram Header) is a management message header in the RoCEv2 message, which is mainly used to carry information at the management level. For a disconnect request message, the Attribute ID field in the MAD header is usually 21, which indicates that the message is a disconnect request message in communication management. Through the MAD field, the device can identify and process management operations, especially in the scenarios of disconnection and flow table aging, this field provides important guidance information.
[0067] The CM field (Communication Management Header) carries specific information related to connection management, the most important of which is the Remote QPN (Remote Queue Number) field. This field is a key identifier for the device to perform flow table lookup and aging, ensuring that the device can accurately match the disconnected flow table entry. When receiving a disconnect request message, the device extracts the Remote QPN in the CM header and looks up the corresponding flow table entry based on this field to ensure the accuracy of the aging operation.
[0068] ICRC & CRC fields are used for data integrity verification to ensure that the data has not been tampered with or damaged during transmission. ICRC is used for message transmission verification, while CRC is used for frame verification. Through these verification fields, the device can determine whether there is an error in the message during transmission. Once an error is detected, the device can discard the message, thereby ensuring the reliability of the entire data transmission.
[0069] S202: Using the Remote QPN field as a key identifier (key), search for flow table information.
[0070] It should be noted that Remote QPN is the queue pair number of the remote device, which is used to identify the communication queue of the remote device during the RoCEv2 communication process. Each queue pair has a unique QPN number, which the device uses to identify and manage data flows. The main purpose of this step S202 is to find the corresponding entry in the flow table of the network device through the extracted Remote QPN field, so as to perform subsequent flow table aging, update or deletion operations.
[0071] In the specific implementation, the device extracts the Remote QPN field by parsing the RoCEv2 disconnect request message. This field is usually in the CM (Communication Management) header, which contains key information for connection management. After obtaining the Remote QPN, the device uses it as the key field to look up the flow table. The flow table is a table used to record and manage the status of each data flow in the network, which contains information about each flow, such as source address, destination address, source QPN, destination QPN, etc. Remote QPN is the core field in the flow table used to identify remote connections.
[0072] Then, the device matches the stored flow table entries through the Remote QPN to check whether there is an entry corresponding to the RemoteQPN. If a matching entry is found, the device can update or delete it as needed; if no matching entry is found, it means that the connection may have aged, and the device can continue to perform other operations (such as adding a flow table entry or maintaining the status quo).
[0073] For example, suppose that client A and server B communicate through the switch based on the RoCEv2 protocol. The QPN of client A is 67890, and the QPN of server B is 12345. When client A sends a disconnect request message to server B, the switch receives and parses the message and extracts the Remote QPN field. In this example, the Remote QPN is 12345 (the queue number of client A). Next, the switch searches its flow table for an entry that matches Remote QPN = 12345. If a matching entry is found, the switch marks the connection as "disconnected" and prepares to age or delete the flow table entry. In this way, the device can accurately manage the status of each connection to ensure that resources are released in a timely manner.
[0074] Through the search of Remote QPN, the device can identify and locate the flow table entries that need to be processed in the most accurate way. This search method avoids interference with other irrelevant flow table entries and ensures the accuracy of processing. This mechanism makes the management of flow tables more flexible, and can dynamically update and age flow table entries without relying on a fixed time aging mechanism. This can significantly improve the system performance and resource management efficiency in a network environment with high-frequency connection and disconnection operations.
[0075] By searching for flow table information using Remote QPN as the identifier, precise control of multiple concurrent connections can also be achieved. Especially in large-scale data centers and high-performance computing environments, this mechanism can greatly reduce the waste of system resources and ensure that the device can efficiently process large amounts of data flows.
[0076] S203: If the Remote QPN field matches the destination queue pair field of the flow table entry in the flow table, the flow table entry is deleted to implement flow table aging of the RoCEv2 message.
[0077] In RoCEv2 communication, a queue pair (QP) is used to identify the communication channel between the two devices. Each connection has a source QPN and a destination QPN, which identify the queue numbers of the client and server respectively. With the end of the communication process or the sending of a disconnect request, the relevant queue pair will no longer be used, so the associated flow table entries need to be deleted in time to avoid invalid resource occupation.
[0078] When the device finds a matching flow table entry in step S102 (i.e., the RemoteQPN field is the same as the destination queue pair field in the flow table), it indicates that the communication of the connection has been completed. At this time, the device will mark or delete the flow table entry related to the queue pair and perform the flow table aging operation. This deletion operation can immediately release the memory and computing resources of the device, avoiding performance degradation due to unused flow table entries remaining in the system.
[0079] For example, suppose the queue pair number of client A is 67890, and it communicates with the queue pair number of server B, which is 12345. When client A sends a RoCEv2 disconnect request message, the switch receives and parses the message, extracts Remote QPN = 12345, and searches for an entry matching this QPN in the flow table. If an entry with QPN = 12345 is found, the switch confirms that the communication has been completed and the flow table entry is no longer needed. At this point, the switch deletes the entry, removes it from the flow table, and releases the corresponding resources to ensure that the device can be used for subsequent new connections.
[0080] In the present invention, flow table aging is performed in an event-driven manner (based on changes in connection status), which is more flexible than the traditional fixed timeout aging method. The traditional timeout aging mechanism may set a longer time window to prevent premature deletion of flow table entries, but this will cause resources to occupy too long and cannot flexibly adapt to actual network traffic changes. By matching and deleting based on Remote QPN, the device can take immediate action based on the actual status of the connection, thereby ensuring efficient use of resources.
[0081] In an exemplary embodiment, if the Remote QPN field does not match the destination queue of the flow table entry in the flow table, the flow table entry is not processed.
[0082] If the device does not find an entry matching the Remote QPN in the flow table, this may be because the connection has been processed and deleted from the flow table, or the request message belongs to a connection that is not under the control of the current device. In this case, the device should not perform any operation on the flow table entry. Otherwise, mishandling irrelevant flow table entries may cause system confusion or incorrect release of resources, thus affecting system stability and performance.
[0083] Please refer to Figure 4 As shown, based on the same inventive concept as the aforementioned flow table aging method based on RoCEv2 messages, the present invention provides a flow table aging device 400 based on RoCEv2 messages, which includes: an extraction module 401, a search module 402, and a deletion module 403.
[0084] The extraction module 401 is used to extract the Remote QPN field of the RoCEv2 disconnect request message. The search module 402 is used to use the Remote QPN field as a key identifier to search for flow table information. The deletion module 403 is used to delete the flow table entry in the flow table when the destination queue pair field of the flow table entry matches the Remote QPN field, so as to realize the flow table aging of the RoCEv2 message.
[0085] Please refer to Figure 5 As shown, an embodiment of the present invention further provides an electronic device 500, which includes at least one processor 501, a memory 502 (e.g., a non-volatile memory), a memory 503, and a communication interface 504, and the at least one processor 501, the memory 502, the memory 503, and the communication interface 504 are connected together via a bus 505. At least one processor 501 is used to call at least one program instruction stored or encoded in the memory 502, so that at least one processor 501 performs various operations and functions of the flow table aging method based on RoCEv2 messages described in various embodiments of this specification.
[0086] In the embodiments of the present specification, the electronic device 500 may include, but is not limited to, personal computers, server computers, workstations, desktop computers, laptop computers, notebook computers, mobile electronic devices, smart phones, tablet computers, cellular phones, personal digital assistants (PDAs), handheld devices, messaging devices, wearable electronic devices, consumer electronic devices, and the like.
[0087] An embodiment of the present invention also provides a computer-readable medium, which carries computer-executable instructions. When the computer-executable instructions are executed by a processor, they can be used to implement various operations and functions of the RoCEv2 message-based flow table aging method described in the various embodiments of this specification.
[0088] The computer-readable medium in the present invention can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0089] In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0090] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0091] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatuses, systems, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0093] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A flow table aging method based on RoCEv2 messages, characterized in that: include: Extract the Remote QPN field of the RoCEv2 disconnect request message; Using the Remote QPN field as a key identifier, searching for flow table information; If the Remote QPN field matches the destination queue pair field of the flow table entry in the flow table, the flow table entry is deleted to achieve flow table aging of the RoCEv2 message.
2. The flow meter aging method according to claim 1, characterized in that: The method further comprises: Receiving and parsing a RoCEv2 message to extract a characteristic field of the RoCEv2 message; If the characteristic field of the RoCEv2 message meets the preset condition, the RoCEv2 message is a RoCEv2 disconnection request message.
3. The flow meter aging method according to claim 2, characterized in that: The method comprises: If the UDP destport of the RoCEv2 message is 4791, the opcode of BTH is 100, and the Attribute ID of the MAD Header is 21, then the RoCEv2 message is a RoCEv2 disconnection request message.
4. The flow meter aging method according to claim 2, characterized in that: The method further comprises: If the RoCEv2 message is a RoCEv2 disconnect request message, IPFIX processing is performed.
5. The flow table aging method according to claim 1, characterized in that: The method further comprises: Parse the received RoCEv2 message and extract the destination queue pair field; Using the destination queue pair field as a key identifier for searching the flow table, searching for a corresponding flow table entry in the stored flow table; If no matching flow table entry is found, a flow table learning operation is performed, the destination queue pair field is recorded in the flow table, and a new flow table entry is generated; If a matching flow table entry is found, the information of the flow table entry is updated.
6. The flow meter aging method according to claim 1, characterized in that: The method further comprises: If the Remote QPN field does not match the destination queue of the flow table entry in the flow table, the flow table entry is not processed.
7. The flow meter aging method according to claim 1, characterized in that: The RoCEv2 disconnection request message includes an ETH field, an IP field, a UDP field, a BTH field, a DETH field, a MAD field, a CM field and an ICRC&CRC field.
8. A flow table aging device based on RoCEv2 message, characterized in that: include: An extraction module, used to extract the Remote QPN field of the RoCEv2 disconnection request message; A search module, used to use the Remote QPN field as a key identifier to search for flow table information; The deletion module is used to delete the flow table entry in the flow table when the destination queue pair field of the flow table entry matches the Remote QPN field, so as to realize the flow table aging of the RoCEv2 message.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the flow table aging method according to any one of claims 1 to 7 is implemented.
10. A computer-readable medium, characterized in that The computer-readable medium carries computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the flow table aging method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Stream aging method and network appliance
CN101247353A
Data forwarding method, data caching method, data forwarding device, data caching device and related equipment
CN113037640A
Message forwarding method, device, equipment and chip system
CN117424862A
Congestion control system and method based on CAM
CN117834533A
Hardware unloading flow table deletion method and device
CN117857446A
Cited By
RoCE network end system flow monitoring method
CN119996267A