6. Host State Diagram
6. Host State Diagram
Host behavior is more formally specified by the state transition diagram below. A host may be in one of three possible states with respect to any single IP multicast group on any single network interface:
-
"Non-Member" state, when the host does not belong to the group on the interface. This is the initial state for all memberships on all network interfaces; it requires no storage in the host.
-
"Delaying Member" state, when the host belongs to the group on the interface and has a report delay timer running for that membership.
-
"Idle Member" state, when the host belongs to the group on the interface and does not have a report delay timer running for that membership.
There are five significant events that can cause IGMP state transitions:
-
"join group" occurs when the host decides to join the group on the interface. It may occur only in the Non-Member state.
-
"leave group" occurs when the host decides to leave the group on the interface. It may occur only in the Delaying Member and Idle Member states.
-
"query received" occurs when the host receives either a valid General Membership Query message, or a valid Group-Specific Membership Query message. To be valid, the Query message must be at least 8 octets long, and have a correct IGMP checksum. The group address in the IGMP header must either be zero (a General Query) or a valid multicast group address (a Group-Specific Query). A General Query applies to all memberships on the interface from which the Query is received. A Group-Specific Query applies to membership in a single group on the interface from which the Query is received. Queries are ignored for memberships in the Non-Member state.
-
"report received" occurs when the host receives a valid IGMP Membership Report message (Version 1 or Version 2). To be valid, the Report message must be at least 8 octets long and have a correct IGMP checksum. A Membership Report applies only to the membership in the group identified by the Membership Report, on the interface from which the Membership Report is received. It is ignored for memberships in the Non-Member or Idle Member state.
-
"timer expired" occurs when the report delay timer for the group on the interface expires. It may occur only in the Delaying Member state.
All other events, such as receiving invalid IGMP messages, or IGMP messages other than Query or Report, are ignored in all states.
There are seven possible actions that may be taken in response to the above events:
-
"send report" for the group on the interface. The type of report is determined by the state of the interface. The Report Message is sent to the group being reported.
-
"send leave" for the group on the interface. If the interface state says the Querier is running IGMPv1, this action SHOULD be skipped. If the flag saying we were the last host to report is cleared, this action MAY be skipped. The Leave Message is sent to the ALL-ROUTERS group (224.0.0.2).
-
"set flag" that we were the last host to send a report for this group.
-
"clear flag" since we were not the last host to send a report for this group.
-
"start timer" for the group on the interface, using a delay value chosen uniformly from the interval (0, Max Response Time], where Max Response time is specified in the Query. If this is an unsolicited Report, the timer is set to a delay value chosen uniformly from the interval (0, [Unsolicited Report Interval] ].
-
"reset timer" for the group on the interface to a new value, using a delay value chosen uniformly from the interval (0, Max Response Time], as described in "start timer".
-
"stop timer" for the group on the interface.
In all of the following state diagrams, each state transition arc is labeled with the event that causes the transition, and, in parentheses, any actions taken during the transition. Note that the transition is always triggered by the event; even if the action is conditional, the transition still occurs.
________________
| |
| |
| |
| |
--------->| Non-Member |<---------
| | | |
| | | |
| | | |
| |________________| |
| | |
| leave group | join group | leave group
| (stop timer, |(send report, | (send leave
| send leave if | set flag, | if flag set)
| flag set) | start timer) |
________|________ | ________|________
| |<--------- | |
| | | |
| |<-------------------| |
| | query received | |
| Delaying Member | (start timer) | Idle Member |
---->| |------------------->| |
| | | report received | |
| | | (stop timer, | |
| | | clear flag) | |
| |_________________|------------------->|_________________|
| query received | timer expired
| (reset timer if | (send report,
| Max Resp Time | set flag)
| < current timer) |
-------------------
The all-systems group (address 224.0.0.1) is handled as a special case. The host starts in Idle Member state for that group on every interface, never transitions to another state, and never sends a report for that group.
In addition, a host may be in one of two possible states with respect to any single network interface:
-
"No IGMPv1 Router Present", when the host has not heard an IGMPv1 style query for the [Version 1 Router Present Timeout]. This is the initial state.
-
"IGMPv1 Router Present", when the host has heard an IGMPv1 style query within the [Version 1 Router Present Timeout].
There are two events that can cause state transitions:
-
"IGMPv1 query received", when the host receives a query with the Max Response Time field set to 0.
-
"timer expires", when the timer set to note the presence of an IGMPv1 router expires.
And a single action that can be triggered by an event:
- "set timer", setting the timer to its maximum value [Version 1 Router Present Timeout] and (re)starting it.
________________
| |
| |
| No IGMPv1 |
| Router |
| Present |
| |
---->| |----
| | | |
| |________________| |
timer expires | | IGMPv1 query
| ________________ | received
| | | | (set timer)
| | | |
| | | |
-----| IGMPv1 |<---
| Router |
| Present |
| |
---->| |----
| |________________| |
| |
| IGMPv1 query received |
| (set timer) |
---------------------------