IGMP(4)

πŸ’– IGMP β€” the Internet Group Management Protocol πŸ’–

okay bestie, we're doing the igmp page today, from the Kernel Interfaces Manual (section 4, networking era ✨). this is the protocol your kernel uses to whisper to routers about who wants which multicast streams. let's get into it 🫢


🌈 SYNOPSIS 🌈

first, the ritual. you include the sacred scrolls:

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#include <netinet/igmp.h>

and then you open the socket like this, exactly like this, no edits:

int
socket(AF_INET, SOCK_RAW, IPPROTO_IGMP);

raw socket, AF_INET, SOCK_RAW, IPPROTO_IGMP. that's the whole summoning circle πŸ”₯


✨ DESCRIPTION ✨

so like. IGMP is a control plane protocol. it's the thing IPv4 hosts and routers use to pass around multicast group membership info β€” like, "hey, I'm in this group," "hey, I'm out of this group," that whole vibe πŸ¦‹

and here's the tea: normally you do not touch this directly. it's basically the kernel's job, and the kernel does it in response to multicast membership requests that user applications make. so your app asks for multicast, kernel handles the IGMP chatter. you're just vibing, it's doing the work πŸ’…

that said β€” routing protocols may open a raw socket to directly interact with igmp. so if that's your situation, that's your situation. no cap.

As of FreeBSD 8.0, IGMP version 3 is implemented. and v3 adds support for Source-Specific Multicast (SSM). which means applications can tell upstream multicast routers, "bestie, I only want streams from these particular sources, not whatever random thing shows up." very picky, very demure, extremely valid πŸ‘‘


πŸŽ€ SYSCTL VARIABLES πŸŽ€

these are your knobs. here's every single one, don't skip πŸ’œ

  • net.inet.igmp.stats β€” an opaque read-only variable. it exposes the stack-wide IGMPv3 protocol statistics to netstat(1). read-only, opaque, no touching, just looking πŸ™ˆ
  • net.inet.igmp.ifinfo β€” also opaque, also read-only. this one exposes the per-link IGMPv3 status to ifmcstat(8). per-link, so it's the detail view 🌸
  • net.inet.igmp.gsrdelay β€” this one sets the time threshold, in seconds, for processing Group-and-Source Specific Queries (GSR). and here's why it matters: processing GSR queries means the host has to maintain state, which can cause memory to be allocated, which means it's a potential attack point for Denial-of-Service (DoS) 😭 so if more than one GSR query shows up within this threshold, it gets dropped, to mitigate that DoS potential. protective queen behavior fr fr.
  • net.inet.igmp.default_version β€” controls the default version of IGMP used on all links. normally set to 3 by default. slay.
  • net.inet.igmp.legacysupp β€” if this is non-zero, then IGMP v1 and v2 membership reports received on a link are allowed to suppress the IGMP v3 state-change reports that this host would otherwise issue. this sysctl is normally enabled by default.
  • net.inet.igmp.v2enable β€” if non-zero, IGMP v2 membership queries get processed by this host, and backwards compatibility is enabled until the v2 'Old Querier Present' timer expires. normally enabled by default ⭐
  • net.inet.igmp.v1enable β€” same deal but v1: if non-zero, IGMP v1 membership queries are processed by this host, and backwards compatibility stays on until the v1 'Old Querier Present' timer expires. normally enabled by default ⭐
  • net.inet.igmp.sendlocal β€” if non-zero, then IGMP state-changes for groups in the 224.0.0.0/24 link-scope prefix will be issued. this behaviour is recommended if you're deploying FreeBSD in a network environment with layer 2 devices that snoop IGMP traffic, so that multicast propagation throughout the network gets mitigated. normally enabled by default πŸ‘‘
  • net.inet.igmp.sendra β€” if non-zero, IGMP v2 and v3 reports will contain the IP Router Alert option. normally enabled by default.
  • net.inet.igmp.recvifkludge β€” if non-zero, received IGMP reports that contain 0.0.0.0 as their source get rewritten to contain the subnet address. this is useful when there are hosts on-link that haven't been configured with a primary IPv4 address yet. normally enabled by default. the kludge is doing the lord's work 🧚
ngl, most of these are "normally enabled by default," so if you go messing with them, that's a choice you're making. just saying πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie, they're all connected:


🌸 HISTORY 🌸

the igmp manual page re-appeared in FreeBSD 8.0. it came back. main character return arc πŸ’…βœ¨


and that's the whole page!! you did it, you read the entire thing, I'm so proud πŸ₯ΉπŸ’– this one came from the Debian crew, dated March 9, 2009 β€” oldie but a goodie, and yes the page header was IGMP(4) in the Kernel Interfaces Manual. go configure something. or don't. either way, mwah πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from