AGGREGATE SECURED PACKETS IN A NETWORK DEVICE

DE102024136101A1Undetermined Publication Date: 2025-06-12MELLANOX TECHNOLOGIES LTD(IL)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
DE102024136101P0
Authority / Receiving Office
DE · DE
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-06-13
Filing Date
2024-12-04
Publication Date
2025-06-12

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

In one embodiment, a network device comprises: a network interface configured to receive secured packets from a remote device over a packet data network, each of the secured packets being secured according to a security protocol and comprising a respective security protocol header and a Transmission Control Protocol (TCP) packet encrypted according to the security protocol; a host device interface configured to connect the network device to a host device;and packet processing circuitry configured to decrypt each of the secured packets based on the respective security protocol header, resulting in a plurality of decrypted packets comprising decrypted TCP packets, aggregate the decrypted TCP packets into a single aggregated packet, and provide the single aggregated packet to software running on a processor of the host device via the host device interface;
Need to check novelty before this filing date? Find Prior Art

Description

FIELD OF THE INVENTIONThe present invention relates to computer systems and, more particularly, to aggregating secured packages.BACKGROUNDLarge Receive Offload (LRO) or packet aggregation is a power optimization technique that reduces central processing unit (CPU) overhead for processing packets arriving at a high rate from the network. In LRO, hardware, for example, in a network device, aggregates received packets into aggregated packets, and the network code in the kernel retrieves the aggregated packets and processes the aggregated packets as respective units. LRO groups incoming network packets back into larger buffers and transmits the resulting larger but fewer packets to the host or virtual machine network stack. This reduces the number of packets that the CPU must process, which in turn reduces the network CPU load. This is particularly useful for high bandwidth connections.SUMMARYThe invention is defined by the claims. In order to illustrate the invention, aspects and embodiments are described which may or may not fall within the scope of the claims.According to an embodiment of the present disclosure, there is provided a network device comprising: a network interface configured to receive, from a remote device, packets secured via a packet data network, each of the secured packets secured according to a security protocol and comprising a respective security protocol header and a transmission control protocol (TCP) packet encrypted according to the security protocol; a host device interface configured to connect the network device to a host device; Packet processing circuitry configured to decrypt each of the secured packets based on the respective security protocol header, resulting in multiple decrypted packets comprising decrypted TCP packets, aggregating the decrypted TCP packets into a single aggregated packet, and providing the single aggregated packet to software running on a processor of the host device via the host device interface.Further, according to an embodiment of the present disclosure, the aggregated packet is encapsulated with a given security protocol header and a given TCP header.Further, according to an embodiment of the present disclosure, the packet processing circuitry is configured to scatter the single aggregated packet to a memory of the host device that is accessible to the software.Additionally, according to an embodiment of the present disclosure, the packet processing circuitry is configured to scatter the single aggregated packet to memory at a storage location given by a job queue entry consumed by the single aggregated packet.Moreover, according to an embodiment of the present disclosure, the security protocol is a per-packet encryption protocol.Further, according to an embodiment of the present disclosure, the security protocol is one of the following: Internet Protocol Security (IPsec), PSP security protocol, datagram transport layer security (DTLS), or media access control security (MACSec).Further, according to an embodiment of the present disclosure, the packet processing circuitry is configured to check that sequence numbers of the plurality of decrypted packets form a sequence of consecutive numbers and aggregate the decrypted TCP packets into the single aggregated packet in response to the sequence numbers of the plurality of decrypted packets forming a sequence of consecutive numbers.Additionally, according to an embodiment of the present disclosure, the packet processing circuitry is configured to check that the sequence numbers in security protocol headers and TCP headers of the decrypted packets form respective sequences of consecutive numbers, and aggregate the decrypted TCP packets into the single aggregated packet in response to the sequence numbers in the security protocol headers and the TCP headers of the multiple decrypted packets forming respective sequences of consecutive numbers.Moreover, according to an embodiment of the present disclosure, the packet processing circuitry is configured to generate metadata about the number of decrypted TCP packets in the single aggregated packet and provide the metadata to the software running on the processor of the host device.Further, according to an embodiment of the present disclosure, the packet processing circuitry is configured to generate the metadata with an indication of the sequence numbers of the decrypted packets in the single aggregated packet.Further, according to an embodiment of the present disclosure, the packet processing circuitry is configured to receive a offload of cryptographic material from the software running on the processor of the host device and to decrypt the TCP packet of each of the secured packets based on the respective security protocol header and the offloaded cryptographic material, resulting in the decrypted TCP packets.Further, according to another embodiment of the present disclosure, there is provided a system comprising the network device and the host device, wherein the software is configured to receive the single aggregated packet and to de-encapsulate the given security protocol header from the aggregated packet.Additionally, according to an embodiment of the present disclosure, the software is configured to update a re-entry protection card based on security protocol sequence numbers of the decrypted packets in the single aggregated packet.Moreover, according to an embodiment of the present disclosure, the software is configured to derive the security protocol sequence numbers from metadata of the single aggregated packet or header data of the single aggregated packet and a number of decrypted packets in the single aggregated packet.Further, according to yet another embodiment of the present disclosure, there is provided a method comprising: receiving secured packets from a remote device over a packet data network, each of the secured packets secured according to a security protocol and having a respective security protocol header and a transmission control protocol (TCP) packet encrypted according to the security protocol; decrypting each of the secured packets based on the respective security protocol header, resulting in multiple decrypted packets comprising decrypted TCP packets; aggregating the decrypted TCP packets into a single aggregated packet; and providing the single aggregated packet over a host device interface to software running on a processor of a host device.Further, according to an embodiment of the present disclosure, the aggregated packet is encapsulated with a given security protocol header and a given TCP header.Further, according to an embodiment of the present disclosure, the method includes scattering the single aggregated packet to a memory of the host device that is accessible to the software.Additionally, according to an embodiment of the present disclosure, the scattering includes scattering the single aggregated packet to the memory at a storage location given by a job queue entry consumed by the single aggregated packet.Moreover, according to an embodiment of the present disclosure, the security protocol is a per-packet encryption protocol.Further, according to an embodiment of the present disclosure, the security protocol is one of the following: Internet Protocol Security (IPsec), PSP security protocol, datagram transport layer security (DTLS), or media access control security (MACSec).Further, according to an embodiment of the present disclosure, the method includes checking that sequence numbers of the plurality of decrypted packets form a sequence of consecutive numbers, and wherein aggregating includes aggregating the decrypted TCP packets into the single aggregated packet in response to the sequence numbers of the plurality of decrypted packets forming a sequence of consecutive numbers.Additionally, according to an embodiment of the present disclosure, the checking includes checking that the sequence numbers in security protocol headers and TCP headers of the decrypted packets form respective sequences of consecutive numbers, and the aggregating includes aggregating the decrypted TCP packets into the single aggregated packet in response to the sequence numbers in the security protocol headers and the TCP headers of the multiple decrypted packets form respective sequences of consecutive numbers.Moreover, according to an embodiment of the present disclosure, the method includes generating metadata about the number of decrypted TCP packets in the single aggregated packet and providing the metadata to the software running on the processor of the host device.Further, according to an embodiment of the present disclosure, the generating includes generating the metadata with an indication of the sequence numbers of the decrypted packets in the single aggregated packet.Further, according to an embodiment of the present disclosure, the method includes receiving a replacement of cryptographic material from software running on the processor of the host device, wherein decrypting includes decrypting the TCP packet of each of the secured packets based on the respective security protocol header and the replaced cryptographic material, resulting in the decrypted TCP packets.Additionally, according to an embodiment of the present disclosure, the method includes receiving the single aggregated packet and decapsulating the given security protocol header from the aggregated packet.Moreover, according to an embodiment of the present disclosure, the method includes updating a replay protection card based on security protocol sequence numbers of the decrypted packets in the single aggregated packet.Further, according to an embodiment of the present disclosure, the software is configured to derive the security protocol sequence numbers from metadata of the single aggregated packet or from header data of the single aggregated packet and a number of decrypted packets in the single aggregated packet.Each feature of an aspect or embodiment may be applied to other aspects or embodiments in any suitable combination. In particular, any feature of a method aspect or form may be applied to a device aspect or form and vice versa.BRIEF DESCRIPTION OF THE DRAWINGSThe present invention will be understood from the following detailed description taken in conjunction with the drawings. FIG. 1 is a block diagram view of a computer system constructed and operable in accordance with an embodiment of the present invention; FIG. 2 is a flow diagram including steps in a method of operating a network device in the system of FIG. 1 ; FIG. 3 is a flow diagram illustrating packet aggregation in a network device in the system of FIG. 1 ; and FIG. 4 is a flow diagram including steps in a method of operating a host device in the system of FIG. 1.DESCRIPTION OF EMBODIMENTSSUMMARYAs mentioned previously, packet aggregation reduces the number of packets a CPU must process, which in turn reduces the network CPU load. Currently, packet aggregation is not performed for secured, e.g., encrypted, packets for two reasons: (1) an internal flow of the packets (e.g., TCP packet sequence numbers) is hidden by the encryption; and (2) network device hardware lacks support for stateful operations performed per flow, such as replay protection updates.Thus, embodiments of the present invention address at least some of the above disadvantages by providing a network device that receives a offload of cryptographic information (e.g., from a connected host device), receives secured packets encrypted using a per-packet encryption protocol (e.g., Internet Protocol Security (IPsec), PSP security protocol, datagram transport layer security (DTLS), or media access control security (MACSec)), decrypts (without removing the security protocol header) the received secured packets based on the offloaded cryptographic information and / or data derived from the packet headers, For example, if the packet is an IPSEC packet, the packet remains an IPSEC packet after decryption), resulting in multiple decrypted packets, and aggregating data from the multiple decrypted packets into an aggregated packet.The network device may then present the aggregated packet to software running on the host device for further processing. For example, the network device may scatter the aggregated packet to memory (e.g., the host device) for retrieval by the software running on the host device. In some embodiments, the network device may scatter the aggregated packet to a storage location indicated by a work queue entry (WQE) consumed by the aggregated packet.The secured packets may include a security protocol header, a TCP header, and TCP payload. The aggregated packet may include a plurality of TCP payloads inserted into the payload of the aggregated packet. The network device may encapsulate the payload of the aggregated packet with a TCP header and a security protocol header based on the TCP headers and security protocol headers of the decrypted packets aggregated to the aggregation packet. The TCP header and the security protocol header of the aggregation packet may include an indication or list of the security protocol packet sequence numbers and the TCP sequence numbers, respectively, of the packets aggregated into the aggregated packet.For example, in some embodiments where replay attack protection is performed by software running on the host device, the network device checks the packet headers of the decrypted packets and aggregates only decrypted packets in which the decrypted packets have sequential packet sequence numbers, e.g., security protocol sequence numbers and / or TCP sequence numbers.In some embodiments, the network device generates metadata about the aggregated packet. The metadata may indicate the packet sequence numbers of the packets aggregated to the aggregated packet and / or the number of packets aggregated to the aggregated packet. The metadata may also indicate the storage location(s) to which the aggregated packet in the memory has been (or will be) scattered. The metadata may be included in a completion queue entry (CQE) written by the network device to a completion queue, e.g., memory, to be read by software running on the host.The software running on the host receives the aggregated packet (e.g., based on the metadata), de-encapsulates the packet of the security protocol header and the TCP header, and may perform stateful operations in the encryption protocol layer, such as updating the replay protection card, e.g., in IPSEC.SYSTEM DESCRIPTIONReference is now made to Figure 1, which is a block diagram view of a computer system 10 constructed and operable in accordance with an embodiment of the present invention. The computer system 10 includes a host device 12, a network device 14, and a remote device 16.The host device 12 includes a processor 18, a memory 20, and an interface 22. The processor 18 is configured to execute software 24, which will be described in more detail with reference to FIG. 4. The memory 20 is configured to store: data used by the processor 18; received packets for processing by the software 24; and queues such as a job queue with WQEs and a completion queue with CQEs. The interface 22 is configured to connect the host device 12 to the network device 14 for purposes of sharing data. The interface 22 may operate according to any suitable protocol, for example, according to a data communication bus protocol such as Peripheral Component Interconnect Express (PCIe).Network device 14 includes host device interface 26, packet processing circuitry 28, and network interface 30. The host device interface 26 is configured to connect the network device 14 to the host device 12 for purposes of sharing data, for example, in accordance with a data communication bus protocol such as Peripheral Component Interconnect Express (PCIe). The network interface 30 is configured to receive packets 32 secured via a packet data network 34 from the remote device 16. The packet processing circuitry 28 is configured to decrypt the secured packets 32 and aggregate the decrypted packets into an aggregated packet 36, as will be described in more detail with reference to FIGS. 2 and 3. The packet processing circuitry 28 is configured to provide the aggregated packet 36 to the software 24 running on the processor 18 of the host device 12, for example, by scattering the aggregated packet 36 to a memory, e.g., the memory 20, where it may be retrieved by the software 24, as will be described in more detail with reference to FIG. 4.Reference is now made to FIGS. 2 and 3. FIG. 2 is a flow diagram 200 including steps in a method of operating the network device 14 in the system 10 of FIG. 1. FIG. 3 is a flow diagram 300 illustrating packet aggregation in the network device 14 in the system 10 of FIG. 1. The packet processing circuitry 28 is configured to receive a replacement of cryptographic material from the software 24 running on the processor 18 of the host device 12 (block 202).The network interface 30 is configured to receive packets 32 secured over the packet data network 34 from the remote device 16 (block 204). Each of the secured packets 32 is secured according to a security protocol and includes a respective security protocol header 38 and a secured (e.g., encrypted) transmission control protocol (TCP) packet 40 encrypted according to the security protocol. The security protocol is generally a per packet encryption protocol. The security protocol may be one of the following: Internet Protocol Security (IPsec); PSP security protocol; datagram transport layer security (DTLS); or media access control security (MACSec).The packet processing circuitry 28 is configured to decrypt each of the secured packets 32 based on the respective security protocol header 38, resulting in a plurality of decrypted packets 42 comprising decrypted TCP packets 44 (block 206). The decrypted packets 42 are further security protocol packets and have the respective security protocol headers 38. Each of the decrypted TCP packets 44 includes a TCP header 46 and TCP payload 48. In some embodiments, the packet processing circuitry 28 is configured to decrypt the TCP packet 40 of each of the secured packets 32 based on the respective security protocol header 38 and the offloaded cryptographic material, resulting in the decrypted TCP packets 44.The packet processing circuitry 28 is configured to check that packet sequence numbers (e.g., the security protocol header 38 and / or the TCP header 46) of the plurality of decrypted packets 42 form a sequence of consecutive numbers (block 208). In some embodiments, the packet processing circuitry 28 is configured to check that the sequence numbers in security protocol headers 38 and TCP headers 46 of the decrypted packets 42 form respective sequences of consecutive numbers (e.g., one consecutive sequence for the packet sequence numbers of the security protocol header 38 and another consecutive sequence for the packet sequence numbers of the TCP header 46).In other embodiments, cryptographic replay protection and TCP window validation may also be offloaded by software 24 to packet processing circuitry 28 to perform replay attack protection. In these other embodiments, packet processing circuitry 28 would indicate in metadata that the re-entry attack protection was performed for the relevant packets. Software 24 may then determine whether to perform additional validation. In some cases, such as errors, software 24 may perform further checks and / or loggings.The packet processing circuitry 28 is configured to aggregate the decrypted TCP packets 42 into a single aggregated packet 36 (block 210). In some embodiments, the packet processing circuitry 28 is configured to aggregate the decrypted TCP packets 44 into the single aggregated packet 36 in response to the sequence numbers (e.g., security protocol packet sequence numbers or TCP packet sequence numbers) of the plurality of decrypted packets 42 forming a sequence of consecutive numbers. In some embodiments, the packet processing circuitry 28 is configured to aggregate the decrypted TCP packets 44 into the single aggregated packet 36 in response to the sequence numbers in the security protocol headers 38 and the TCP headers 46 of the plurality of decrypted packets 42 forming respective sequences of consecutive numbers.The packet processing circuitry 28 is configured to encapsulate the aggregated packet 36 with a given security protocol header 50 and a given TCP header 52 based on the security protocol headers 38 and the TCP header 46 of the decrypted packets 42 (block 212). The aggregated packet 36 therefore includes the security protocol header 50, the TCP header 52, and payload 54 comprising the TCP payload 48 of the decrypted packets 42. The security protocol header 50 may indicate the packet sequence numbers included in the security protocol headers 38 of the decrypted packets 42 aggregated into the aggregated packet 36. The security protocol header 50 may also include other information common to the security protocol headers 38 of the decrypted packets 42 aggregated to the aggregated packet 36. The TCP header 52 may indicate the packet sequence numbers included in the TCP headers 46 of the decrypted packets 42 aggregated into the aggregated packet 36. The TCP header 52 may also include other information common to the TCP headers 46 of the decrypted packets 42 aggregated to the aggregated packet 36, such as a source port, a destination port, an acknowledgement number, a header length, a window size, flags, a TCP checksum, and a Urogent pointer.The packet processing circuitry 28 is configured to provide the single aggregated packet 36 via the host device interface 26 to the software 24 running on the processor 18 of the host device 12 (block 214). In some embodiments, the packet processing circuitry 28 is configured to scatter the single aggregated packet 36 to the memory 20 of the host device 12 that is accessible to the software 24 (block 216). In some embodiments, the packet processing circuitry 28 is configured to scatter the single aggregated packet 36 to the memory 20 according to a storage location given by a job queue entry (WQE) 56 consumed by the single aggregated packet 36. In other embodiments, packet processing circuitry 28 may scatter aggregated packet 36 to memory 20 without using a WQE.The packet processing circuitry 28 is configured to generate metadata 58 about the number of decrypted TCP packets 44 included in the single aggregated packet 36 (block 218) and provide the metadata 58 to the software 24 running on the processor 18 of the host device 12 (block 220). In some embodiments, the packet processing circuitry 28 is configured to generate the metadata 58 with an indication of the sequence numbers (e.g., security protocol packet sequence numbers and / or TCP packet sequence numbers) of the decrypted packets 42 in the single aggregated packet 36. In some embodiments, metadata 58 may be provided to software 24 using a completion queue entry (CQE) that indicates completion processing of aggregated packet 36 by packet processing circuitry 28. In some embodiments, the indication of the sequence numbers (e.g., the sequence number of the first decrypted packet 42 in the aggregated packet 36) may be added to the header data of the aggregated packet 36.In practice, some or all of these functions of packet processing circuitry 28 may be combined into a single physical component or alternatively implemented using multiple physical components. These physical components may include hardwired or programmable devices, or a combination of the two. In some embodiments, at least some of the functions of packet processing circuitry 28 may be performed by a programmable processor under the control of suitable software. This software can be downloaded to a device in electronic form, for example, via a network. Alternatively or additionally, the software may be stored in tangible, non-transitory computer readable storage media such as optical, magnetic, or electronic storage.Reference is now made to FIG. 4, which is a flowchart 400 including steps in a method of operating the host device 12 in the system 10 of FIG. 1. The software 24 executing on the processor 18 of the host device 12 is configured to: offload cryptographic material to the network device 14 (block 402); receive the metadata 58 (e.g., in a CQE) (block 404); receive the single aggregated packet 36 (block 406), for example, based on one or more storage locations indicated in the metadata 58; uncapsulate the security protocol header 50 (and the TCP header 52) from the aggregated packet 36 (block 408); derive security protocol sequence numbers of decrypted packets 42 from: the metadata 58 of the aggregated packet 36; or from header data of the single aggregated packet 36 and a number of decrypted packets 42 in the single aggregated packet 36 (block 410); Perform one or more replay protection checks (e.g., based on the packet sequence number data in the metadata 58, the security protocol header 50, and / or the TCP header 52), and update a replay protection card based on security protocol sequence numbers (and / or the TCP packet sequence numbers) of the decrypted packets 42 in the single aggregated packet 36 and / or the metadata 58 (block 412).Various features of the invention, which are described in the contexts of separate embodiments for clarity, may also be provided in combination in a single embodiment. Conversely, various features of the invention, which are described in the context of a single embodiment for brevity, may also be provided separately or in any suitable sub-combination.The above-described embodiments are exemplified, and the present invention is not limited to what has been specifically shown and described above. Rather, the scope of the invention includes both combinations and sub-combinations of the various features described above, as well as variations and modifications thereof that would occur to those skilled in the art upon reading the above description and are not disclosed in the prior art.It is to be understood that aspects and embodiments are described above by way of example only and that modifications may be made in detail within the scope of the claims.Any apparatus, method and feature disclosed in the specification and (optionally) the claims and drawings may be provided independently or in any suitable combination.Reference numerals appearing in the claims are intended to be illustrative only and have no limiting effect on the scope of the claims.

Claims

A network device comprising: a network interface configured to receive, from a remote device, packets secured over a packet data network, each of the secured packets secured according to a security protocol and having a respective security protocol header and a transmission control protocol (TCP) packet encrypted according to the security protocol; a host device interface configured to connect the network device to a host device; and packet processing circuitry configured to: decrypt each of the secured packets based on the respective security protocol header, resulting in a plurality of decrypted packets comprising decrypted TCP packets; aggregate the decrypted TCP packets into a single aggregated packet; and providing the single aggregated packet to software running on a processor of the host device via the host device interface.The apparatus of claim 1, wherein the aggregated packet is encapsulated with a given security protocol header and a given TCP header.The apparatus of claim 1 or 2, wherein the packet processing circuitry is configured to scatter the single aggregated packet to a memory of the host device that is accessible to the software.The apparatus of claim 3, wherein the packet processing circuitry is configured to scatter the single aggregated packet to the memory according to a storage location given by a job queue entry consumed by the single aggregated packet.The apparatus of any preceding claim, wherein the security protocol is a per-packet encryption protocol.The apparatus of claim 5, wherein the security protocol is one of: Internet Protocol Security (IPsec); PSP security protocol; datagram transport layer security (DTLS); or media access control security (MACSec).The apparatus of any preceding claim, wherein the packet processing circuitry is configured to: check that sequence numbers of the plurality of decrypted packets form a sequence of consecutive numbers; and aggregate the decrypted TCP packets into the single aggregated packet in response to the sequence numbers of the plurality of decrypted packets forming a sequence of consecutive numbers.The apparatus of claim 7, wherein the packet processing circuitry is configured to: check that the sequence numbers in security protocol headers and TCP headers of the decrypted packets form respective sequences of consecutive numbers; and aggregate the decrypted TCP packets into the single aggregated packet in response to the sequence numbers in the security protocol headers and the TCP headers of the multiple decrypted packets forming respective sequences of consecutive numbers.The apparatus of claim 7 or 8, wherein the packet processing circuitry is configured to: generate metadata about the number of decrypted TCP packets included in the single aggregated packet; and provide the metadata to the software running on the processor of the host device.The apparatus of claim 9, wherein the packet processing circuitry is configured to generate the metadata with an indication of the sequence numbers of the decrypted packets in the single aggregated packet.The apparatus of any preceding claim, wherein the packet processing circuitry is configured to: receive a offload of cryptographic material from the software running on the processor of the host device; and decrypt the TCP packet of each of the secured packets based on the respective security protocol header and the offloaded cryptographic material, resulting in the decrypted TCP packets.A system comprising: the network device of claim 1; and the host device, wherein the software is configured to: receive the single aggregated packet; and decapsulate the given security protocol header from the aggregated packet.The system of claim 12, wherein the software is configured to update a re-entry protection card based on security protocol sequence numbers of the decrypted packets in the single aggregated packet.The system of claim 13, wherein the software is configured to derive the security protocol sequence numbers from: metadata of the single aggregated packet; or header data of the single aggregated packet and a number of decrypted packets in the single aggregated packet.A method comprising: receiving secured packets from a remote device over a packet data network, each of the secured packets secured according to a security protocol and having a respective security protocol header and a transmission control protocol (TCP) packet encrypted according to the security protocol; decrypting each of the secured packets based on the respective security protocol header, resulting in multiple decrypted packets comprising decrypted TCP packets; aggregating the decrypted TCP packets into a single aggregated packet; and providing the single aggregated packet over a host device interface to software running on a processor of a host device.The method of claim 15, wherein the aggregated packet is encapsulated with a given security protocol header and a given TCP header.The method of claim 15 or 16, further comprising scattering the single aggregated packet to a memory of the host device that is accessible to the software.The method of claim 17, wherein the scattering comprises scattering the single aggregated packet to the memory according to a storage location given by a job queue entry consumed by the single aggregated packet.The method of any of claims 15 to 18, wherein the security protocol is a per-packet encryption protocol.The method of claim 19, wherein the security protocol is one of: Internet Protocol Security (IPsec); PSP security protocol; datagram transport layer security (DTLS); or media access control security (MACSec).The method of any of claims 15 to 20, further comprising checking that sequence numbers of the plurality of decrypted packets form a sequence of consecutive numbers, and wherein aggregating comprises aggregating the decrypted TCP packets into the single aggregated packet in response to the sequence numbers of the plurality of decrypted packets forming a sequence of consecutive numbers.The method of claim 21, wherein: the checking comprises checking that the sequence numbers in security protocol headers and TCP headers of the decrypted packets form respective sequences of consecutive numbers; and the aggregating comprises aggregating the decrypted TCP packets into the single aggregated packet in response to the sequence numbers in the security protocol headers and the TCP headers of the plurality of decrypted packets forming respective sequences of consecutive numbers.The method of claim 21 or 22, further comprising: generating metadata about the number of decrypted TCP packets in the single aggregated packet; and providing the metadata to the software running on the processor of the host device.The method of claim 23, wherein the generating comprises generating the metadata with an indication of the sequence numbers of the decrypted packets in the single aggregated packet.The method of any of claims 15 to 24, further comprising receiving a replacement of cryptographic material from the software running on the processor of the host device, wherein the decrypting comprises decrypting the TCP packet of each of the secured packets based on the respective security protocol header and the replaced cryptographic material, resulting in the decrypted TCP packets.The method of any of claims 15 to 25, further comprising: receiving the single aggregated packet; and decapsulating the given security protocol header from the aggregated packet.The method of claim 26, further comprising updating a replay protection card based on security protocol sequence numbers of the decrypted packets in the single aggregated packet.The method of claim 27, wherein the software is configured to derive the security protocol sequence numbers from: metadata of the single aggregated packet; or header data of the single aggregated packet and a number of decrypted packets in the single aggregated packet.