21.1. Introduction21.2. Multicast AddressesIPv4 Class D AddressesIPv6 Multicast AddressesScope of Multicast AddressesMulticast Sessions21.3. Multicasting versus Broadcasting on a LAN21.4. Multicasting on a WAN21.5. Source-Specific Multicast21.6. Multicast Socket OptionsIP_ADD_MEMBERSHIP, IPV6_JOIN_GROUP, MCAST_JOIN_GROUPIP_DROP_MEMBERSHIP, IPV6_LEAVE_GROUP, MCAST_LEAVE_GROUPIP_BLOCK_SOURCE, MCAST_BLOCK_SOURCEIP_UNBLOCK_SOURCE, MCAST_UNBLOCK_SOURCEIP_ADD_SOURCE_MEMBERSHIP, MCAST_JOIN_SOURCE_GROUPIP_DROP_SOURCE_MEMBERSHIP, MCAST_LEAVE_SOURCE_GROUPIP_MULTICAST_IF, IPV6_MULTICAST_IFIP_MULTICAST_TTL, IPV6_MULTICAST_HOPSIP_MULTICAST_LOOP, IPV6_MULTICAST_LOOP21.7. mcast_join and Related FunctionsExample: mcast_join FunctionHandle indexCopy address and call setsockoptHandle indexHandle nameSpecify defaultCopy addressHandle index, name, or defaultExample: mcast_set_loop Function21.8. dg_cli Function Using MulticastingIP Fragmentation and Multicasts21.9. Receiving IP Multicast Infrastructure Session AnnouncementsWell-Known name and Well-Known portCreate UDP socketbind portJoin multicast groupPacket formatRead UDP datagram, print sender and contentsCheck SAP headerFind beginning of announcement and print21.10. Sending and ReceivingCreate sending socketCreate receiving socket and bind multicast address and portJoin multicast group and turn off loopbackfork and call appropriate functionsObtain hostname and form datagram contentsSend datagram, then go to sleepAllocate socket address structureRead and print datagramsExample21.11. Simple Network Time Protocol (SNTP)Get multicast IP addressBind wildcard address to socketGet interface listJoin multicast groupRead and process all NTP packetsValidate packetObtain transmit time from NTP packet21.12. SummaryExercises