Methods, apparatuses, and storage media for high performance transmission control protocol communication using b+ trees

WO2025000184A1PCT designated stage expired Publication Date: 2025-01-02HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/102393
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-06-26
Publication Date
2025-01-02

Smart Images

  • Figure CN2023102393_02012025_PF_FP_ABST
    Figure CN2023102393_02012025_PF_FP_ABST
Patent Text Reader

Abstract

A method for receiving transmission control protocol (TCP) packets using B+ trees are for high performance TCP. The B+ trees have nodes which may represent intervals of sequence number (SN) values, which may be linked using bi-directional linked lists. Intervals within the nodes may be inserted, merged, and removed to accommodate received TCP packets. A method for transmitting TCP packets using B+ trees are for high performance TCP. The B+ trees have nodes which may represent intervals of sequence number (SN) values, which may be linked using bi-directional linked lists. Intervals within the nodes may be inserted, merged, and removed to accommodate received TCP packets. Methods may be implemented on systems including data processing units.
Need to check novelty before this filing date? Find Prior Art

Description

METHODS, APPARATUSES, AND STORAGE MEDIA FOR HIGH PERFORMANCE TRANSMISSION CONTROL PROTOCOL COMMUNICATION USING B+ TREES

[0001] FIELD OF THE DISCLOSURE

[0002] The present disclosure relates generally to data communications, and in particular to methods, apparatuses, and storage media using B+ trees for transmission and reception for high performance transmission control protocol packet communication.BACKGROUND

[0003] In cloud computing, application performance is largely dependent on network performance. The transmission control protocol (TCP) is commonly used in networks, such as cloud networks, for ensuring orderly communication of packets. In many cloud computing networks, data packets transmitted in order from a source may arrive at a destination out-of-order as a result of various factors. Network performance of a TCP connection in a cloud network may be significantly reduced when TCP packets arrive out-of-order. In some cases, out-of-order packets may lead to TCP performance collapse.

[0004] A method to handle out-of-order TCP packets is to use a linked list. However, the use of linked lists has performance issues as the lists grow in size. Another method to handle out-of-order TCP packets is the use of binary search trees, such as a red-black tree for transmitting and receiving TCP packets. However, the use of red-black trees may be resource intensive and may consume significant computing resources.SUMMARY

[0005] Embodiments disclosed herein relate to the use of B+ trees for transmission control protocol (TCP) processing of out-of-order packets, including use of the interval property of TCP packets. Embodiments of the present disclosure may be implemented either using software or hardware, including data structure engines in data processing units providing higher TCP performance and requiring reduced chip area.

[0006] According to one aspect of this disclosure, a method comprises receiving a TCP packet, and inserting the TCP packet into a B+ tree.

[0007] In some embodiments, inserting the TCP packet into the B+ tree comprises determining a sequence number (SN) range of the TCP packet; and inserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, wherein each node comprises up to m-1 node keys and up to m node values, each node may be a parent node comprising up to m child nodes, each child node is an internal node if it is a parent node and a leaf node if it is not a parent node, each node value of the root node and the internal nodes are for storing pointers to nodes, and each node value of the leaf nodes are for storing packet data.

[0008] In some embodiments, m is three or more.

[0009] In some embodiments, the leaf nodes are linked together with a bi-directional linked list.

[0010] In some embodiments, each node key is for storing a SN value; each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the B+ tree; and the TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.

[0011] In some embodiments, each leaf node corresponds to two or more intra-node SN intervals; and the two or more intra-node SN intervals are merged.

[0012] In some embodiments, the method further comprises caching the SN values of the leaf node corresponding to a SN interval.

[0013] In some embodiments, the method further comprises changing node keys defining a first SN interval to define a merged SN interval comprising SN values of both the first and a second SN interval; and changing node keys defining the second SN interval to remove the second SN interval from the B+ tree, wherein the SN range is within the first SN interval and the second SN interval.

[0014] In some embodiments, the method further comprises changing node keys defining a third SN interval to define an expanded SN interval comprising SN values of the third SN interval and the SN range, wherein the SN range is partially within the third SN interval and partially outside the range of any other SN intervals of the B+ tree.

[0015] In some embodiments, the method further comprises changing node keys defining a first SN interval to define an expanded SN interval comprising SN values of the first SN interval and the SN range; and changing node keys defining a second SN interval to define a reduced SN interval comprising SN values of the second SN interval excluding the SN range, wherein the SN range is partially within the first SN interval and partially within the second SN interval.

[0016] In some embodiments, the method further comprises monitoring an aggregate size of all leaf nodes; changing nodes keys defining one or more SN intervals to merge two or more SN intervals into merged SN intervals upon the aggregate size of all leaf nodes meeting a merge threshold; and changing node keys to remove one or more SN intervals merged into merged SN intervals from the m rooted tree.

[0017] In some embodiments, a node value is for storing TCP packets of two or more SN intervals.

[0018] In some embodiments, the method further comprises removing TCP packets preceding the TCP packet from the B+ tree, wherein the SN range represents an in order packet by changing a pointer in the linked list to a leftmost SN interval.

[0019] According to one aspect of this disclosure, a method comprises accepting a transmission control protocol (TCP) packet for transmission; and inserting the TCP packet into a B+ tree.

[0020] In some embodiments, inserting the TCP packet into the B+ tree comprises determining a sequence number (SN) range of the TCP packet; and inserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, wherein each node comprises up to m-1 node keys and up to m node values, each node may be a parent node comprising up to m child nodes, each child node is an internal node if it is a parent node and a leaf node if it is not a parent node, each node value of the root node and the internal nodes are for storing pointers to nodes, and each node value of the leaf nodes are for storing packet data.

[0021] In some embodiments, the TCP packet is inserted by changing a pointer in the linked list to a rightmost SN interval.

[0022] In some embodiments, each node key is for storing a SN value; each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the B+ tree; each node value comprises a selective acknowledgement (SACK) field; and the TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.

[0023] In some embodiments, the method further comprises receiving an acknowledgement (ACK) SN; identifying preceding TCP packets in the B+ tree having SN ranges preceding the ACK SN; and removing the preceding TCP packets from the B+ tree.

[0024] In some embodiments, removing the preceding TCP packets comprises changing a pointer in the linked list to a leftmost SN interval.

[0025] In some embodiments, the method further comprises receiving a SACK packet; determining a SACK SN range of the SACK packet; and identifying one or more SACK SN intervals of the B+ tree comprising at least a portion of the SACK SN range.

[0026] In some embodiments, the method further comprises setting a SACK field of a first SACK SN interval wherein SN values of the SACK SN range is identical to SN values of the first SACK SN interval.

[0027] In some embodiments, the method further comprises changing node keys defining a second SACK SN interval to define an acknowledged second SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the second SACK SN interval; setting a SACK field of the acknowledged second SACK SN interval; and adding a third SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the second SACK SN interval, wherein the SN values of the SACK SN range is not identical to the SN values of the second SACK SN interval and the SN values of the SACK SN range include an upper SN bound of the second SACK SN interval.

[0028] In some embodiments, changing node keys defining a fourth SACK SN interval to define an acknowledged fourth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the fourth SACK SN interval; setting a SACK field of the acknowledged fourth SACK SN interval; and adding a fifth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the fourth SACK SN interval, wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range include a lower SN bound of the fourth SACK SN interval.

[0029] In some embodiments, the method further comprises changing node keys defining a sixth SACK SN interval to define an acknowledged sixth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the sixth SACK SN interval; setting a SACK field of the acknowledged sixth SACK SN interval; adding a seventh SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and preceding SN values the fourth SACK SN interval; and adding an eighth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and following SN values the fourth SACK SN interval, wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range includes a portion of the sixth SACK SN interval and not including a lower SN bound nor an upper SN bound of the sixth SACK SN interval.

[0030] In some embodiments, an apparatus comprising a memory; and one or more processors for executing instructions stored in the memory for receiving transmission control protocol (TCP) packets, the instructions comprising the methods described herein.

[0031] In some embodiments, the memory comprises one or more memory assemblies each comprising one or more memory units and a data processing unit (DPU) circuitally connected to the one or more memory units.

[0032] In some embodiments, the apparatus comprises on-chip static random access memory, or high-bandwidth memory of a data processing unit, a network interface card, or a smart network interface card.BRIEF DESCRIPTION OF THE DRAWINGS

[0033] For a more complete understanding of the disclosure, reference is made to the following description and accompanying drawings, in which:

[0034] FIG. 1 is a schematic diagram showing out-of-order and ordered sequences of packets;

[0035] FIG. 2 is a schematic diagram of an exemplary embodiment of a red-black binary tree;

[0036] FIG. 3 is a schematic diagram showing the architecture of a conventional data center;

[0037] FIG. 4 is a schematic diagram showing the architecture of a data center according to some embodiments of this disclosure;

[0038] FIG. 5 is a schematic diagram showing intervals defined by sequence numbers according to some embodiments of this disclosure;

[0039] FIG. 6 is a schematic diagram of an exemplary embodiment of a B+ tree according to some embodiments of this disclosure;

[0040] FIG. 7A is a schematic diagram of a B+ tree according to some embodiments of this disclosure;

[0041] FIG. 7B is a schematic diagram of leaf nodes of the B+ tree of FIG. 7A;

[0042] FIG. 8A is a schematic diagram showing merging of intervals in a B+ tree for receiving TCP packets defined by sequence numbers according to some embodiments of this disclosure;

[0043] FIG. 8B is a schematic diagram showing merging of intervals in a B+ tree for receiving TCP packets defined by sequence numbers according to some embodiments of this disclosure;

[0044] FIG. 9A and 9B are schematic diagrams showing adjusting and merging of intervals of a B+ tree for receiving TCP packets according to some embodiments of this disclosure;

[0045] FIG. 10A and 10B are schematic diagrams showing adjusting of intervals of a B+ tree for receiving TCP packets according to some embodiments of this disclosure;

[0046] FIG. 11 are schematic diagrams showing intra-node merging of intervals within leaf nodes of a B+ tree for transmitting TCP packets according to some embodiments of this disclosure;

[0047] FIG. 12 is a schematic diagram of leaf nodes of the B+ tree for transmitting TCP packets according to some embodiments of this disclosure;

[0048] FIG. 13 is a schematic diagram showing the architecture of a data processing unit according to some embodiments of this disclosure;

[0049] FIG. 14 is block diagram of a method for receiving TCP packets using a B+ tree according to some embodiments of this disclosure; and

[0050] FIG. 15 is block diagram of a method for transmitting TCP packets using a B+ tree according to some embodiments of this disclosure.DETAILED DESCRIPTION

[0051] Transmission control protocol (TCP) is one of most widely used network protocols for the Internet and cloud computing. TCP comprises the use of a 32-bit sequence number (SN) for indicating order of byte transmission over a network. When packets are received out-of-order in a network using TCP, they are reordered.

[0052] Referring to FIG. 1, a sequence of packets P1, P2, P3, P4, and P5 are received out-of-order in the order illustrated in a received sequence 100. The received sequence 100 comprises the order P1, P2, P4, P5, and P3. The correct order for the received packets is packet P1 first, followed by packet P2, P3, P4, and P5 as illustrated in a correct sequence 102. A TCP protocol stack requires that packets are delivered to applications in the correct order, therefore packets received out-of-order such as in the received sequence 100 require a packet reordered operation to re-order to the correct sequence 102.

[0053] In the past, some implementations of packet reordering operations in operating systems comprise the use of linked lists. Use of linked lists for packet reordering operations may have poor performance as lists becoming larger and result in the triggering of time-out events, which may result in TCP performance collapse.

[0054] Some implementations of packet reordering operations in certain current operating systems use binary trees, such as red-black (RB) trees for packet reordered to reduce the likelihood of TCP performance collapse. A RB tree is balanced binary tree and is commonly used in software. In a binary tree, for any node X in the tree, all node keys of node X’s left sub-tree is less than node X’s key, and all node keys of node X’s right sub-tree is larger than node X’s key. This may be referred to as a binary tree ordering property. An RB tree may be defined as a binary tree wherein each node has a colour code of red or black, the RB comprising the following properties: every node is either red or black, root and leaves, referred to as NIL nodes, are black, a red node does not have a red child, and every path from a given node to any of its descendant NIL nodes goes through the same number of black nodes.

[0055] Referring to FIG. 2, an exemplary RB tree 200 has root node 202, intermediate nodes 206, 208 and 210, and leaf nodes 204, 212, 214, and 216. The height h of the RB tree 200 is 4. The key values for the nodes in the RB tree 200 are illustrated. For an RB tree with n nodes, operations of search, insertion, and deletion are performed in O (log2 (n) ) time.

[0056] To perform TCP reordering using a RB tree, the TCP sequence numbers are used as node keys and TCP packets are used as node values. As a result, for every non-leaf node of the RB tree, both the key and associated packet are stored therein.

[0057] When transmitting packets with TCP using a RB tree, once a selective acknowledgement (SACK) is received, packet retransmission is required and a transmit queue needs to be searched to find the packet with the same TCP sequence number as those in the SACK. In the past, some implementations of transmit queues in operating systems comprise the use of linked lists. Use of linked lists for transmit queues may result in frequency queue backpressure, overflow, and / or time-out events, which may result in TCP performance collapse. Some implementations of transmit queues in certain current operating systems use binary trees, such as RB trees for transmit queues to reduce the likelihood of TCP performance collapse.

[0058] When receiving packets with TCP using a RB tree for out-of-order packet handling, a new node representing an out-of-order received packet will be inserted into the RB tree. This operation results in O (log (n) ) computational time cost, where n is the number of received packets that require reordering. In addition, receiving a packet with an expected SN, representing the next byte to be received in the correct order, may result in one or more packets in the RB tree becoming in order packet and their deletion from the RB tree. Each packet deletion operation results in O (log (n) ) computational time cost.

[0059] When transmitting packets with TCP using a RB tree, a new node representing the packet to be transmitted will be inserted into the RB tree upon receipt for transmission. This operation results in O (log (n) ) computational time cost, where n is the number of packets in the transmission queue that are awaiting receipt of an acknowledgement (ACK) from a remote  TCP receiver. Upon receipt of an ACK, packets having SN less than or equal to the SN in the ACK shall be deleted from the RB tree. Each packet deletion operation results in O (log (n) ) computational time cost.

[0060] As the size of a RB tree for receiving or transmitting TCP packets increases, they take a significant portion of host memory. For high performance TCP processing, system components such as data processing units (DPUs) , network interface cards (NICs) , and smart NICs (SmartNICs) are used to perform TCP functionality, as either TCP offload or TCP stack processing, to distribute computational work. However, as a result, DPUs, NICs, and SmartNICs read a packet from host memory and then write the packet back to host memory for each RB tree operation, with each operation having O(log (n) ) computational time cost. As this is required for all RB tree operations triggered by packet transmission or receipt, very high memory bandwidth demand is placed on host memory and may result in poor TCP performance and long latency.

[0061] FIG. 3 is a schematic diagram showing the architecture of a conventional data center 310. The data center 310 usually comprises a front end dedicated for computing using computer servers and a back end dedicated for storage using storage servers. The front and back ends comprise one or more front-end racks 312 and one or more back-end racks 314, respectively. As those skilled in the art understand, a data-center rack such as a front-end rack 312 or a back-end rack 314 is a physical structure (such as a steel framework structure) with necessary electronic components and wiring for housing various computing devices such as servers, networking devices, cables, and the like, and provides equipment placement and orchestration in the data center facility.

[0062] As shown in FIG. 3, each front-end rack 312 comprises a top-of-rack (TOR) switch 322A (which is a network switch usually placed at the top of the rack) connected to one or more aggregation switches 324A (which is a network switch for interconnecting multiple racks 312 and 314 in the data center 310) . One or more computer servers 326 are deployed on the front-end racks 312 and connect to the TOR switch 322A of the front-end rack 312 via an internal or external network interface card (NIC) 328 for accessing a network 332 (such as the Internet) or devices on other racks via the TOR switch 322A and the aggregation switch 324A. Each computer sever 326 comprises various computing resources such as one or more central processing units (CPUs) 342, one or more memory units 344, one or more storage units 346 such one or more solid-state drives (SSDs) , one or more programmable and / or configurable acceleration processors 348 such as one or more graphic processing units (GPUs) , one or more DPUs, one or more tensor processing units (TPUs) , one or more field-programmable gate arrays (FPGAs) , and / or the like (collectively denoted “xPUs” ) .

[0063] Each back-end rack 314 comprises a TOR switch 322B connected to an aggregation switch 324B. One or more storage servers 352 are deployed on the back-end racks 314 and connect to the TOR switch 322B of the back-end rack 314 via an internal or external NIC 328 for accessing the network 332 or devices on other racks via the TOR switch 322B and the aggregation switch 324B. Each storage server 352 generally comprises a controller (not shown) controlling one or more non-volatile storage units 354 such as one or more hard drives, one or more SSDs, and / or the like.

[0064] In the following, various embodiments of a data-center architecture are disclosed, which provide disaggregation of computing resources with data-centric heterogeneous computing. More specifically, the data-center architecture disclosed below divides hardware resources into physically separated and circuitally interconnected hardware assemblies so that the hardware resources may be more efficiently shared and accessed.

[0065] FIG. 4 is a schematic diagram showing the architecture of a data center 400 according to some embodiments of this disclosure. As shown, the data center 400 comprises one or more racks 402. Each rack 402 comprises a TOR switch 404  connected to one or more aggregation switches 406 for functionally connecting various components, assemblies, and devices on the rack 402 to a network 408 and to the components, assemblies, and devices on other racks.

[0066] In these embodiments, the hardware components for computing and depository (similar to those of the computer servers 326 and storage servers 352 shown in FIG. 3) are organized into physically separated and circuitally interconnected hardware assemblies (also denoted “pools” or “nodes” ) according to their types. For example, as shown in FIG. 4, the data center 400 comprises one or more CPU nodes 412, one or more memory nodes 414, one or more ACC or xPU nodes 416, and one or more storage nodes 418 for deployment to the one or more racks 402. Of course, those skilled in the art will appreciate that, in other embodiments, the data center 400 may further comprise other types of nodes as needed.

[0067] Each node generally comprises a plurality of same-type hardware components for computing or storage and a DPU, which is a programmable processor specialized for use in data-center infrastructure and streaming applications for processing networking packets, storage requests, analytics requests, and / or the like) for managing communication of the hardware components of the node with other nodes, other devices, and / or the network 408. In some embodiments, each node may also comprise a printed circuit board (PCB) or any suitable circuitry having a plurality suitable connection interfaces for receiving the hardware components of the node and establishing communication between the hardware components and between the hardware components and the DPU thereof.

[0068] Out-of-order TCP packet reception occurs in a wide variety of application scenarios including: routers or switches changing routing paths for packets based on TCP traffic flow, either due to configuration or use of multi-path routing; routers or switches performing random early discards for TCP congestion control; packet discard by a host due to buffer overflow; and TCP packet corruption. As a result, SN of out-of-order TCP packets may not be completely random. Instead, they may be grouped into one or more disjoint intervals, wherein the number of intervals is generally much less than the total number of packets.

[0069] Referring to FIG. 5, intervals of packets 500, 502, and 504 are shown and the expected SN of the next packet, being the next byte to be received in order, is 80. However, packet with SN of 80 has not been received while SN in a first interval 500 representing one or more TCP packets having SN from 100 to 400, a second interval 502 representing one or more TCP packets having SN from 540 to 810, and a third interval 504 representing one or more TCP packets having SN from 945 to 1420 have already been received. An internal may be generated by receiving one or more packets, and packets within an interval are commonly received in order. This may be the case because they follow the same transmission path and are not retransmitted.

[0070] Referring to FIG. 6, a B+ tree 600 is a balanced m-ary tree with ordering properties similar to binary trees. The B+tree 600 comprises a root node 602, one or more internal nodes 604 and 606, and one or more leaf nodes 608, 610, 612, 614, and 616. The root node 602 and internal nodes 604 and 606 comprise only keys and pointers to children nodes. An internal node 604 and 606 has at least m / 2 and at most m child nodes 608, 610, 612, 614, and 616.

[0071] Referring to FIG. 6, the root node 602 comprises one key, 13 and stores two pointers. One pointer for child node 604 with keys less than 13 and one pointer for child node 606 for keys greater than or equal to 13. The leaf nodes 608, 610, 612, 614, and 616 may store both keys and values, wherein values may also be pointers to values. In some embodiments disclosed herein, the leaf nodes 608, 610, 612, 614, and 616 are linked together with a unidirectional or bi-directional linked list. For a B+ tree with n leaf nodes, operations of search, insertion, and deletion are performed in O (logm (n) ) time. Where m is large, B+ trees provide much more efficient performance than RB trees.

[0072] In some embodiments of the present disclosure, when receiving packets with TCP using a B+ tree, leaf nodes may store SN interval values and meta data associated with the intervals. The number of intervals per leaf node may be specific to a particular implementation or application. For example, leaf nodes may have 16, 32, 64, 128, 256, or 512 intervals per leaf node. For non-leaf nodes of a B+ tree, SNs from interval boundaries of leaf nodes may be used as node keys.

[0073] Referring to FIG. 7A, a B+ tree 700 comprises a root node 700 and three leaf nodes 704, 706, and 708. The root node 700 comprises two keys, SN of 540 and SN of 945. Each of the leaf nodes 704, 706, and 708 is configured to store meta data for on interval. The first leaf node 704 comprises an interval between SN of 100 to SN of 400, the second leaf node 706 comprises an interval between SN of 540 to SN of 810, and the third leaf node 708 comprises an interval between SN of 945 to SN of 1420. The leaf nodes 704, 706, and 708 may be linked together using a bi-directional linked list.

[0074] In some embodiments disclosed herein, TCP packets in an interval may be stored in any suitable manner including a pseudo first-in-first-out (FIFO) order, wherein packets are inserted and / or deleted at either a FIFO head or a FIFO tail of a FIFO data structure. As the FIFO data structure may need to support dynamic sizes upon packet insertion and / or deletion, it may be implemented using any suitable dynamic data structure such as a linked list, a dynamic array, queue, and / or the like.

[0075] Referring to FIG. 7B, each leaf node 704, 706, and 708 comprises intervals, wherein each interval may comprise the following fields: start SN (sSN) , end SN (eSN) , head pointer (hPtr) , and tail pointer (tPtr) . sSN being the lowest SN of the interval, eSN being the highest SN of the interval, hPtr being a pointer pointing to the head of the FIFO data structure, and tPtr being a pointer pointing to the tail of the FIFO data structure. Further, in some embodiments of the present disclosure, the leaf nodes 704, 706, and 708 may be linked together using a bi-directional linked list and each of the leaf nodes 704, 706, and 708 may comprise a next pointer (next) , a previous pointer (prev) , and a count (cnt) . The next pointer for pointing to the next leaf node, the previous pointer for pointing to the previous pointer, and the count for indicating the number of intervals in the leaf node.

[0076] In some embodiments of the present disclosure, the TCP B+ tree may be deployed using on-chip static ram (SRAM) or high-bandwidth memory (HBM) of a DPU, a NIC, or a SmartNIC where the size of the B+ tree is suitable for use on the SRAM or HBM. Where the B+ tree is deployed on the SRAM or HBM, higher TCP performance may be obtained. However, if the SRAM or HBM is unsuitable for the requirements for the B+ tree, then nodes of the root and higher of levels of the B+ tree may be implemented in SRAM or HBM of a DPU, a NIC, or SmartNIC, with lower level nodes deployed in host memory. This may require frequent access of lower nodes, which may be cached in the SRAM or HBM to increase performance.

[0077] When a TCP packet is received that comprises a range of SNs that overlaps with two or more intervals of leaf nodes in a B+ tree, the two or more intervals that the range of SNs overlaps with are merged into one interval. As TCP SN represent data on a byte-by-byte basis, bytes in the received packet with SNs overlapping with any interval may be discarded.

[0078] Referring to FIG. 8A, a B+ tree comprises leaf nodes representing three intervals 800, 802, and 804. The first interval 800 comprises a range between SN of 100 to SN of 400, the second interval 802 comprises a range between SN of 540 to SN of 810, and the third interval 804 comprises a range between SN of 945 to SN of 1420. The next received TCP packet has a first received SN range 806 from SN of 800 to SN of 860. As the first received SN range 806 overlaps with the second interval 802 and the third interval 804, they are merged to form a fourth interval 808, wherein the fourth interval 808 comprises a range between SN of 540 to SN of 1420. Bytes of SN of the TCP packet between 811 to 944 are stored and the remaining bytes of the first received SN range 806 are discarded.

[0079] This interval merge is more complex and computationally costly than an insertion or deletion operation for a B+tree for many reasons. For example, multiple leaf nodes may require merging into a single leaf node upon receipt of a single TCP packet, and merging two leaf nodes has the computational cost equivalent to deleting two leaf nodes and inserting a new leaf node.

[0080] Further, under extreme cases, multiple non-leaf nodes may also require merging upon receipt of a single TCP packet. Referring to FIG. 8B, a B+ tree comprises leaf nodes representing four intervals 810, 812, 814, and 816. The first interval 810 comprises a range between SN of 100 to SN of 400, the second interval 812 comprises a range between SN of 540 to SN of 810, the third interval 814 comprises a range between SN of 945 to SN of 1420, and the fourth interval 816 comprises a range between SN of 1500 to SN of 1600. The next received TCP packet has a second received SN range 818 of between SN of 380 and SN of 1520. As the second received SN range 818 overlaps with the first interval 810, the second interval 812, the third interval 814, and the fourth interval 816, they are merged to form a fifth interval 820, wherein the fifth interval 820 comprises a range between SN of 100 to SN of 1600. Bytes of SN of the TCP packet between 401 to 539, 811 to 944, and 1421 to 1499 are stored and the remaining bytes of the second received SN range 818 are discarded.

[0081] Referring to FIG. 9A, a B+ tree 900 comprises a root node 902, internal nodes 904 and 906, and leaf nodes 908, 910, 912, and 914. The first leaf node 908 comprises an interval between SN of 100 to SN of 400, the second leaf node 910 comprises an interval between SN of 540 to SN of 810, the third leaf node 912 comprises an interval between SN of 945 to SN of 1420, and the fourth leaf node 914 comprises an interval between SN of 1500 to SN of 1600. The first leaf node 908, the second leaf node 910, and the third leaf node 912 are connected by a bi-directional linked list. Upon receipt of a received TCP packet comprising a received SN range of between SN of 380 and SN of 1420, the B+ tree 900 is searched to determine the interval corresponding to the first SN value of the received TCP packet, being 380. In this case, the corresponding interval is in the first leaf node 908 being the leftmost leaf node. The B+ tree 900 is then searched to determine the interval corresponding to the last SN value of the received TCP packet, being 1420. To determine the corresponding interval, the linked list connecting the leaf nodes 908, 910, 912, and 914 may be traversed with intervals in the leaf nodes 908, 910, 912, and 914 comprising non-overlapping intervals of SNs and increasing in value from the first leaf node 908 to the third leaf node 914. As the SN range of the received TCP packet overlaps with the first interval 810, the second interval 812, and the third interval 814, they are merged to form a fifth interval 916, wherein the fifth interval 916 comprises a range between SN of 100 to SN of 1420. Bytes the received TCP packet comprising SN values between 401 to 539 as well as 811 to 944 are stored and the remaining bytes of received TCP packet are discarded.

[0082] As this process may be very complex and computationally costly, an alternative to immediate interval merging is a lazy node merge, wherein merging is not performed immediately following receipt of TCP packets but is rather performed more infrequently. In some embodiments of the present disclosure, a lazy node merge may comprise two steps. A first step may comprise updating existing intervals and / or inserting new intervals upon receipt of an out-of-order packet without node merging. Optionally, intervals within a single leaf node may be merged, which is also called intra-node interval merging. A second step may comprise monitoring the aggregate size of all leaf nodes, either periodically or continuously. Once the aggregated size of all leaf nodes exceeds a certain merge threshold, one or more node merge operations may be initiated. The second step may be optional and used for more optimized memory usage for the B+ tree, wherein the merge threshold may be based on the number of adjacent leaf nodes that do not have gaps their aggregate SN range.

[0083] The first step may be performed either completely by hardware, completely by software, or through a combination of hardware and software. The second step may be performed either by software, or through a combination of hardware and software, wherein software is used to divide a node merge operation into multiple simplified steps. The simplified steps may  be performed by hardware, while software controls and coordinates the performance of the simplified steps. For example, a simplified step may be a search, insertion, or deletion operation for a B+ tree performed by hardware.

[0084] Referring to FIG. 10A, a B+ tree 1000 comprises a root node 1002, internal nodes 1004 and 1006, and leaf nodes 1008, 1010.1012, and 1014. The first leaf node 1008 comprises an interval between SN of 100 to SN of 400, the second leaf node 1010 comprises an interval between SN of 540 to SN of 810, the third leaf node 1012 comprises an interval between SN of 945 to SN of 1420, and the fourth leaf node 1014 comprises an interval between SN of 1500 to SN of 1600. The first leaf node 1008, the second leaf node 1010, and the third leaf node 1012 are connected by a bi-directional linked list. Upon receipt of a received TCP packet comprising a received SN range of between SN of 380 and SN of 1449, the B+ tree 1000 is searched to determine the interval corresponding to the first SN value of the received TCP packet, being 380. In this case, the corresponding interval is in the first leaf node 1008 being the leftmost leaf node. The B+ tree 1000 is then searched to determine the interval corresponding to the last SN value of the received TCP packet, being 1449. To determine the corresponding interval, the linked list connecting the leaf nodes 1008, 1010, 1012, and 1014 may be traversed with intervals in the leaf nodes 1008, 1010, 1012, and 1014 comprising non-overlapping intervals of SNs and increasing in value from the first leaf node 1008 to the fourth leaf node 1014. Referring to FIG. 10A, to remove the gaps in SNs between adjacent leaf nodes 1008, 1010, 1012, and 1014, the lower and upper bounds of the intervals maybe adjusted corresponding to the first step of the lazy node merge. For example, referring to FIG. 10B, the interval of the first leaf node 1008 is adjusted to between SN of 100 to SN of 539, the interval of the second leaf node 1010 is adjusted to between SN of 540 to SN of 944, the interval of the third leaf node 1012 is adjusted to between SN of 945 to SN of 1449, and interval of the fourth leaf node 1014 is adjusted to between SN of 1500 to SN of 1600. The upper and lower bounds of the leaf nodes 1008, 1010, 1012, and 1014 may be adjusted in any manner wherein updated leaf nodes follow B+ tree properties such that no gaps in the aggregate SN range of the B+ tree exists within the SN range of the received TCP packet.

[0085] When there are no SN gaps between two or more adjacent intervals within the same leaf node, intra-node merging may be optionally carried out. After intra-node merging, adjacent intervals may be replaced with one interval that covers all SNs of both merged intervals. When two intervals are merged, their associated pseudo FIFOs are also merged into a new pseudo FIFO.

[0086] Referring to FIG. 11, a B+ tree 1100 comprises a root node 1104 and two leaf nodes 1106 and 1108, with each leaf node 1106 and 1108 comprising two intervals. A first leaf node 1106 comprises a first interval 1110 between SN of 100 to SN of 400 and a second interval 1112 between SN of 540 to SN of 810. The second leaf node 1108 comprises a third interval 1114 between SN of 945 to SN of 1420 and a fourth interval 1116 between SN of 1500 and SN of 1600.

[0087] Upon receipt of a received TCP packet comprising a received SN range of between SN of 380 and SN of 1520, a lazy node merge operation is used to adjust the SN ranges of the intervals. As a result, the first interval 1110 is adjusted to between SN of 100 to SN of 539, the second interval 1112 is adjusted to between SN of 540 to SN of 944, the third interval 1114 remains between SN of 945 to SN of 1420, and the fourth interval 1116 is adjusted to between SN of 1421 to SN of 1600. As a result, no gaps in the aggregate SN range exists within the SN range of the received TCP packet.

[0088] Referring to FIG. 11, intra-node merging of the first leaf node 1106 between the first interval 1110 and the second interval 1112 results in a fifth interval 1118 comprising a range between SN of 100 to SN of 944. Similarly, intra-node merging of the second leaf node 1108 between the third interval 1114 and the fourth interval 1116 results in a sixth interval 1120 comprising a range between SN of 945 to SN of 1600.

[0089] The use of intra-node interval merging may assist in the handling of full leaf nodes with no memory space left for inserting new intervals. This may result in room to insert new intervals after the use of intra-node interval merging operations and avoid the use of more computationally costly operations to insert one or more new leaf nodes, which may provide higher TCP B+ tree capacity.

[0090] When an TCP packet is received out-of-order, it may be inserted into a TCP B+ tree using a similar operation as standard B+ tree insertions. Initially, the B+ tree is searched to determine the corresponding interval of the TCP packet’s first SN. If a matching leaf node is identified, a lazy node merge operation may be used. Optionally, intra-node interval merging may be used. If a matching leaf node is not identified, a new interval may be generated from the packet’s SNs at a location based on the matching operation. A new interval may either be inserted into an existing leaf node or inserted into a new leaf node.

[0091] For out-of-order packets arriving from the same interval arrive consecutively, packet insertion may be done at O (1) computational cost by caching sSN and eSN of an interval and pointers to an associated leaf node. In this case, internal and root nodes may split but not frequently and may only require updating the eSN. If out-of-order packets from different intervals arrive in an interleaved order, packet insertion may be done at O (1) computational cost by caching sSN and eSN of the associated intervals and pointers to the associated leaf nodes. For normal out-of-order packet arrival patterns, packet insert may be done at O (1) computational cost on average.

[0092] When an in order packet comprising an expected SN is received, packets in a leftmost interval of a leftmost nodes left of the in order packet may become in order packets and may be deleted from the TCP B+ tree. As such deletion necessarily relates to the leftmost interval of the leftmost leaf node in a B+ tree, a fast deletion operation may be performed by adjusting a pointer to a leftmost leaf node. Therefore, computational cost of such a fast deletion operation may by O (1) on average. An internal node merge may be required in some instances.

[0093] Referring to FIG. 12, in a B+ tree for TCP transmission, each leaf node 1200, 1202, and 1204 comprises intervals, wherein each interval may comprise the following fields: start SN (sSN) , end SN (eSN) , head pointer (hPtr) , tail pointer (tPtr) , and SACK. Similar FIG. 7B in relation to a B+ tree for receiving TCP packets, sSN may be the lowest SN of the interval, eSN may be the highest SN of the interval, hPtr may be a pointer pointing to the head of the FIFO data structure, and tPtr may be a pointer pointing to the tail of the FIFO data structure. For a B+ tree for TCP transmission, each interval may further comprise the field of SACK, indicating whether a SACK or similar packet has been received for an interval.

[0094] For TCP transmission, a packet may be inserted into a B+ tree awaiting transmission. Once a packet has been transmitted to its destination, it remains in a B+ tree until confirmation of successful transmission has been received, upon which time the packet may deleted from the B+ tree. For example, a packet transmission may be deemed successful and may be deleted from a B+ tree if the packet’s SNs are all smaller or equal to an ACK SN received from the far end. Upon receiving an ACK SN, the ACK SN must generally be identified. Once an interval in the B+ tree is identified, an associated pseudo FIFO is searched. To limit computational cost of such searches, an upper bound may be imposed on the maximum size of a pseudo FIFO. For example, a pseudo FIFO may be limited to a maximum of 8, 16, 32, 64, 128 or 512 elements.

[0095] In some embodiments of the present disclosure, the TCP B+ tree for transmission may be deployed using on-chip SRAM or HBM of a DPU, a NIC, or a SmartNIC where the size of the B+ tree is suitable for use on the SRAM or HBM. Where the B+ tree is deployed on the SRAM or HBM, higher TCP performance may be obtained. However, if the SRAM or HBM is unsuitable for the requirements for the B+ tree, then nodes of the root and higher of levels of the B+ tree may be  implemented in SRAM or HBM of a DPU, a NIC, or SmartNIC, with lower level nodes deployed in host memory. This may require frequent access of lower nodes, which may be cached in the SRAM or HBM to increase performance.

[0096] Upon receipt of an ACK, all transmitted bytes having a SN less than the ACK may be deleted from a B+ tree for TCP transmission. As such deletion necessarily relates to the leftmost interval of the leftmost leaf node in a B+ tree, a fast deletion operation may be performed by adjusting a pointer to a leftmost leaf node. Therefore, computational cost of such a fast deletion operation may by O (1) on average. An internal node merge may be required in some instances.

[0097] Insertion in a B+ tree for TCP transmission is generally performed where a new TCP packet is accepted, from an application, for transmission and upon receipt of a SACK or similar packet. Insertion of a TCP packet into a B+ tree is generally fast as it always involves a rightmost interval of a rightmost leaf node. By adjusting a pointer to a rightmost leaf node, computational cost of such an operation may generally by O (1) on average. An internal node split may be required in some instances.

[0098] Insertion in a B+ tree for TCP transmission may be more complicated upon receipt of a SACK or similar packet. For each range of contiguous SN for a SACK packet, all intervals in the B+ tree comprising SNs overlapping with the range are identified. Where all SN values of an interval are within the range, the SACK flag for the interval may be set. Otherwise, the interval may be split into two or three new intervals.

[0099] If the upper bound of the interval is within the range, then the interval may be split into two new intervals. One interval comprising the upper bound of the original interval has all SN values within the range and can have its SACK flag set. The other interval not having its SN values within the range has its SACK flag cleared, and will have the same lower bound as the original interval.

[0100] Alternatively, if the lower bound of the interval is within the range, then the interval may be split into two new intervals. One interval comprising the lower bound of the original interval has all SN values within the range and can have its SACK flag set. The other interval not having its SN values within the range has its SACK flag cleared, and will have the same upper bound as the original interval.

[0101] Otherwise, where the SN values of the range fall in the middle of the interval, it may be split into three new intervals. Two new intervals, one comprising the upper bound of the original interval and one comprising the lower bound of the original interval will have their SACK flags cleared. The other interval shall comprise SN values of the range and will have its SACK flag set.

[0102] In some embodiments of the present disclosure, a B+ tree may be implemented in a DPU architecture. DPU architecture used maybe suitable for TCP and transport layer security (TLS) processing. Referring to FIG. 13, an exemplary DPU architecture is illustrated. A DPU 1300 may comprise clusters of heavy cores 1302 and lite cores 1304. A heavy core 1302 may be selected by a scheduling policy for one or more of the following: to perform a TLS handshake protocol, TCP connection setup for a TLS session, to maintain a TLS handshake state table, and to maintain a TCP connection context table. A TLS session may be defined by five tuples (sport, dport, sip, dip, smac, dmac) . An RSA / EC accelerator 1306 may be used for Rivest-Shamir-Adleman (RSA) or elliptic curve acceleration for large exponent and module calculations. The heavy core 1302 may store encryption and decryption keys for a TLS session in a security association table 1308. One or more lite cores 1304 may be selected by a scheduling policy to perform TLS and TCP data path processing. A cryptographic accelerator 1310 may be used for encryption and decryption accelerator using encryption and decryption keys from the security  association table 1308 and other cryptographic operations. A flexible data structure engine (DSE) 1312 optimized for B+tree operations may be used for TCP transmission and to accelerate packets stored in TCP transmission and receipt queues. A segmentation engine 1314 may be used to accelerate transmission and receipt TLS record segmentation and reassembly into and from TCP transmission and receipt packets. TLS record buffers 1316 and TCP transmission and receipt queues 1318 may use memory from the DPU 1300 HBM and DRAM 1320 using compute express link (CXL) 1322, while transmission and receipt TLS records may be fetched and stored from and into a buffer of a host virtual machine 1324. A TCP packet buffer may use either host DRAM 1326 or DPU 1300 direct attached DRAM 1320 using CXL 1322.

[0103] FIG. 14 is a flowchart showing the steps of a method 1400, according to some embodiments of the present disclosure. The method 1400 begins with receiving a TCP packet (step 1402) . At step 1404, the TCP packet is inserted into a B+ tree. Optionally, at step 1406, a SN range of the TCP packet is determined. Optionally, at step 1408, the TCP packet is inserted into the B+ tree according to the SN range. Optionally, at step 1410, SN values of the SN range are cached. Optionally, at step 1412, node keys defining a first SN interval are changed to define a merged SN interval. Optionally, at step 1414, node keys defining a second SN interval are changed to remove the second SN interval. Optionally, at step 1416, node keys defining a third SN interval are changed to define an expanded SN interval. Optionally, at step 1418, node keys defining a first SN interval are changed to define an expanded SN interval and node keys defining a second SN interval are changed to define a reduced SN interval. Optionally, at step 1420, an aggregate size of all leaf nodes is monitored and node keys are changed to define a merged SN interval. Optionally, at step 1422, TCP packets preceding the TCP packet are removed by changing a pointer in the linked list to a leftmost SN interval.

[0104] FIG. 15 is a flowchart showing steps of a method 1500, according to some embodiments of the present disclosure. The method 1500 begins with accepting a TCP packet for transmission (step 1502) . At step 1504, the TCP packet is inserted into a B+ tree. Optionally, at step 1506, a SN range of the TCP packet is determined. Optionally, at step 1508, the TCP packet is inserted into the B+ tree according to the SN range. Optionally, at step 1510, the TCP packet is inserted by changing a pointer in the linked list to a rightmost interval. Optionally, at step 1512, an ACK SN is received, preceding TCP packets are identified, and preceding TCP packets are removed. Optionally, at step 1514, a SACK packet is received, a SACK SN range is determined, and one or more intervals comprising the SACK SN range are identified. Optionally, at step 1516, a SACK field of an interval are set. Optionally, at step 1518, node keys of an interval are changed and a SACK field of an interval is set. Optionally, at step 1520, an aggregate size of all leaf nodes is monitored and node keys are changed to define a merged SN interval. Optionally, at step 1522, TCP packets preceding the TCP packet are removed by changing a pointer in the linked list to a leftmost SN interval.

[0105] Although embodiments have been described above with reference to the accompanying drawings, those of skill in the art will appreciate that variations and modifications may be made without departing from the scope thereof as defined by the appended claims.

Claims

1.A method comprising:receiving a transmission control protocol (TCP) packet; andinserting the TCP packet into a B+ tree.2.The method of claim 1, wherein said inserting the TCP packet into the B+ tree comprises:determining a sequence number (SN) range of the TCP packet; andinserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, whereineach node comprises up to m-1 node keys and up to m node values,each node may be a parent node comprising up to m child nodes,each child node is an internal node if it is a parent node and a leaf node if it is not a parent node,each node value of the root node and the internal nodes are for storing pointers to nodes, andeach node value of the leaf nodes is for storing packet data.3.The method of claim 2, wherein m is three or more.4.The method of claim 2 or 3, wherein the leaf nodes are linked together with a bi-directional linked list.5.The method of any one of claims 2 to 4, whereineach node key is for storing a SN value;each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the B+ tree; andthe TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.6.The method of claim 5, whereineach leaf node corresponds to two or more intra-node SN intervals; andthe two or more intra-node SN intervals are merged.7.The method of claim 5, further comprising caching the SN values of the leaf node corresponding to a SN interval.8.The method of any one of claims 5 to 7, further comprising:changing node keys defining a first SN interval to define a merged SN interval comprising SN values of both the first and a second SN interval; andchanging node keys defining the second SN interval to remove the second SN interval from the B+ tree,wherein the SN range is within the first SN interval and the second SN interval.9.The method of any one of claims 5 to 8, further comprising changing node keys defining a third SN interval to define an expanded SN interval comprising SN values of the third SN interval and the SN range, wherein the SN range is partially within the third SN interval and partially outside the range of any other SN intervals of the B+ tree.10.The method of any one of claims 5 to 7, further comprising:changing node keys defining a first SN interval to define a revised SN interval comprising SN values of the first SN interval and the SN range; andchanging node keys defining a second SN interval to define a reduced SN interval comprising SN values of the second SN interval excluding the SN range,wherein the SN range is partially within the first SN interval and partially within the second SN interval.11.The method of claim 9 or 10, further comprising:monitoring an aggregate size of all leaf nodes;changing nodes keys defining one or more SN intervals to merge two or more SN intervals into merged SN intervals upon the aggregate size of all leaf nodes meeting a merge threshold; andchanging node keys to remove one or more SN intervals merged into merged SN intervals from the m rooted tree.12.The method of any one of claims 5 to 11, wherein a node value is for storing TCP packets of two or more SN intervals.13.The method of claim 4, further comprising removing TCP packets preceding the TCP packet from the B+ tree, wherein the SN range represents an in order packet, by changing a pointer in the linked list to a leftmost SN interval.14.A method comprising:accepting a transmission control protocol (TCP) packet for transmission; andinserting the TCP packet into a B+ tree.15.The method of claim 14, wherein said inserting the TCP packet into the B+ tree comprises:determining a sequence number (SN) range of the TCP packet; andinserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, whereineach node comprises up to m-1 node keys and up to m node values,each node may be a parent node comprising up to m child nodes,each child node is an internal node if it is a parent node and a leaf node if it is not a parent node,each node value of the root node and the internal nodes are for storing pointers to nodes, andeach node value of the leaf nodes is for storing packet data.16.The method of claim 15, wherein m is three or more.17.The method of claim 15 or 16, wherein the leaf nodes are linked together with a bi-directional linked list.18.The method of claim 17, wherein the TCP packet is inserted by changing a pointer in the linked list to a rightmost SN interval.19.The method of any one of claims 15 to 18, whereineach node key is for storing a SN value;each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the B+ tree;each node value comprises a selective acknowledgement (SACK) field; andthe TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.20.The method of claim 19, further comprising:receiving an acknowledgement (ACK) SN;identifying preceding TCP packets in the B+ tree having SN ranges preceding the ACK SN; andremoving the preceding TCP packets from the B+ tree.21.The method of claim 17, wherein removing the preceding TCP packets comprises changing a pointer in the linked list to a leftmost SN interval.22.The method of claim 19 or 20, further comprising:receiving a SACK packet;determining a SACK SN range of the SACK packet; andidentifying one or more SACK SN intervals of the B+ tree comprising at least a portion of the SACK SN range.23.The method of claim 22, further comprising setting a SACK field of a first SACK SN interval wherein SN values of the SACK SN range is identical to SN values of the first SACK SN interval.24.The method of claim 22 or 23, further comprising:changing node keys defining a second SACK SN interval to define an acknowledged second SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the second SACK SN interval;setting a SACK field of the acknowledged second SACK SN interval; andadding a third SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the second SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the second SACK SN interval and the SN values of the SACK SN range include an upper SN bound of the second SACK SN interval.25.The method of any one of claims 22 to 24,changing node keys defining a fourth SACK SN interval to define an acknowledged fourth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the fourth SACK SN interval;setting a SACK field of the acknowledged fourth SACK SN interval; andadding a fifth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the fourth SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range include a lower SN bound of the fourth SACK SN interval.26.The method of any one of claims 22 to 25,changing node keys defining a sixth SACK SN interval to define an acknowledged sixth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the sixth SACK SN interval;setting a SACK field of the acknowledged sixth SACK SN interval;adding a seventh SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and preceding SN values the fourth SACK SN interval; andadding an eighth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and following SN values the fourth SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range includes a portion of the sixth SACK SN interval and not including a lower SN bound nor an upper SN bound of the sixth SACK SN interval.27.An apparatus comprising:a memory; andone or more processors for executing instructions stored in the memory for receiving transmission control protocol (TCP) packets, the instructions comprising:receiving a TCP packet, andinserting the TCP packet into a B+ tree.28.The apparatus of claim 27, wherein the memory comprises one or more memory assemblies each comprising one or more memory units and a data processing unit (DPU) circuitally connected to the one or more memory units.29.The apparatus of claim 27 or 28, wherein said inserting the TCP packet into the B+ tree comprises:determining a sequence number (SN) range of the TCP packet; andinserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, whereineach node comprises up to m-1 node keys and up to m node values,each node may be a parent node comprising up to m child nodes,each child node is an internal node if it is a parent node and a leaf node if it is not a parent node,each node value of the root node and the internal nodes are for storing pointers to nodes, andeach node value of the leaf nodes is for storing packet data.30.The apparatus of claim 29, wherein m is three or more.31.The apparatus of claim 29 or 30, wherein the leaf nodes are linked together using a bi-directional linked list.32.The apparatus of any one of claims 29 to 31, wherein:each node key is for storing a SN value;each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the m rooted tree; andthe TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.33.The apparatus of claim 32, wherein each leaf node corresponds to two or more intra-node SN intervals, and the apparatus is further for merging two or more intra-node SN intervals.34.The apparatus of claim 32 further for caching the SN values of the leaf node correspondin6g to a SN interval.35.The apparatus of any one of claims 32 to 34 further for:changing node keys defining a first SN interval to define a merged SN interval comprising SN values of both the first and a second SN interval; andchanging node keys defining the second SN interval to remove the second SN interval from the m rooted tree,wherein the SN range is within the first SN interval and the second SN interval.36.The apparatus of any one of claims 32 to 35 further for:changing node keys defining a third SN interval to define an expanded SN interval comprising SN values of the third SN interval and the SN range, wherein the SN range is partially within the third SN interval and partially outside the range of any other SN intervals of the B+ tree.37.The apparatus of any one of claims 33 to 36 further for:changing node keys defining a first SN interval to define an expanded SN interval comprising SN values of the first SN interval and the SN range; andchanging node keys defining a second SN interval to define a reduced SN interval comprising SN values of the second SN interval excluding the SN range,wherein the SN range is partially within the first SN interval and partially within the second SN interval.38.The apparatus of claim 36 or 37 further for:monitoring an aggregate size of all leaf nodes;changing node keys defining one or more SN intervals to merge two or more SN intervals into merged SN intervals upon the aggregate size of all leaf nodes meeting a merge threshold; andchanging node keys to remove one or more SN intervals merged into merged SN intervals from the m rooted tree.39.The apparatus of any one of claims 32 to 38, wherein a node value is for storing TCP packets of two or more SN intervals.40.The apparatus of claim 31 further for removing TCP packets preceding the TCP packet from the B+ tree, wherein the SN range represents an in order packet by changing a pointer in the linked list to a leftmost SN interval.41.The apparatus of any one of claims 27 to 40 comprising on-chip static random access memory, or high-bandwidth memory of a data processing unit, a network interface card, or a smart network interface card.42.An apparatus comprising:a memory; andone or more processors for executing instructions stored in the memory for transmitting transmission control protocol (TCP) packets, the instructions comprising:accepting a TCP packet for transmission, andinserting the TCP packet into a B+ tree.43.The apparatus of claim 42, wherein the memory comprises one or more memory assemblies each comprising one or more memory units and a data processing unit (DPU) circuitally connected to the one or more memory units.44.The apparatus of claim 42 or 43, wherein said inserting the TCP packet into the B+ tree comprises:determining a sequence number (SN) range of the TCP packet; andinserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, whereineach node comprises up to m-1 node keys and up to m node values,each node may be a parent node comprising up to m child nodes,each child node is an internal node if it is a parent node and a leaf node if it is not a parent node,each node value of the root node and the internal nodes are for storing pointers to nodes, andeach node value of the leaf nodes is for storing packet data.45.The apparatus of claim 44, wherein m is three or more.46.The apparatus of claim 44 or 45, wherein the leaf nodes are linked together with a bi-directional linked list.47.The apparatus of claim 46, wherein the TCP packet is inserted by changing a pointer in the linked list to a rightmost SN interval.48.The apparatus of any one of claims 44 to 47, whereineach node key is for storing a SN value;each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the B+ tree;each node value comprises a selective acknowledgement (SACK) field; andthe TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.49.The apparatus of claim 48 further for:receiving an acknowledgement (ACK) SN;identifying preceding TCP packets in the B+ tree having SN ranges preceding the ACK SN; andremoving the preceding TCP packets from the B+ tree.50.The apparatus of claim 46, wherein removing the preceding TCP packets comprises changing a pointer in the linked list to a leftmost SN interval.51.The apparatus of claim 48 or 49 further for:receiving a SACK packet;determining a SACK SN range of the SACK packet; andidentifying one or more SACK SN intervals of the B+ tree comprising at least a portion of the SACK SN range.52.The apparatus of claim 51 further for setting a SACK field of a first SACK SN interval wherein SN values of the SACK SN range is identical to SN values of the first SACK SN interval.53.The apparatus of claim 51 or 52 further for:changing node keys defining a second SACK SN interval to define an acknowledged second SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the second SACK SN interval;setting a SACK field of the acknowledged second SACK SN interval; andadding a third SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the second SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the second SACK SN interval and the SN values of the SACK SN range include an upper SN bound of the second SACK SN interval.54.The apparatus of any one of claims 51 to 53 further for:changing node keys defining a fourth SACK SN interval to define an acknowledged fourth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the fourth SACK SN interval;setting a SACK field of the acknowledged fourth SACK SN interval; andadding a fifth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the fourth SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range include a lower SN bound of the fourth SACK SN interval.55.The apparatus of any one of claims 51 to 54 further for:changing node keys defining a sixth SACK SN interval to define an acknowledged sixth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the sixth SACK SN interval;setting a SACK field of the acknowledged sixth SACK SN interval;adding a seventh SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and preceding SN values the fourth SACK SN interval; andadding an eighth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and following SN values the fourth SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range includes a portion of the sixth SACK SN interval and not including a lower SN bound nor an upper SN bound of the sixth SACK SN interval.56.The apparatus of any one of claims 42 to 55 wherein the apparatus comprises on-chip static random access memory, or high-bandwidth memory of a data processing unit, a network interface card, or a smart network interface card.57.One or more non-transitory computer-readable storage media comprising computer-executable instructions for receiving transmission control protocol (TCP) packets, wherein the instructions, when executed, cause a processing structure to perform actions comprising:receiving a TCP packet, andinserting the TCP packet into a B+ tree.58.The storage media of claim 57, wherein said inserting the TCP packet into the B+ tree comprises:determining a sequence number (SN) range of the TCP packet; andinserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, whereineach node comprises up to m-1 node keys and up to m node values,each node may be a parent node comprising up to m child nodes,each child node is an internal node if it is a parent node and a leaf node if it is not a parent node,each node value of the root node and the internal nodes are for storing pointers to nodes, andeach node value of the leaf nodes is for storing packet data.59.The storage media of claim 58, wherein m is three or more.60.The storage media of claim 58 or 59, wherein the leaf nodes are linked together using a bi-directional linked list.61.The storage media of any one of claims 58 to 60, wherein:each node key is for storing a SN value;each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the m rooted tree; andthe TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.62.The storage media of claim 61, wherein each leaf node corresponds to two or more intra-node SN intervals, and the storage media is further for merging two or more intra-node SN intervals.63.The storage media of claim 61 further for caching the SN values of the leaf node corresponding to a SN interval.64.The storage media of any one of claims 61 to 63 further for:changing node keys defining a first SN interval to define a merged SN interval comprising SN values of both the first and a second SN interval; andchanging node keys defining the second SN interval to remove the second SN interval from the m rooted tree,wherein the SN range is within the first SN interval and the second SN interval.65.The storage media of any one of claims 61 to 64 further for:changing node keys defining a third SN interval to define an expanded SN interval comprising SN values of the third SN interval and the SN range, wherein the SN range is partially within the third SN interval and partially outside the range of any other SN intervals of the B+ tree.66.The storage media of any one of claims 62 to 65 further for:changing node keys defining a first SN interval to define an expanded SN interval comprising SN values of the first SN interval and the SN range; andchanging node keys defining a second SN interval to define a reduced SN interval comprising SN values of the second SN interval excluding the SN range,wherein the SN range is partially within the first SN interval and partially within the second SN interval.67.The storage media of claim 65 or 66 further for:monitoring an aggregate size of all leaf nodes;changing node keys defining one or more SN intervals to merge two or more SN intervals into merged SN intervals upon the aggregate size of all leaf nodes meeting a merge threshold; andchanging node keys to remove one or more SN intervals merged into merged SN intervals from the m rooted tree.68.The storage media of any one of claims 61 to 67, wherein a node value is for storing TCP packets of two or more SN intervals.69.The storage media of claim 60 further for removing TCP packets preceding the TCP packet from the B+ tree, wherein the SN range represents an in order packet by changing a pointer in the linked list to a leftmost SN interval.70.One or more non-transitory computer-readable storage media comprising computer-executable instructions for transmitting transmission control protocol (TCP) packets, wherein the instructions, when executed, cause a processing structure to perform actions comprising:accepting a TCP packet for transmission, andinserting the TCP packet into a B+ tree.71.The storage media of claim 70, wherein said inserting the TCP packet into the B+ tree comprises:determining a sequence number (SN) range of the TCP packet; andinserting the TCP packet into the B+ tree according to the SN range, the B+ tree comprising a plurality of nodes comprising one root node, whereineach node comprises up to m-1 node keys and up to m node values,each node may be a parent node comprising up to m child nodes,each child node is an internal node if it is a parent node and a leaf node if it is not a parent node,each node value of the root node and the internal nodes are for storing pointers to nodes, andeach node value of the leaf nodes is for storing packet data.72.The storage media of claim 71, wherein m is three or more.73.The storage media of claim 71 or 72, wherein the leaf nodes are linked together with a bi-directional linked list.74.The storage media of claim 73, wherein the TCP packet is inserted by changing a pointer in the linked list to a rightmost SN interval.75.The storage media of any one of claims 71 to 74, whereineach node key is for storing a SN value;each node value of a leaf node corresponds to a SN interval defined by SN values in adjacent node keys of leaf nodes on the B+ tree;each node value comprises a selective acknowledgement (SACK) field; andthe TCP packet is inserted as the packet data in the node value having the SN interval corresponding to the SN range.76.The storage media of claim 75 further for:receiving an acknowledgement (ACK) SN;identifying preceding TCP packets in the B+ tree having SN ranges preceding the ACK SN; andremoving the preceding TCP packets from the B+ tree.77.The storage media of claim 73, wherein removing the preceding TCP packets comprises changing a pointer in the linked list to a leftmost SN interval.78.The storage media of claim 75 or 76 further for:receiving a SACK packet;determining a SACK SN range of the SACK packet; andidentifying one or more SACK SN intervals of the B+ tree comprising at least a portion of the SACK SN range.79.The storage media of claim 78 further for setting a SACK field of a first SACK SN interval wherein SN values of the SACK SN range is identical to SN values of the first SACK SN interval.80.The storage media of claim 78 or 79 further for:changing node keys defining a second SACK SN interval to define an acknowledged second SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the second SACK SN interval;setting a SACK field of the acknowledged second SACK SN interval; andadding a third SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the second SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the second SACK SN interval and the SN values of the SACK SN range include an upper SN bound of the second SACK SN interval.81.The storage media of any one of claims 78 to 80 further for:changing node keys defining a fourth SACK SN interval to define an acknowledged fourth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the fourth SACK SN interval;setting a SACK field of the acknowledged fourth SACK SN interval; andadding a fifth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with SN values the fourth SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range include a lower SN bound of the fourth SACK SN interval.82.The storage media of any one of claims 78 to 81 further for:changing node keys defining a sixth SACK SN interval to define an acknowledged sixth SACK SN interval comprising SN values of the SACK SN range overlapping with SN values of the sixth SACK SN interval;setting a SACK field of the acknowledged sixth SACK SN interval;adding a seventh SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and preceding SN values the fourth SACK SN interval; andadding an eighth SACK SN interval to the B+ tree comprising SN values of the SACK SN range not overlapping with and following SN values the fourth SACK SN interval,wherein the SN values of the SACK SN range is not identical to the SN values of the fourth SACK SN interval and the SN values of the SACK SN range includes a portion of the sixth SACK SN interval and not including a lower SN bound nor an upper SN bound of the sixth SACK SN interval.

Citation Information

Patent Citations

  • High-efficiency tcp session reorganization method

    CN107743102A

  • Efficient tcp session reorganization device

    CN107786472A

  • A network data packet availability deciding method and system

    CN1741473A

  • Method and apparatus for secure internet protocol (IPSEC) offloading with integrated host protocol stack management

    US20060104308A1