1

My ultimate goal is to setup IGMP snooping on a linux machine using netfilter hooks. This is for exploratory purposes to understand IGMP protocol.

The topology we are using is as follows:

 |               |                        |                  |
 | Host 1        |<---------------------> |           Host 2 |
 | Linux         |                        |           Linux  |

What we plan to do is create a Multicast group on Host2 so that we can send the multicast traffic from Host1 to Host2 and using the hooks on Host2 we can then check for membership messages (join, leaving, timing info, port etc) on Host2 and create our own Multicast Database similar to mdb.

How can we create a Multicast group ? (commands to use on linux ?) How can we attach interfaces or Host's to that multicast group ? How can we transfer packets between interfaces belonging to multicast group? Thanks

closed as off-topic by user36472, Ron Maupin Sep 20 '18 at 13:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "NE is a site for to ask and provide answers about professionally managed networks in a business environment. Your question falls outside the areas our community decided are on topic. Please visit the help center for more details. If you disagree with this closure, please ask on Network Engineering Meta." – Community, Ron Maupin
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Unfortunately, questions about host/server configurations are off-topic here. You could try to ask this question on Server Fault for a business network, or on Super User or Unix & Linux for a personal network. – Ron Maupin Sep 20 '18 at 13:11
  • I had asked there, they redirected me here, anyways i'll drop the question, since I have received a satisfactory answer, i hoped it woud stay so anyone with this simple doubt would not have to search much. – Haswell Sep 21 '18 at 4:58
2

How can we create a Multicast group?

A multicast group is not "created".

A multicast group is formed of all computers listening to a certain multicast address. Therefore a multicast group automatically exists whenever at least one computer is listening to the multicast address given.

How can we attach interfaces or Host's to that multicast group?

You simply have to start a program which is listening to multicast packets on a certain address. For example a program listening to UDP packets.

Using Wireshark I saw that Linux sends an IGMP joining message when the program is started and an IGMP leaving message when the program is finished.

If there are multiple programs listening to the same address Linux may behave like this: The "join" message will only be sent when the first of these programs is started and the "leave" message will only be sent when the last program is finished.

I don't know if a ready-to-use program exists but I found an example C program here.

How can we transfer packets between interfaces belonging to multicast group?

Simply send some packet (e.g. an UDP packet) to a multicast address. The sender need not even be listening to that multicast address (it need not be part of the multicast address group).

The example program in the link above seems also to be able to send messages...

Not the answer you're looking for? Browse other questions tagged or ask your own question.