Multicast

=Multicast=

__Related Pages__
include component="pageList" hideInternal="true" tag="multicast" limit="10"

toc
 * sending a message from a single source to selected multiple destinations across a layer 3 network in on data stream
 * problems with unicast and broadcast
 * unicast uses a lot of bandwidth
 * broadcast wastes bandwidth and increases processing load on network devices
 * ===__Requirements__===
 * designated range of layer 3 addresses
 * only used by multicast applications
 * multicast address only as destination address, not source
 * address doesn't specify recipients address
 * address signifies that packet is for specific multicast application
 * hosts on LAN use standard method to calculate layer 2 multicast address from layer 3
 * example - OSPF multicast address is 224.0.0.5 which becomes 0100.5e00.0005
 * must be mechanism for informing connected router
 * Internet Group Management Protocol (IGMP)
 * between hosts and routers in same subnet
 * Cisco Group Management Protocol (CGMP)
 * or IGMP snooping helps switches learn which ports
 * ====__**Routing Protocols**__====
 * Distance Vector Multicast Routing Protocol (DVMRP)
 * Multicast Open Shortest Path First (MOSPF)
 * Protocol Independent Multicast (PIM)
 * dense mode (PIM-DM)
 * sparse mode (PIM-SM)
 * ===__Disadvantages__===
 * uses udp - lack of tcp windowing and slow-start can result in congestion
 * some multicast protocols occasionally generate duplicate packets and deliver packets out of oder
 * ===__Layer 3 Addresses__===
 * an address represents a multicast application, referred to as multicast group
 * source address always unicast
 * ====__**Range & Structure**__====
 * IANA assigned class D address to multicast
 * first 4 bits always 1110
 * 224.0.0.0 - 239.255.255.255
 * ====__**Well-Known**__====
 * =====**Permanent**=====
 * 224.0.0.0 - 224.0.1.255
 * 2 groups, 1 is forwarded by routers, other isn't
 * 224.0.0.0 - 224.0.0.255 (no routed)
 * 224.0.1.0 - 224.0.1.255 (router)
 * 224.0.0.9 - RIPv2 routers
 * 224.0.0.10 - EIGRP routers
 * 224.0.0.13 - PIM routers
 * 224.0.0.22 - IGMPv3
 * 224.0.0.25 - RGMP
 * 224.0.1.39 - Cisco-RendezvousPoint-Announce
 * 224.0.1.40 - Cisco-RendezvousPoint-Discovery
 * =====**Source-Specific Multicast (SSM)**=====
 * 232.0.0.0 - 232.255.255.255
 * allows host to select source of multicast
 * makes multicast routing efficient
 * host can select better-quality source
 * =====**GLOP**=====
 * 233.0.0.0 - 233.255.255.255
 * experimental
 * can be used by anyone who owns ASN
 * 233 as first octet, ASN for 2nd and 3rd
 * =====**Private**=====
 * 239.0.0.0 239.255.255.255
 * must configure routers to ensure multicast traffic doesn't leave its domain boundaries
 * ====**__Transient Groups__**====
 * when an enterprise wants address for global multicast application
 * can use any multicast address that's not part of the well known permanent address space
 * entire internet must share
 * must be dynamically allocated
 * must be released when no longer used
 * ===__Layer 2 Addresses__===
 * OUI is always 01-00-5E
 * ====__**Steps**__====
 * convert IP to binary
 * first 4 bits are always 1110
 * replace first 4 bits with OUI
 * replace next 5 bits of IP with a 0
 * convert 2ns half (24 bits) to 6 hex digits
 * doesn't provide completely unique MAC address
 * ===__Managing Distribution of Traffic__===
 * communication between router and hosts connected to it
 * since multicast never uses source address, switch can't learn them and just floods
 * needs to snoop IGMP
 * ====__**Joining a Group**__====
 * is the process of installing and running a multicast application
 * host software calculates multicase MAC address and starts listening for it
 * ====**__Internet Group Management Protocol (IGMP)__**====
 * evolved from Host Membership Protocol
 * IP datagrams with IP Protocol number 2
 * TTL set to 1 so routers won't forward it
 * informs router that host wants to receive multicast
 * informs router when hosts wants to leave group
 * automatically enabled when multicast routing and PIM is configured
 * ====__**IGMPv2**__====
 * =====**Fields**=====
 * **Type (8)**
 * Membership Query (0x11) - used by routers to discover presence of group members on subnet, usually sent after leave group
 * Membership Report Version 1 (0x12) - sent by group member to router
 * Membership Report Version 2 (0x16) - sent by group member to router
 * Leave Group (0x17) - sent by group member to router
 * **Maximum Response Time (8)**
 * only included in Query messages
 * 1/10 second units (10 seconds default)
 * 1 - 255 (0.1 - 25.5)
 * **Checksum (16)**
 * computed by source
 * uses whole IP payload
 * **Group Address**
 * General Query - 0.0.0.0
 * =====**Features**=====
 * leave group messages
 * group-specific query messages
 * maximum response time field
 * queries election process - selecting preferred router for sending query messages when multiple routers exist on the same subnet
 * =====**Host Membership Query Functions**=====
 * routers send query messages on a Query Interval (60 seconds default)
 * destination IP 224.0.0.1 (01-00-5E-00-00-01)
 * source IP and MAC is router interface
 * TTL of 1 to prevent from being routed
 * =====**Host Membership Report Function**=====
 * replies to queries from router
 * sends when first joins group (Unsolicited Host Membership Report)
 * **Solicited Host Membership Report**
 * Report Suppression Mechanism
 * uses Maximum Response Timer (MRT)
 * picks random time between 0 and MRT
 * send report when the random timer expires
 * wil not send if other host already has
 * **Unsolicited Host Membership Response**
 * doesn't have to wait for query
 * sent when multicast application launched
 * =====**Leave Group & Group-Specific Query Messages**=====
 * when a host leaves a group, sends Leave Group message
 * when router receives Leave message
 * send Group-Specific query to see if it can stop forwarding traffic for that group
 * **Last Member Query Interval** - MRT value (Specific Query timeout)
 * **Last Member Query Count** - number of retry attempts (default 2)
 * =====**Querier**=====
 * election when multiple routers on subnet
 * when router starts, sends general query to 224.0.0.1
 * if a router receives general query, compares source address
 * lowest IP is elected
 * non-elected router monitors how often querier sends general queries
 * after 2 Query Intervals and 1/2 Query Response Interval
 * considers querier dead, elects new querier
 * considered Other Querier Present Interval
 * default is 255 seconds (2*125 + 2/10)
 * =====**Timers**=====
 * **Query Interval** - general queries, default 125 seconds
 * **Query Response Interval** - default 10 seconds
 * **Query Membership Interval** - default 260 seconds
 * **Other Querier Present Interval** - default 255 seconds
 * **Last Member Query Interval** - default 1 seconds
 * **Version 1 Router Present Timeout** - default 400 seconds
 * ====__**IGMPv3**__====
 * helps against DoS attacks
 * hosts can filter incoming traffic based on source IP
 * Source-Specific Multicast
 * host can indicate interest in receiving packets only from specific source address or from all but a specific source
 * hosts sends Membership Report message
 * 224.0.0.22
 * message type - 0x22
 * includes note: Source-INCLUDE-192.168.1.1
 * ===__LAN Optimizations__===
 * ====__**Cisco Group Management Protocol (CGMP)**__====
 * layer 2 protocol
 * proprietary
 * must be enabled on both ends of the router-switch connection
 * destination address - 01-00-0C-DD-DD-DD (multicast)
 * forces switches to flood, so all switches receive
 * pairs of MAC address
 * Group Destination Address (GDA)
 * Unicast Source Address (USA)
 * =====**Process**=====
 * router connects to switch, sends Join Message
 * GDA set to 0
 * USA set to own MAC
 * repeats every 60 seconds
 * if router receives IGMP JOIN from host, examines layer 2 information
 * sends CGMP Join to switch with GDA set to source MAC of IGMP message
 * when host leaves, router generates CGMP Leave message
 * GDA - Multicast MAC address
 * USA - Unicast MAC address
 * when switch receives Leave
 * search for port associated with USA
 * remove port from CAM that is associated with GDA
 * =====**Messages**=====
 * Add USA port to group
 * Join
 * GDA - Group MAC
 * USA - Host MAC
 * Delete USA port form group
 * Leave
 * GDA -Group MAC
 * USA - Host MAC
 * Learn which ports connect to CGMP router
 * Join
 * GDA - 0
 * USA - Router MAC
 * Release CGMP router port
 * Leave
 * GDA - 0
 * USA - Router MAC
 * Delete group from CAM
 * Leave
 * GDA - Group MAC
 * USA - 0
 * Delete all groups from CAM
 * Leave
 * GDA - 0
 * USA - 0
 * ====__**IGMP Snooping**__====
 * switch examines IGMP messages and learns location of multicast routers and group members
 * =====**Steps**=====
 * detect multiple routers in same subnet
 * **IGMP General Query Message** - GDA 01-00-5E-00-00-01
 * **OSPF** - GDA 01-00-5E-00-00-05 or 01-00-5E-00-00-06
 * **Protocol Independent Multicast (PIM) & HSRP Hello** - GDA 01-00-5E-00-00-02
 * **PIMv2 Hello** - GDA 01-00-5E-00-00-OD
 * **Distance Vector Multicast Routing Protocol (DVMRP)** - GDA 01-00-5E-00-00-04
 * when switch detects router ports in VLAN, added to port list of all GDAs in the VLAN
 * =====**Configuration**=====
 * config# ip igmp snooping
 * config# no ip igmp snooping vlan 20
 * config# ip igmp snooping last-member-query-interval 500
 * config# ip igmp snooping vlan 22 immediate-leave
 * Port 0 meant for CPU
 * ====__**Router-Port Group Multicast Protocol (RGMP)**__====
 * layer 2 protocol
 * router communicates to switch which group traffic it does and does not want
 * cisco proprietary
 * doesn't work with CGMP (disabled by RGMP and vice-versa)
 * works well with IGMP snooping
 * =====**Messages**=====
 * **Hello** - default every 30 seconds, switch stops forwarding multicast traffic on port that hello was received
 * **Join** - starts forwarding on port received
 * **Leave** - stops forwarding on port received
 * **Bye** - when RGMP disabled on router

Class D: 224-239 224.0.0.1-224.0.0.255 is reserved for protocols Protocol Independent Multicasting (PIM)

=Basic Configuration=

config# ip multicast-routing config# interface s0/0 config-if# ip pim sparse-dense-mode =Testing=

config-if# ip igmp join-group 230.240.100.1 (interface closest to multicast server)
 * 1) ping 230.240.100.1 (from a multicast client)

=Sparse Mode (less bandwidth)=

config# ip pim rp-address 192.168.1.3

=Frame Relay (that doesnt allow broadcast or multicast)=

config-if# ip pim nbma-mode (only sparse; converts to unicast)

=Auto-Create Rendezvous Points (only sparse-dense)=

config# ip pim send-rp-announce s0/0.1 1...255 (ttl; use loopback for applying to multiple interfaces) config# ip pim send-rp-discovery 1...255 (accumulates RP addresses) config# ip pim accept-rp auto-rp (for clients)

=Restrict Multicasts=

config-if# ip multicast [ttl-]threshold 1...255 (subtracts from ACL) config-if# ip multicast boundry

=Switches=

config# ip igmp snooping (switch wont broadcast multicasts)

=View/Debug Commands=

show ip pim interface show ip mroute show ip pim rp map