xref: /dpdk/doc/guides/howto/security.rst (revision 8711af290f353f727989684de2e75c7c41d2779a)
1*8711af29SNandini Persad.. SPDX-License-Identifier: BSD-3-Clause
2*8711af29SNandini Persad   Copyright 2024 The DPDK contributors
3*8711af29SNandini Persad
4*8711af29SNandini PersadSecurity Support
5*8711af29SNandini Persad================
6*8711af29SNandini Persad
7*8711af29SNandini PersadThis document describes the security features of interest for DPDK.
8*8711af29SNandini PersadThis guide will provides information on each protocol,
9*8711af29SNandini Persadincluding supported algorithms, practical implementation details, and references.
10*8711af29SNandini Persad
11*8711af29SNandini PersadBy detailing the supported algorithms and providing insights into each security protocol,
12*8711af29SNandini Persadthis document serves as a resource for anyone looking
13*8711af29SNandini Persadto implement or enhance security measures within their DPDK-based environments.
14*8711af29SNandini Persad
15*8711af29SNandini Persad
16*8711af29SNandini PersadRelated Documentation
17*8711af29SNandini Persad---------------------
18*8711af29SNandini Persad
19*8711af29SNandini PersadHere is a list of related documents that provide detail of each library,
20*8711af29SNandini Persadits capabilities and what level of support it currently has within DPDK.
21*8711af29SNandini Persad
22*8711af29SNandini Persad:doc:`../prog_guide/cryptodev_lib`
23*8711af29SNandini Persad   This section contains the design of the crypto API.
24*8711af29SNandini Persad
25*8711af29SNandini Persad:doc:`../cryptodevs/index`
26*8711af29SNandini Persad   This section contains information about all the crypto drivers in DPDK,
27*8711af29SNandini Persad   such as feature support availability, cipher algorithms and authentication algorithms.
28*8711af29SNandini Persad
29*8711af29SNandini Persad:doc:`../prog_guide/rte_security`
30*8711af29SNandini Persad   This library is the session-level glue between ethdev and cryptodev APIs
31*8711af29SNandini Persad   for the supported protocols.
32*8711af29SNandini Persad
33*8711af29SNandini PersadHigh-level protocol processing
34*8711af29SNandini Persad   * :doc:`../prog_guide/ipsec_lib`
35*8711af29SNandini Persad   * :doc:`../prog_guide/pdcp_lib`
36*8711af29SNandini Persad
37*8711af29SNandini Persad
38*8711af29SNandini PersadProtocols
39*8711af29SNandini Persad---------
40*8711af29SNandini Persad
41*8711af29SNandini PersadMACSec
42*8711af29SNandini Persad~~~~~~
43*8711af29SNandini Persad
44*8711af29SNandini PersadMACsec is a network security standard
45*8711af29SNandini Persadthat operates at the medium access control layer
46*8711af29SNandini Persadand defines connectionless data confidentiality
47*8711af29SNandini Persadand integrity for media access independent protocols.
48*8711af29SNandini PersadIt is standardized by the IEEE 802.1 working group.
49*8711af29SNandini Persad
50*8711af29SNandini PersadWikipedia Link
51*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/IEEE_802.1AE
52*8711af29SNandini Persad
53*8711af29SNandini PersadStandard Link
54*8711af29SNandini Persad  * https://1.ieee802.org/security/802-1ae/
55*8711af29SNandini Persad
56*8711af29SNandini PersadLevel of Support in DPDK
57*8711af29SNandini Persad  * Supported
58*8711af29SNandini Persad  * :doc:`Sample Application <../sample_app_ug/l2_forward_macsec>`
59*8711af29SNandini Persad
60*8711af29SNandini PersadSupported Algorithms
61*8711af29SNandini Persad  * As specified by MACsec specification: AES-128-GCM, AES-256-GCM
62*8711af29SNandini Persad
63*8711af29SNandini PersadDrivers
64*8711af29SNandini Persad  * Marvell :doc:`cnxk <../nics/cnxk>`
65*8711af29SNandini Persad  * Marvell/Aquantia :doc:`atlantic <../nics/atlantic>` with PMD-specific API
66*8711af29SNandini Persad  * Intel :doc:`ixgbe <../nics/ixgbe>` with PMD-specific API
67*8711af29SNandini Persad
68*8711af29SNandini PersadFacts
69*8711af29SNandini Persad  * Uses the AES-GCM cryptography algorithm.
70*8711af29SNandini Persad  * Works on layer 2 and protects all DHCP and ARP traffic.
71*8711af29SNandini Persad  * Each MAC frame has a separate integrity verification code.
72*8711af29SNandini Persad  * Prevents attackers from resending copied MAC frames
73*8711af29SNandini Persad    into the network without being detected.
74*8711af29SNandini Persad  * Commonly used in environments where securing Ethernet traffic between devices is critical,
75*8711af29SNandini Persad    such as in enterprise networks, data centers and service provider networks.
76*8711af29SNandini Persad
77*8711af29SNandini PersadCons
78*8711af29SNandini Persad  * Only operates at Layer 2,
79*8711af29SNandini Persad    so it doesn't protect traffic beyond the local Ethernet segment
80*8711af29SNandini Persad    or over Layer 3 networks or the Internet.
81*8711af29SNandini Persad  * Data is decrypted and re-encrypted at each network device,
82*8711af29SNandini Persad    which could expose data at each point.
83*8711af29SNandini Persad  * Can't detect rogue devices that operate on Layer 1.
84*8711af29SNandini Persad  * Relies on hardware for encryption and decryption,
85*8711af29SNandini Persad    so not all network devices can use it.
86*8711af29SNandini Persad
87*8711af29SNandini Persad
88*8711af29SNandini PersadIPsec
89*8711af29SNandini Persad~~~~~
90*8711af29SNandini Persad
91*8711af29SNandini PersadIPsec allows secure communication over the Internet
92*8711af29SNandini Persadby encrypting data traffic between two or more devices or networks.
93*8711af29SNandini PersadIPsec works on a different layer than MACsec, at layer 3.
94*8711af29SNandini Persad
95*8711af29SNandini PersadWikipedia Link
96*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/IPsec
97*8711af29SNandini Persad
98*8711af29SNandini PersadStandard Link
99*8711af29SNandini Persad  * https://datatracker.ietf.org/wg/ipsec/about/
100*8711af29SNandini Persad
101*8711af29SNandini PersadLevel of Support in DPDK
102*8711af29SNandini Persad  * Supported
103*8711af29SNandini Persad  * :doc:`High-level library <../prog_guide/ipsec_lib>`
104*8711af29SNandini Persad  * :doc:`Sample application <../sample_app_ug/ipsec_secgw>`
105*8711af29SNandini Persad
106*8711af29SNandini PersadSupported Algorithms
107*8711af29SNandini Persad  * AES-GCM and ChaCha20-Poly1305
108*8711af29SNandini Persad  * AES-CBC and AES-CTR
109*8711af29SNandini Persad  * HMAC-SHA1/SHA2 for integrity protection and authenticity
110*8711af29SNandini Persad
111*8711af29SNandini PersadDrivers
112*8711af29SNandini Persad  * Intel :doc:`ixgbe <../nics/ixgbe>`, :doc:`iavf <../nics/intel_vf>`,
113*8711af29SNandini Persad    :doc:`qat <../cryptodevs/qat>`, :doc:`ipsec_mb <../cryptodevs/aesni_mb>`
114*8711af29SNandini Persad  * Marvell :doc:`cnxk <../nics/cnxk>`, :doc:`mvsam <../cryptodevs/mvsam>`
115*8711af29SNandini Persad  * Netronome :doc:`nfp <../nics/nfp>`
116*8711af29SNandini Persad  * NXP :doc:`caam_jr <../cryptodevs/caam_jr>`,
117*8711af29SNandini Persad    :doc:`dpaa_sec <../cryptodevs/dpaa_sec>`, :doc:`dpaa2_sec <../cryptodevs/dpaa2_sec>`
118*8711af29SNandini Persad  * Wangxun :doc:`txgbe <../nics/txgbe>`
119*8711af29SNandini Persad
120*8711af29SNandini PersadPros
121*8711af29SNandini Persad  * Uses public keys to create an encrypted, authenticated tunnel.
122*8711af29SNandini Persad  * Offers strong security, scalability, and interoperability.
123*8711af29SNandini Persad  * IPsec can work across routers.
124*8711af29SNandini Persad
125*8711af29SNandini PersadCons
126*8711af29SNandini Persad  * Can be simple to apply but complex to use.
127*8711af29SNandini Persad    It can also be difficult to configure
128*8711af29SNandini Persad    and place an administrative burden on network administrators.
129*8711af29SNandini Persad  * Can impact network performance
130*8711af29SNandini Persad    because it encrypts all traffic and uses strict authentication processes,
131*8711af29SNandini Persad    both of which consume network bandwidth and increase data usage.
132*8711af29SNandini Persad  * IPsec relies on the security of public keys.
133*8711af29SNandini Persad    Key management protocol is not part of DPDK
134*8711af29SNandini Persad    but DPDK provides asymmetric crypto API which is required for key generation.
135*8711af29SNandini Persad
136*8711af29SNandini Persad
137*8711af29SNandini PersadTLS
138*8711af29SNandini Persad~~~
139*8711af29SNandini Persad
140*8711af29SNandini PersadTransport Layer Security (TLS) is a cryptographic protocol
141*8711af29SNandini Persadthat operates at the fifth application layer.
142*8711af29SNandini PersadIt encrypts data sent between web applications and servers,
143*8711af29SNandini Persadsuch as when a web browser loads a website.
144*8711af29SNandini PersadTLS can also be used to encrypt other types of communication, including:
145*8711af29SNandini Persademail, Voice over IP (VoIP), file transfers, video/audio conferencing,
146*8711af29SNandini Persadand Internet services like DNS and NTP.
147*8711af29SNandini Persad
148*8711af29SNandini PersadWikipedia Link
149*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/Transport_Layer_Security
150*8711af29SNandini Persad
151*8711af29SNandini PersadStandard Links
152*8711af29SNandini Persad  * https://datatracker.ietf.org/doc/html/rfc5246 - TLS 1.2
153*8711af29SNandini Persad  * https://datatracker.ietf.org/doc/html/rfc8446 - TLS 1.3
154*8711af29SNandini Persad  * https://datatracker.ietf.org/doc/html/rfc9147 - DTLS 1.3
155*8711af29SNandini Persad
156*8711af29SNandini PersadLevel of Support in DPDK
157*8711af29SNandini Persad  * DPDK supports TLS/DTLS record processing via rte_security API
158*8711af29SNandini Persad
159*8711af29SNandini PersadPros
160*8711af29SNandini Persad  * Considered one of the strongest encryption protocols available.
161*8711af29SNandini Persad  * Doesn't require parties to encrypt the content they exchange.
162*8711af29SNandini Persad  * Universally deployable, doesn't rely on specific operating systems or applications.
163*8711af29SNandini Persad  * Can reduce the risk of phishing attacks.
164*8711af29SNandini Persad
165*8711af29SNandini PersadCons
166*8711af29SNandini Persad  * May not work with complex proxy caching systems.
167*8711af29SNandini Persad  * Adding a server to handle encryption before it gets to the caching server
168*8711af29SNandini Persad    can require additional costs.
169*8711af29SNandini Persad  * TLS can be vulnerable to attacks and data leaks,
170*8711af29SNandini Persad    including downgrade attacks, weak ciphers, and programming errors.
171*8711af29SNandini Persad  * The added layer of security that TLS provides can come at the cost of speed.
172*8711af29SNandini Persad
173*8711af29SNandini Persad
174*8711af29SNandini PersadTLS Handshake
175*8711af29SNandini Persad^^^^^^^^^^^^^
176*8711af29SNandini Persad
177*8711af29SNandini PersadTLS Handshake is the process that kicks off a communication session that uses TLS.
178*8711af29SNandini PersadDuring a TLS handshake, the two communicating sides exchange messages
179*8711af29SNandini Persadto acknowledge each other, verify each other,
180*8711af29SNandini Persadestablish the cryptographic algorithms they will use, and agree on session keys.
181*8711af29SNandini Persad
182*8711af29SNandini PersadWikipedia Link
183*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake
184*8711af29SNandini Persad
185*8711af29SNandini PersadStandard Link
186*8711af29SNandini Persad  * https://datatracker.ietf.org/doc/html/rfc8446#section-4
187*8711af29SNandini Persad
188*8711af29SNandini PersadLevel of Support in DPDK
189*8711af29SNandini Persad  * Handshake as protocol is not implemented in DPDK.
190*8711af29SNandini Persad    However, it supports asymmetric crypto API, which can be used by the protocol.
191*8711af29SNandini Persad
192*8711af29SNandini PersadNote
193*8711af29SNandini Persad  * TLS 1.3 also supports an even faster version of the TLS handshake
194*8711af29SNandini Persad    that does not require any round trips,
195*8711af29SNandini Persad    or back-and-forth communication between client and server, at all.
196*8711af29SNandini Persad
197*8711af29SNandini Persad
198*8711af29SNandini PersadTLS Record
199*8711af29SNandini Persad^^^^^^^^^^
200*8711af29SNandini Persad
201*8711af29SNandini PersadTLS Record Protocol is a layer of the TLS protocol
202*8711af29SNandini Persadthat protects application data using keys created during the TLS handshake.
203*8711af29SNandini Persad
204*8711af29SNandini PersadWikipedia Link
205*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_record
206*8711af29SNandini Persad
207*8711af29SNandini PersadStandard Link
208*8711af29SNandini Persad  * https://datatracker.ietf.org/doc/html/rfc8446#section-5
209*8711af29SNandini Persad
210*8711af29SNandini PersadLevel of Support in DPDK
211*8711af29SNandini Persad  * Supported
212*8711af29SNandini Persad
213*8711af29SNandini PersadSupported Algorithms
214*8711af29SNandini Persad  * 3DES-CBC-SHA1-HMAC, NULL-SHA1-HMAC
215*8711af29SNandini Persad  * AES-GCM-128, AES-GCM-256, AES-128-CBC-SHA1, AES-128-CBC-SHA256,
216*8711af29SNandini Persad  * AES-256-CBC-SHA1, AES-256-CBC-SHA256, AES-256-CBC-SHA384,
217*8711af29SNandini Persad  * CHACHA20-POLY1305
218*8711af29SNandini Persad
219*8711af29SNandini PersadDrivers
220*8711af29SNandini Persad  * Marvell :doc:`cnxk <../cryptodevs/cnxk>`
221*8711af29SNandini Persad
222*8711af29SNandini Persad
223*8711af29SNandini PersadPDCP
224*8711af29SNandini Persad~~~~
225*8711af29SNandini Persad
226*8711af29SNandini PersadPacket Data Convergence Protocol (PDCP) is a sublayer in the LTE radio protocol stack
227*8711af29SNandini Persadthat provides security and integrity protections to Protocol Data Units (PDU)
228*8711af29SNandini Persadin both the control and data planes.
229*8711af29SNandini PersadPDCP is located between the Radio Link Control (RLC) layer
230*8711af29SNandini Persadand the upper layers of the network, such as the IP layer.
231*8711af29SNandini Persad
232*8711af29SNandini PersadWikipedia Link
233*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/Packet_Data_Convergence_Protocol
234*8711af29SNandini Persad
235*8711af29SNandini PersadStandard Link
236*8711af29SNandini Persad  * https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1177
237*8711af29SNandini Persad
238*8711af29SNandini PersadLevel of Support in DPDK
239*8711af29SNandini Persad  * Supported
240*8711af29SNandini Persad  * :doc:`High-level library <../prog_guide/pdcp_lib>`
241*8711af29SNandini Persad  * rte_security based PDCP sessions are also supported
242*8711af29SNandini Persad
243*8711af29SNandini PersadSupported Algorithms
244*8711af29SNandini Persad  * Encryption: NULL, AES-CTR, SNOW 3G, ZUC
245*8711af29SNandini Persad  * Authentication: NULL, AES-CMAC, SNOW 3G, ZUC
246*8711af29SNandini Persad
247*8711af29SNandini PersadDrivers supporting rte_security API (and used with the PDCP library)
248*8711af29SNandini Persad  * NXP :doc:`dpaa_sec <../cryptodevs/dpaa_sec>`, :doc:`dpaa2_sec <../cryptodevs/dpaa2_sec>`
249*8711af29SNandini Persad
250*8711af29SNandini PersadDrivers supported only with the PDCP library
251*8711af29SNandini Persad  * Intel :doc:`qat <../cryptodevs/qat>`, :doc:`ipsec_mb <../cryptodevs/aesni_mb>`
252*8711af29SNandini Persad  * Marvell :doc:`cnxk <../nics/cnxk>`
253*8711af29SNandini Persad
254*8711af29SNandini PersadPros
255*8711af29SNandini Persad  * Compresses the IP header of user plane packets
256*8711af29SNandini Persad    to reduce overhead and optimize bandwidth usage over the radio interface.
257*8711af29SNandini Persad    This is particularly important in mobile networks
258*8711af29SNandini Persad    where radio resources are limited and efficiency is critical.
259*8711af29SNandini Persad  * PDCP encrypts and decrypts user plane data
260*8711af29SNandini Persad    to ensure confidentiality and integrity of data transmitted over the air interface.
261*8711af29SNandini Persad  * Has the option of interoperability between different generations of mobile networks
262*8711af29SNandini Persad    (e.g., LTE and 5G) and compatibility with IP-based networks.
263*8711af29SNandini Persad
264*8711af29SNandini PersadCons
265*8711af29SNandini Persad  * Limitations currently unclear.
266*8711af29SNandini Persad
267*8711af29SNandini Persad
268*8711af29SNandini PersadPSP
269*8711af29SNandini Persad~~~
270*8711af29SNandini Persad
271*8711af29SNandini PersadPSP is a TLS-like protocol created by Google
272*8711af29SNandini Persadfor encrypting data in transit between data centers.
273*8711af29SNandini PersadIt uses concepts from IPsec ESP to create an encryption layer on top of IP,
274*8711af29SNandini Persadand supports non-TCP protocols like UDP.
275*8711af29SNandini PersadGoogle uses PSP along with other protocols,
276*8711af29SNandini Persadsuch as TLS and IPsec, depending on the use case.
277*8711af29SNandini Persad
278*8711af29SNandini PersadLinks
279*8711af29SNandini Persad  * https://cloud.google.com/blog/products/identity-security/announcing-psp-security-protocol-is-now-open-source
280*8711af29SNandini Persad  * https://github.com/google/psp
281*8711af29SNandini Persad
282*8711af29SNandini PersadLevel of Support in DPDK
283*8711af29SNandini Persad  * Not supported in DPDK, but algorithms are supported.
284*8711af29SNandini Persad
285*8711af29SNandini PersadSupported Algorithms
286*8711af29SNandini Persad  * AES-GCM-128
287*8711af29SNandini Persad  * AES-GCM-256
288*8711af29SNandini Persad  * AES-GMAC
289*8711af29SNandini Persad
290*8711af29SNandini PersadPros
291*8711af29SNandini Persad  * PSP is transport-independent and can be offloaded to hardware.
292*8711af29SNandini Persad  * It does not mandate a specific key exchange protocol.
293*8711af29SNandini Persad  * Enables per-connection security by allowing an encryption key
294*8711af29SNandini Persad    per layer-4 connection (such as a TCP connection).
295*8711af29SNandini Persad
296*8711af29SNandini PersadCons
297*8711af29SNandini Persad  * Offers few choices for the packet format and the cryptographic algorithms.
298*8711af29SNandini Persad
299*8711af29SNandini Persad
300*8711af29SNandini PersadWireguard
301*8711af29SNandini Persad~~~~~~~~~
302*8711af29SNandini Persad
303*8711af29SNandini PersadWireguard is an open-source tunneling protocol over UDP.
304*8711af29SNandini Persad
305*8711af29SNandini PersadWikipedia Link
306*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/WireGuard
307*8711af29SNandini Persad
308*8711af29SNandini PersadStandard Link
309*8711af29SNandini Persad  * https://www.wireguard.com/
310*8711af29SNandini Persad
311*8711af29SNandini PersadLevel of Support in DPDK
312*8711af29SNandini Persad  * Not supported at this time, but algorithms are supported.
313*8711af29SNandini Persad
314*8711af29SNandini PersadSupported Algorithms
315*8711af29SNandini Persad  * ChaCha20
316*8711af29SNandini Persad  * Poly1305
317*8711af29SNandini Persad
318*8711af29SNandini PersadPros
319*8711af29SNandini Persad  * Faster than most VPNs.
320*8711af29SNandini Persad  * Straightforward with a lean codebase.
321*8711af29SNandini Persad  * Works with various operating systems such as Linux, Windows, macOS, Android, and iOS.
322*8711af29SNandini Persad  * Quick connections (good for mobile environments).
323*8711af29SNandini Persad
324*8711af29SNandini PersadCons
325*8711af29SNandini Persad  * Has been rapidly adopted, but still a new, young protocol.
326*8711af29SNandini Persad  * May not have the same level of extensive real-world testing and deployment as other VPNs.
327*8711af29SNandini Persad  * Widely supported, but compatibility may still be an issue.
328*8711af29SNandini Persad
329*8711af29SNandini Persad
330*8711af29SNandini PersadQUIC
331*8711af29SNandini Persad~~~~
332*8711af29SNandini Persad
333*8711af29SNandini PersadQUIC (Quick UDP Internet Connections) is a transport layer network protocol
334*8711af29SNandini Persaddesigned by Google to improve the speed and reliability of web connections.
335*8711af29SNandini PersadQUIC is built on top of the User Datagram Protocol (UDP)
336*8711af29SNandini Persadand uses a combination of encryption and multiplexing to achieve its goals.
337*8711af29SNandini PersadThe protocol's main goal is to reduce latency
338*8711af29SNandini Persadcompared to Transmission Control Protocol (TCP).
339*8711af29SNandini PersadQUIC also aims to make HTTP traffic more secure
340*8711af29SNandini Persadand eventually replace TCP and TLS on the web with HTTP/3.
341*8711af29SNandini PersadMedia over QUIC (MoQ) is a new live media protocol powered by QUIC.
342*8711af29SNandini Persad
343*8711af29SNandini PersadWikipedia Link
344*8711af29SNandini Persad  * https://en.wikipedia.org/wiki/QUIC
345*8711af29SNandini Persad
346*8711af29SNandini PersadStandard Link
347*8711af29SNandini Persad  * https://datatracker.ietf.org/doc/html/rfc9000
348*8711af29SNandini Persad
349*8711af29SNandini PersadLevel of Support in DPDK
350*8711af29SNandini Persad  * Not supported yet.
351*8711af29SNandini Persad
352*8711af29SNandini PersadPros
353*8711af29SNandini Persad  * Useful for time-sensitive application like online gaming or video streaming.
354*8711af29SNandini Persad  * Can send multiple streams of data over a single channel.
355*8711af29SNandini Persad  * Automatically limits the packet transmission rate
356*8711af29SNandini Persad    to counteract load peaks and avoid overload, even with low bandwidth connections.
357*8711af29SNandini Persad  * Uses TLS 1.3, which offers better security than others.
358*8711af29SNandini Persad  * Fast data transfer.
359*8711af29SNandini Persad  * Combines features of TCP, such as reliability and congestion control,
360*8711af29SNandini Persad    with the speed and flexibility of UDP.
361*8711af29SNandini Persad
362*8711af29SNandini PersadCons
363*8711af29SNandini Persad  * Has more complex protocol logic,
364*8711af29SNandini Persad    which can result in higher CPU and memory usage compared to TCP.
365*8711af29SNandini Persad  * May result in poorer transmission rates.
366*8711af29SNandini Persad  * Requires changes to client and server, making it more challenging to deploy than TCP.
367*8711af29SNandini Persad  * Not yet as widely deployed as TCP.
368