The socket option (IP_ADD_MEMBERSHIP) is available on application level to join an IP multicast group. In the kernel, the call results in the function ip_mc_join_group(). The kernel is instructed to use IGMP, unless it is already used, to join the desired group, and to forward the data to the application. Notice that more than one application in one single computer can be members of a group.
For example, the code sequence to join group 233.25.10.72 looks like this: