MACsec is the IEEE 802.1AE standard for securing Ethernet at Layer 2, providing confidentiality, integrity and origin authentication for every frame exchanged between two directly connected devices. In network security, MACsec protects the physical link itself, so traffic cannot be read, altered or injected by anyone who taps a cable, a patch panel or a leased fiber between two ports.
Unlike IPsec or a VPN, MACsec works hop by hop: each link is encrypted separately, and frames are decrypted inside every switch so they can be forwarded normally. Because it is usually implemented in the port hardware, it runs at line rate with negligible added latency, from 1 Gb/s access ports up to 400 Gb/s data center links.
How MACsec protects Ethernet frames
MACsec inserts a Security TAG (SecTAG) after the source MAC address and appends an Integrity Check Value (ICV) at the end of the frame. The payload between them, including the original EtherType, is encrypted, while the destination and source MAC addresses stay in clear text so that the frame can still be delivered on the link.
The default cipher suite is GCM-AES-128, an authenticated encryption mode that both encrypts and authenticates in one pass. Newer revisions add GCM-AES-256 and the extended packet numbering variants GCM-AES-XPN-128 and XPN-256, which use a 64-bit packet number so that keys do not have to be rotated every few minutes on 100 Gb/s links.
The table below shows what a MACsec frame adds to a standard Ethernet frame and why each element matters.
| Field | Size | Function |
|---|---|---|
| SecTAG | 8 or 16 bytes | Carries the association number, packet number and optional channel identifier |
| Packet number | 32 or 64 bits | Provides replay protection and a unique nonce |
| Secure channel identifier | 8 bytes, optional | Identifies the sending port |
| ICV | 8 to 16 bytes, usually 16 | Authenticates header and payload |
Together these fields add up to 32 bytes per frame, so links that already run close to their maximum frame size may need a larger MTU on the physical interface.
Key agreement with MKA and 802.1X
MACsec itself only defines frame protection; keys are negotiated by the MACsec Key Agreement (MKA) protocol defined in IEEE 802.1X-2010 and later. MKA peers prove that they share a Connectivity Association Key (CAK), elect a key server, and then distribute short-lived Secure Association Keys (SAKs) that actually encrypt traffic.
The CAK can come from two sources, and the choice shapes how MACsec is operated. With pre-shared keys, administrators configure the same CAK and key name on both ends. With 802.1X authentication, an EAP exchange against a RADIUS server derives the CAK dynamically, which suits access ports where users and devices change.
| Keying method | Typical use | Advantages | Drawbacks |
|---|---|---|---|
| Static CAK (PSK) | Switch-to-switch and router links | Simple, no RADIUS dependency | Manual key rotation |
| 802.1X with EAP-TLS | Host-to-switch access ports | Per-device identity, central policy | Requires certificates and RADIUS |
| Fallback PSK | Uplinks during RADIUS outage | Keeps links encrypted | Extra keys to manage |
MACsec compared with IPsec and other encryption layers
MACsec, IPsec and TLS solve different parts of the same problem: MACsec protects one link, IPsec protects an IP path across many routers, and TLS protects a single application session. They are often used together rather than chosen against each other.
| Property | MACsec | IPsec | WireGuard |
|---|---|---|---|
| OSI layer | Layer 2 | Layer 3 | Layer 3 |
| Scope | Single Ethernet hop | End to end across routers | End to end across routers |
| Implementation | Port hardware (PHY or MAC) | Software or crypto accelerator | Software kernel module |
| Throughput | Line rate | Depends on hardware | Depends on CPU |
| Protects non-IP traffic | Yes, including ARP and LLDP | No | No |
| Crosses routed networks | No, only with special carrier services | Yes | Yes |
Because MACsec encrypts everything above the MAC header, it also hides ARP, LLDP and routing protocol traffic that IPsec cannot cover. The trade-off is that data sits unencrypted inside each switch, so a compromised intermediate device sees plaintext.
Where MACsec is deployed
MACsec is most valuable where the physical path cannot be fully trusted. Typical deployments include data center interconnects over leased dark fiber, campus uplinks running through shared risers, and access ports in buildings where visitors can reach wall jacks.
| Situation | Recommended approach | Reason |
|---|---|---|
| Dark fiber between data centers | MACsec with GCM-AES-XPN-256 | Line-rate protection of untrusted fiber |
| Carrier Ethernet service | WAN MACsec with offset or tag in clear | Provider needs VLAN tags visible |
| Campus access ports | 802.1X with MKA, combined with NAC | Binds encryption to device identity |
| Path through untrusted routers | IPsec instead of MACsec | MACsec does not survive routing |
In zero trust architectures MACsec is a link-level control, not a replacement for identity-based access. It complements 802.1X network access control, segmentation and application encryption rather than standing alone.
Limitations and common mistakes
The most common practical limitation is hardware support. MACsec must be implemented in the switch or NIC silicon to run at line rate, and many older or lower-cost ports either lack it entirely or support only 128-bit ciphers. Licensing can also be required on some enterprise platforms.
- Assuming end-to-end protection: MACsec does not protect traffic inside switches or beyond the first routed hop.
- Ignoring MTU overhead: the extra 32 bytes can cause silent drops of full-size or jumbo frames.
- Mismatched cipher suites or key names: MKA sessions fail to form and links fall back to clear text or go down, depending on policy.
- Using the should-secure policy carelessly: it allows unencrypted traffic when MKA fails, which hides misconfiguration.
- Forgetting key rotation for static CAKs: long-lived pre-shared keys weaken the security model.
Operators should decide explicitly between must-secure and should-secure policies and monitor MKA session state, because an encrypted link that silently falls back to plaintext gives a false sense of security.
The idea in brief
MACsec locks every cable between two network devices. Whatever travels along that cable is scrambled when it leaves one device and unscrambled when it arrives at the next, so someone who secretly taps the wire sees only noise.
Think of a relay race where each runner carries a locked box and hands it to the next runner, who has the key for that stretch. The box is opened and locked again at each handover. That makes the road between devices safe, but the devices themselves still need to be trustworthy.
A practical scenario
A regional hospital group connects its two data centers, 18 kilometers apart, with a pair of leased dark fibers carrying 100 Gb/s links between core switches. The fiber passes through street cabinets owned by a third party, and patient records replicate continuously between storage arrays at both sites.
The network team enables MACsec on both interconnect ports with GCM-AES-XPN-256 and a static CAK stored in the configuration vault, with a second key ready for scheduled rotation. They raise the interface MTU to accommodate the added overhead and set the policy to must-secure, so the link drops rather than carrying clear text if key agreement fails.
Replication throughput stays at full line rate with no measurable latency increase, and the security audit can now document that data in transit between the sites is encrypted. Application-level TLS remains in place, giving the hospital two independent layers of protection.