views:

53

answers:

3

I've been asked to look into adding multicast support to a Java trading system but, to be honest, I don't have the slightest clue what this could be for. Would this mainly be to allow the trading system to broadcast trade messages to different types of clients, say, a mobile phone as well as a server? Why might a trading system need multicast support?

A: 

The best thing to do would be to ask the person who assigned you the task.

I am not a network expert but my understanding is that multicast can be helpful in making the system scalable. IP multicast allows your application to delegate the responsibility of notifying the subscribers to the network layer.

Multicast: A multicast address is associated with a group of interested receivers. According to RFC 3171, addresses 224.0.0.0 to 239.255.255.255, the former Class D addresses, are designated as multicast addresses in IPv4. The sender sends a single datagram (from the sender's unicast address) to the multicast address, and the intermediary routers take care of making copies and sending them to all receivers that have registered their interest in data from that sender

http://en.wikipedia.org/wiki/IP_multicast#Addressing

Tahir Akhtar
+1  A: 

Multicast is a protocol to send (UDP-)datagrams to a defined set of recepients. A router maintains this list, so you need at least a router with this capability. And changing the set set of multicast addresses requires configuring the router. (-> clients can't register themselves to receive multicast messages..)

As mulitcast is for sending datagrams only we don't have a 'reliable' communication. No guarantee that a package reaches it's destination, no guarantee that datagrams arrive in the correct order.

Multicast is a solution if you need to notify a fixed set of systems with short messages, the server doesn't have to know the receivers (the list is on the router only) and the server doesn't care if the messages are received.

Andreas_D
It has been awhile since I dealt with multi-cast but this is not entirely correct. The routers have to be multi-cast enabled to allow multicast traffic to pass through to other routers on valid multicast addresses. Senders and receivers still open sockets on the same ports to send and receive, just like in unicast operations. The major difference being that the sending is no longer duplicated to reach different subscribers.
Robin
@Robin - You send your datagrams to one multicast address, as far as I remember, and only the router (owner of that multicast IP address) knows the members of the multicast group. Quite similiar to broadcast, where the sender doesn't know the receivers too.
Andreas_D
@Andreas_D - You are right that there is no knowledge of receivers, but your answer implies that your have to configure your router to add new receivers, this is not true. Applications simply open sockets on a designated multicast address to receive. The router simply has to be enabled to allow multicast traffic through, which most weren't 11 years ago when I was actually using it, can't comment on whether that is the case today or not. Your statement about a fixed set of systems with short messages is also misleading, since the main usage of multicast that I know of is for streaming media.
Robin
+1  A: 

Multicast would be used for distribution of live pricing details. The choice of unicast or multicast is determined by the size of the client base, the network capability, and requirements of the application.

If you have 1,000 client applications it is faster to send one packet than 1,000 packets.

However TCP is faster for smaller distribution numbers and so dedicated hardware devices are popular to implement mulitcast overlay built upon TCP connections. Check http://www.a-teamgroup.com/site/low-latency-com/ for news about the popular vendors in use today.

Steve-o