Designing multicast programs

This topic describes IP multicasting and how an application can exploit multicasting using the TCP/IP socket APIs. IP multicasting concepts in IPv4 and IPv6 protocols are very similar; however there are some differences, such as the IP addresses used for multicasting with each protocol. The topic that follows introduces the basic concepts for IP multicasting with an emphasis on IPv4. However, most of the concepts described here apply to IPv6 multicast applications as well. A more detailed description of IPv6 multicast options follows in the next topic.

IPv4 has three types of IP addresses: unicast, broadcast, and multicast. When an IP datagram is sent to an individual IP address, it is called a unicast IP datagram. The process of sending the datagram is called unicasting. Unicasting is used when two IP nodes are communicating with each other.

When an IP datagram is sent to all nodes on a specific network, it is called broadcasting. Broadcasting support can be both limited and directed.

Multicasting is used to send an IP datagram to a group of systems identified by a class D address. The class D address is used as the destination address. When an application program requests that it receive datagrams with a particular class D destination IP address, it is said to have joined a multicast group. Multicast datagrams (datagrams with a class D destination address) are discarded by a host system unless an application on that host has joined the matching multicast group. The UDP application must bind in order to receive multicast datagrams, after which the application can then receive an IP datagram. The application can receive an IP datagram in two ways:

When a host is added to a group that group is referred to as a host group. A host group may span multiple networks. Hosts may join and leave a host group as necessary and there is no restriction to the number of hosts involved in a group. A host does not have to belong to a group to send a message to that group. Any hosts on an IP Internet can join a multicast group. The hosts need not be on a single LAN and may be separated by routers. When an application joins a group, it joins the multicast group on a specific interface. Routers use this information to determine if multicast datagrams should be forwarded from one interface to another.

Routers and hosts use a multicast routing protocol called Internet Group Management Protocol (IGMP) to share information about multicast groups. Through this protocol, hosts inform routers when they join or leave a multicast group. Routers can query hosts about groups they have joined and use this information in determining whether to forward multicast datagrams. Some multicast group addresses are referred to as permanent host groups. These addresses are assigned by the Internet Assigned Numbers Authority group as well-known addresses similar to the well-known TCP and UDP port numbers. For example, 224.0.0.1 means all systems on this subnet, and 224.0.0.2 means all routers on this subnet. For a review of The Internet Assigned Number RFC to familiarize yourself with more of the well-known standard multicast address see http://www.iana.org/assignments/multicast-addresses for IPv4 multicast address assignments and RFC 2375 for IPv6 multicast address assignments.
Note: z/OS® (OMPROUTE) does not support a multicast routing protocol.