Multicast+(routing)

=**Multicast Routing**=

Related Pages include component="pageList" hideInternal="true" tag="multicast" limit="10"

toc
 * ===**__Dense-Mode__**===
 * assumes multicast group should be accessible in every subnet
 * forward traffic on all configuration interfaces
 * some exceptions to prevent looping (never out interface received)
 * allows routers to ask not to receive multicast group
 * usually the case if both are true:
 * router has no downstream routers that need packets from that group
 * router does not know if ant hosts that joined that group
 * sends a Prune message
 * ====__**Routing Protocols**__====
 * =====**__Protocol Independent Multicast Dense Mode (PIM-DM)__**=====
 * **Adjacencies**
 * PIMv1
 * does not use Hello
 * uses PIM Query message
 * IP Protocol # 2
 * 224.0.0.2
 * PIMv2
 * sends Hello every 30 seconds on all PIM interfaces
 * IP Protocol # 103
 * 224.0.0.13 destination (all PIM routers)
 * contains Holdtime value (typically Hello interval x 3)
 * if receiver doesn't receive for Holdtime period, neighbor considered dead
 * **Source-Based Distribution Trees**
 * if PRF succeeds then send to all neighbors but one received from
 * root is source
 * nodes are routers
 * branches & leaves are subnets connected to the routers
 * sometimes called Shortest-Path Tree (SPT)
 * notation (S,G) refers to a particular SPT
 * S - source's IP address
 * G - multicast group address
 * **Prune Message**
 * removes an interface from SPT
 * if Prune timer expires then traffic resumes (3 minute default)
 * PIMv2 uses State Refresh messages
 * Reacting to Failed link
 * PIM Graft message to reactivate pruned link
 * Pruning Rules
 * upstream router - router that packets are received from
 * downstream router - router that packets are sent to
 * Main Reasons
 * when receiving packets on non-RPF interface
 * when router realizes:
 * no locally connected hosts are listening for the group
 * no downstream routers are listening
 * **State Refresh Message**
 * can be sent just before Prune timer expires; keeps the interface in pruned state
 * when received, Prune timer is reset
 * **Graft Message**
 * allows routers to unprune an interface
 * sent out PRF interface to upstream router
 * Graft Ack sent as response
 * **Configuration**
 * config# ip multicast-routing
 * config-if# ip pim dense-mode
 * show ip mroute (multicast routing table)
 * =====**__Distance Vector Multicast Routing Protocol (DVMRP)__**=====
 * IOS doesn't fully support this, only connectivity to a network using this
 * distance vector routing protocol similar to RIPv2
 * route updates sent every 60 seconds
 * considers 32 hops as infinity
 * send Probe messages to find neighbors
 * 224.0.0.4 - all DVMRP routers
 * =====**__Multicast Open Shortest Path First (MOSPF)__**=====
 * group membership LSA type 6
 * calculated on-demand when first multicast received
 * all routers know where attached group members are
 * PRF is not required since OSPF is loop free
 * IOS does not support MOSPF
 * ===**__Reverse Path Forwarding__**===
 * prevents loops
 * ====**__Process__**====
 * look at source IP of multicast packet
 * if route matches source and has outgoing interface that the packet was received on, packet passes the check
 * ====**__Protocol Differences__**====
 * **DVMRP** - maintains seperate multicast routing table which is uses for RPF check
 * **PIM** & Core-Based Tree (CBT) - use unicast routing table for check
 * can also use:
 * DVMRP routing table
 * Multiprotocol Border Gateway Protocol (MBGP) route table
 * statically configured multicast routes
 * **Multicast OSPF (MOSPF)** - does not use RPF, uses Dijkstra for forward and backward routes
 * ===**__LAN-Specific Issues__**===
 * ====**__Prune Override Message__**====
 * two downstream routers connected to same upstream router
 * one wants to prune, other wants the traffic
 * a Prune message is sent and received by the upstream and the other downstream router
 * upstream know that it is a multiaccess network and delays the pruning for 3 seconds
 * the other downstream router send a Join to counter the pruning
 * ====**__Assert Message__**====
 * if two or more routers are on the same LAN
 * routers negotiate responsibility for forwarding traffic
 * determines winner by:
 * lowest administrative distance of routing protocol used to lean the route
 * router with the lowest advertised routing protocol metric
 * router with highest IP address on the LAN
 * ====**__Designated Routers__**====
 * uses Hello messages
 * the Highest IP wins
 * mainly when IGMPv1 is used
 * ===**__Sparse-Mode__**===
 * group users are located in few subnets
 * does not forward to other routers unless it receives a message that requests it
 * downstream router sends packet if:
 * it has received a request from a different downstream router
 * a host that is directly connected sends an IGMP Join message for a group
 * ====**__Rendezvous Point (RP)__**====
 * the source sends group traffic is here, it is not auto-forwarded to other routers
 * PRF checks use IP of the RP
 * ====**__Routing Protocols__**====
 * =====**__Protocol Independent Multicast Sparse Mode (PIM-SM)__**=====
 * assumes
 * no hosts want to receive
 * downstream routers continually send Join messages
 * if not received, port goes into pruned state
 * similar to PIM-DM
 * neighbor discovery using Hello messages
 * recalculated RPF if routing table changes
 * elects DR on multiaccess networks
 * uses Prune Overrides on multiaccess networks
 * uses Assert messages
 * ======**__Rendezvous Point (RP)__**======
 * sources send packets to router called Rendezvous Point
 * RP sends multicast to routers/hosts that requested it
 * process uses a shared tree
 * ======**__Process__**======
 * Host sends multicast to downstream router
 * router sends unicast PIM Register message to RP
 * original multicast packet is encapsulated inside
 * RP hash no one registered, responds with unicast Register-Stop message
 * upstream receives Register-Stop
 * starts 1 minute Register-Suppression timer
 * 5 seconds before expires, sends another Register
 * flag set named Null-Register bit and does not encapsulate anything
 * RP receives, if still no registrations then send Register Stop else send nothing and let timer expire
 * RP de-encapsulates and sends to receiving hosts
 * RP sends PIM Join to source
 * starts receiving multicast traffic
 * sill receives Register message with encapsulated packets
 * RP sends Register-Stop to course
 * ======**__Joining the Shared Tree__**======
 * called Root-Path Tree (PRT) is the tree with the RP as the root
 * ======**__Shared Distribution Trees__**======
 * network has multiple sources for the same group
 * ======**__Shortest-Path Tree Switchover__**======
 * routers switch from RPT to source-specific SPT after they receive their first packet from the shared tree
 * config# ip pim spt-threshold
 * **Process**
 * source sends to first router (R1)
 * forwards to RP (R2)
 * forwards to next-hop router (R4) via shared tree
 * this router learns source address of multicast group
 * consults unicast routing table
 * finds next-hop to course
 * sends PIM Join to (R1)
 * R1 starts sending to R4
 * ======**__Pruning the Shared Tree__**======
 * after switching from RPT to SPT we might not need the RPT anymore
 * can ask RP to stop sending traffic
 * send PIM-SM Prune to RP
 * references SPT, identifies IP of source
 * says stop forwarding from source IP to the listed group address down the RPT
 * ======**__Dynamically Finding RPs and Using Redundant RPs__**======
 * **Auto-RP**
 * RP sends RP Announce - 224.0.1.39
 * advertises groups
 * sends every minute
 * Mapping Agent
 * learns all RPs and groups they support from the RP Announce
 * sends RP Discovery - 224.0.1.40
 * selects highest IP address as RP for the group
 * Process
 * each RP is configured to use Auto-RP and to announce
 * the Mapping Agent listens for announcements
 * the Mapping Agent builds a mapping table from them
 * lists the best RP for each range of multicast groups
 * the Mapping Agent sends RP Discover message
 * all routers listen for the Discover message to find the current RP
 * Sparse-Dense Mode
 * the router uses PIM-DM rules when it doesn't know the location of the RP
 * the router uses PIM-SM when it does know an RP
 * config# ip pim sparse-dense-mode
 * Auto RP Listener
 * use sparse mode on interface
 * only Auto-RP traffic is flooded out all sparse interfaces
 * config# ip pim autorp listener
 * Configuration
 * config# ip multicast-routing
 * config-if# ip pim sparse-mode
 * config# ip pim autorp-listener
 * config# ip pim send-rp-discovery scope 10
 * config# interface Loopback 0
 * config-if# ip pim sparse-mode
 * config# ip pim send-rp-announce Loopback0 scope 10
 * **BootStrap Router (BSR)**
 * similar to mapping agent
 * Differences
 * does not pick best RP, sends all of them
 * each PIM router picks best
 * floods mapping information, 224.0.0.13 (all PIM routers)
 * does not require routers to have known RP or dense-mode
 * flood bootstrap messages out all non-RPF interfaces
 * Candidate RP (c-RP)
 * send unicast advertisements to BSR
 * multiple BSRs supported
 * Candidate BSR (c-BSR)
 * send bootstrap messages that include priority and IP
 * highest priority, then highest IP wins
 * winner continues to send bootstrap messages
 * if stops, redundant BSR can take over
 * Configure
 * config-if# ip pim sparse-mode (loopback and MC interfaces)
 * config-if# ip pim bsr-candidate Loopback0 0 (priority; default)
 * **Anycast RP with MSDP**
 * can use static RP, Auto-RP and BSR
 * without anycast RP
 * use one RP for some groups and another RP for other groups
 * with anycast RP
 * multiple RPs cancurrently acting as RP for same group
 * each RP uses same IP
 * typically advertised with /32 prefix, with IGP
 * **Interdomain Multicast Routing with MSDP**
 * Anycast RP Problem
 * all RPs build own shared tree
 * RP closest to source will learn source
 * other RPs might not learn source if they never receive a packet from the source
 * solution would be to share all known sources
 * **Multicast Source Discovery Protocol (MSDP)**
 * when PIM router registers a source with RP
 * RP sends messages to peer RPs
 * Source Active (SA) message
 * lists IPs of each source for each group
 * sent as unicast over TCP
 * sends every 60 seconds
 * peers must be statically configured
 * RPs must have routers to other peers and sources
 * typically BGP or Multicast BGP (MBGP)
 * RP can request SA with a SA-Request message
 * config# ip msdp peer 172.16.1.1
 * =====**__Bidirectional PIM__**=====
 * slightly changing rules used by PIM-SM
 * ======**__Process__**======
 * RP builds shared tree with self as root
 * when source sends multicast
 * receiving router doesn't use PIM-Register
 * forwards all packets up tree to RP
 * RP receives multicast traffic, sends down tree
 * leaf routers do not join SPT either
 * =====**__Source-Specific Multicast (SSM)__**=====
 * uses IGMPv3
 * config# ip pim ssm default
 * config-if# ip igmp version 3
 * ===__Scoping__===
 * determines how far multicast traffic will travel
 * ====**__TTL__**====
 * threshold set on interface
 * if packet TTL is higher or equal to threshold the forward it
 * default is 0
 * ====**__Administrative__**====
 * private addresses 239.0.0.0 - 239.255.255.255
 * requires manual configuration
 * you can configure and apply a filter on an interface to disallow private addresses
 * ===__M-Route Table Flags__===
 * D - dense
 * S - sparse
 * C - directly connected
 * L - local
 * P - pruned
 * R - RP bit set
 * F - register flag
 * T - SPT bit set
 * J - join SPT
 * J - join SPT