Skip to content Skip to sidebar Skip to footer

To Discover Other Device Ip:port In Same Wifi Network Using Zeromq

I want to discover all Android devices IP and Port in same wifi network using ZeroMQ? My app basically connect all device in same wifi network (no internet needed) and message to

Solution 1:

Principle

Part A)

Every IEEE 802.x CSMA/CD network "collision domain" ( wifi AP/SSID is such one ) has to be managed so as to work well. Thus the Address Resolution Protocol [ARP] will help you in the task to find all ISO-OSI-Layer-3 IP Addresses. Wifi Access Point [AP] host, to which all live devices register and handshake with, is the choice to start with.

HG520i> ip arp status
received 54205 badtype 0 bogus addr 0 reqst in12105 replies 196 reqst out 14301
cache hit 63152696 (24%), cache miss 19455672 (23%)
IP-addr         Type           Time  Addr              stat iface
192.168.0.23010 Mb Ethernet 29000:15:af:e6:b1:7941   enif0
192.168.0.6210 Mb Ethernet 30000:0c:29:98:d4:3b 41   enif0
192.168.0.5510 Mb Ethernet 30000:27:0e:07:c5:9e 41   enif0
192.168.0.25510 Mb Ethernet 0ff:ff:ff:ff:ff:ff 43   NULL
num of arp entries= 4

Part B)

Scanning all the ports on all the known IP hosts is a dumb brute force approach to the second issue.

Scanning just a subset of "reasonable" ones would save you both the time and efforts on peer-recognitions.

Using some smarter, active "visibility self-advertisement policy" will save you even more.

Solution

Decide on multi-party system architecture, whether an individual passive scan, a central/distributed proxy-assisted scan or an active self-advertisement policy will be used to build and maintain live records in a neighbouring hosts register.

ZeroMQ per-se brings you a lot of power for the smart solutions, while the dumb-force solutions would have to wait till fully fledged ZeroMQ services will be ready. Low level L2/L3-inspections will have to bring their fruit before ZeroMQ can first .bind()/.connect()

Needless to say, that uncoordinated CSMA/CD networks do not guarantee that all the L2-visible hosts will have "compatible" L3-ip-adddress ( will belong to / have the same L3-ip-network address ).

Thus you never know about all IP addresses without a truly low-level sniffer.

Post a Comment for "To Discover Other Device Ip:port In Same Wifi Network Using Zeromq"