23

I'm not sure how best to approach my problem. I have a service with runs on a remote machine with receives and process UDP packets. I want the service to be able to re-send these packets to anyone that happens to want them (could be no-one, will typically be one machine, but may be more)

I figured UDP Multicasting would be ideal - the service can send to the multicast group and it doesn't matter how many receivers have registered, or even if there are none.

However, I want to be able to access this over the internet and from what I gather this is nigh-on impossible with UDP Multicasting. Is there another method I might use to achieve this?

If relevant, both my client and service are written in C#.

Kara
  • 6,115
  • 16
  • 50
  • 57
Barg
  • 2,968
  • 7
  • 26
  • 28

2 Answers2

22

In general this is not possible since multicast packets aren't routed.

There are some techniques to work around this (DVMRP, MOSPF and others) but they all require that you can configure all the routers between your server and the clients (or create a tunnel). There are backbone networks (Abilene, Mbone) with multicast support, but those are of most interest for universities and such. The normal consumer's internet does not have multicast.

Unfortunately you need point-to-point communication. But you are in good company, internet, radio and TV all do point-to-point, transmitting the same data numerous times. Quite a waste of bandwidth.

Community
  • 1
  • 1
Stefan
  • 4,187
  • 1
  • 32
  • 38
  • 2
    Mbone was turned off a long time ago, IPv6 mandates multicast, some ISPs have IPv4 multicast for DVB such as Germany and UK. – Steve-o Jun 26 '10 at 03:54
  • 3
    Many services use UDP or PGM for multicasting locally. If you need to connect others, such as a remote site over the internet you can use a TCP tunnel, which listens to the local UDP and routes the traffic to the other side where it is re-broadcast. This works great for connecting two offices etc.. If you need help on the UDP here is a tutorial: http://jarloo.com/code/networking/c-udp-multicasting-tutorial/ – Kelly Feb 15 '11 at 02:46
11

The preferred method is to use overlay multicast, i.e. use TCP links between peers and implement multicast semantics above that.

Many IPv4 routers do not support multicast or have it disabled, IPv6 is mandated to support multicast and broadcast semantics have been removed.

Steve-o
  • 12,678
  • 2
  • 41
  • 60