Glossary

MACsec

Media Access Control Security

What is MACsec

MACsec (Media Access Control Security) is a link-layer encryption technology standardized by IEEE 802.1AE. It protects data confidentiality, integrity, and replay protection directly on Ethernet links, encrypting traffic frame-by-frame as it crosses the wire.

MACsec is widely used in Data Center Interconnect (DCI), where it establishes secure channels over the physical or logical links connecting geographically separated data centers. Even on dedicated infrastructure like dark fiber, links remain exposed to real risks — fiber tapping, unauthorized physical access, and insider threats — that put sensitive cross-domain traffic at risk of eavesdropping or tampering. MACsec addresses this directly at the link layer, letting organizations in finance, government, telecommunications, and other data-sensitive industries encrypt inter-site traffic without touching anything above Layer 2.

How MACsec Works

MACsec modifies every frame that passes over a protected link in three ways: it inserts a MACsec tag (SecTAG, 16 bytes) just before the ethertype, appends an Integrity Check Value (ICV, 16 bytes) at the end of the frame, and encrypts the original ethertype and payload in between — adding 32 bytes to the frame overall.

Before any traffic can be encrypted, the two ends of the link need matching keys. That's the job of the MACsec Key Agreement (MKA) protocol, which runs inside the IEEE 802.1X framework and exchanges keys over EAPOL (Extensible Authentication Protocol over LAN). MKA performs symmetric key agreement using a pre-shared Connectivity Association Key (CAK) and its identifying Connectivity Association Key Name (CKN), and from these derives the session-level Security Association Key (SAK) actually used to encrypt and decrypt frames. MKA can select from four cipher suites — GCM-AES-128, GCM-AES-256, and their Extended Packet Number (XPN) variants — negotiated by a designated Key Server during setup.

Every encrypted frame carries a Packet Number (PN), unique within its Security Association, that both prevents replay and tracks key freshness. Standard 32-bit PN cipher suites can exhaust their counter surprisingly fast — on a 10 Gbps link carrying minimum-size frames, roughly every 18 minutes — triggering a SAK rekey each time. The XPN cipher suites extend this to a 64-bit counter, pushing that exhaustion point out to years at realistic link speeds and largely eliminating PN-driven rekeys. Rekeys are also triggered by an expiring configured key lifetime or a security/configuration event.

Once keys are in place, encryption and decryption happen transparently: the sending device inserts the header, appends the ICV, and encrypts the payload; the receiving device decrypts the frame, verifies its ICV to confirm nothing was altered, and passes the now-plaintext frame on for normal forwarding, QoS, and other Layer 2/3 processing exactly as if MACsec weren't there. This entire process is typically hardware-accelerated to sustain line-rate throughput.

To stop replay attacks — where a captured frame is re-injected onto the network — the receiving peer compares each incoming frame's PN against its lowest acceptable value and discards anything below it. A configurable replay protection window balances strict ordering against tolerance for legitimate reordering: a window of 0 requires strictly increasing PNs (highest security, but can drop frames on networks with frequent reordering), while a window greater than 0 tolerates limited out-of-order delivery without weakening protection against genuine replay.

Why MACsec is Beneficial

  • Encrypts at the link layer, transparently: Because MACsec operates at Layer 2, it requires no changes to upper-layer protocols or applications, making it straightforward to add to an existing network without redesigning anything above it.

  • Line-rate performance: Hardware-accelerated encryption and decryption keep MACsec's impact on latency and throughput minimal, which matters for workloads like virtual machine migration, real-time data replication, and disaster recovery that depend on both.

  • Defends against real physical-layer risk: Even links assumed to be secure — like dedicated dark fiber — remain vulnerable to tapping and unauthorized access; MACsec removes the assumption that physical isolation alone is enough.

  • Flexible security-vs-performance tradeoffs: Multiple cipher suites, an integrity-only mode for latency-sensitive links, and configurable rekey timing let operators tune MACsec to their specific security and performance requirements.

  • Resilient against replay and tampering: Per-frame packet numbering with a configurable replay window blocks replay attacks while still tolerating the ordinary reordering that happens on real networks.

At Asteraix

What We Can Do at Asteraix

AsterNOS includes a complete IEEE 802.1AE MACsec and MKA implementation, configurable entirely through the standard CLI — no separate encryption appliance required.

  • All four standard cipher suites: GCM-AES-128, GCM-AES-256, GCM-AES-XPN-128, and GCM-AES-XPN-256 are all supported and selectable per MACsec profile, so operators can choose the right balance of key strength and rekey frequency for their link.

  • Two MKA policy modes: An integrity_only mode protects against tampering without the overhead of encryption, suited to latency-sensitive links, while a full security mode encrypts and authenticates all protected traffic for links that require confidentiality.

  • Configurable key server priority and rekey timing: mka priority sets which peer wins Key Server election ties, and mka rekey_period sets key lifetime directly, giving operators control over how and when SAKs refresh.

  • Configurable replay protection: Replay protection can be enabled per profile with an adjustable window size, letting operators tune the tradeoff between strict ordering and tolerance for legitimate frame reordering.

  • Simple per-interface deployment: A MACsec profile is defined once (macsec profile <name>) and then applied to any interface with macsec bind <profile_name>, making consistent policy easy to roll out across many links.

  • Proven in real DCI and 5G fronthaul deployments: AsterNOS's MACsec documentation includes validated configuration examples for both Data Center Interconnect over dark fiber and 5G fronthaul network scenarios — including strict validation mode and tuned replay-window settings — reflecting how it's actually deployed in the field.