Today’s post will talk about one Multicast LAN Optimization Protocol.
As you remember from one of our posts IGMP it’s the protocol used by hosts to inform routers they want to join a specific Multicast Group or they want to leave that Multicast Group.
But here comes a question!! What does a switch do when it receives a Multicast Packet??
I mean the destination IP address would be one in the Multicast Range 184.108.40.206-220.127.116.11 but switches forward packets based in the MAC address not in the IP address, so how would they forward the traffic?
That’s a very good question and to answer that I will provide a scenario.
Imagine that Server A wants to send traffic to the Multicast Group 18.104.22.168 and that Router 1 connects to a LAN where the PC-A wants to receive that traffic.
That PC sends a IGMP Join message for that group and immediately the router starts to forward any multicast traffic it receives about that group.
When the Router send the multicast traffic the IP packet will have the following IP and MAC address info:
- IP: 22.214.171.124
- MAC: 0100.5e01.0101
So Far So Good.. Right!!!
Now here it’s a question for you (that you should be able to answer).
When would a switch store a MAC address in it’s CAM table?
This will happen whenever a station sends a packet to the network and reaches the switch.
The switch will then store the source MAC address on the stations in it’s CAM with the respective port where it received it! so it knows where to send any traffic destined to that MAC address.
And now a different question.
Can you use a Multicast IP to source traffic?
NEVER!!! Multicast IP addresses and hence MAC addresses are only used as destination addresses.
This means that the switch will never store the MAC address of the multicast group in the CAM table.
Here you have another question.
What does a switch do when it receives a packet for a destination MAC address it does not know?
The traffic will be forwarded to all of the ports in the same VLAN except to the port where it was received.
WOW, do you imagine a LAN with 100,200 or more users where only one user in the LAN wants to receive Multicast Traffic for a specific group?
There will be a waist of resources as the Switch will forward the traffic to all the ports, PCs will get it and will discard it as they are not expecting that traffic.
OMG….. Is there a way we can fix this or better said “Is there a way we can optimize the behaviour of Multicast in a LAN environment?
YES, it is!!! There are actually about 3 different protocols that will allow us to improve this and they are:
- Cisco Group Management Protocol (CGMP)
- IGMP Snooping
- Router-Port- Group Management Protocol (RGMP)
Now that we know there is a need for this protocols, let’s start talking about the CGMP protocol (this is why we created this post anyway)
This Cisco Proprietary Protocol allows Switches and Routers to maintain a communication where they can exchange information about to what ports in the Switch the Multicast Listeners are.
CGMP needs to be configured in the L3 device (Multilayer Cisco Switch or a Cisco Router) as they are the ones that send CGMP packets. Switches only listen for CGMP messages.
In the router you just get into the LAN interface that goes to the switch and enter the following command
Layer 3 Device Config
Layer 2 Device Config
ip cgmp (Globally defined)
That’s it! Afterwards the router will start communicating to the switch information learned from IGMP messages.
The destination MAC address of the CGMP messages is 0100.0cdd.dddd
The use of this destination MAC address forces the switch to forward this CGMP packets through all the ports so that all switches in a campus can successfully add the respective ports into the Multicast Output Ports.
Within CGMP messages there is one key set of information known as:
- Group Destination Address (GDA)
- Unicast Source Address (USA)
CGMP Join Process
1) As soon as the router running CGMP gets connected to a LAN switch, it will send a CGMP message with the GDA set to zero and the USA set with it’s own MAC address.
The CGMP capable switch will then now that a multicast router lives on the port where it learned the MAC address of the port.
This CGMP message that the router sent is re-transmitted each 60 seconds.
2) If a host in that LAN join a multicast group, it will send an IGMP Multicast Join packet.
That packet will reach the router and normally the router would just focus on the L3 Info of the packet (determine what multicast group is the host trying to join) but as we have CGMP turned on the router would also check L2 information and it will obtain the source MAC address of the host.
The router will then send a CGMP message to the switch that will have the GDA set to the Multicast Group MAC address the host is trying to join and the USA to the Unicast MAC address of the host that wants to join that Multicast Group.
It’s important to mention that the destination MAC address of this packet it’s the well known multicast CGMP address 0100.0cdd.dddd.
3) The switch will get this CGMP join message and will search in the CAM address for the port where the USA address is connected to.
The switch will then create a new entry for the multicast MAC address listed in the GDA field and will add the port number associated with the host MAC address.
That’s how the joining process works, now we are going to discuss the leave process.
CGMP Leave Process
1) When a host does not want to receive multicast traffic it will send an IGMP leave message.
That message will get to the router and the router will check the source MAC address of the host as well as the Multicast IP address (so it can map it to the L2 Multicast Address) in order to be able to build the respective CGMP message.
The router generates the CGMP leave message and sets the GDA to the L2 address of the multicast group the user is leaving and the USA to the host source MAC address.
2) The switch will receive this CGMP leave message and will delete from it’s CAM table the entry that allows the forwarding of that GDA group (Multicast L2 Address) to the port where the USA (Host Source MAC address) exists.
This is exactly how CGMP works in a LAN environment.
I hope you liked this post and get back to us if you have any questions.