Embedded Security explained: IPsec and IKEv2 for embedded Systems

1. IPSec (Internet Protocol Security)

IPsec is a standardized protocol suite for securing IP-based communication. In embedded systems, IPsec is commonly used to secure communication between devices, gateways, or distributed systems operating under strict resource and link constraints. Unlike application-layer security mechanisms, IPsec protects all IP traffic, independent of the application protocol. This makes it suitable for embedded platforms where multiple services share the same network interface or where applications cannot easily be modified.

It operates at the network layer and protects IP packets through encryption and authentication. IPSec uses two modes: 

  • In transport mode, only the payload (data) of the IP packet is encrypted, while the original IP header remains visible. This mode is typically used for host-to-host communication.
  • In tunnel mode, the entire IP packet, including the header and payload (data), is encrypted and encapsulated inside a new IP packet. Tunnel mode is commonly used in gateway-based architectures, such as device-to-gateway or network-to-network communication.

The choice between transport and tunnel mode is an architectural decision and depends on network topology, trust boundaries, and system constraints.

2. IPsec Components

Rather than a single protocol, IPsec consists of a framework composed of several standardized components:

  • Authentication Header (AH): AH provides integrity protection and data origin authentication for IP packets, but does not offer encryption. Because AH does not protect confidentiality and is sensitive to changes in IP headers it is rarely used in practical embedded deployments.
  • Encapsulating Security Protocol (ESP): ESP is the primary data protection mechanism of IPsec. It provides encryption and can additionally offer integrity protection and authentication. In embedded systems, ESP is almost always used to secure data traffic.
  • Security Associations (SA): They define how traffic is protected, including cryptographic algorithms, keys, and lifetimes. Each IPsec connection relies on one or more SAs.

3. IPsec/IKEv2

While IPsec protects the data plane, IKEv2 (Internet Key Exchange version 2) operates on the control plane. IKEv2 is responsible for establishing and managing Security Associations.

IKEv2 handles:

  • Mutual authentication of peers
  • Secure key exchange (classical or post-quantum)
  • Negotiation of cryptographic parameters
  • Rekeying and recovery from packet loss or link interruptions  

In embedded systems, many IPsec-related issues are not caused by encryption itself, but by key management behavior under real-world conditions such as latency, packet loss, or limited MTU sizes.

4. Embedded Constraints

Deploying IPsec in embedded environments introduces challenges that are uncommon in traditional IT networks:

  • Restricted CPU resources for cryptographic processing: Limited processing capabilities can lead to slow data rates, latency, and an inability to handle high traffic loads.
  • Memory constraints (RAM/Flash): Limited memory, restricting IPsec stack complexity and the size of key and Security Association data.
  • Hardware limitations (acceleration): Without hardware acceleration, cryptographic processing on the CPU limits performance in low-end embedded devices.
  • MTU constraints: IPsec overhead may exceed Maximum Transmission Unit (MTU) limits, leading to fragmentation and efficiency loss.

IPsec and IKEv2 are mature and well-defined standards. In embedded systems, however, they must be treated as architectural building blocks, not just cryptographic features. Successful deployments start with a clear understanding of system constraints, communication patterns, and lifecycle requirements, long before implementation begins.


Explore Cryptography IP:


×
Semiconductor IP