Protocol 24 of 81Layer 3FrameAssembly v3.1.2
llms-full.txt
pimProtocol Independent Multicast — Sparse Mode

Sparse-Mode Multicast Trees (leaf -> rp pim IP Proto 103)

Default Port / Protocol
IP Proto 103
Host Endpoint Rule
Dual-Stack IPv4/IPv6
Wireshark Display Filter
pim
Standards & Specs
RFC 7761
Wire Stack:Ethernet II[802.1Q / QinQ / MPLS]IPv4 / IPv6PIM-SM (IP Proto 103)

What It Does on the Wire

Debug Rendezvous Points (rp) without a 6-router multicast lab: pim emits IP Protocol 103 hello, joinprune, and register frames with proper RFC 7761 encoded unicast/group addresses.

Protocol Independent Multicast — Sparse Mode (pim, RFC 7761) builds shared (*,G) and shortest-path (S,G) multicast distribution trees across Layer 3 routers over IP Protocol 103 (PIMv2, header byte 0x20).

FrameAssembly encodes PIMv2 hello neighbor discovery (Type 0, carrying Holdtime TLV 1 and DR Priority TLV 19), unicast First-Hop Router register (Type 1 to the Rendezvous Point, checksumming only the 8-byte PIMv2 header excluding encapsulated multicast data per RFC 7761 §4.9), and joinprune (Type 3 carrying Encoded-Group and Encoded-Source addresses) across both IPv4 and IPv6.

Rendezvous Point (RP) PIM Register Firewall & CoPP Verification

Test unicast IP Protocol 103 pim register packets between First-Hop Routers and Rendezvous Points—a frequent casualty of overly strict transit ACLs.

Designated Router (DR) Election & (S,G) Tree Troubleshooting

Craft pim hello drpriority 200 and pim joinprune group 239.10.1.1 source 10.1.1.50 captures to validate multicast routing state.

RFC 7761 §4.9 PIM Register Checksum Regression Tests

Validate packet dissectors and router dataplanes against exact 8-byte header-only Register checksums vs full-message Hello/JoinPrune checksums.

Minimal Quickstart (pim_quickstart.frasm)

Hit Preview Packets to compile in-browser and eyeball timestamps + wire byte lengths, or ship it straight to the Playground.

pim_quickstart.frasm7 lines
Open in Playground
host fhr_leaf { ip 172.16.20.1 }
host core_rp { ip 172.16.0.1 }
compile {
fhr_leaf -> core_rp pim hello holdtime 105 drpriority 100 wait 3ms
fhr_leaf -> core_rp pim register group 239.10.10.1 source 10.10.1.50 rp 172.16.0.1
}

What the Compiler Calculates So You Don't Have To

  • Encapsulates over IPv4 Protocol 103 or IPv6 Next Header 103 with PIM Version 2 (0x20).
  • Computes full-message checksums (including IPv6 pseudo-header on v6) for hello and joinprune, while restricting register checksums to the 8-byte PIMv2 header per RFC 7761 §4.9.
  • Derives multicast Ethernet MACs automatically when targeting 224.0.0.13 (ALL-PIM-ROUTERS) or ff02::d.
Multi-Frame Lab · Ready to Compile

End-to-End Multicast Control Plane: IGMPv3 Join + PIM Hello, Join/Prune & Register

Combines a receiver igmp v3 report with upstream pim hello, (S,G) joinprune, and First-Hop pim register signaling to the Rendezvous Point.

pim_multicast_tree.frasm15 lines
Open in Playground
host receiver_01 { ip 10.40.1.50 }
host lhr_router { ip 10.40.1.1 }
host pim_mcast { ip 224.0.0.13 }
host core_rp { ip 172.16.255.1 }
compile {
// 1. PIMv2 Hello on multicast 224.0.0.13 electing DR (drpriority 200)
lhr_router -> pim_mcast pim hello holdtime 105 drpriority 200 ttl 1 dscp 48 wait 2ms
// 2. Receiver joins SSM channel 232.10.10.5 on LAN
receiver_01 -> lhr_router igmp v3 report group 232.10.10.5 wait 2ms
// 3. Last-Hop Router sends PIM Join/Prune upstream toward source 10.10.5.100
lhr_router -> core_rp pim joinprune group 232.10.10.5 source 10.10.5.100 holdtime 210 dscp 48 wait 3ms
// 4. Unicast PIM Register encapsulated to Rendezvous Point
lhr_router -> core_rp pim register group 239.20.20.1 source 10.40.1.50 rp 172.16.255.1 ttl 64 dscp 48
}
Terminal Commands (FrameAssembly CLI v3.1.2)
# 1. Eyeball relative timestamps, ports & wire lengths in your terminal
frameassembly show pim_multicast_tree.frasm

# 2. Compile .frasm -> classic .pcap (tcpdump/tcpreplay/Suricata) or nanosecond .pcapng
frameassembly pim_multicast_tree.frasm pim_multicast_tree.pcap
frameassembly pim_multicast_tree.frasm pim_multicast_tree.pcapng

# 3. Round-trip .pcap <-> .frasm whenever you want to scrub or tweak an existing capture
frameassembly reverse pim_multicast_tree.pcap pim_multicast_tree_edited.frasm

All pim 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 pim:

src_host -> dst_host pim [hello | joinprune | register] [holdtime <0..65535>] [drpriority <number>] [group <ip>] [source <ip>] [rp <ip>]
Keyword / OptionAccepted ValueDefaultEffect on Packet
hello | joinprune | registerPIMv2 Message Type keywordhello (Type 0)Selects Type 0 Hello, Type 1 unicast Register (to RP), or Type 3 Join/Prune.
holdtime <0..65535>Whole number (0..65535) (seconds)105 (3.5x 30s Hello)Encodes Holdtime Option TLV 1 in hello or Holdtime field in joinprune (0xffff = never expire).
drpriority <number>Whole number1Encodes Designated Router Priority Option TLV 19 in pim hello messages.
group <ip> | source <ip> | rp <ip>IPv4 or IPv6 address literals239.1.1.1 / endpoint IPsSets the multicast Group, unicast Source (S,G), and Rendezvous Point addresses in joinprune and register packets.

Cross-Layer Wrappers Valid with pim

802.1Q VLAN / QinQ / MPLS tags, IPv4/IPv6 QoS & TTL fields, wait gaps, and transport overrides allowed on this protocol

9 options
OptionRange / FormatDefaultEffect on Packet
wait <number><ns|us|ms|s|m>Time gap (ns, us, ms, s, m)10msAdvances 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)OmittedAppends 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 MACHost MAC / RFC multicast MACOverrides 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..1UntaggedWraps 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..4095Untagged (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..255Unlabeled (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..3ttl 64, dscp 0, ecn 0Sets 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..8191ipid 1, flags 0, fragoffset 0Sets 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)0Sets the 20-bit IPv6 Flow Label for ECMP routing tests (ignored when running over IPv4 hosts).

Gotchas & Quick Fixes

Spell joinprune and drpriority Without Underscores or Slashes

Avoid
r1 -> r2 pim join_prune dr_priority 100
Valid v3.1.2 Syntax
r1 -> r2 pim joinprune drpriority 100

All built-in PIM tokens are strictly lowercase alphanumeric (joinprune, drpriority, holdtime).

Match Address Families Across group, source, and Endpoints

Avoid
rtr6_a -> rtr6_b pim joinprune group 239.1.1.1
Valid v3.1.2 Syntax
rtr6_a -> rtr6_b pim joinprune group ff05::100 source 2001:db8::10

When running pim over IPv6 routers, pass IPv6 multicast group (ffxx::) and IPv6 source literals.

Field Guide 05
VLANs, QinQ, MPLS, Tunnel Soup & Dual-Stack IPv6