CPU and method related to security association
The introduction of sub-anti-replay windows based on hash calculations addresses scalability and computational inefficiencies in multi-core CPUs, enhancing performance and reducing contention in anti-replay services.
Patent Information
- Application Number
- CN202280095329.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-25
- Publication Date
- 2024-12-03
AI Technical Summary
Existing anti-replay solutions for multi-core CPUs in communication networks face scalability issues, increased load and storage contention, and high computational overhead, particularly in high-throughput scenarios, leading to inefficient CPU processing and increased costs with intelligent NICs.
Implementing multiple sub-anti-replay windows based on hash calculations of integrity-protected packet data, allowing parallel processing across CPU cores and reducing the need for inter-core synchronization.
Enhances scalability, reduces CPU load and storage contention, and improves performance by enabling efficient parallel processing of packets with reduced computational overhead.
Smart Images

Figure CN119072901A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method related to security association and executed by a central processing unit (CPU), a CPU, a computer program, and a corresponding computer program product. Background Art
[0002] Anti-replay is a widely implemented feature in some protocols in communication networks and many consumer electronics products. In communication networks, anti-replay is used for security associations (SAs), such as Internet Protocol Security (IPsec) SA, Media Access Control Security (MACsec) SA, and Datagram Transport Layer Security (DTLS) SA. IPsec is a secure network protocol suite that authenticates and encrypts data packets to provide secure encrypted communications between two computers over an Internet Protocol (IP) network, where the IP network can be trusted or untrusted. IPsec is also used for virtual private networks (VPNs). In the Third Generation Partnership Project (3GPP) 4G and 5G mobile networks, IPsec with integrity and confidentiality protection is mandatory for all user plane and control plane services unless the network can be trusted.
[0003] The state of the art is to implement the IP protocol stack in software (SW) on common off-the-shelf (COTS) hardware. The hardware (HW) is typically a system on a chip (SoC) comprising a multi-core CPU with one or more hardware accelerators for packet processing.
[0004] If the throughput requirements are high, the encryption and integrity functions required by IPsec are often offloaded to hardware accelerators. For cloud-native IPsec implementations, CPU cores are used for encryption and integrity operations. Some IPsec hardware accelerators are "self-contained", meaning that the complete IPsec protocol processing is implemented in the hardware accelerator. Other hardware accelerators only implement support for encryption / decryption and integrity checking functions. In the latter case, IPsec protocol processing is implemented in software.
[0005] Anti-replay is a feature of IPsec in which a receiver maintains a "sliding window" record of sequence numbers of authenticated received packets. The receiver rejects all packets with sequence numbers (SN) below the starting point of the sliding window (i.e., packets that are too old), or rejects all packets that have appeared within the sliding window (i.e., duplicate packets or packets that have been replayed). Anti-replay can be used with both IPsec's Encapsulating Security Payload (ESP) protocol and the Authentication Header (AH) protocol. Therefore, anti-replay can also be used with the two encapsulation modes provided by IPsec (i.e., tunnel mode and transport mode).
[0006] Part of the IP protocol stack is typically implemented in user space, that is, not in the network stack of the operating system for performance reasons. This part of the IP protocol stack is called the "fast path". Programming frameworks such as the Data Plane Development Kit (DPDK) are typically used for fast path development. The fast path programming framework can support an event-driven programming model that can be used to build packet processing pipelines with multiple stages. The stages in these packet processing pipelines can be atomic, ordered, or parallel. Atomic scheduling on queues ensures that a single traffic flow does not exist on two different CPU cores at the same time. Ordered scheduling allows all flows to be sent to any CPU core, but in this case the scheduler must ensure that the packets are returned to the entry order of the downstream queues on the egress. Parallel scheduling allows all traffic flows to be sent to all CPU cores without any packet ordering guarantees during reception at the receiver.
[0007] US2016277358 A1 discloses a method for detecting a replay attack while enabling multiple cores in a multi-core processor to manage an established tunnel session. The tunnel session includes multiple flows. One core is assigned to manage one flow, and another core is assigned to manage another flow.
[0008] Existing solutions and technologies for extending anti-replay services in multi-core SoCs have multiple disadvantages. In many communication networks, a single IPsec SA may carry a large amount of business. The common configuration in current 4G and 5G networks is to tunnel all user-plane services to the base station in one SA. Multiple SAs can be used, but most network operators prefer to use as few SAs as possible to reduce the cost of IPsec configuration, maintenance, and IPsec connection leasing. The anti-replay services performed by each inbound IPsec SA are specified in a serial manner. This means that it is difficult to implement anti-replay services in a scalable manner. In addition, the current anti-replay implementation with only a single anti-replay window leads to increased load and storage contention, which ultimately causes the CPU to be suspended during processing of incoming packets or business flows. A dedicated atomic processing stage is usually used for anti-replay. The dedicated atomic processing stage limits the throughput of a single IPsec SA to the capacity of a single CPU core. Alternative solutions such as intelligent network interface controllers (NICs) are expensive, and therefore increase both manufacturing costs and software costs. Intelligent NIC solutions will also reduce the portability of software. Separate software tracking is required for low-end deployments (deployments without smart NICs) and high-end deployments (deployments with smart NICs). Some existing solutions cannot be used for packets that include encrypted data. In addition, some solutions introduce additional protocols such as Internet Key Exchange (IKE) to perform negotiations between the sender system and the receiver system, which leads to increased overhead and reduced system efficiency. In addition, there is a lock-free anti-replay service, but it uses compute-intensive atomic compare and exchange (CAS) instructions, which typically results in high contention for cache lines that save the anti-replay window state. In addition, synchronization becomes a processing-intensive task once high-frequency CPU core-to-core synchronization is considered. Summary of the invention
[0009] It is an object of the present invention to improve security involving multi-core CPUs.
[0010] This and other objects are met by means of different aspects of the invention as defined by the independent claims.
[0011] According to a first aspect, a method is provided, which is performed by a central processing unit CPU including a plurality of cores and is associated with a security association SA. The method comprises: dividing an anti-replay window for the SA into at least two sub-anti-replay windows, wherein each of the sub-anti-replay windows is assigned a sub-anti-replay window identifier. The method comprises: receiving a first packet and a second packet, each of the first packet and the second packet comprising an integrity-protected portion. The method comprises: for each of the first packet and the second packet, determining a sub-anti-replay window among the sub-anti-replay windows based on a hash calculation, the hash calculation using data from the integrity-protected portion of the first packet and the second packet as a sole input to generate a derived sub-anti-replay window identifier for each of the first packet and the second packet. The method comprises: performing a lookup of the sub-anti-replay window using the derived sub-anti-replay window identifier of each of the first packet and the second packet against the sub-anti-replay window identifier of each of the sub-anti-replay windows. The method includes: performing a service, wherein the service uses the derived sub-anti-replay window identifier of each of the first packet and the second packet to perform the following operations: if the sequence numbers of the first packet and the second packet are the same, accept the first packet and reject the second packet, and if the sequence numbers of the first packet and the second packet are different, accept the first packet and the second packet.
[0012] Thus, a reduced need for computationally intensive tasks (such as high-frequency inter-CPU core synchronization) is achieved. Another significant advantage is that the present invention allows better performance, increased efficiency and improved scalability because more CPU cores can be involved in the processing of packets involving a given IPsec SA. In addition, each sub-anti-replay window is based on a calculated hash value, which in turn is based entirely / only on data obtained from a specific packet, so the sub-anti-replay window is effectively immutable to a potential attacker. Therefore, protection against anti-replay attacks is ensured or at least improved. One of the multiple advantages is that multiple sub-anti-replay windows will reduce load and storage contention, which leads to reduced CPU aborts.
[0013] According to one embodiment, the service is an anti-replay service.
[0014] According to one embodiment, the method includes receiving one of the first packet and the second packet at two cores of the plurality of cores, respectively.
[0015] According to one embodiment, the method includes receiving the first packet and the second packet at a core among the plurality of cores.
[0016] According to one embodiment, the number of sub-anti-replay windows is less than or equal to 2^[data length (in bits)].
[0017] According to one embodiment, the method comprises: if the sequence number of the first packet and the sequence number of the second packet are equal, distributing the first packet and the second packet to the same sub-anti-replay window.
[0018] According to one embodiment, the method includes receiving a third packet, and if a sequence number of the third packet is the same as a sequence number of the first packet, distributing the third packet to the same sub-anti-replay window as the first packet.
[0019] According to one embodiment, the method includes receiving a third packet, and if a sequence number of the third packet is the same as a sequence number of the second packet, distributing the third packet to the same sub-anti-replay window as the second packet.
[0020] According to one embodiment, the method comprises: if the sequence numbers of the first packet and the second packet are different, distributing the first packet and the second packet to different sub-anti-replay windows.
[0021] According to one embodiment, the method includes receiving a third packet, and if a sequence number of the third packet is the same as a sequence number of the first packet, distributing the third packet to the same sub-anti-replay window as the first packet.
[0022] According to one embodiment, the method comprises receiving a third packet and, if a sequence number of the third packet is the same as a sequence number of the second packet, distributing the third packet to the same sub-anti-replay window as the second data packet.
[0023] According to one embodiment, the method comprises: if the sequence numbers of the first packet and the second packet are different, distributing the first packet and the second packet to different sub-anti-replay windows.
[0024] According to one embodiment, performing the anti-replay service on the first packet and the second packet is accomplished using other bytes in the first packet and the second packet except for the corresponding security parameter index SPI values.
[0025] According to one embodiment, the first packet and the second packet belong to a first service flow and a second service flow.
[0026] According to one embodiment, the method includes: using atomic scheduling to schedule one of the first service flow and the second service flow at two cores of the plurality of cores, respectively, thereby reducing the need for cross-core CPU synchronization.
[0027] According to one embodiment, if the data selected for the service flow identification is the same as the data selected for determining the sub-anti-replay window, then synchronization is not required when updating the sub-anti-replay window.
[0028] According to one embodiment, the method includes: scheduling one of the first service flow and the second service flow respectively at two cores among the plurality of cores using in-order scheduling.
[0029] According to one embodiment, the method comprises determining a contention risk in the service based on a number of sub-anti-replay windows.
[0030] According to one embodiment, the sub-anti-replay window includes a right edge and a left edge.
[0031] According to one embodiment, the method comprises: periodically synchronizing the right edge and the left edge. Thus, it is achieved to prevent the acceptance of old packets with SN lower than the left edge.
[0032] According to one embodiment, the method includes processing the sub-anti-replay window on a per-core basis.
[0033] According to one embodiment, the method comprises performing the service on the first packet and the second packet in parallel.
[0034] According to one embodiment of the method, the hash calculation for each of the first packet and the second packet always produces the same derived sub-anti-replay window identifier for each of the first packet and the second packet.
[0035] According to one embodiment, the method comprises: performing the hash calculation in a network interface card NIC.
[0036] According to one embodiment of the method, the integrity-protected parts of the first packet and the second packet are an Encapsulating Security Payload ESP header, payload data, and an ESP trailer in each of the first packet and the second packet.
[0037] According to one embodiment of the method, the data in the integrity protected portion from each of the first packet and the second packet is encrypted.
[0038] According to one embodiment, the hash calculation for each of the first packet and the second packet includes extracting encryption bits of each of the first packet and the second packet.
[0039] According to one embodiment, the data in the integrity protected portion from each of the first packet and the second packet is not encrypted.
[0040] According to one embodiment, the SA is an Internet Protocol Security IPSec SA.
[0041] According to one embodiment, the SA is a Media Access Control Protocol Security MACSec SA.
[0042] According to one embodiment, the SA is a Datagram Transport Layer Security DTLS SA.
[0043] According to a second aspect, a CPU including a plurality of cores is provided. The CPU is configured to divide an anti-replay window for an SA into at least two sub-anti-replay windows, wherein each of the sub-anti-replay windows is assigned a sub-anti-replay window identifier. The CPU is configured to receive a first packet and a second packet, each of the first packet and the second packet including an integrity-protected portion. The CPU is configured to determine, for each of the first packet and the second packet, a sub-anti-replay window among the sub-anti-replay windows based on a hash calculation, the hash calculation using data from the integrity-protected portion of the first packet and the second packet as a sole input to generate a derived sub-anti-replay window identifier for each of the first packet and the second packet. The CPU is also configured to perform a search for the sub-anti-replay window using the derived sub-anti-replay window identifier of each of the first packet and the second packet against the sub-anti-replay window identifier of each of the sub-anti-replay windows. The CPU is configured to: execute a service, wherein the service uses the derived sub-anti-replay window identifier of each of the first packet and the second packet to perform the following operations: if the sequence numbers of the first packet and the second packet are the same, accept the first packet and reject the second packet, and if the sequence numbers of the first packet and the second packet are different, accept the first packet and the second packet.
[0044] According to one embodiment, the service is an anti-replay service.
[0045] According to one embodiment, the CPU is configured to receive one of the first packet and the second packet at two cores among the plurality of cores, respectively.
[0046] According to one embodiment, the CPU is configured to receive the first packet and the second packet at a core among the plurality of cores.
[0047] According to one embodiment, the number of sub-anti-replay windows is less than or equal to 2^[data length (in bits)].
[0048] According to one embodiment, the CPU is configured to: if the sequence number of the first packet and the sequence number of the second packet are the same, distribute the first packet and the second packet to the same sub-anti-replay window.
[0049] According to one embodiment, the CPU is configured to: receive a third packet, and if a sequence number of the third packet is the same as a sequence number of the first packet, distribute the third packet to the same sub-anti-replay window as the first packet.
[0050] According to one embodiment, the CPU is configured to: receive a third packet, and if a sequence number of the third packet is the same as a sequence number of the second packet, distribute the third packet to the same sub-anti-replay window as the second packet.
[0051] According to one embodiment, the CPU is configured to distribute the first packet and the second packet to different sub-anti-replay windows if the sequence numbers of the first packet and the second packet are different.
[0052] According to one embodiment, the anti-replay service for the first packet and the second packet is performed using other bytes in the first packet and the second packet except for the corresponding SPI values.
[0053] According to one embodiment, the first packet and the second packet belong to a first service flow and a second service flow.
[0054] According to one embodiment, the CPU is configured to use atomic scheduling to schedule one of the first service flow and the second service flow at two cores among the multiple cores respectively.
[0055] According to one embodiment, if the data selected for the service flow identifier is the same as the data selected for determining the sub-anti-replay window, then synchronization is not required when updating the sub-anti-replay window. Thus, it is achieved that no "extra" processing stage needs to be added, and inter-core anti-replay window synchronization will no longer be required.
[0056] According to one embodiment, the CPU is configured to: use in-order scheduling to schedule one of the first service flow and the second service flow at two cores among the plurality of cores, respectively.
[0057] According to one embodiment, the CPU is configured to determine a contention risk in the service based on the number of sub-anti-replay windows.
[0058] According to one embodiment, the sub-anti-replay window includes a right edge and a left edge.
[0059] According to one embodiment, the CPU is configured to periodically synchronize the right edge with the left edge.
[0060] According to one embodiment, the CPU is configured to process the sub-anti-replay window on a per-core basis.
[0061] According to one embodiment, the CPU is configured to perform the service on the first packet and the second packet in parallel.
[0062] According to one embodiment, the hash calculation for each of the first packet and the second packet always produces the same derived sub-anti-replay window identifier for each of the first packet and the second packet.
[0063] According to one embodiment, the CPU is configured to delegate the hash calculation to the NIC.
[0064] According to one embodiment, the integrity protected portions of the first packet and the second packet are an ESP header, payload data, and an ESP trailer in each of the first packet and the second packet.
[0065] According to one embodiment, the data in the integrity protected portion from each of the first packet and the second packet is encrypted.
[0066] According to one embodiment, the hash calculation for each of the first packet and the second packet includes extracting encryption bits of each of the first packet and the second packet.
[0067] According to one embodiment, the data in the integrity protected portion from each of the first packet and the second packet is not encrypted.
[0068] According to one embodiment, the SA is an IPSec SA.
[0069] According to one embodiment, the SA is a MACSec SA.
[0070] According to one embodiment, the SA is a DTLS SA.
[0071] A third aspect relates to a computer program comprising instructions which, when executed on a processing circuit, cause the processing circuit to perform the method according to any one of the embodiments of the first aspect.
[0072] According to a fourth aspect, a computer program product is provided, comprising a non-transitory computer-readable storage medium and a computer program according to the third aspect stored on the non-transitory computer-readable storage medium.
[0073] The CPU, the method, the computer program and the computer program product can be used in various applications, such as communication network nodes such as radio base stations, routers, gateways, switches, etc. Other applications of the CPU, the method, the computer program and the computer program product are in computing systems, such as edge data centers, edge computers, micro data centers. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The above and additional objects, features and advantages of the present invention will be better understood through the following illustrative and non-limiting detailed description of embodiments of the present invention with reference to the accompanying drawings, in which:
[0075] Figure 1A The current implementation of anti-replay service for IPsec in tunnel mode (prior art) is shown;
[0076] Figure 1B The current implementation of anti-replay service for IPsec in transport mode (prior art) is shown;
[0077] Figure 2 A sliding window for IPsec anti-replay service (prior art) is shown;
[0078] Figure 3A is a flow chart showing an embodiment of a method in a multi-core CPU according to one embodiment of the present invention;
[0079] Figure 3B is a flow chart showing an embodiment of a method in a multi-core CPU according to one embodiment of the present invention;
[0080] Figure 4 A schematic block diagram of a CPU placed in a device according to an embodiment of the present invention is shown;
[0081] Figure 5 A schematic block diagram of a CPU according to an embodiment of the present invention is shown;
[0082] Figure 6 A table format showing an example of an anti-replay service on an IPsec SA with an ESP header according to one embodiment of the present invention;
[0083] Fig. 7A shows the ESP packet format;
[0084] Figure 7B The AH packet format is shown;
[0085] Figure 8 A CPU according to an embodiment of the present invention is shown;
[0086] Fig. 9 An example of a computer program product according to an embodiment of the present invention is shown;
[0087] Fig.10 A schematic block diagram of an anti-replay service according to an embodiment of the present invention is shown;
[0088] Fig.11 A schematic block diagram of an anti-replay service in a system including a receiver using atomic / ordered scheduling according to an embodiment of the present invention is shown.
[0089] All the figures are schematic, not necessarily to scale, and generally show only parts which are necessary in order to elucidate the invention, wherein other parts may be omitted or merely suggested. DETAILED DESCRIPTION
[0090] Currently, the anti-replay service adopted in Internet Protocol Security (IPsec), Media Access Control Security (MACsec), and Datagram Transport Layer Security (DTLS), etc. includes a single anti-replay window. The anti-replay window is a logical window. The inventors have recognized that this current anti-replay service implementation makes it difficult to implement an anti-replay algorithm in a scalable manner for a single IPsec security association (SA) or DTLS SA. For MACsec, the anti-replay service is called a replay protection service. The present invention implements a "scalable" anti-replay service and introduces the concept of multiple instances of an anti-replay window (or simply referred to as a sub-anti-replay window). Sub-anti-replay windows are introduced while maintaining protection against any anti-replay attacks and providing integrity for packets or business flows. The disclosure of the present invention reduces the need for computationally intensive tasks (such as high-frequency central processing unit (CPU) inter-core synchronization), and therefore allows better performance and improved scalability because more CPU cores can participate in the processing of packets involving a given IPsec SA.
[0091] The present invention will now be described more fully below with reference to the accompanying drawings, in which specific embodiments of the invention are shown. However, the present invention may be embodied in a variety of different forms and should not be construed as being limited to the embodiments set forth herein. Rather, these embodiments are provided by way of example to make this disclosure exhaustive and complete, and to fully convey the scope of the invention to those skilled in the art.
[0092] Generally, unless different meanings are clearly given and / or different meanings are implied in the context of using the term, all terms used in this article will be interpreted according to their common meanings in the relevant technical field. Unless explicitly stated, all references to one / an / the element, feature, device, assembly, part, step, etc. should be publicly interpreted as referring to at least one instance of the element, device, assembly, part, step, etc. Unless a step or feature is explicitly described as after or before another step / feature and / or a step must be after or before another step implicitly, the steps of any method disclosed herein do not have to be performed in the exact order disclosed. Where appropriate, any feature of any embodiment disclosed herein may be applied to any other embodiment. Similarly, any advantage of any embodiment may be applicable to any other embodiment, and vice versa. By the following description, other purposes, features and advantages of the attached embodiments will be apparent.
[0093] In order to effectively balance the packet processing between the cores of a multi-core CPU, the software can utilize an internal hardware (HW)-based or software-based event scheduler that can be used for load balancing, such as Eventdev of the Data Plane Development Kit (DPDK). Packet processing is performed in a pipeline that is usually divided into multiple stages. Each of the multiple stages in the pipeline has a worker thread that performs one or more packet processing functions. Event-driven programming models generally support three types of scheduling for "sending" events from one processing level to another. In a packet-switched network, a business flow, packet flow, or network flow refers to a sequence of packets from a source computer to a destination, which can be another host, a multicast group, or a broadcast domain. A business flow, packet flow, or network flow is a sequence of packets belonging to the same session / connection. The first type of scheduling in packet processing is atomic scheduling. Atomic scheduling ensures that processing in a specific level is performed in the order in which packets are passed in in the same business flow. In addition, for this level, atomic scheduling limits the number of cores used to process a business flow to 1. The second type of scheduling in packet processing is in-order scheduling, where traffic flows can be processed simultaneously on two or more cores while preserving the incoming order of the packets. The third type of scheduling is parallel scheduling, where all cores can process all traffic flows simultaneously without preserving the incoming order of the packets. For parallel scheduling, at least two CPU cores are preferred.
[0094] A separate processing stage is typically required to perform anti-replay services for a single IPsec SA. As disclosed in Internet Engineering Task Force (IETF) Request for Comments (RFC) 4303, IPsec allows two levels of verification of the sequence number (SN) of a packet via anti-replay services. This is allowed because many cryptographic hardware accelerators cannot handle decryption and / or authentication at line rate. As disclosed in IETF RFC 8238, the line rate or physical layer frame rate is the maximum capacity to send frames of a certain size at the transmit clock frequency of the device under test (DUT). The first level of anti-replay services protects the system from "overload" attacks, while the second level is required because the information in the IPsec header is not trustworthy until it has been authenticated. If the cryptographic hardware accelerator can handle the line rate, the first level of anti-replay services is not required.
[0095] IPsec SA is a set of standards and protocols that support secure communication of packets. IPsec SA ensures that packets are transmitted from IP addresses across network boundaries and vice versa. Media Access Control Security (MACsec) SA is a set of standards and protocols that support secure communication of Ethernet frames. MACsec SA ensures that frames are securely transmitted within a local area network (LAN). DTLS SA is a set of standards and protocols that protect network services.
[0096] The two main modes in IPSec are tunnel mode and transport mode. In IPsec tunnel mode, the contents of the original IP packet are encapsulated to become the payload of a new IP packet. Additionally, a new IP header is added on top of the original IP packet. The IP of the original IP packet is called the inner IP, and the IP of the new IP packet is called the outer IP. Because the new packet is created using the original information, tunnel mode is useful for protecting traffic between different networks. An additional advantage of this mode is that it makes it very easy to establish a "tunnel" between two secure IPsec gateways. In IPsec transport mode, the original IP header is retained. In other words, the payload data sent within the original IP packet is protected, but the IP header is not protected. In transport mode, encrypted traffic is sent directly between two hosts that previously established a secure IPsec tunnel.
[0097] The replay protection service for MACsec behaves the same way for frames as the anti-replay service in IPsec behaves for IP packets. The corresponding term for the anti-replay window in MACsec is the replay window. The corresponding term for the IPsec sequence number in MACsec is the packet number. For DTLS, the anti-replay service behaves the same way as the anti-replay service in IPSec. Therefore, the present invention and all various embodiments extend to all functions of replay protection for MACsec and DTLS as well.
[0098] As previously described, the present disclosure relates to replacing a single anti-replay window with multiple instances or multiple sub-anti-replay windows while maintaining protection against anti-replay attacks and providing integrity protection for data in a packet stream or a service stream. The anti-replay service of the present disclosure can be interchangeably referred to as a scalable anti-replay service. For each packet, a hash value based on an integrity-protected packet header and / or payload is calculated. Then, the calculated hash value is used to direct a specific packet to a specific sub-window. In other words, the calculated hash value is used to determine a sub-anti-replay window among the sub-anti-replay windows. Each sub-anti-replay window is based on a calculated hash value, which is in turn completely / only based on data obtained from a specific packet, so that for potential attackers, the sub-anti-replay window is actually immutable. Therefore, protection against anti-replay attacks is ensured or at least increased. One of the multiple advantages of this method is that multiple sub-anti-replay windows will reduce load and storage contention, which leads to a reduction in CPU interruptions. As described herein, in the case where atomic scheduling is used for anti-replay services, the need for cross-core CPU synchronization will be significantly reduced.
[0099] Protection against replay attacks for the disclosed scalable anti-replay service will be performed by using the calculated hash value as the IPsec SA ID, rather than using a conventional implementation in which the security parameter index (SPI) from the IPsec header is used as the IPsec SA identifier (ID). As previously described, the hash value should be constructed in such a way that it is only a function of the payload so that the same or replayed packets hit the same sub-anti-replay window. In other words, the sub-anti-replay window is determined within the sub-anti-replay window based on a hash calculation that uses data from the integrity-protected portion of the first packet and the second packet as the only input to generate a derived sub-anti-replay window identifier for each of the first packet and the second packet. For each identical or replayed packet, the derived sub-anti-replay window identifier is the same. In some embodiments, a hash value is generated by applying a hash function to a portion of the payload. Examples of hash functions include, but are not limited to, XOR, cyclic redundancy check (CRC), secure hash algorithm (SHA), and message digest (MD). In some embodiments, instead of using a hash function, the calculated hash value may be one or more bits from a payload, where the payload is encrypted. In some embodiments, the calculation of the hash value is performed on a network interface card (NIC).
[0100] If the order of packets in a stream is important, ordered scheduling must be used for the first anti-replay level, because using anything other than the IPsec SA (SPI index + IP destination) to identify the sub-anti-replay window will cause packets in the stream to be out of order. The order of packets in the stream is important for backhaul communications. If IPsec is used for forwarding in the future, the order of packets in the stream will not be important, and therefore, atomic scheduling can be used for the first anti-replay level. If ordered scheduling is used, the data structure in the sub-anti-replay window must be protected by a "lock". If the field used to identify the sub-anti-replay window is the same as the field used to identify the stream, atomic scheduling can be used. In the above scenario, the stream ID is equivalent to the sub-anti-replay window ID. If atomic scheduling is used, the data structure of the sub-anti-replay window does not have to be protected by a "lock". According to one embodiment, the CPU is configured to: if the sequence numbers of the first packet and the second packet are different, the first packet and the second packet are distributed to different sub-anti-replay windows. According to another embodiment, the CPU is configured to: if the sequence numbers of the first packet and the second packet are different, the first packet and the second packet are distributed to the same sub-anti-replay window.
[0101] The number of sub-anti-replay windows can be determined by “N sub " indicates. sub Should preferably be large enough to provide parallelism, but small enough not to use too much memory and / or cause too many cache misses. In some embodiments, N sub Equal to the number of traffic flows to avoid synchronization issues. In one embodiment, the number of sub-anti-replay windows is hard-coded / predetermined by the operator. In another embodiment, the number of sub-anti-replay windows is dynamic and determined using a machine learning approach.
[0102] If the left and right edges of the sliding window are not updated periodically, the extremely uneven distribution of packets to the sub-anti-replay windows will result in a large jump in SN and also temporarily result in a larger window size. One reason for the uneven distribution is suboptimal packet scheduling. In order to alleviate this potential problem, a mechanism must be implemented to periodically update / synchronize the left and right edges of the sub-anti-replay window. The window size is not fixed because it is the lowest value of the left edge and the highest value of the right edge in any corresponding sub-anti-replay window at any time. The window size will be dynamic until periodic synchronization, but after periodic synchronization (i.e., before the first packet arrives), the window size will be fixed. It can, for example, be a shared left and / or right edge protected by a sequence lock (seqlock) that is periodically updated. In other words, the window size is not only based on packets. If the various embodiments of the method described herein are introduced into a pipeline that already performs load balancing based on packet content, further gains can be obtained because no "extra" processing stage needs to be added, and inter-core anti-replay window synchronization will no longer be required.
[0103] exist Figure 1A , 1B With the help of FIG. 2 , the current implementation and sliding window for IPSec (ie, the prior art with respect to the present invention) are shown to more easily disclose how the present invention differs from the prior art. Figure 1A A current implementation of an anti-replay service for IPsec in tunnel mode is shown. A receiver including a CPU is configured to receive incoming packets from a single IPsec SA before or after decryption. The receiver also includes an encryption hardware accelerator. The CPU is also configured to process incoming packets to read the outer IP of the packet. The CPU is also configured to process packets in which the remaining contents of the packets are queued except for the inner IP of the first level of anti-replay service. Because many encryption hardware accelerators cannot process decryption and / or authentication at line rate, the first level of anti-replay service is implemented. The first level effectively protects the system including the CPU and the hardware accelerator from overload attacks. The hardware accelerator is configured to perform computationally intensive encryption operations on the contents of the packets. The hardware accelerator is also configured to queue the contents of the packets before passing them to the second level of anti-replay service. The second level of anti-replay service is required because the information in the IPsec header is not credible before it has been authenticated. If the hardware accelerator is capable of handling line rate, the first level of anti-replay service is not required. After the second level of anti-replay services, the CPU is configured to send the contents of the packet to the process and queue the contents before reading the inner IP of the packet.
[0104] Figure 1BA current implementation of an anti-replay service for IPsec in transport mode is shown. A receiver including a CPU is configured to receive incoming packets from a single IPsec SA before or after decryption. The receiver also includes an encryption hardware accelerator. The CPU is further configured to process incoming packets to read the original IP of the packet. The CPU is further configured to process packets where the rest of the contents of the packets are queued except for the internal IP of the first level of the anti-replay service. The hardware accelerator is configured to perform computationally intensive cryptographic operations on the contents of the packets. The hardware accelerator is further configured to queue the contents of the packets before passing them to the second level of the anti-replay service.
[0105] Figure 2 A sliding window for IPsec anti-replay service is shown. The sliding window includes a left edge and a right edge. Consider a sliding window duration of N to N+13. The sliding window can, for example, accept 14 packets at a time, that is, the window size of the sliding window is 14. In this case, the lowest sequence number N is the left edge and the highest sequence number N+13 is the right edge.
[0106] Figure 3A It is shown that in the multi-core CPU 110 ( Figure 4 , 58). In S301, the CPU 110 divides the anti-replay window for SA into at least two sub-anti-replay windows, wherein each sub-anti-replay window is assigned a sub-anti-replay window identifier. In S302, the CPU 110 receives a first packet and a second packet, wherein each of the first packet and the second packet includes a portion protected by integrity. In S303, the CPU 110 determines a sub-anti-replay window among the sub-anti-replay windows for each of the first packet and the second packet based on a hash calculation. In other words, the CPU 110 guides the first packet and the second packet to a sub-anti-replay window among the sub-anti-replay windows for each of the first packet and the second packet based on a hash calculation. The hash calculation determined from the CPU uses data from the integrity-protected portion of the first packet and the second packet as the only input to generate a derived sub-anti-replay window identifier for each of the first packet and the second packet. In S304, the CPU 110 performs a search for the sub-anti-replay window using the derived sub-anti-replay window identifier of each of the first and second groups against the sub-anti-replay window identifier of each sub-anti-replay window. In other words, the CPU 110 performs a search for the sub-anti-replay window in an index, table, storage unit, or CPU register using the derived sub-anti-replay window identifier of each of the first and second groups against the sub-anti-replay window identifier of each sub-anti-replay window. In S305, the CPU 110 also performs a service, wherein the service uses the derived sub-anti-replay window identifier of each of the first and second groups. In S306, the CPU 110 checks whether the SN of the second group and the first group for a specific SA are the same. If the SN of the first group and the second group are the same, then in S306a, the CPU 110 processes the first group and rejects the second group. If the SNs of the first packet and the second packet are different, then in S306b, the CPU 110 processes the first packet and the second packet, ie, accepts both the first packet and the second packet.
[0107] Figure 3B is a flow chart showing an embodiment of a method in a multi-core CPU 110. The method includes Figure 3A However, instead of or in addition to executing S305, the CPU 110 executes an anti-replay service or a replay protection service in S307, wherein the service uses the derived sub-anti-replay window identifier of each of the first packet and the second packet.
[0108] Figure 4A schematic block diagram of a CPU 110 placed within an apparatus 450 according to one or more embodiments is shown. The apparatus 450 may be, but is not limited to, any of the following: an electronic device, a telecommunications system node, and a network node. The apparatus herein also includes (optionally) a NIC 410. The NIC 410 may be connected to the CPU via a component such as a Peripheral Component Interconnect Express (PCIe) or any other connector.
[0109] Figure 5 1 shows a schematic block diagram of a CPU 110 according to other embodiments. As shown in the figure, the CPU 110 implements various functional components, units or modules via, for example, a bus interface 510, a core 1 520, a core 2 521, a core N 522, etc. and / or via software code. For example, these functional components, units or modules for implementing the method herein may include, for example, a method for implementing the method according to the combination Figure 3B The number of kernels of the anti-replay service of the disclosed embodiment can be any number greater than or equal to 2.
[0110] Figure 6A tabular format is shown for an example of an anti-replay service over an IPsec SA having an ESP header, an anti-replay window size = 4, and two sub-anti-replay windows (and therefore having a 1-bit sub-anti-replay window ID, i.e., sub-anti-replay window ID = {0, 1}). For each incoming packet, a decision is issued as an output. The decision (which may also be referred to as a decision, acceptance, or result) indicates whether the packet will be accepted or discarded by the CPU 110. As an example, consider the initial window left edge = 0 and the window right edge = 3, so the window range or window is 0-3. If the first incoming packet has an ESP SN = 2 and a payload-based sub-anti-replay window ID = 0, the CPU 110 provides a decision of "accept", i.e., the CPU 110 accepts the incoming packet. Considering that the left edge of the sub-anti-replay window is updated periodically or after a certain amount of time has passed, the new left edge = 1. The period of updating the left edges of the two sub-anti-replay windows is based on a timer. In addition, if the second incoming packet has ESP SN=4 and payload-based sub-anti-replay window ID=0, the CPU 110 provides a decision of "accept", that is, the CPU 110 accepts the incoming packet. Therefore, the right edge of the sub-anti-replay window is updated to 4, because the right edge is updated each time the SN is higher than the current right edge. Therefore, the new sub-anti-replay window ranges from 1 to 4. The timer for updating the edge can be configured based on the packet or any other fixed time (e.g., 1 millisecond). In addition, if the third incoming packet has ESP SN=3 and payload-based sub-anti-replay window ID=1, the CPU provides a decision of "accept", that is, the CPU 110 accepts the incoming packet. Further, if the fourth incoming packet has ESP SN=3 and payload-based sub-anti-replay window ID=1, the CPU 110 provides a decision of "discard", that is, the CPU 110 rejects the incoming packet. Furthermore, if the fourth incoming packet has ESP SN=0 and payload-based sub-anti-replay window ID=0, the CPU 110 provides a decision of "discard", that is, the CPU 110 rejects the incoming packet. Therefore, the basis of "acceptance" and "discarding" in the CPU 110 is based on multiple factors, such as ESP SN, sub-anti-replay window ID, and payload-based sub-anti-replay window ID.
[0111] Fig. 7A The ESP packet format is shown. The ESP packet includes a security parameter index (SPI), a SN, a variable payload data, 0-255 padding bytes, a padding length, a next header (usually an identifier of the type of the next header), and a variable integrity check value (ICV). The entire content of the ESP packet is integrity protected. In the present disclosure, the integrity protected portion of the ESP packet is used for hash calculations. The outer IP of the packet is not used for hash calculations.
[0112] Figure 7B The AH packet format is shown. The AH packet includes SPI, SN, payload length, next header, reserved bits, variable integrity check value (ICV), and variable payload. All fields of the AH packet are integrity protected, except for the variable payload. In the present disclosure, the integrity protected portion of the ESP packet is used for hash calculation.
[0113] Figure 8 An example of a CPU 110 implemented according to one or more embodiments is shown. The CPU 110 is adapted to / configured to / operable to perform a set of operations or steps S301, S302, S303, S304, S305, S306, S306a, S306b, S307 as described above, for example, by executing instructions stored in the memory 810. The CPU 110 herein includes a plurality of cores: core 1 820, core 2 821 to core N 822. In this regard, the CPU 110 may implement specific functional components, units or modules. The memory 810 may be or include one or more non-volatile storage media and / or one or more volatile storage media. In one embodiment, a computer program product 910 may be provided in the CPU 110. For Fig. 9 Such a computer program product is described.
[0114] The memory 810 may store any suitable instructions, data, or information, including software, applications (including one or more of logic, rules, codes, tables), and / or other instructions / computer program codes that can be executed by the CPU 110. The memory 810 may also be used to store any calculations performed by the CPU 110 and / or any data received via an input / output (I / O) interface circuit 830, such as input from the CPU 110. In some embodiments, the CPU 110 and the memory 810 are integrated. The I / O interface circuit 830 is configured to send information to and / or receive information from one or more other electronic devices, such as via an input cable.
[0115] Fig. 9An example of a computer program product 910 is shown. In one embodiment, the computer program product 910 is in the CPU 110. The computer-readable storage medium 920 of the computer program product 910 is a non-temporary computer-readable medium, such as a magnetic medium (e.g., a hard disk), an optical medium, and a storage device (e.g., a flash memory). The computer-readable storage medium 920 stores a computer program 930 including computer-readable instructions. In some embodiments, the computer-readable instructions of the computer program 930 are configured so that when executed by the CPU 110, the computer-readable instructions cause the CPU 110 to perform the steps described herein (e.g., S301, S302, S303, S304, S305, S306, S306a, S306b, S307). In other embodiments, the CPU 110 may be configured / operable to perform the steps described herein without code. That is, for example, the CPU 110 may include only one or more ASICs. Therefore, the features of the embodiments described herein may be implemented in hardware and / or software. In other words, the computer program product 910 includes a computer-readable storage medium 920 on which a computer program 920 is stored, wherein the computer program 920 causes the CPU 110 to perform any or all of the various embodiments herein.
[0116] The above-mentioned computer program 920 can also be provided, for example in the form of a data carrier carrying the computer program 920, which is used to perform the embodiments of this document when loaded into the hardware. One such carrier can take the form of a CDROM disk. However, other data carriers such as memory sticks are feasible. In addition, the computer program 920 can be provided as pure program code on a server and downloaded to the hardware device at the time of production and / or during software updates.
[0117] Fig.10 A schematic block diagram of a scalable anti-replay service according to an embodiment of the present invention is shown. A receiver 100 including a CPU 110 is configured / adapted to receive an incoming packet from an IPsec SA. The receiver 100 also includes an optional encryption hardware accelerator 120. The packet is sent to an optional first level of anti-replay. Then, based on the derived sub-anti-replay window identifier, the packet is distributed to different sub-anti-replay windows. A sub-anti-replay window is selected or determined among the sub-anti-replay windows based on a calculated hash value, which uses data from an integrity-protected portion of the packet as the only input to generate a derived sub-anti-replay window identifier. The output from the sub-anti-replay windows 0...N is sent to encryption hardware to perform encryption operations. The output of the encryption hardware 120 is sent to the second level of anti-replay, where the incoming data is distributed to the sub-anti-replay windows 0...N and is accepted or discarded based on the SN of the packet.
[0118] Fig.11 A schematic block diagram of an anti-replay service in a system including a receiver 100 using atomic scheduling or ordered scheduling is shown. The receiver 100 is configured to perform a load balancing function, which helps to distribute incoming packets to worker threads. As previously described, the receiver 100 includes a CPU 110 and may or may not include an encryption hardware accelerator 120. The CPU 110 is a multi-core CPU. In addition, the CPU 110 may include one or more worker threads and a storage unit 810. The receiver 100 is configured to receive incoming packets and then distribute the packets to worker threads 1...N of the anti-replay service as part of the load balancing function. In one embodiment, the anti-replay service is performed in an atomic or ordered level, so the worker threads 1...N are configured to perform the anti-replay service in an atomic or ordered scheduling manner. Multiple worker threads can process packets from the same IPsec SA at a time, thereby improving parallelism in the case of a multi-core CPU 110. Then, the CPU 110 is also configured to receive output from the atomic or ordered level of the anti-replay service in the form of a business flow. In the anti-replay service according to the present invention, each SA has at least two sub-anti-replay windows. Based on a load balancer placed inside or outside the receiver 100, each service flow will be distributed to sub-anti-replay windows 0...N. Therefore, the CPU 110 with multiple cores can fully utilize the potential of multiple cores, or at least improve the scalability and / or efficiency of the receiver 100. In one embodiment, the CPU 110 is configured to: operate each sub-anti-replay window on a separate core, thereby improving the scalability of the anti-replay service. The CPU 110 is also configured to: perform an anti-replay service, in which incoming packets are accepted or rejected based on their SN. In one embodiment, the CPU 110 is configured to: perform an anti-replay service based on the sliding window size and / or the right edge or left edge of the window.
[0119] The CPU 110 includes a plurality of cores, wherein the CPU is configured to: divide an anti-replay window for an SA into at least two sub-anti-replay windows, wherein each sub-anti-replay window is assigned a sub-anti-replay window identifier; receive a first packet and a second packet, each of the first packet and the second packet including an integrity-protected portion; for each of the first packet and the second packet, determine a sub-anti-replay window among the sub-anti-replay windows based on a hash calculation, wherein the hash calculation uses data from the integrity-protected portion of the first packet and the second packet as a unique input to generate a derived sub-anti-replay window identifier for each of the first packet and the second packet; perform a search for the sub-anti-replay window using the derived sub-anti-replay window identifier for each of the first packet and the second packet against the sub-anti-replay window identifier of each sub-anti-replay window; and execute a service, wherein the service uses the derived sub-anti-replay window identifier for each of the first packet and the second packet to perform the following operations: accept the first packet and reject the second packet if the sequence numbers of the second packet and the first packet are the same, and accept the first packet and the second packet if the sequence numbers of the first packet and the second packet are different. In one embodiment, the service is an anti-replay service.
[0120] In one embodiment, the CPU 110 is configured to receive one of the first packet and the second packet at two cores of the plurality of cores, respectively. In one embodiment, the CPU 110 is configured to receive the first packet and the second packet at one core of the plurality of cores. In one embodiment, the number of sub-anti-replay windows is less than or equal to 2^[data length (in bits)]. In one embodiment, the CPU is configured to distribute the first packet and the second packet to the same sub-anti-replay window if the sequence number of the first packet and the sequence number of the second packet are the same. In one embodiment, the CPU 110 is configured to receive the third packet, and if the sequence number of the third packet is the same as the sequence number of the first packet, distribute the third packet to the same sub-anti-replay window as the first packet. In one embodiment, the CPU 110 is configured to receive the third packet, and if the sequence number of the third packet is the same as the sequence number of the second packet, distribute the third packet to the same sub-anti-replay window as the second packet. In one embodiment, the CPU 110 is configured to distribute the first packet and the second packet to different sub-anti-replay windows if the sequence numbers of the first packet and the second packet are different. In one embodiment, the CPU 110 is configured to: reject and / or discard the second packet if the sequence number of the first packet is greater than or equal to the sequence number of the second packet, or wherein the CPU is configured to: reject and / or discard the second packet if the sequence number of the first packet is less than or equal to the sequence number of the second packet. In one embodiment, performing anti-replay service on the first packet and the second packet is completed using other bytes in the first packet and the second packet except for the corresponding security parameter index SPI value. In one embodiment, the first packet and the second packet belong to the first business flow and the second business flow. In one embodiment, the CPU 110 is configured to: use atomic scheduling to schedule one of the first business flow and the second business flow at two cores in a plurality of cores, respectively, wherein if the data selected for the business flow identifier is the same as the data selected for determining the sub-anti-replay window, then synchronization is not required when updating the sub-anti-replay window. In one embodiment, the CPU 110 is configured to: use ordered scheduling to schedule one of the first business flow and the second business flow at two cores in a plurality of cores, respectively, wherein the CPU 110 is configured to: determine the contention risk in the service based on the number of sub-anti-replay windows. In one embodiment, the sub-anti-replay window includes a right edge and a left edge, wherein the right edge and the left edge are periodically synchronized. In one embodiment, the CPU 110 is configured to process the sub-anti-replay window on a per-core basis. In one embodiment, the CPU 110 is configured to perform services on the first packet and the second packet in parallel. In one embodiment, the hash calculation for each of the first packet and the second packet always produces the same derived sub-anti-replay window identifier for each of the first packet and the second packet.In one embodiment, the CPU 110 is configured to delegate or offload at least a portion of the hash calculation to the network interface card NIC 410. In one embodiment, the integrity-protected portion of the first packet and the second packet is the Encapsulating Security Payload ESP header, payload data, and ESP trailer in each of the first packet and the second packet. In one embodiment, the data in the integrity-protected portion from each of the first packet and the second packet is encrypted. In one embodiment, the hash calculation for each of the first packet and the second packet includes extracting the encryption bits of each of the first packet and the second packet. In another embodiment, the data in the integrity-protected portion from each of the first packet and the second packet is not encrypted. In one embodiment, the SA is an IPSec SA or a MACSec SA or a DTLS SA.
[0121] Most cloud environments use standard unified server platforms working in parallel to provide flexibility and / or scalability. It is very difficult to add hardware accelerators to one or more server platforms because it jeopardizes the consistency provided by the server platforms. Therefore, it is very important to use better software implementations running on general-purpose processors for tasks that are usually offloaded to hardware accelerators. The present disclosure enables a scalable IPsec gateway (GW) to be implemented in a cloud-native manner. In other words, the present disclosure enables scalable services, such as anti-replay services or replay protection services, to be implemented on general-purpose CPUs that can be used for current and future cloud environments.
[0122] Those skilled in the art recognize that the present invention is by no means limited to the above-described embodiments. On the contrary, within the scope of the appended claims, many modifications and variations are possible. An example of the receiver 100 is a base station, a UE, a computer, a router, a switch, or any other device capable of networking. Examples of base stations include, but are not limited to, a node B, an evolved node B (eNB), an NR node B (gNB), a radio access point (AP), a relay node, a remote radio head (RRH), a node in a distributed antenna system (DAS), and the like. In addition, the CPU 110 can be used for any 3GPP standard (e.g., 3G, 4G, 5G, 6G, and higher standards) or a non-3GPP standard (e.g., a low power wide area network (LoRaWAN), Sigfox, a wireless local area network (WLAN), and higher standards). The CPU 110 described in various embodiments herein improves the scalability of the anti-replay function in any SA-based protocol (e.g., IPsec, MACsec, and DTLS).
[0123] Those skilled in the art will also understand that Figure 8The blocks in the representation of the CPU 110 in the embodiment may refer to a combination of analog and digital circuits that are configured with software and / or firmware stored, for example, in one or more local storage units, which, when executed by the CPU 110, performs steps S301, S302, S303, S304, S305, S306, S306a, S306b, S307 as described above. The CPU 110 as described in the present invention and any other combination of analog and digital circuits may be included in a single application specific integrated circuit (ASIC), or multiple controllers and various digital hardware may be distributed among multiple separate components, whether individually packaged or assembled into a system on a chip (SoC).
Claims
1. A method related to a security association SA and executed by a central processing unit CPU (110) including multiple cores, the method comprising: dividing the anti-replay window for the SA into at least two sub-anti-replay windows, wherein each of the sub-anti-replay windows is assigned a sub-anti-replay window identifier; receiving a first packet and a second packet, each of the first packet and the second packet including an integrity protected portion; for each of the first packet and the second packet, determining a sub-anti-replay window among the sub-anti-replay windows based on a hash calculation using data from the integrity-protected portions of the first packet and the second packet as a sole input to produce a derived sub-anti-replay window identifier for each of the first packet and the second packet; performing a lookup of the sub-anti-replay window using the derived sub-anti-replay window identifier of each of the first group and the second group against the sub-anti-replay window identifier of each of the sub-anti-replay windows; performing a service, wherein the service uses the derived sub-anti-replay window identifier of each of the first packet and the second packet to: If the sequence numbers of the first packet and the second packet are the same, accepting the first packet and rejecting the second packet, and If the sequence numbers of the first packet and the second packet are different, the first packet and the second packet are accepted.
2. The method according to claim 1, wherein: The service is an anti-replay service.
3. The method according to any one of claims 1 or 2, comprising: One of the first packet and the second packet is received at two cores of the plurality of cores, respectively.
4. The method according to any one of claims 1 to 3, comprising: The first packet and the second packet are received at a core of the plurality of cores.
5. The method according to any one of claims 1 to 4, wherein: The number of sub-anti-replay windows is less than or equal to 2^[data length (in bits)].
6. The method according to any one of claims 1 to 5, comprising: If the sequence number of the first packet is equal to the sequence number of the second packet, the first packet and the second packet are distributed to the same sub-anti-replay window.
7. The method according to any one of claims 1 to 6, comprising: A third packet including the integrity protected portion is received, and if a sequence number of the third packet is the same as a sequence number of the first packet, the third packet is distributed to the same sub-anti-replay window as the first packet.
8. The method according to any one of claims 1 to 6, comprising: A third packet including the integrity protected portion is received, and if a sequence number of the third packet is the same as a sequence number of the second packet, the third packet is distributed to the same sub-anti-replay window as the second packet.
9. The method according to any one of claims 1 to 8, comprising: If the sequence numbers of the first packet and the second packet are different, the first packet and the second packet are distributed to different sub-anti-replay windows.
10. The method according to any one of claims 1 to 9, comprising: If the sequence number of the first packet is greater than or equal to the sequence number of the second packet, discard the second packet, or If the sequence number of the first packet is less than or equal to the sequence number of the second packet, the second packet is discarded.
11. The method according to any one of claims 2 to 10, wherein: The anti-replay service is performed on the first packet and the second packet using bytes other than corresponding security parameter index (SPI) values in the first packet and the second packet.
12. The method according to any one of claims 1 to 11, wherein: The first packet and the second packet belong to a first service flow and a second service flow.
13. The method according to claim 12, comprising: Atomic scheduling is used to schedule one of the first service flow and the second service flow at two cores among the multiple cores, respectively.
14. The method according to any one of claims 12 or 13, wherein: If the data selected for the service flow identification is the same as the data selected for determining the sub-anti-replay window, synchronization is not required when updating the sub-anti-replay window.
15. The method according to claim 12, comprising: One of the first service flow and the second service flow is scheduled at two cores of the plurality of cores respectively using in-order scheduling.
16. The method according to claim 15, comprising: Based on the number of sub-anti-replay windows, a contention risk in the service is determined.
17. The method according to any one of claims 1 to 16, wherein: The sub-anti-replay window includes a right edge and a left edge.
18. The method according to claim 17, comprising: The right edge and the left edge are synchronized periodically.
19. The method according to any one of claims 1 to 18, comprising: The sub-anti-replay windows are processed on a per-core basis.
20. The method according to any one of claims 1 to 19, comprising: The service is performed on the first packet and the second packet in parallel.
21. The method according to any one of claims 1 to 20, wherein: The hash calculation for each of the first packet and the second packet always produces the same derived sub-anti-replay window identifier for each of the first packet and the second packet.
22. The method according to any one of claims 1 to 21, comprising: The hash calculation is performed in the network interface card NIC 410 .
23. The method according to any one of claims 1 to 22, wherein: The integrity-protected portions of the first packet and the second packet are an Encapsulating Security Payload (ESP) header, payload data, and an ESP trailer in each of the first packet and the second packet.
24. The method according to any one of claims 1 to 23, wherein: The data in the integrity-protected portion from each of the first packet and the second packet is encrypted.
25. The method according to claim 24, wherein: The hash calculation for each of the first packet and the second packet includes extracting encryption bits of each of the first packet and the second packet.
26. The method according to any one of claims 1 to 25, wherein: The data in the integrity-protected portion from each of the first packet and the second packet is not encrypted.
27. The method according to any one of claims 1 to 24, wherein: The SA is an Internet Protocol security IPSec SA.
28. The method according to any one of claims 1 to 24, wherein: The SA is a Media Access Control Protocol Security MACSec SA.
29. The method according to any one of claims 1 to 24, wherein: The SA is the Datagram Transport Layer Security DTLS SA.
30. A central processing unit (CPU) (110) comprising a plurality of cores, the CPU being configured to: The anti-replay window for SA is divided into at least two sub-anti-replay windows, wherein: Each of the sub-anti-replay windows is assigned a sub-anti-replay window identifier; receiving a first packet and a second packet, each of the first packet and the second packet including an integrity protected portion; for each of the first packet and the second packet, determining a sub-anti-replay window among the sub-anti-replay windows based on a hash calculation using data from the integrity-protected portions of the first packet and the second packet as a sole input to produce a derived sub-anti-replay window identifier for each of the first packet and the second packet; performing a lookup of the sub-anti-replay window using the derived sub-anti-replay window identifier of each of the first group and the second group against the sub-anti-replay window identifier of each of the sub-anti-replay windows; performing a service, wherein the service uses the derived sub-anti-replay window identifier of each of the first packet and the second packet to: If the sequence numbers of the first packet and the second packet are the same, accepting the first packet and rejecting the second packet, and If the sequence numbers of the first packet and the second packet are different, the first packet and the second packet are accepted.
31. The CPU according to claim 30, wherein: The service is an anti-replay service.
32. The CPU according to any one of claims 30 or 31, configured to receive one of the first packet and the second packet at two cores among the plurality of cores, respectively.
33. The CPU according to any one of claims 30 to 32, configured to receive the first packet and the second packet at one core among the plurality of cores.
34. The CPU according to any one of claims 30 to 33, wherein: The number of sub-anti-replay windows is less than or equal to 2^[data length (in bits)].
35. The CPU according to any one of claims 30 to 34, configured to: if the sequence number of the first packet and the sequence number of the second packet are the same, distribute the first packet and the second packet to the same sub-anti-replay window.
36. A CPU according to any one of claims 30 to 35, configured to: receive a third packet including an integrity-protected portion, and if the sequence number of the third packet is the same as the sequence number of the first packet, distribute the third packet to the same sub-anti-replay window as the first packet.
37. A CPU according to any one of claims 30 to 35, configured to: receive a third packet including an integrity-protected portion, and if the sequence number of the third packet is the same as the sequence number of the second packet, distribute the third packet to the same sub-anti-replay window as the second packet.
38. The CPU according to any one of claims 30 to 37, configured to distribute the first packet and the second packet to different sub-anti-replay windows if the sequence numbers of the first packet and the second packet are different.
39. The CPU according to any one of claims 30 to 38, configured to: If the sequence number of the first packet is greater than or equal to the sequence number of the second packet, discard the second packet, or If the sequence number of the first packet is less than or equal to the sequence number of the second packet, the second packet is discarded.
40. The CPU according to any one of claims 31 to 39, wherein: The anti-replay service for the first packet and the second packet is performed using other bytes in the first packet and the second packet except for the corresponding security parameter index SPI values.
41. The CPU according to any one of claims 30 to 40, wherein: The first packet and the second packet belong to a first service flow and a second service flow.
42. The CPU according to claim 41, configured to: use atomic scheduling to schedule one of the first service flow and the second service flow at two cores among the plurality of cores respectively.
43. The CPU according to any one of claims 41 or 42, wherein: If the data selected for the service flow identification is the same as the data selected for determining the sub-anti-replay window, synchronization is not required when updating the sub-anti-replay window.
44. The CPU according to claim 41, configured to: schedule one of the first service flow and the second service flow at two cores of the plurality of cores respectively using in-order scheduling.
45. The CPU of claim 44, configured to determine a contention risk in the service based on a number of sub-anti-replay windows.
46. The CPU according to any one of claims 30 to 45, wherein: The sub-anti-replay window includes a right edge and a left edge.
47. The CPU of claim 46, configured to periodically synchronize the right edge and the left edge.
48. The CPU according to any one of claims 30 to 47, configured to process the sub anti-replay window on a per-core basis.
49. The CPU according to any one of claims 30 to 48, configured to perform the service on the first packet and the second packet in parallel.
50. The CPU according to any one of claims 30 to 49, wherein: The hash calculation for each of the first packet and the second packet always produces the same derived sub-anti-replay window identifier for each of the first packet and the second packet. 51 . The CPU according to claim 30 , being configured to delegate the hash calculation to a network interface card NIC 410 .
52. The CPU according to any one of claims 30 to 51, wherein: The integrity-protected portions of the first packet and the second packet are an Encapsulating Security Payload (ESP) header, payload data, and an ESP trailer in each of the first packet and the second packet.
53. The CPU according to any one of claims 30 to 52, wherein: The data in the integrity-protected portion from each of the first packet and the second packet is encrypted.
54. The CPU according to claim 53, wherein: The hash calculation for each of the first packet and the second packet includes extracting encryption bits of each of the first packet and the second packet.
55. The CPU according to any one of claims 30 to 54, wherein: The data in the integrity-protected portion from each of the first packet and the second packet is not encrypted.
56. A CPU according to any one of claims 30 to 53, wherein: The SA is an Internet Protocol security IPSec SA.
57. A CPU according to any one of claims 30 to 53, wherein: The SA is a Media Access Control Protocol Security MACSec SA.
58. The CPU according to any one of claims 30 to 53, wherein: The SA is the Datagram Transport Layer Security DTLS SA.
59. A computer program (930) comprising instructions which, when executed on a central processing unit (CPU) (110) having a plurality of cores (820; 821; 822), cause the CPU (110) to perform a method according to any one of claims 1 to 29.
60. A computer program product (910) comprising a non-transitory computer readable storage medium (920) having stored thereon a computer program (930) according to claim 59.
