What is Authentication Header (AH) format?

Authentication Header (AH) is a security protocol used in IPSec to provide data integrity, authentication, and replay protection to IP datagrams. The services are connectionless, meaning they work on a per-packet basis without maintaining connection state.

AH operates in two modes: transport mode (protecting payload only) and tunnel mode (protecting the entire original IP packet). However, AH cannot protect certain IP header fields that change during transit, called mutable fields.

Mutable IPv4 Fields

The following IPv4 header fields are considered mutable and are not protected by AH:

  • Type of Service (TOS) − Can be modified by routers for QoS
  • Flags − May change during fragmentation
  • Fragment Offset − Modified during fragmentation/reassembly
  • Time to Live (TTL) − Decremented by each router
  • Header Checksum − Recalculated when other fields change

To protect these fields, tunneling must be used. The IP payload is considered immutable and is always protected by AH.

AH Processing Rules

  • AH processing applies only to non-fragmented IP packets. IP packets with AH can be fragmented by intermediate routers.

  • The destination first reassembles fragmented packets before applying AH processing.

  • Fragmented packets input to AH processing are discarded, preventing overlapping fragment attacks.

  • Packets that fail authentication are discarded and never delivered to upper layers, reducing denial-of-service attack success.

AH Format

The Authentication Header format is defined in RFC 2402. The header is inserted between the IP header and the payload:

Authentication Header (AH) Format IP Header Next Header (8) Payload Len (8) Reserved (16) Security Parameter Index - SPI (32) Sequence Number (32) Authentication Data (Variable Length) Protected Payload 0-7 8-15 16-31 Numbers in parentheses indicate field size in bits

AH Header Fields

Next Header (8 bits)

Identifies the protocol type that follows the AH header. When AH is used, the IP protocol field is set to 51, and the original protocol value moves to this field.

Payload Length (8 bits)

Contains the AH header length in 32-bit words, minus 2. For default options, the value is typically 4 (representing six 32-bit words minus two).

Reserved (16 bits)

Reserved for future use and set to zero.

Security Parameter Index - SPI (32 bits)

Identifies the Security Association (SA) used for this packet, allowing the receiver to determine which algorithms and keys to use for verification.

Sequence Number (32 bits)

A monotonically increasing counter starting from 1, used for replay protection. The sender always includes this field, but receiver processing is optional. Sequence numbers cannot repeat within an SA.

Authentication Data (Variable Length)

Contains the Integrity Check Value (ICV) computed over the packet. This field is padded to 32-bit boundaries for IPv4 or 64-bit boundaries for IPv6.

Conclusion

Authentication Header provides essential security services including data integrity, authentication, and replay protection for IP packets. While AH cannot protect mutable header fields, it ensures the authenticity and integrity of the IP payload and immutable header fields through cryptographic verification.

Updated on: 2026-03-16T23:36:12+05:30

17K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements