• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Find a Server of unknown IP

 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I find a server that I do not know the IP for?

Scenario: Friends come over and we all get a wifi connect and one of us will host, so the others will be clients. We are all going to be on the same subnet, is there a way short of trying every IP in a range to see if the host is there or manually looking up the IP and saying: "Hey everyone I'm going to be the host tonight, so everyone..."
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One way to do this is a UDP multicast or broadcast.
In multicast, the application running on all devices joins a hardcoded multicast IP address and listens. One of the devices decides to become the server and advertises itself by sending its IP address in a UDP to the multicast address. The router then forwards that UDP to all members of the multicast group.
Same with broadcast, except that router forwards that packet to all devices on the subnet, and whoever's listening on broadcast address receives it.

A more formal way of doing the same thing is using SSDP (Simple Service Discovery Protocol), which also uses multicasting.
 
Les Morgan
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds perfect for what I want. Thank you.

Karthik Shiraly wrote:One way to do this is a UDP multicast or broadcast.
In multicast, the application running on all devices joins a hardcoded multicast IP address and listens. One of the devices decides to become the server and advertises itself by sending its IP address in a UDP to the multicast address. The router then forwards that UDP to all members of the multicast group.
Same with broadcast, except that router forwards that packet to all devices on the subnet, and whoever's listening on broadcast address receives it.

A more formal way of doing the same thing is using SSDP (Simple Service Discovery Protocol), which also uses multicasting.

 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic