 <p>Implement a echoing system on the server on a specific port say 8070</p> <p>i have done Broadcast of message to a given port using following code.</p> <pre><code>broadCastSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:dispatch_get_main_queue()]; if ([broadcastSocket enableBroadcast:true error:&amp;error] == false) { NSLog(@"Failed to enable broadcast, Reason %@:",[error userInfo]); } NSData *data = [QueryString dataUsingEncoding:NSUTF8StringEncoding]; [broadcastSocket sendData:data toHost:@"255.255.255.255" port:8070 withTimeout:-1 tag:5]; </code></pre> <p>your all the server will receive data on the port and echoing system reply to given port. Now you can listen to those port and get the ip of all the server which will reply.and ofcourse this trick will only work if sever is yours.<br> <strong>NOTE ::</strong> I was using <a href="https://github.com/robbiehanson/CocoaAsyncSocket" rel="nofollow">GCDAsyncSocket</a> Library but you can use whatever you want.</p>