开发者

multicasting in different networks in java

开发者 https://www.devze.com 2023-03-29 01:58 出处:网络
I\'m writing a code to work through sockets in java. I\'ve created a multicast group to which anybody can join on the LAN. But the LAN has many different networks, operated by a router, and the multic

I'm writing a code to work through sockets in java. I've created a multicast group to which anybody can join on the LAN. But the LAN has many different networks, operated by a router, and the multicast group created by the code would be different in different network and if a person multicast's something to the multicast group in the network A it will only be received by the people joined to the group in tha开发者_C百科t network only, and not by all the people's in different networks.

For Example:

The multicast group is, let's say, 224.0.0.1. And the LAN has 2 different networks.

Network A = 172.22.28.0/255.255.254.0

Network B = 172.22.30.0/255.255.254.0

Then there will be two different multicast group, with the same address as 224.0.0.1, in the two different networks.

My problem is How can I multicast over these two diff. networks on the LAN through java?

As I was searching for the solution, I came across the concept of IP ENCAPSULATION, in which I can add an outer ip address to the packet, so that it can go through different networks. I think this should work as I can encapsulate the other network's address on the packet send.

Can somebody tell me that how can this(IP ENCAPSULATION) be implemented in java? If not, Is there any other method possible which I can apply.

Any help Appreciated.


First, 224.0.0.1 is a reserved group known as all-systems.mcast.net, i.e. all reachable networked machines, see wikipedia.

Then, the things you are looking for are IGMP and multicast routing, that is, the switches in the path have to be configured to specifically forward multicast, and the routers also need to know to forward multicast traffic between attached networks.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号