Can you imagine a video conference taking place on a primarily T1 based WAN? Multiple copies of the same video stream being unicast from the host to each participant. Multiple people at each location streaming the same video conference would destroy your bandwidth and quickly become a QoS nightmare. Such a solution has serious scalability limitations. IP Multicast can provide a solution where only one copy of each packet is sent down a single connection.
Multicast receivers join a group, denoted by a Class D IP address (inside 188.8.131.52/4). The source sends traffic to the Class D address and packets are forwarded only to intended destinations. Multicast packets are forwarded via UDP (best effort). With some implementations there is a potential for duplicate packets being received by the client, or packets being delivered out of order. Cisco routers have a built in mechanism to help prevent duplicate packets from being received. This is accomplished by performing a Reverse Path Forwarding (RPF) check which determines if a multicast packet is entering a router on the appropriate interface. During an RPF check the router examines the source address of an incoming packet and checks it against the unicast routing table to see which interface would be used to get back to the source network. If the incoming multicast packet is not using that interface, the RPF check fails and the packet is discarded.
Internet Group Management Protocol
The protocol used to john multicast groups is as the Internet Group Management Protocol, or IGMP. Routers also use this protocol to build their multicast routing table. Currently there are three versions of IGMP out in the wild, however only two are widely deployed.
- IGMPv1: When a PC wants to join a multicast group, it sends an IGMP Report message to the router, letting it know that it wants to receive traffic for that group. After which the router sends an IGMP Query message every 60 seconds to determine if the PC still wants to stay in that multicast group. Those messages are sent using 184.108.40.206 which addresses all IP multicast hosts.
- IGMPv2: The two largest differences here are that IGMPv2 enabled routers can send queries to a specific group, and that Leave messages are supported. Since the receiver is allowed to send a Leave message, routers are able to prune the multicast traffic far earlier.
In situation where there may be more than one multicast router in a broadcast domain, for example in an Ethernet segment, one router must be designated as the querier for that segment. The IGMP designated querier is the router that has the lowest IP unicast address. To determine which router on a multi-access network is the querier you can issue the command: show ip igmp interface [interface] – The following command displays the multicast groups that your router is aware of: show ip igmp group
By default L2 switches flood multicast frames to all interfaces (except the one on which it was received). This is obviously no the preferred behavior as it is a huge waste of resources. Instead, the switch should be aware of what interfaces are part of each multicast group. IGMP snooping is a feature that allows Catalyst switches to determine which interfaces are connected to receivers for specific multicast groups by eavesdropping on the IGMP traffic being exchanged. The following global command enabled IGMP snooping: ip igmp snooping – This should be followed with the following command specifying which VLANS snooping is enabled on: ip igmp snooping vlan [vlans list]
A member of a multicast group receives the packets destined for that group, thus the sender does not need to be a member of the group for which it is sending packets out to. Multicast traffic flows from a source to a destination over a distribution tree. There are two types of distribution trees:
- Source Distribution Tree: A source distribution tree creates an optimal path between each source router and each last-hop router (a last-hop router is the last router in the path to the client). Source distribution trees place routes in the multicast routing table denoted by the (S,G) or (Source,Group) marking.
- Shared Distribution Tree: Shared distribution trees create a tree from a centralized point in the networks know as a rendezvous point or RP to all last-hop routers. Shared trees place mutlicast routes denoted by the (*,G) or (Any Source,Group). This (*,G) route is created along the path from the RP to the last-hop routers. The advantage here is less memory consumption, at the cost of increased delay.
Multicast Routing Protocols
Cisco routers use the Protocol Independent Multicast (PIM) protocol to construct IP multicast distribution trees. PIM can run over any IP network regardless of the routing protocol. There are two widely used varieties of PIM that I will cover, PIM Sparse mode (PIM-SM) which uses a shared distribution tree, and PIM Dense (PIM-DM) mode, which uses a source distribution tree. To explain the differences, I want to walk you through the formation of each distribution tree.
- Multicast source comes up, floods network with multicast traffic
- If more than one router is inside the same broadcast domain (Ethernet segment) assert messages are used to determine the PIM forwarder. The router with the best metric, or highest IP address (default) wins.
- Router who do not have multicast receivers for the group send prune messages to their upstream router requesting to be cut off from the flood of traffic. If there is another router in the same broadcast segment with active receivers it will send a join override message and the original prune message will be ignored.
- If a receiver comes up behind a router that was previously pruned from the distribution tree, that router can rejoin the tree by sending a graft message.
Since the flood and prune method if PIM-DM is not one that scales well at all, most engineers will agree that PIM-SM is a far better solution.
- A receiver sends an IGMP report message to its router indicating that it wants to join a multicast group. This router sends a join message to the RP which creates a (*,G) along the shared tree path to the RP.
- A source comes up and creates a source tree between its router (we’ll call this the first-hop router) and the RP. This action creates (S,G) entries along the path. Before the source tree is completely established, the source sends its multicast packets to the RP encapsulated inside of unicast register messages.
- Once the RP receives the first multicast packet along the source tree, it sends a register stop message to the source. This tells the source to stop encapsulating its packets inside register messages.
- At this point in time there are two trees. A source tree from the first-hop router to the RP, and a shared tree from the RP to the last hop router. Since this may not be the optimal path, we still have work to do!
- The last-hop router discovers the location of the first-hop router and sends it an IGMP join message directly. This creates an optimal path over a shared tree, (*,G), from the first-hop router to the last-hop router.
- The last-hop router sends the RP an (S,G) RP-bit prune message since it gets its multicast traffic elsewhere
- Since the RP has no receivers, it sends the first-hop router an (S,G) prune message.
- At this point traffic is flowing in an optimal path between the first-hop and last-hop router. The process of switching between the path from the RP to the direct path is called the Shortest Path Tree (SPT) Switchover.