MACsec is a Layer 2 (Data Link Layer) point-to-point security and hop-by-hop encryption mechanism based on the IEEE 802.1AE network security standard. It can secure data communications by performing data integrity checks and encrypting network traffic between two peers.
The traffic is unencrypted while it is handled internally within the switch. Thus, it enables the switch to inspect the inner packets for SGT tags to execute packet enforcement or QoS prioritizing. It also uses onboard ASICs to conduct encryption and decryption rather than offloading to a crypto engine, as IPsec does.
MACsec provides authentication via the Galois Method Authentication Code (GMAC) or authenticated encryption using the Galois/Counter Mode Advanced Encryption Standard (AES-GCM) to ensure the data communication confidentiality, integrity, and data origin authenticity of all the network traffic.
Security Tag Field
The MACsec frame format is based on the Ethernet frame format, with the addition of a 16-byte MACsec Security Tag field (802.1AE header) and a 16-byte Integrity Check Value (ICV) field. It implies that all devices in the path of the data traffic must support MACsec for these fields to be utilized and the traffic to be secure. The following composes the Security Tag field:
- MACsec EtherType – The 1st and 2nd octets. It is set to 0x88e5, designating the frame as a MACsec frame.
- Tag Control Information/Association Number (TCI/AN) – The 3rd octet. It designates the version number if confidentiality or integrity is used on its own.
- Short Length (SL) – The 4th octet. It designates the length of the encrypted data.
- Packet Number – The 5th to 8th octets. It is the packet number for replay protection and building of the initialization vector.
- Secure Channel Identifier (SCI) – The 9th to 16th octets. It classifies the connection to the virtual port.
MACsec Keying Protocols
MACsec enables data security between the devices by exchanging and verifying security keys. It has two security protocols, SAP and MKA.
Security Association Protocol (SAP)
SAP is a Cisco proprietary keying protocol that is utilized between Cisco switches.
MACsec Key Agreement (MKA) Protocol
MKA generates the relevant session keys and manages the appropriate encryption keys. The 802.1AE encryption with MKA is supported both between endpoints and the switch and between switches.
The port with the higher priority is selected as the Key Server, responsible for generating and distributing Security Association Keys (SAKs). The devices communicate via the MKA protocol regarding their capabilities and the various parameters needed to establish a session.
Downlink MACsec refers to the encrypted link between an endpoint and a switch. The MKA keying protocol handles the encryption between the endpoint and the switch, which necessitates the use of a MACsec-capable switch and supplicant. On the endpoint, encryption can be done in hardware or software, with encryption and decryption performed by the main CPU.
The Cisco switch can enforce encryption, make encryption optional, or force non-encryption. This option can be set manually per port or dynamically as an authorization option via Cisco ISE. If ISE returns an encryption policy along with the authorization result, the policy delivered by ISE overrides any settings made via the switch CLI.
Uplink MACsec refers to encrypting a link between switches implementing 802.1AE. It employs Cisco’s proprietary SAP encryption by default. The encryption is the same AES-GCM-128 encryption used with uplink and downlink MACsec. Uplink MACsec may be achieved manually or dynamically, whereas dynamic MACsec requires 802.1x authentication between the switches.
Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.
We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: