views:

159

answers:

4

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 (?)

A: 

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.

Dewfy
A: 

What exactly do your network engineers want to know? "How your multicasting works" is a pretty broad question.

suszterpatt
That's exactly what I'm thinking and the reason for this question. I'm not sure that I've missed something, or indeed should supply them with any more information than I am.
Alan
+2  A: 

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.

coryan
These are not questions that Alan would need to be involved with, these are all network architecture decisions. He does not have a choice of dense vs sparse (he network engineers will choose this based on his application's needs), the same goes for the vlan aspect.
avirtuos
+1  A: 

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)
avirtuos