# Multicast ![[Internet Protocol - Wikipedia#^7vnt98]] Because multicast traffic is many-to-many traffic, it only supports UDP. TCP does not work because the TCP handshake assumes one-to-one traffic. The act of expressing interest in receiving multicast traffic is called *joining a multicast group*, and similarly a host can *leave a multicast group* at any time. With IPv4 this is achieved using the Internet Group Management Protocol (IGMP), while IPv6 uses the Multicast Listener Discovery (MLD) (part of ICMPv6). ![[What Is the Internet Group Management Protocol (IGMP)#^n1c9i1]] The main advantage of multicast is that we don't have to duplicate the same traffic across multiple anycast streams when multiple clients are interested in it. The main use case for multicast is IPTV. One could wrongly assume that multicast is widely used for video streaming, but that is not the case simply because each client can pause their stream independently of other clients (without effecting them). ![[Introduction to Multicast#^hfjlzx]] Both [[Multicast DNS - Wikipedia|mDNS]] (multicast DNS) and its extension [[Zero-Configuration Networking - Wikipedia|zero-configuration networking]] (zeroconf) use multicast. Many IoT devices such as TVs (for streaming), printers, and smart home control apps use these services to announce their presence on a network, simplifying configuration, or even making it unnecessary. ## Multicast at the Data Link Layer By default, multicast at the data link layer is handled the same way as broadcast, that is multicast traffic is forwarded to all data link layer nodes. Switches identify that they are dealing with multicast traffic based on a special class of MAC addresses (multicast MAC addresses). Traffic to these MAC addresses is broadcast (by default), and port/MAC address mapping is not kept in its CAM table. ![[Multicast Address - Wikipedia#^p34m5c]] ![[Multicast Addressing Guide for IP & MAC Multicast Addresses#^103sb1]] Note that different multicast groups are mapped to different MAC addresses, allowing NICs to discard irrelevant traffic at the hardware level for performance. With IPv4 32 multicast groups are mapped to the same MAC address, meaning that some traffic might not be discarded by the NIC, requiring additional software-level filtering. ![[Multicast Addressing Guide for IP & MAC Multicast Addresses#^gmpszf]] ![[Multicast Addressing Guide for IP & MAC Multicast Addresses#^cfg3jk]] ### Converting IPv4 Multicast Groups to Multicast MAC Addresses ![[Multicast Addressing Guide for IP & MAC Multicast Addresses#^glwaft]] ### IGMP Snooping Because broadcasting all multicast traffic can overwhelm networking equipment, often times switches implement IGMP snooping, in which they interpret IGMP to determine which ports are interested in particular IGMP groups. ![[Introduction to Multicast#^go5r4v]]