ospfOpen Shortest Path First — OSPFv2 & Dual-Stack OSPFv3Link-State Hellos & LSA Flooding (rtr1 <-> rtr2 ospf Proto 89)
What It Does on the Wire
Mismatched hello/dead timers have caused more silent routing blackholes than fiber backhoes. ospf builds IPv4 OSPFv2 (Fletcher-16 checksum) and IPv6 OSPFv3 (ICMPv6-style pseudo-header checksum) automatically.
Open Shortest Path First (ospf) is the enterprise and service-provider link-state Interior Gateway Protocol running directly over IP Protocol 89 with link-local ttl 1. In FrameAssembly v3.1.2, ospf is dual-stack morphing: over IPv4 hosts, it emits OSPFv2 (RFC 2328, 24-byte header, RFC 1071 checksum omitting the 64-bit authentication field); over IPv6 hosts, the exact same syntax emits OSPFv3 (RFC 5340, Version 3, 16-byte header, Instance ID 0, and full IPv6 pseudo-header checksum).
All five OSPF packet types (hello, dbd, lsr, lsu, lsack) are natively generated, including valid Fletcher-16 (ISO 8473) LSA checksums on Link State Update and Acknowledgment records.
OSPF Neighbor Adjacency Mismatch Troubleshooting
Simulate mismatched hellointerval, deadinterval, or areaid Hellos to train engineers and verify NMS log parsers on stuck INIT / EXSTART states.
Dual-Stack OSPFv2 & OSPFv3 Control-Plane CoPP Audits
Replay IPv4 (224.0.0.5) and IPv6 (ff02::5) OSPF packets (dscp 48 CS6) against router Control Plane Policing (CoPP) ACLs.
LSA Flooding & Wireshark Fletcher-16 Checksum Validation
Synthesize full hello -> dbd -> lsr -> lsu -> lsack adjacency synchronization traces with verified LSA header checksums.
Minimal Quickstart (ospf_quickstart.frasm)
Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.
host rtr_a { ip 10.0.0.1 }host rtr_b { ip 10.0.0.2 }compile { rtr_a -> rtr_b ospf hello routerid 1.1.1.1 areaid 0}What the Compiler Calculates So You Don't Have To
- Selects OSPFv2 (24B header, IPv4 Proto
89) over IPv4 hosts or OSPFv3 (16B header, IPv6 Next Header89, IPv6 pseudo-header checksum) over IPv6 hosts. - Defaults IP
ttl/ Hop Limit to1and derives multicast destination MACs automatically when sending to224.0.0.5/224.0.0.6orff02::5/ff02::6. - Computes both the outer OSPF packet checksum and inner ISO 8473 Fletcher-16 LSA checksums on
lsuandlsackpackets.
Full OSPF Adjacency Synchronization Plus OSPFv3 IPv6 Backbone Hello
Walks two core routers through OSPFv2 hello, dbd, lsr, lsu, and lsack exchange on Area 0, followed by an OSPFv3 IPv6 Hello using 32-bit routerid.
host core_1_v4 { ip 172.16.0.1 }host core_2_v4 { ip 172.16.0.2 }host allspf_v6 { ip ff02::5 }host core_1_v6 { ip fe80::1c73:1 }compile { // 1. OSPFv2 Area 0 adjacency bring-up and LSA exchange core_1_v4 -> core_2_v4 ospf hello routerid 1.1.1.1 areaid 0 hellointerval 10 deadinterval 40 priority 100 dscp 48 wait 2ms core_1_v4 <- core_2_v4 ospf hello routerid 2.2.2.2 areaid 0 hellointerval 10 deadinterval 40 priority 1 dscp 48 wait 2ms core_1_v4 -> core_2_v4 ospf dbd routerid 1.1.1.1 areaid 0 dscp 48 wait 1ms core_1_v4 <- core_2_v4 ospf lsr routerid 2.2.2.2 areaid 0 dscp 48 wait 1ms core_1_v4 -> core_2_v4 ospf lsu routerid 1.1.1.1 areaid 0 dscp 48 wait 1ms core_1_v4 <- core_2_v4 ospf lsack routerid 2.2.2.2 areaid 0 dscp 48 wait 4ms // 2. OSPFv3 over IPv6 multicast ff02::5 (routerid stays 32-bit dotted-quad!) core_1_v6 -> allspf_v6 ospf hello routerid 1.1.1.1 areaid 0.0.0.0 hellointerval 10 deadinterval 40}# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show ospf_adjacency_v2_v3.frasm
# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly ospf_adjacency_v2_v3.frasm ospf_adjacency_v2_v3.pcap
frameassembly ospf_adjacency_v2_v3.frasm ospf_adjacency_v2_v3.pcapng
# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse ospf_adjacency_v2_v3.pcap ospf_adjacency_v2_v3_edited.frasmAll ospf Keywords & Header Options
Every sub-keyword and header option is lowercase [a-z0-9]+ with zero underscores — mix and match them in any order after ospf:
src_host -> dst_host ospf [hello | dbd | lsr | lsu | lsack] [routerid <ipv4>] [areaid <u32|ipv4>] [hellointerval <0..65535>] [deadinterval <number>] [priority <0..255>]| Keyword / Option | Accepted Value | Default | Effect on Packet |
|---|---|---|---|
| hello | dbd | lsr | lsu | lsack | OSPF Packet Type keyword | hello (Type 1) | Selects Type 1 Hello, Type 2 Database Description (dbd), Type 3 Link State Request (lsr), Type 4 Link State Update (lsu), or Type 5 Link State Acknowledgment (lsack). |
| routerid <ipv4> | 32-bit dotted-quad IPv4 format (e.g. 1.1.1.1) | Source IPv4 (or 1.1.1.1 on IPv6) | Sets the 32-bit OSPF Router ID in both OSPFv2 and OSPFv3 headers. |
| areaid <u32|ipv4> | u32 integer (0) or dotted-quad (0.0.0.0) | 0 (Backbone Area 0.0.0.0) | Sets the 32-bit OSPF Area ID. |
| hellointerval <0..65535> | deadinterval <number> | Timers in seconds | hellointerval 10, deadinterval 40 | Sets the Hello Interval (u16 seconds) and Router Dead Interval (u32 OSPFv2 / u16 OSPFv3) in hello packets. |
| priority <0..255> | Whole number (0..255) | 1 | Sets the Designated Router (DR) Election Priority (0 = ineligible to become DR/BDR). |
Cross-Layer Wrappers Valid with ospf
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
9 options
Cross-Layer Wrappers Valid with ospf
802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol
| Option | Range / Format | Default | Effect on Packet |
|---|---|---|---|
| wait <number><ns|us|ms|s|m> | Time gap (ns, us, ms, s, m) | 10ms | Advances the packet timestamp clock after sending this packet and before the next packet (wait 0ns sends back-to-back). |
| payload "<text>" | hexpayload "<hex>" | Quoted text or hex bytes (choose one) | Omitted | Appends or overrides raw payload bytes ("deadbeef" or "de:ad:be:ef") and updates packet lengths and checksums. |
| srcmac <mac> | dstmac <mac> | Colon, hyphen, or Cisco dot MAC | Host MAC / RFC multicast MAC | Overrides the 14-byte Ethernet II source or destination MAC address for this single packet. |
| vlan <0..4095> [pcp <0..7>] [dei <0|1>] | VLAN ID 0..4095, PCP 0..7, DEI 0..1 | Untagged | Wraps the packet in an IEEE 802.1Q VLAN tag (0x8100) with optional 802.1p QoS priority. |
| qinq <0..4095> [innervlan <0..4095>] | Outer S-VLAN 0..4095, Inner C-VLAN 0..4095 | Untagged (innervlan 1 when qinq is set) | Double-tags the packet with outer IEEE 802.1ad S-Tag (0x88a8) plus inner IEEE 802.1Q C-Tag (0x8100). |
| mpls <0..1048575> [exp|tc <0..7>] [bos <0|1>] [mplsttl <0..255>] | Label 0..1048575, exp/tc 0..7, bos 0..1, ttl 0..255 | Unlabeled (at most 1 mpls tag per packet) | Inserts a 32-bit MPLS label header (0x8847) ahead of the Layer 3 header. |
| ttl <0..255> [dscp <0..63>] [ecn <0..3>] | TTL/Hop Limit 0..255, DSCP 0..63, ECN 0..3 | ttl 1, dscp 0, ecn 0 | Sets IPv4 TTL or IPv6 Hop Limit plus DiffServ (DSCP) and ECN QoS markings. |
| ipid <0..65535> [df] [mf] [fragoffset <0..8191>] | IPv4 ID, DF/MF flags, fragment offset 0..8191 | ipid 1, flags 0, fragoffset 0 | Sets IPv4 Identification, Do-Not-Fragment (df), More-Fragments (mf), and fragment offset (ignored over IPv6). |
| flowlabel <0..1048575> | 20-bit IPv6 Flow Label (0..1048575) | 0 | Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts). |
Gotchas & Quick Fixes
OSPFv3 routerid Always Remains 32-Bit Dotted-Quad (RFC 5340)
core_1_v6 -> core_2_v6 ospf hello routerid 2001:db8::1core_1_v6 -> core_2_v6 ospf hello routerid 1.1.1.1Per RFC 5340 §2.11, OSPFv3 retains 32-bit Router IDs and Area IDs formatted in dotted-quad notation (1.1.1.1) even when running over 128-bit IPv6 endpoints.
Zero Underscores in Timer Modifiers
r1 -> r2 ospf hello router_id 1.1.1.1 hello_interval 10r1 -> r2 ospf hello routerid 1.1.1.1 hellointerval 10 deadinterval 40Use routerid, areaid, hellointerval, and deadinterval with zero underscores.