2

I want to develop a Web Application that sends packets to clients In JAVA using UDP protocol.

I need to send packets to each clients directly .

Java provide a class called MulticastSocket that extends UDP. This can send packets to multiple clients over the network.

But it just happens in local network not on the "Internet".

Is there any way to send multicast packet over internet ? If it possible explain it and explain how i can implement it in Java.

I found some protocols like IGMP... but I think it developed in MulticastSocket.

An-droid
  • 6,433
  • 9
  • 48
  • 93
Alireza Akhoundi
  • 214
  • 3
  • 12
  • I'm sure a firewall exception will need to be added on the client side. maybe you need a multicast router for sending multicast packets. – Tim Strawbridge Jun 16 '17 at 00:59
  • @Tim but i never can understand how i can send multicast packet over internet . Because the multicast group ip must be in class D and i think this IP clasa not accessable from the internet ! – Alireza Akhoundi Jun 16 '17 at 01:12
  • Would you mind to share your solution found on www.iana.org? Thanks – ehe888 Feb 25 '18 at 06:53

1 Answers1

0

When sending multicast packets, if you expect them to cross one or more routers you need to set the TTL of the outgoing packet to be at least as large as the number of routers you expect to pass through. You can set this via the setTimeToLive() method of MulticastSocket.

IGMP messages are sent by multicast receivers to let routers know where to forward multicast traffic to. You don't need to explicitly send the packets as the OS will do it automatically when you join a multicast group via one of the joinGroup methods.

However, the main problem with sending multicast over the public Internet is that most routers aren't configured to allow multicast traffic to pass through them. By default, they will drop IGMP packets instead of forwarding them.

There was an experimental Internet multicast backbone called the MBONE, however I don't believe it's in use anymore.

So no, you can't send multicast over the public Internet, regardless of the language.

dbush
  • 205,898
  • 23
  • 218
  • 273