Mldv1¶
Package: inet.networklayer.icmpv6
simple module Mldv1
Implements MLDv1 (RFC 2710): Multicast Listener Discovery for IPv6 – the IPv6 equivalent of Igmpv2. A single module performs both the host listener role and the router querier role; the router role is active only on multicast routers (i.e. when IPv6 multicast forwarding is enabled on the node).
MLD messages (ICMPv6 types 130/131/132, see MldMessage) are exchanged with
the IPv6 layer through the ipIn/ipOut gates, which connect to the network
layer’s message dispatcher. Host membership is driven by the
ipv6MulticastGroupJoinedSignal / ipv6MulticastGroupLeftSignal
notifications emitted by Ipv6InterfaceData when an application joins or
leaves an IPv6 multicast group.
Host behavior (RFC 2710 Section 5)
When an interface joins a multicast group, the host sends an unsolicited
Multicast Listener Report to the group address, repeated after
unsolicitedReportInterval. On receiving a General or Multicast-Address-
Specific Query, the host enters the Delaying Listener state and schedules a
Report after a random delay in [0, Maximum Response Delay]; if it first
hears another node’s Report for the group, it cancels its own (report
suppression) and returns to the Idle Listener state. When the interface
leaves a group for which this host was the last reporter, it sends a
Multicast Listener Done to the all-routers address (ff02::2). Per-(interface,
group) state is one of Non-Listener, Delaying Listener, or Idle Listener. The
link-scope all-nodes group (ff02::1) is never reported.
:ref:`Router <neddoc-inet-node-inet-router>` (querier) behavior (RFC 2710 Section 6)
On a multicast router this module acts as the single querier on each attached
link (querier election is not modelled): it sends periodic General Queries
(every queryInterval), records the listeners reported on each interface in
Ipv6InterfaceData (reportedMulticastGroups), and on receiving a Done sends
group-specific Queries (called Multicast-Address-Specific Queries in RFC 2710;
lastListenerQueryCount of them, spaced lastListenerQueryInterval apart) and
removes the group if no Report arrives before the last-listener timeout.
Per-(interface, group) state is one of No Listeners Present, Listeners Present,
or Checking Listeners.
When enabled is false the module is inert: it sends no Report or Done on
group join/leave, runs no querier, and drops any inbound MLD message (it stays
instantiated and registered, but performs no MLD protocol activity).
Querier election, source filtering (SSM), MLD snooping, and MLDv2 are not implemented.
See also: IMld, Igmpv2, MldMessage, Ipv6InterfaceData
Usage diagram¶
Inheritance diagram¶
Used in compound modules¶
Name |
Type |
Description |
|---|---|---|
compound module |
Represents a complete IPv6 network layer (L3), to be used within hosts and routers. It connects to higher-layer protocols (TCP, UDP, …) on top and to the network interfaces below, and bundles the modules that together implement IPv6: |
Extends¶
Name |
Type |
Description |
|---|---|---|
simple module |
Base module for all INET simple modules. |
Parameters¶
Name |
Type |
Default value |
Description |
|---|---|---|---|
displayStringTextFormat |
string |
“” |
Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information |
interfaceTableModule |
string |
path to the InterfaceTable module |
|
routingTableModule |
string |
path to the Ipv6RoutingTable module |
|
checksumMode |
string |
“declared” |
how the ICMPv6 checksum is handled |
enabled |
bool |
true |
when false, MLD is inert on this node (see above) |
unsolicitedReportInterval |
double |
10s |
host: delay before the repeated Report after a join |
robustnessVariable |
int |
2 |
loss tolerance; only supplies the defaults of the three params marked (RV) below |
queryInterval |
double |
125s |
querier: interval between periodic General Queries |
queryResponseInterval |
double |
10s |
querier: max delay a host may wait before answering a General Query |
multicastListenerInterval |
double |
(robustnessVariable * queryInterval) + queryResponseInterval |
querier: how long a group stays “has listeners” without a new Report (RV) |
startupQueryInterval |
double |
queryInterval / 4 |
querier: interval between the initial General Queries at startup |
startupQueryCount |
int |
robustnessVariable |
querier: number of General Queries sent at startup (RV) |
lastListenerQueryInterval |
double |
1s |
querier: interval between the group-specific Queries sent after a Done |
lastListenerQueryCount |
int |
robustnessVariable |
querier: number of group-specific Queries sent after a Done (RV) |
Properties¶
Name |
Value |
Description |
|---|---|---|
class |
Mldv1 |
|
display |
i=block/cogwheel |
Gates¶
Name |
Direction |
Size |
Description |
|---|---|---|---|
ipIn |
input |
||
ipOut |
output |
Source code¶
//
// Implements MLDv1 (RFC 2710): Multicast Listener Discovery for IPv6 -- the
// IPv6 equivalent of ~Igmpv2. A single module performs both the host listener
// role and the router querier role; the router role is active only on multicast
// routers (i.e. when IPv6 multicast forwarding is enabled on the node).
//
// MLD messages (ICMPv6 types 130/131/132, see ~MldMessage) are exchanged with
// the IPv6 layer through the `ipIn`/`ipOut` gates, which connect to the network
// layer's message dispatcher. Host membership is driven by the
// `ipv6MulticastGroupJoinedSignal` / `ipv6MulticastGroupLeftSignal`
// notifications emitted by Ipv6InterfaceData when an application joins or
// leaves an IPv6 multicast group.
//
// <b>Host behavior</b> (RFC 2710 Section 5)
//
// When an interface joins a multicast group, the host sends an unsolicited
// Multicast Listener Report to the group address, repeated after
// `unsolicitedReportInterval`. On receiving a General or Multicast-Address-
// Specific Query, the host enters the Delaying Listener state and schedules a
// Report after a random delay in [0, Maximum Response Delay]; if it first
// hears another node's Report for the group, it cancels its own (report
// suppression) and returns to the Idle Listener state. When the interface
// leaves a group for which this host was the last reporter, it sends a
// Multicast Listener Done to the all-routers address (ff02::2). Per-(interface,
// group) state is one of Non-Listener, Delaying Listener, or Idle Listener. The
// link-scope all-nodes group (ff02::1) is never reported.
//
// <b>Router (querier) behavior</b> (RFC 2710 Section 6)
//
// On a multicast router this module acts as the single querier on each attached
// link (querier election is not modelled): it sends periodic General Queries
// (every `queryInterval`), records the listeners reported on each interface in
// Ipv6InterfaceData (`reportedMulticastGroups`), and on receiving a Done sends
// group-specific Queries (called Multicast-Address-Specific Queries in RFC 2710;
// `lastListenerQueryCount` of them, spaced `lastListenerQueryInterval` apart) and
// removes the group if no Report arrives before the last-listener timeout.
// Per-(interface, group) state is one of No Listeners Present, Listeners Present,
// or Checking Listeners.
//
// When `enabled` is false the module is inert: it sends no Report or Done on
// group join/leave, runs no querier, and drops any inbound MLD message (it stays
// instantiated and registered, but performs no MLD protocol activity).
//
// Querier election, source filtering (SSM), MLD snooping, and MLDv2 are not
// implemented.
//
// @see ~IMld, ~Igmpv2, ~MldMessage, Ipv6InterfaceData
//
simple Mldv1 extends SimpleModule like IMld
{
parameters:
@class(Mldv1);
string interfaceTableModule; // path to the InterfaceTable module
string routingTableModule; // path to the Ipv6RoutingTable module
string checksumMode @enum("declared","computed") = default("declared"); // how the ICMPv6 checksum is handled
bool enabled = default(true); // when false, MLD is inert on this node (see above)
double unsolicitedReportInterval @unit(s) = default(10s); // host: delay before the repeated Report after a join
int robustnessVariable = default(2); // loss tolerance; only supplies the defaults of the three params marked (RV) below
double queryInterval @unit(s) = default(125s); // querier: interval between periodic General Queries
double queryResponseInterval @unit(s) = default(10s); // querier: max delay a host may wait before answering a General Query
double multicastListenerInterval @unit(s) = default((robustnessVariable * queryInterval) + queryResponseInterval); // querier: how long a group stays "has listeners" without a new Report (RV)
double startupQueryInterval @unit(s) = default(queryInterval / 4); // querier: interval between the initial General Queries at startup
int startupQueryCount = default(robustnessVariable); // querier: number of General Queries sent at startup (RV)
double lastListenerQueryInterval @unit(s) = default(1s); // querier: interval between the group-specific Queries sent after a Done
int lastListenerQueryCount = default(robustnessVariable); // querier: number of group-specific Queries sent after a Done (RV)
@display("i=block/cogwheel");
gates:
input ipIn @labels(Ipv6ControlInfo/up);
output ipOut @labels(Ipv6ControlInfo/down);
}