Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

multicasting java program with nodes on different static or dynamic networks!  RSS feed

Mandar Khire
Ranch Hand
Posts: 575
Android Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on java program which runs on server. Java program monitor lots of electronics custom made device which connected to the server.
When at first time both server & that device starts, server send broadcast message which receive to that device, it send its details to server so basis of that details i can show different print statements on screen & we can understand that device no x condition, whether it connected, disconnected or working on plan a, plan b etc

Always i enter ip address in that device manually(Not every time only first time), so we can say every device ip address i know. Or i can change it. Device currently not smart to automatically get network Server network setting is not accessible to java user or developer but may be by program we can fetch server network configuration & print it in console!

Now problem is when i connect device on different network, & we dont know what is network i can connect very easily if server connect on network & some device on same network then on those devices i can keep ip like or

It not always happens that we can know the network ip or details by wire comes on table for internet which we can just plug on laptop or electronics simple scenario like normal offices or home we can easily plug that wire to laptop & see network configuration by tracert or ping but some more secure place where laptop not allow & no one tells what ip for particular wire comes on table...some where far router placed restricted area there i face problem.

So that situation my java program fail to send broadcast packet using UDP.
I am try to find out way to communicate those electronic devices & server when both connect on different networks considering we can fetch network details on server or on electronics device!

I search on google, regarding how networks works, how router works, which protocol do what etc from basics.
So find out some points
1. If router configure for advertise its network details to all its ports then by that packet if our electronic device learn how to read it, then problem will solve?
2. By this we can list all network details for each electronic device on paper & in our java program we can use multicasting udp program given in many website (simple example).

I found one API also after reading this & this.
That API is jnetpcap.

Now i think my electronics device should more intelligent to read or fetch different packets. So it also do something for get reach to the server!

But i need guidance from expert...whether i am going right path or doing wrongly?
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!