Skip to main content
  1. Index/

MACsec (IEEE 802.1AE)

MACsec (MAC Security, IEEE 802.1AE) is an IEEE standard, first published in 2006 and supported in the Linux kernel since 4.6 (2016), that encrypts and authenticates Ethernet frames at layer 2 — hop by hop between directly connected devices. Its operating layer is what distinguishes it from IPsec (layer 3) and TLS (layer 4): MACsec wraps Ethernet frames, not IP packets or TCP streams, so it can protect every byte that traverses a link segment regardless of what protocol it carries. ARP replies, DHCP offers, LLDP frames, routing protocol adjacencies, and layer-2 broadcast traffic are all encrypted and authenticated alongside application data — something neither IPsec nor TLS can accomplish because both require an IP header to already be present and unenforced. The topology implication of this is that MACsec is link-local and hop-by-hop: it encrypts between two directly adjacent Ethernet peers (a host and a switch, or two switches), decrypts at each hop for forwarding decisions, and re-encrypts toward the next hop. It cannot stretch across a routed boundary; for that, IPsec is the right tool.

MACsec achieves encryption by inserting a SecTAG (Security Tag) header between the Ethernet source address and the EtherType field of a standard Ethernet frame, and appending an ICV (Integrity Check Value) trailer. The SecTAG carries the SCI (Secure Channel Identifier, derived from the sender’s MAC address and a port ID), the association number identifying the active Secure Association, and a packet number for replay protection. The payload between the SecTAG and ICV is encrypted with AES-GCM-128 (or AES-GCM-256 per the 802.1AEbn amendment), and the ICV cryptographically binds the cleartext Ethernet header, SecTAG, and encrypted payload together — ensuring that neither the addressing information nor the encrypted content can be tampered with without detection. There is no encrypt-only mode: integrity and origin authentication are fundamental to the design. The overhead is a fixed 32 bytes per frame (16-byte SecTAG + 16-byte ICV), so on a standard 1500-byte MTU link the effective payload is 1468 bytes; jumbo frames are strongly recommended for MACsec deployments carrying VXLAN or other encapsulated overlay traffic. Key management is out of scope for 802.1AE itself and is handled by MKA (MACsec Key Agreement, IEEE 802.1X-2010), which establishes Connectivity Associations, derives Secure Association Keys using a two-message exchange, and periodically rotates them. On Linux, MKA is implemented in wpa_supplicant; keys can also be provisioned statically via ip macsec for point-to-point links.

MACsec fits into the network security stack as the encryption layer that closes the gap neither IPsec nor TLS addresses: unencrypted layer-2 control plane traffic and the physical link between a host and its first-hop switch. Its primary deployment contexts are: data centre switch-to-switch links, where it protects east-west traffic on bare-metal Ethernet segments between top-of-rack switches without the CPU overhead of IPsec; host-to-switch access ports, where it provides mutual authentication and encryption before the host is granted network access, typically combined with 802.1X port authentication (the 802.1X EAP session derives the Connectivity Association Key that seeds MKA, giving the two protocols a natural integration); and WAN handoff links, where carrier Ethernet circuits — MPLS hand-offs, metro Ethernet — are encrypted at the Ethernet layer without requiring IPsec concentrators. In Linux virtual network contexts, MACsec can be applied over VXLAN tunnels between hypervisors, encrypting the overlay traffic at the virtual Ethernet level inside the VM rather than relying on the hypervisor’s infrastructure-level encryption — giving tenants cryptographic control over their own traffic independent of the cloud operator. The PQC transition will affect MACsec at the MKA/EAP layer, since the Connectivity Association Key derivation depends on the EAP method’s key material; EAP-TLS with PQC certificates propagates quantum-safe keys into MKA automatically once the TLS and PKI stack is migrated.

Related

IPsec (Internet Protocol Security)

IPsec (Internet Protocol Security) is a suite of IETF standards (core specification RFC 4301) that adds cryptographic security to IP packets at the network layer, transparently to applications running above it. Where TLS secures a specific connection between two application endpoints, IPsec secures all IP traffic between two hosts or networks — including traffic from applications that have no TLS support, protocols that predate encryption (routing protocols, SNMP, ICMP), and layer-3 metadata that TLS cannot protect. IPsec provides two protocol headers: AH (Authentication Header, IP protocol 51) signs the IP packet including immutable header fields, providing integrity and source authentication without confidentiality — rarely used in modern deployments because NAT rewrites fields that AH covers. ESP (Encapsulating Security Payload, IP protocol 50) encrypts the payload and provides authenticated encryption with AES-GCM or ChaCha20-Poly1305, optionally protecting the inner IP header as well; ESP is the universally deployed choice. Both operate in two modes: transport mode protects only the payload of an existing IP packet (used for host-to-host encryption between endpoints that share routing), and tunnel mode encapsulates the entire original IP packet inside a new one with new source and destination addresses — the basis of VPN gateways where traffic from one network is tunnelled to another through the public internet.

Port-based Network Access Control (IEEE 802.1X)

IEEE 802.1X is a standard for Port-Based Network Access Control (PNAC) that prevents any device from sending or receiving traffic on a network port until it has successfully authenticated. Originally designed for wired Ethernet and ratified in 2001, it now equally underpins enterprise Wi-Fi (WPA-Enterprise/WPA3-Enterprise), where access points act as the port gatekeeper. The core premise is that physical access to a port — plugging in a cable or being in range of an access point — does not grant network access. The port is logically divided into two channels: the uncontrolled port, which passes only EAP authentication traffic (EAPOL frames), and the controlled port, which is fully blocked until authentication succeeds. Only after the authentication server approves the device does the switch or access point open the controlled port and allow normal traffic. This port-level gate is what separates 802.1X from higher-layer authentication: a device that fails 802.1X receives no IP address, cannot reach any network resource, and cannot even attempt an attack at layer 3.

AES (Advanced Encryption Standard)

AES (Advanced Encryption Standard), standardised as NIST FIPS 197 in 2001, is the symmetric block cipher that underlies virtually all data encryption in modern infrastructure. It was selected through a five-year open competition that evaluated 15 candidate algorithms; the winner, Rijndael (designed by Joan Daemen and Vincent Rijmen), became AES. A block cipher takes a fixed-size block of plaintext and a key and produces a fixed-size block of ciphertext — AES always operates on 128-bit (16-byte) blocks, regardless of key size. Three key lengths are standardised: AES-128 (128-bit key, 10 rounds), AES-192 (192-bit key, 12 rounds), and AES-256 (256-bit key, 14 rounds), providing 128, 192, and 256 bits of security respectively against classical attacks. AES-256 is the conservative choice for data with long confidentiality requirements and is mandated by CNSA 2.0 for national security systems; AES-128 is widely deployed in TLS and provides adequate security for most workloads. The internal structure — SubBytes, ShiftRows, MixColumns, AddRoundKey — is fully public and has withstood over two decades of cryptanalysis; the best known attacks against full-round AES are theoretical and computationally infeasible, requiring work far beyond brute force but not threatening practical security.