Chapter 17: IP Multicast Routing

Chapter 17: IP Multicast Routing

  • Mcast using Dense Mode
    • instructs the router to forward the multicast traffic on all the configured interfaces, except not forwarding out the interface on which it was received.
    • DM protocols assume that all subnets need to receive a copy of the packets. But they do not want to receive multicast packets for a particular group if: 1) the router does not have any active downstream routers that needs packets for that group, 2) the router does not know of any hosts on directly connected subnets that have joined that group.
    • when these conditions are true, router sends a “prune” message to the upstream router.
    • DVMRP, PIM-DM and MOSPF are dense-mode routing protocols.
  • RPF check
    • use RPF check to prevent loops. Rule: “Look at the source IP address of the multicast packet. If my route that matches the source, lists an outgoing interface that is the actual interface on which the packet was received, the packet passes the RPF check. If not, do not replicate and forward the packet.”
    • Mcast router does not forward any mcast packets unless the packet passes the RPF check.
    • uses shortest path.
    • how different Mcast protocols determine their RPF interfaces
      • DVMRP: maintains separate mcast routing table and uses it for RPF check
      • PIM and CBT: use unicast table for RPF check
      • Multicast OSPF does not use RPF check cuz it computes both forward and reverse shortest-path source-rooted trees by using Dijkstra
  • Mcast using Parse Mode
    • e.g. PIM-SM
    • by default, DM protocols keep forwarding the group traffic unless a downstream router sends a message stating that it does not want that traffic. Sparse-mode protocols do not forward the group traffic to any other routers unless it receives a message from that router requesting copies of packets sent to a particular mcast group. Downstream router requests only when: 1) router received request for packets from downstream router or 2) a host on a directly connected subnet has sent an IGMP join message.
    • PIM-SM begins with packet being forwarded to a special router, RP.
    • all routers configure the RP ip statically.
    • usually loopback IP is used as the RP’s IP address (and advertised via IGPs)
    • critical for all routers to somehow learn the IP address of an RP.
    • RPF check performed by using the IP address of the RP rather than the IP of the source packet.
  • Multicast Scoping
    • TTL Scoping
      • routers compare the TTL value on a multicast packet with a configured TTL value on each outgoing interface.
      • router forwards the mcast packet only on those interfaces whose configured TTL is less than or equal to ttl value in the mcast packet. E.g: ttl is 17 in mcast packet and interface ttl is 0 and 32. It will go out 0 but not 32. By default, Cisco interfaces are configured as 0 ttl.
    • Administrative scoping
      • IP addresses 239.0.0.0 to 239.255.255.255, admin scoped mcast. Sets admin boundaries to limit forwarding of mcast traffic. You can configure and apply a filter on a router’s interface so that multicast traffic with group addresses in private address range is not allowed to enter or exit the interface.
  • Dense-Mode Routing protocols
    • PIMv2 sends hello messages every 30 seconds on every interface on which PIM is configured.
    • PIMv2 Hellos use IP protocol # 103 and reserved Mcast destination address, 224.0.0.13 (ALL-PIM-Routers)
    • holdtime = 3xhello
    • establishing adjacency is very important for PIM.
    • Source Based Distribution Trees:
      • also called Shortest Path Tree (SPT) or simply a source tree.
      • the tree defines a path b/w the source host that originates the multicast packets and all subnets that need to receive a copy of the multicasts sent by that host.
      • configuration:
        • ip multicast-routing
        • (int) ip pim dense-mode (on all interfaces)
      • in the sh ip mroute command:
      • (S,G) refers to a particular SPT or to an individual routers’ part of a particular SPT. Where S is the source’s IP address and G is the group Multicast Address.
      • The C flag indicates that R3 has a directly connected group member for G and T flag indicates that the (S,G) traffic is forwarded SPT. Everytime R3 forwards a packet using (S,G) entry, the timer resets to 3 minutes.
      • the PIM-DM will continue to forward traffic until it is PRUNED.
    • Prune Message:
      • The PIM prune message is sent by one router to a second router to cause the second router to remove the link on which the Prune is received from a particular (S,G) SPT.
      • So if in sh ip mroute, it shows S0/1 as pruned, it means Router won’t forward traffic for G (226.1.1.1) on its s0/1 interface.
      • in PIM-DM, when a router receives a Prune message on an interface, it starts a default 3-minute Prune timer, counting down to 0. If the downstream router still does not want the traffic, it can send a prune message again. This allows downstream router to know the (S,G) traffic is available from the other router.
      • The only interface in which a router will receive and process multicast packets from a particular source is the RPF interface.
      • Rules for Pruning: 2 key rules PIM-DM router must follow to decide when it can request a prune.
        • 1) when receiving packets on a non-RPF interface
        • 2) when a router realizes that both of the following are true: 1) no locally connected hosts in a particular group are listening for packets 2) no downstream routers are listening for the group.
        • P (Prune flag) which means that the router has completely pruned itself from that particular (S,G) SPT.
        • combination of C flag and RPF neighbor 0.0.0.0 indicates that the connected device is the SOURCE of the group.
        • in reality, there is not separate Prune message and Join message; PIM-DM and PIM-SM use a single message called Join/Prune message. Prune message, G in prune filed and join message, G in join field.
      • PIM-DM reacting to a failed link
        • RD changed its S0/1 interface to forwarding state because of a PIM Graft messages sent by downstream router.
    • Steady state operation and the State Refresh Message
      • when Cisco created PIMv2, created a feature called “State refresh”. Prevents inefficient method of PIMv1 of pruning and automatically unpruning.
      • The PM state refresh message can be sent just before neighbor’s prune timer expires.
    • Graft Message
      • to allow routers to “unprune” a previously pruned interface from an SPT, PIM-DM includes the GRAFT Message, which puts the upstream router to put the link back into a forwarding state.
  • LAN specific issues with PIM-DM and PIM-SM
    • Prune override: in multi-access networks, when one router sends a prune message doesn’t mean other routers also want to get pruned. Upstream router sets a 3 minute timer once it gets a prune message. The downstream router that doesn’t want to be pruned (it received prune message too on all PIM-Routers address, 224.0.0.13). So this router sends a Join message to upstream router so the upstream router does not remove the interface. This process is called prune override.
    • Assert Messages: PIM-DM message. Used to prevent wasted effort when more than one router attaches to the same LAN. Rather than sending multiple copies of each multicast packet onto the LAN, the PIM assert message allows the routers to negotiate. Assert picks a winner based on the routing protocol and metric used to find the route to reach the unicast address of the source.
      • Router advertising lowest AD used to learn the route wins
      • if tie, lowest advertised routing protocol metric
      • if tie, the router with the highest IP address on LAN wins.
    • Designated routers.
      • PIM hello message elect a DR on Multiaccess network.
      • A PIM (dm or sm) router with the HIGHEST IP address becomes a DR.
      • used mainly with IGMPv1 since it does not have a method to elect a querier. With IGMPv2, it can automatically select querier based on the “lowest” IP address. so PIM DR is not needed for that.
      • on a LAN, one router might win Assert process for a particular (S,G) SPT while another might become the IGMP querier (PIM DR or IGMPv2 querier). Winner of Assert is responsible for forwarding multicasts and winner for querier is responsible for managing the IGMP query messages on LAN.
  • DVMRP:
    • similar to PIM-DM
    • DVMRP uses its own distance vector routing protocol that is similar to RIPv2. Sends route updates every 60 seconds and considers 32 hops as infinity.
    • uses Probe messages to find neighbors using All DVMRP routers group addres, 224.0.0.4
    • uses a truncated broadcast tree, similar to SPT with some links pruned
  • MOSPF
    • uses group membership LSA, Type 6. It floods it throughout the originating router’s area.
    • SPT is calculated “on-demand”, when the first multicast packet for a group arrives.
    • after spf calculations, entries are made into each routers mcast forwarding table.
    • RPF check is not required.
    • Cisco IOS does not support MOSPF.
  • Sparse Mode Routing Protocols. (PIM-SM)
    • assumes no hosts want to receive multicast packets until they ask (opp. to PIM-DM)
    • downstream routers must send PIM Join messages and must continually send Join messages to upstream router.
    • Similarity with PIM-DM:
      • Neighbor discovery using Hello
      • election of a DR on a multi-access network.
      • Prune overrides on Multiaccess networks.
      • Use of Assert messages to elect a designated forwarded on a multi-access network.
    • Sources sending packets to RP
      • 1) sources send the packets to a router called the RP
      • 2) the RP sends the mcast packets to all routers/hosts that have registered to receive packets for that group. This process uses a shared tree.
      • Configuration:
        • (config)ip multicast-routing
        • (int) ip pim sparse-mode (on all the interfaces)
        • (global)ip pim rp-address 10.1.10.3 (RP’s IP address on all the routers)
      • Process:
        • S1 sends the multicast to 228.8.8.8 for e.g.
        • R1 reacts by sending UNICAST PIM Register messages to the RP.
        • RP sends unicast Register-stop messages back to R1 because RP knows that it does not have any need to forward packets sent to 228.8.8.8 since no PIM-SM router has registered.
        • the encapsulated multicast packet (in the first register by R1) will be forwarded by RP had any senders been interested in receiving packets.
        • R1 starts a 1-minute registration suppression timer after it gets a “Register-Stop” form RP.
        • 5 seconds before the timer expires, R1 sends another Register message with the “Null-Register” bit flag set without any encapsulated multicast packets.
        • if the RP still does not have any host who want to receive multicasts, it sends a “Register-Stop” message to R1 again.
        • but if the RP now knows of one router/host, it does not give a response and then R1 (when it’s timer expires) again sends its multicast packets to RP encapsulated in PIM Register messages.
    • Joining the Shared Tree
      • shared tree is also called Root Path Tree (RPT).
      • RPT is a tree with RP as the root (defines over which links multicast should be sent)
      • one such tree exists for each mcast group that is currently active in the internetwork.
      • so once RP receives the mcast packet, RP uses the RPT for that mcast group (G) to determine where to forward these packets.
      • PIM-SM routers create the RPT by sending PIM Join messages toward the RP.
      • Steps:
        • Hosts wants to join G so it sends an IGMP Join to G.
        • Routers react to IGMP Join by sending a PIM Join toward the RP to become part of the shared tree (*, 228.8.8.8). Also puts the interface connected to the host in forwarding state for the RPT for group 228.8.8.8
        • R5 (intermediate router) receives the join so R5 puts that interface in a forwarding state for the shared tree (*,228.8.8.8) and sends a join to RP
        • RP puts its interface in forwarding state for the (*,228.8.8.8) shared tree
        • by the end, RP realizes at least one host needs multicast traffic and RPT for the group is formed with R3’s interface, R5’s interface and R4’s interface
        • (*,G) represents a single RPT.
        • so now RP de-encapsulates the Register message and forwards it. (second function of Register message – first was to inform RP that it has multicast traffic to send)
        • RP sends a PIM-SM Join (10.1.1.10, G) to Router connected to the source.
        • R1 starts forwarding the G traffic to RP. Now RP receives traffic on the SPT from the source.
        • R3 sends a unicast Register-stop message to R1, to stop sending encapsulated unicast Register messages.
        • Process uses the efficient SPT from the source to RP and the shared tree (*,228.8.8.8) from the RP to the subnets that need to receive the traffic.
        • Note: it would be possible for R1 to keep sending encapped frames to RP but the encap/de-encap process would consume a lot so the best choice is to make RP join the group specific tree for that (S,G) combination
      • Shared Distribution Tree
        • traffic from RP to hosts is called “shared distribution tree” also called root-path tree (RPT) because it’s rooted at the RP.
        • S flag indicates group is using “sparse-mode”.
        • RPF is chosen on how to get to the RP not the source in this case.
      • Steady state operation
        • PIM-SM routers must send PIM Join messages to keep receiving traffic otherwise they are put back to “pruned” state.
        • PIM-SM routers decide based on if they’re getting PIM Join or if local host responds to IGMP query message with IGMP Report.
        • the downstream routers need to keep sending PIM-SM Join messages every 60 seconds to upstream routers. The receiving router then resents the Prune timer to default 3 minutes.
        • Or Mcast router will send IGMP general query to its host every 60 or 125 seconds depending on the IGMP version.
    • Examining the RP’s Mcast routing table
      • the RP has joined the SPT for the source as well as being the root of the shared tree for the group. First entry by “S” flag, second entry by “T” flag. The incoming interface is Null for the first entry because RP is the root and RPF neighbor is listed as 0.0.0.0.
    • SPT switchover
      • PIM-SM design also allows any other PIM-SM router to build an SPT b/w the router and the source DR. This lets PIM-SM avoids inefficient path.
      • when should a router move from RPT to SPT? “initiate the switch to SP-tree after receiving a significant number of data packets during a specified time interval from a particular source”. Cisco router by default switch from RPT to SPT after the first packet from the shared tree is received!!
      • you can change this by “ip pim spt-threshold rate” on any router on any group. Command only affects on the configured router.
      • Flags: SCJ for RP path and CJT for directly connecting to the source.
      • J: flag tells that the traffic was switched from RPT to SPT.
      • since the PIM-SM router has got a better path, it does not need traffic from RP, the downstream router can sends a PIM-SM Prune message to RP. This prune references (S,G) for SPT and means “stop forwarding packets from the listed IP address, to the listed group address, down the RPT). The downstream router sets a bit called RP-tree-bit which informs upstream routers that it has switched to SPT.
  • Dynamically finding RPs and Using Redundant RPs
    • Methods to learn IP address of RP
      • statically configured on all routers: “ip pim rp-address address” in global config
      • Cisco Proprietary, Auto-RP to designate RP and advertise its IP so that all SM router can learn it automatically
        • two step process;
          • RP sends RP-Announce messages to reserved multicast (224.0.1.39) stating that router is a RP. Announce Message also allows RP to announce the mcast groups for which its an RP, allows some load-balancing of the RP workload among different routers. RP-Announce message is sent every 1 minute.
          • Second: one router is configured as a mapping agent. Could be the same router that is RP or different. Mapping agent learns all the RPs and the mcast groups they each support. Mapping agent multicasts another message, RP-Discovery, that identifies the RP for each range of multicast group addresses. This goes to 224.0.1.40. So mapping agent becomes part of the well-known Cisco-RP-Announce mcast group and listens for group traffic.
        • reason for Mapping agent: to support RP redundancy, basically to support multiple RPs that can act as RP for the same multicast group—the Auto-RP mapping agent decides which RP should be used to support each group at the moment. Mapping agent selects the router with the highest IP address as an RP for the group.
        • as soon as Cisco routers are configured for PIM-SM and Auto-RP, they automatically join the “well-know Cisco RP-Discovery (.40) multicast group”
        • creates a small problem. PIM-SM routers need to send a Join toward RP which they do not know! so Cisco created, “sparse dense mode”. Uses DM when it does not know the RP and SM when it knows the RP. So in normal mode with Auto-RP, routers would use dense mode long enough to learn the group-to-RP mappings from the mapping agent, and then switch over to sparse mode.
      • BootStrap Router (BSR) protocol can be used to designate the RP and advertise it’s IP address so that SM routers can understand IP automatically.
        • BSR: router acts similar to mapping agent in auto-rp. The BSR receives mapping info from the RPs, and then it advertises the info to other routers. But there are some differences:
          • BSR router does not pick the best RP for each group; it sends all group-to-RP mapping to the other PIM routers inside bootstrap messages.
          • PIM routers independently pick the currently best RP for each mcast group by running hash on bootstrap message.
          • BSR floods the mapping info on 224.0.0.13.
          • flooding of bootstrap messages does not require the routers to have a known RP or to support dense mode.
        • PIM-SM routers flood bootstrap messages out all non-rpf interfaces.
        • All PIM routers already know the unicast IP of the BSR based on the earlier receipt of bootstrap messages
        • the c-RP simply send unicast messages to BSR called c-RP Advertisements. It has Ip address and the group it supports.
    • Redundant RPs
      • Anycast RP using the Multicast Source Discovery Protocol (MSDP)
        • can use static RP configuration, Auto-RP or BSR
        • KEY: relates to how the redundant RPs are used.
          • without Anycast RP – RP redundancy allows only one router to be active RP for each mcast group.
          • with Anycast RP – RP redundancy and load sharing can be achieved with multiple RPs concurrently acting as the RP for the same group!!
        • each RP uses the same IP address. RP advertise this address (typically /32 prefix) with its IGP. Then other methods of learning (static, autorp…) direct packets to “the” RP per closest IGP routers.
        • both RPs are configured with same IP loopback address
        • Benefits:
          • multiple RPs share the load for a single mcast group
          • recovery after a failed RP happens quickly.
        • design creates a problem that must be overcome by MSDP.
        • problem: each individual RP builds its own shared tree, but any multicast source sends packets to one of the RPs.
        • Solution: RPs tell each other about all known sources by using MSDP. MSDP allows RPs to send messages to each other revealing the IP address of each source for each multicast group.
      • BootStart Router (BSR)
        • multiple BSR routers can be configured.
        • Each candidate BSR (c-BSR) sends bootstrap messages that include the priority of the BSR router and its IP address.
        • highest priority BSR wins and if tied, highest IP address BSR wins.
        • preferred BSR continues to send bootstrap messages, if the preferred BSR ceases, the redundant BSR take over.
    • Bidirectional PIM
      • last few processes of PIM-SM are changed
      • RP builds a shared tree with itself as the root.
      • when a source sends mcasts, the router receiving those mcasts does not use a PIM register message. Instead, it forwards the packet in the opposite direction of the shared tree, back up the tree toward the RP. Happens for all multicast packets from the source.
      • RP forwards the multicasts via the shared tree.
      • RP does not join the source tree for the source and the leaf routers do not join the SPT, either.
  • Query messages IP protocol number is 2, Hello messages, IP protocol number is 103.
  • Query messages sent to 224.0.0.2 for PIM and for PIM hello to 224.0.0.13
  • default query and hello message interval is 30 second
  • default hold time is 90 seconds.
  • When using smaller allocation sizes for scopes, remember that Scope Relative Addressing reserves the upper 256 address of any scope range. The smallest block size that should be used is a /25 allocation because this provides a total of 512 addresses—256 assignable multicast addresses plus 256 reserved Scope Relative addresses.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s