You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MULTICAST FORWARDING] Multicast forwarding lacks receiver-aware decision making #18762
Arch: allIssues that apply to all architecturesArea: NetworkingEffects networking subsystemOS: LinuxIssues related to Linux (building system, etc)Type: BugSomething isn't working
This issue discusses whether NuttX should evolve toward receiver-aware multicast forwarding
Such a change may involve:
Control path: introducing IGMP/MLD snooping or similar mechanisms to learn downstream membership
Data path: adding a multicast forwarding struct and corresponding forwarding logic
User space: other potential support
From project history I found that NuttX has evolved to supporting multiple netdevs and basic forwarding, extending multicast forwarding may be a reasonable next step.
@acassis Seems there hasn’t been enough time for a thorough discussion on multicast forwarding. So I created this issue to track the topic and discuss further.
Hi @ankohuu thank you very much for your detailed Issue. I agree this will be a good improvement. And it will make NuttX more compatible with high-end OSes. Do you think this new feature will require more memory (flash and RAM)? If so, does it make sense to have a config option to keep the old behavior for low end MCUs?
Hi, is anyone working on this? I checked master and open PRs and don’t see it. If not, I’d like to take it.
plan: on the forwarding path, consult per-device multicast group membership (IGMP for IPv4, MLD for IPv6) and only forward to interfaces with interested receivers, falling back to current behavior when membership tracking is disabled.
I’d test on sim with two TAP interfaces and host-side listeners.
Before I start: should membership come from the existing IGMP/MLD group lists on each netdev, or do you want a separate forwarding table?
Checked latest master. Nothing in flight for this; #18738 only added the scope filter.
Findings:
ipv4_in() forwards a multicast packet only if the ingress device has locally joined the group. ipv4_forward_broadcast() then floods it to all other netdevs, with no egress membership check.
IPv6 floods everything above link scope.
The per-netdev IGMP/MLD lists only track local joins. IGMP drops remote reports for unjoined groups, and the MLD_ROUTER counts are never read on the forward path.
So I don't think those lists are the right place to store downstream membership.
Proposal: a small, separate multicast forwarding table in net/ipforward/, shared by IPv4 and IPv6, behind CONFIG_NET_IPFORWARD_MCAST (default n).
Option off: behavior and size unchanged, fully compiled out. This should cover the low-end MCU concern.
Option on: forward only to interfaces with an entry for the group. Rough estimate ~32 B RAM per entry and 1.5-3 KB flash. I'll post measured numbers with the first PR.
Staging:
Table, lookup and data-path filtering, plus a minimal control ioctl so it's testable.
IGMP snooping.
MLD snooping.
Docs and a sim defconfig.
Open questions before I start:
(a) Separate table OK, vs extending the group lists?
(b) With the option on and no entry, drop (Linux behavior) or flood?
(c) ioctl for the control interface, or Linux-style MRT_* socket options?
thanks @xiaoxiang781216! going with: separate table, drop when no entry (linux behavior), and a small isolated ioctl for now that can be swapped for MRT_* later. stage 1 is implemented and tested on sim (incl. two-TAP with host listeners); size with option on is +960 B text / +256 B bss on imxrt1050-evk, and identical with it off.
will open pr shortly
It adds the multicast forwarding table, the data path that uses it and the
SIOCADDMCFWD/SIOCDELMCFWD ioctls, all behind CONFIG_NET_IPFORWARD_MCAST
(default n). Since the proposal, ipforward was renamed to netforward
upstream, so the code is in net/netforward/ (netfwd_mcast*.c) and the
ioctls take 0x0049/0x004A.
Size on imxrt1050-evk:netnsh (IPv4, IPv6, IGMP, MLD, forwarding): option
off is identical to master; option on with 8 entries is +1144 bytes text,
+16 bytes data, +264 bytes bss.
Tests (sim, three TUN devices, examples/ipfwdmcast): option off 3/3 (flooding
unchanged), option on 50/50, also on sim:smp, including packets forwarded
while the table is changed from another thread; also a host test with three
TAP devices and listeners in separate namespaces.
Arch: allIssues that apply to all architecturesArea: NetworkingEffects networking subsystemOS: LinuxIssues related to Linux (building system, etc)Type: BugSomething isn't working
Activity
ankohuu commentedon Apr 18, 2026
@acassis Seems there hasn’t been enough time for a thorough discussion on multicast forwarding. So I created this issue to track the topic and discuss further.
Thank you
acassis commentedon Apr 19, 2026
Hi @ankohuu thank you very much for your detailed Issue. I agree this will be a good improvement. And it will make NuttX more compatible with high-end OSes. Do you think this new feature will require more memory (flash and RAM)? If so, does it make sense to have a config option to keep the old behavior for low end MCUs?
Brijesh-Thakkar commentedon Nov 2, 2026
Hi, is anyone working on this? I checked master and open PRs and don’t see it. If not, I’d like to take it.
plan: on the forwarding path, consult per-device multicast group membership (IGMP for IPv4, MLD for IPv6) and only forward to interfaces with interested receivers, falling back to current behavior when membership tracking is disabled.
I’d test on sim with two TAP interfaces and host-side listeners.
Before I start: should membership come from the existing IGMP/MLD group lists on each netdev, or do you want a separate forwarding table?
Brijesh-Thakkar commentedon Nov 5, 2026
Checked latest master. Nothing in flight for this; #18738 only added the scope filter.
Findings:
So I don't think those lists are the right place to store downstream membership.
Proposal: a small, separate multicast forwarding table in net/ipforward/, shared by IPv4 and IPv6, behind CONFIG_NET_IPFORWARD_MCAST (default n).
Staging:
Open questions before I start:
(a) Separate table OK, vs extending the group lists?
(b) With the option on and no entry, drop (Linux behavior) or flood?
(c) ioctl for the control interface, or Linux-style MRT_* socket options?
@acassis @xiaoxiang781216
xiaoxiang781216 commentedon Nov 5, 2026
the plan looks good.
Brijesh-Thakkar commentedon Nov 7, 2026
thanks @xiaoxiang781216! going with: separate table, drop when no entry (linux behavior), and a small isolated ioctl for now that can be swapped for MRT_* later. stage 1 is implemented and tested on sim (incl. two-TAP with host listeners); size with option on is +960 B text / +256 B bss on imxrt1050-evk, and identical with it off.
will open pr shortly
Brijesh-Thakkar commentedon Dec 3, 2026
Stage 1 is up: #22839, test app apache/nuttx-apps#4287.
It adds the multicast forwarding table, the data path that uses it and the
SIOCADDMCFWD/SIOCDELMCFWD ioctls, all behind CONFIG_NET_IPFORWARD_MCAST
(default n). Since the proposal, ipforward was renamed to netforward
upstream, so the code is in net/netforward/ (netfwd_mcast*.c) and the
ioctls take 0x0049/0x004A.
Size on imxrt1050-evk:netnsh (IPv4, IPv6, IGMP, MLD, forwarding): option
off is identical to master; option on with 8 entries is +1144 bytes text,
+16 bytes data, +264 bytes bss.
Tests (sim, three TUN devices, examples/ipfwdmcast): option off 3/3 (flooding
unchanged), option on 50/50, also on sim:smp, including packets forwarded
while the table is changed from another thread; also a host test with three
TAP devices and listeners in separate namespaces.
Next stages: IGMP snooping (stage 2), MLD snooping (stage 3), docs/defconfig
(stage 4).