wire / wire-format / ospf-packet
OSPF is an interior gateway protocol (IGP) using link-state routing. OSPF packets are carried directly over IP (protocol 89). Common packet types: Hello (1), Database Description (2), Link State Request (3), Link State Update (4), Link State Ack (5). Header: version (1), type (1), packet length (2), router ID (4), area ID (4), checksum (2), auth type (2), authentication (8).
aka: OSPF (Open Shortest Path First) packet
spec: RFC 2328 (OSPFv2)
OSPF is an interior gateway protocol (IGP) using link-state routing. OSPF packets are carried directly over IP (protocol 89). Common packet types: Hello (1), Database Description (2), Link State Request (3), Link State Update (4), Link State Ack (5). Header: version (1), type (1), packet length (2), router ID (4), area ID (4), checksum (2), auth type (2), authentication (8).
| field | size | meaning |
|---|---|---|
| Version | 1 byte | OSPF version (2 for OSPFv2, 3 for OSPFv3). |
| Type | 1 byte | 1 Hello, 2 Database Description, 3 Link State Request, 4 Link State Update, 5 Link State Ack. |
| Packet length | 2 bytes (uint16) | Total packet length including header. |
| Router ID | 4 bytes (uint32) | 32-bit router identifier (usually the highest IP address or loopback). |
| Area ID | 4 bytes (uint32) | Area the packet belongs to (0.0.0.0 = backbone area 0). |
| Checksum | 2 bytes (uint16) | Standard IP checksum of the entire packet (excluding authentication field for OSPFv2). |
| Auth type | 2 bytes (uint16) | 0 null, 1 simple password, 2 cryptographic (MD5/SHA). |
| Authentication | 8 bytes | Auth data (password, or MD5 digest + key ID). |
| Hello body | variable | Network mask (4), Hello interval (2), Options (1), Router priority (1), Router dead interval (4), Designated Router (4), Backup Designated Router (4), Neighbors (4 each). |
example:
02 01 00 2c 0a 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00
OSPF Hello packet: version 2, type 1, length 44, router ID 10.0.0.1, area 0
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/ospf-packet
or /wire-format/ospf-packet.json