Lesson Contents
This packet capture contains a single OSPFv2 Hello protected with HMAC-SHA-256. OSPFv2 has had cryptographic authentication since the start, but only with MD5. RFC 5709 added the SHA family, and this is what it looks like on a Cisco router with a key chain: the same OSPF header fields as MD5, with a longer digest.
There’s also a second digest in this packet, for the Link-Local Signaling (LLS) block, which most people don’t expect. The OSPF HMAC-SHA extended authentication lesson covers the configuration. For the OSPFv3 equivalent, see the OSPFv3 Authentication Trailer Packet Capture. More captures are in the Packet Capture Library.
Want to open this capture in Wireshark yourself? The pcap file is free with a NetworkLessons account. Your free account also unlocks all our free lessons and every capture in the Packet Capture Library.
Create a free account to download the pcap
Already have an account? Log in and the download button appears here.
Capture overview
| File | ospf-hello-hmac-sha-256-authentication.pcapng |
| Packets | 1 |
| Protocol | OSPFv2 (RFC 2328), HMAC-SHA cryptographic authentication (RFC 5709), LLS (RFC 5613) |
| Transport | IP protocol 89, to 224.0.0.5, TTL 1 |
| Devices | Cisco IOS router 192.168.23.2 (router ID 2.2.2.2), area 0, neighbor 3.3.3.3 |
| Wireshark filter | ospf.auth.type == 2 or ospf |
Packet walkthrough
The Hello (packet 1)
Internet Protocol Version 4, Src: 192.168.23.2, Dst: 224.0.0.5
Open Shortest Path First
OSPF Header
Version: 2
Message Type: Hello Packet (1)
Packet Length: 48
Source OSPF Router: 2.2.2.2
Area ID: 0.0.0.0 (Backbone)
Checksum: 0x0000 (None)
Instance ID: Base IPv4 Unicast Instance (0)
Auth Type: Cryptographic (2)
Auth Crypt Key id: 1
Auth Crypt Data Length: 32
Auth Crypt Sequence Number: 1793284225
Auth Crypt Data: 6ebb45a6efb9d11497011bae9859cdbd5f5aac05adcc226ba2b3cdc8ebe6cf47
OSPF Hello Packet
Network Mask: 255.255.255.0
Hello Interval [sec]: 10
Options: 0x12, (L) LLS Data block, (E) External Routing
.0.. .... = (O) Opaque: Not set
..0. .... = (DC) Demand Circuits: Not supported
...1 .... = (L) LLS Data block: Present
.... ..1. = (E) External Routing: Capable
Router Priority: 1
Router Dead Interval [sec]: 40
Designated Router: 0.0.0.0
Backup Designated Router: 0.0.0.0
Active Neighbor: 3.3.3.3
OSPF LLS Data Block
Checksum: 0x0000
LLS Data Length: 72 bytes
Extended options TLV
TLV Type: 1
TLV Length: 4
Options: 0x00000001, (LR) LSDB Resynchronization
.... .... .... .... .... .... .... ...1 = (LR) LSDB Resynchronization: Set
Local Interface ID
TLV Type: 18
TLV Length: 4
Local Interface ID: 00000003
Crypto Authentication TLV
TLV Type: 2
TLV Length: 36
Sequence number: 0x6ae35881
Auth Data: 0ab2ff4c0d81cb3c81886da1503357114f84b83baef9666e58e3094a3705e29a
This is what the fields in red mean:
- Auth Type 2: Cryptographic: the same type that OSPF MD5 authentication uses. The algorithm isn’t in the packet. Both routers must agree on it through their configuration.
- Key id 1: the key number in the key chain. Routers can accept several key IDs at once, which allows hitless key rollover.
- Auth Crypt Data Length 32: 32 bytes of digest means HMAC-SHA-256. MD5 would be 16, HMAC-SHA-1 20, and HMAC-SHA-512 64 bytes.
- Auth Crypt Sequence Number 1793284225: a counter that must never go down, to stop replay attacks. This value is a Unix timestamp (October 29, 2026), a simple way to guarantee it only increases.
- Packet Length 48 and Checksum 0x0000: the OSPF packet itself is 48 bytes. The digest is appended after it and isn’t counted in the packet length. With cryptographic authentication, OSPFv2 doesn’t calculate the checksum, because the digest already protects the packet.
- LLS Data block: Present: the L bit in the options says Link-Local Signaling data follows the packet (and its digest).
- Crypto Authentication TLV in the LLS block: the LLS data has its own sequence number and its own 32-byte digest. Without it, an attacker could change the LLS options without breaking the OSPF digest.
- IP total length 172: 20 bytes of IP header, 48 bytes of OSPF, 32 bytes of digest and 72 bytes of LLS data.