Alan
Alan

Reputation: 13721

As a developer, do I need to fully understand multicasting protocols such as IGMP, PIM-DM and PIM-SM?

We utilise multicasting in our application to efficiently broadcast updates to clients connected to middle-tier(s). I'm continually asked by network engineers about "how our multicasting works" and what multicast protocols it supports. I'm puzzled by these type of questions, in that as far as I'm concerned, our client processes simply join a multicast group by issuing the following commands:

m_sSocket = socket(PF_INET, SOCK_DGRAM, 0);

if (m_sSocket == INVALID_SOCKET)
{
    SocketError();
    return false;
}

sockaddr_in saServer;
ZeroMemory(&saServer, sizeof(sockaddr_in));

saServer.sin_family = AF_INET;
saServer.sin_addr.s_addr = htonl(INADDR_ANY);
saServer.sin_port = htons(nMulticastPort);

if (bind(m_sSocket, (sockaddr *)&saServer, sizeof(sockaddr_in)) == SOCKET_ERROR)
{
    SocketError();
    return false;
}

m_ipMulticast.imr_multiaddr.s_addr = inet_addr(tostring(strMulticast).c_str());
m_ipMulticast.imr_interface.s_addr = htons(INADDR_ANY);

// join the multicast group
if (setsockopt(m_sSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP, 
               (LPCSTR)&m_ipMulticast, sizeof(ip_mreq)) == SOCKET_ERROR)
{
    SocketError();
    return false;
}

There is no distinction in there as to what multicast protocol it should use. Does anyone have any useful suggestions as to how I respond to these type of questions? At the moment I simply supply the address/port on which we multicast and ask them to open this address/port on their network routers. However this doesn't seem to be enough and they require more information (?)

Upvotes: 2

Views: 492

Answers (3)

avirtuos
avirtuos

Reputation: 109

I've had the pleasure of working very closely with our own Network Engineers in Supporting and Building several multicast enabled applications.

Here is what they are asking (assuming they understand from a network level what 'multicast' is and how it works).

  1. Does your application join / leave groups frequently? (important for troubleshooting)
  2. Does your application leave the groups during off hours? (allows the network a windows to rebuild the multicast tree)
  3. What is the nature of the communication over the multicast sockets and how sensitive are you to data loss (udp does not garuntee arrival like TCP/IP)?
  4. How many servers are invlolved and what/where are they? (helps them understand what network changes may need to take place to get the multicast from A to B)
  5. Who are the producers / consumers of the multicast? (goes with #4)

Upvotes: 2

coryan
coryan

Reputation: 1201

Most likely your network engineers are trying to understand things like:

1) Are the subscriptions dense or sparse in the network? Cisco switches (and I presume others) can be configured differently depending on how many subscribers you expect on each segment. The settings affect the performance of the switch.

2) Are you planning to cross multiple LANs or VLANs? Is your TTL going to be anything other than 1? There are settings that also control the algorithms use to route packets in the switch. The wrong settings can make every packet hit the switch CPU. Not a good thing.

The answers to those questions affect the design of the network, i.e., what settings to configure in the routers and switches. Your net engs may be curious about the protocols and contents and what not, but those higher level issues is what will affect their work. My guess is that they want to understand those issues, but do not know how to ask them.

Upvotes: 3

Dewfy
Dewfy

Reputation: 23624

There is free crossplatform lib ACE (http://www.cse.wustl.edu/~schmidt/ACE.html) that contains implementation of multicasting in TAO (The ACE Orb). Sorry for crossreference, but I'm sure your problem have been solved there.

Upvotes: 0

Related Questions