Icmp Igmp
Icmp Igmp
Group Management
For multicasting in the Internet we need routers
that are able to route multicast packets.
The routing tables of these routers must be Message Format
updated by using one of the multicasting Figure 21.17 shows the format of an IOMP
routing protocols that we discuss in Chapter 22. (version 2) message.
IGMP is not a multicasting routing protocol; it is
a protocol that manages group
membership. In any network, there are one or
more multicast routers that distribute
multicast packets to hosts or other routers. The
IGMP protocol gives the multicast routers
information about the membership status of hosts
(routers) connected to the network.
A multicast router may receive thousands of
multicast packets every day for different
groups. If a router has no knowledge about the
membership status of the hosts, it must Type. This 8-bit field defines the type of
broadcast all these packets. This creates a lot of message, as shown in Table 21.1. The value
traffic and consumes bandwidth. A better of the type is shown in both hexadecimal and
solution is to keep a list of groups in the network binary notation.
for which there is at least one loyal
packets destined for that group. This means that
if there are three multicast routers
connected to a network, their lists of groupids are
mutually exclusive. For example, in
Figure 21.18 only router R distributes packets
with the multicast address of225.70.8.20.
A host or multicast router can have membership
in a group. When a host has membership,
Maximum Response Time. it means that one of its processes (an application
program) receives multicast packets
This 8-bit field defines the amount of time in from some group. When a router has
which a membership, it means that a network connected
query must be answered. The value is in tenths of to
a second; for example, if the value is 100, it one of its other interfaces receives these
means 10 s. The value is nonzero in the query multicast packets. We say that the host or the
message; it is set to router has an interest in the group. In both cases,
zero in the other two message types. We will see the host and the router keep a list of
its use shortly. groupids and relay their interest to the
D Checksum. This is a 16-bit field carrying the distributing router.
checksum. The checksum is calculated For example, in Figure 21.18, router R is the
over the 8-byte message. distributing router. There are two
D Group address. The value of this field is 0 for other multicast routers (R1 and R2) that,
a general query message. The value depending on the group list maintained by
defines the groupid (multicast address of the router R, could be the recipients of router R in
group) in the special query, the membership this network. Routers RI and R2 may be
report, and the leave report messages. distributors for some of these groups in other
networks, but not on this network.
Joining a Group
A host or a router can join a group. A host
IGMP Operation maintains a list of processes that have
IGMP operates locally. A multicast router membership
connected to a network has a list of multicast in a group. When a process wants to join a new
addresses of the groups with at least one loyal group, it sends its request to the host.
member in that network (see Figure 21.18).
The host adds the name of the process and the
name of the requested group to its list. If
this is the first entry for this particular group, the
host sends a membership report message.
If this is not the first entry, there is no need to
send the membership report since the
host is already a member of the group; it already
receives multicast packets for this group.
The protocol requires that the membership report
For each group, there is one router that has the be sent twice, one after the other
duty of distributing the multicast
within a few moments. In this way, if the first this message, the group address field is set to
one is lost or damaged, the second one 0.0.0.0. This means the query for membership
replaces it. continuation is for all groups in which a host is
involved, not just one.
Leaving a Group
The router expects an answer for each group in
When a host sees that no process is interested in its group list; even new groups may
a specific group, it sends a leave report. respond. The query message has a maximum
Similarly, when a router sees that none of the response time of 10 s (the value of the
networks connected to its interfaces is field is actually 100, but this is in tenths of a
interested in a specific group, it sends a leave second). When a host or router receives the
report about that group. general query message, it responds with a
However, when a multicast router receives a membership report if it is interested in a
leave report, it cannot immediately group. However, if there is a common interest
purge that group from its list because the report (two hosts, for example, are interested in
comes from just one host or router; the same group), only one response is sent for
there may be other hosts or routers that are still that group to prevent unnecessary traffic.
interested in that group. To make sure, This is called a delayed response. Note that the
the router sends a special query message and query message must be sent by only one router
inserts the groupid, or multicast address, (normally called the query router), also to
related to the group. The router allows a prevent unnecessary traffic. We discuss
specified time for any host or router to respond. this issue shortly.
If, during this time, no interest (membership
report) is received, the router assumes that
there are no loyal members in the network and
purges the group from its list. Delayed Response
To prevent unnecessary traffic, IGMP uses a
Monitoring Membership delayed response strategy. When a host or
router receives a query message, it does not
A host or router can join a group by sending a respond immediately; it delays the response.
membership report message. It can leave Each host or router uses a random number to
a group by sending a leave report message. create a timer, which expires between I and
However, sending these two types of reports lOs. The expiration time can be in steps of I s or
is not enough. Consider the situation in which less. A timer is set for each group in the
there is only one host interested in a list. For example, the timer for the first group
group, but the host is shut down or removed from may expire in 2 s, but the timer for the third
the system. The multicast router will group may expire in 5 s. Each host or router
never receive a leave report. How is this waits until its timer has expired before sending
handled? The multicast router is responsible a membership report message. During this
for monitoring all the hosts or routers in a LAN waiting time, if the timer of another host or
to see if they want to continue their router, for the same group, expires earlier, that
membership in a group. host or router sends a membership report.
The router periodically (by default, every 125 s) Because, as we will see shortly, the report is
sends a general query message. In broadcast, the waiting host or router receives
the report and knows that there is no need to send at the data link layer. What happens next depends
a duplicate report for this group; thus, on whether the underlying data link
the waiting station cancels its corresponding layer supports physical multicast addresses.
timer. Physical Multicast Support Most LANs support
physical multicast addressing. Ethernet
is one of them. An Ethernet physical address
Encapsulation (MAC address) is six octets (48 bits)
The IGMP message is encapsulated in an IP long. If the first 25 bits in an Ethernet address are
datagram, which is itself encapsulated in a 0000000100000000010111100, this
frame. See Figure 21.20. identifies a physical multicast address for the
TCP/IP protocol. The remaining 23 bits can
be used to define a group. To convert an IP
multicast address into an Ethernet address, the
multicast router extracts the least significant 23
bits of a class D IP address and inserts
them into a multicast Ethernet physical address
(see Figure 21.21).