PDA

Click to See Complete Forum and Search --> : I want to compose an ad hoc network


mostafa3k
Jun 1st, 2007, 10:45 AM
Imagine a group of laptop users that are within close proximity. I want an application to constantly seek out users within range and establish a connection with multiple users.

My first strategy was to randomly assign a port to each machine and have a background process constantly scanning all other ports for listening connections. But i didn't think this would work given that every machine would have the same network IP and it would wind up scanning itself.

Another strategy would have been to give each computer a random IP within a certain range. But I know that you can only change the last three digits of a machines ip address, this would also only allow me 255 users on a network, but which is fine but I'd probably run into a large number of connection errors.

This is basically an adhoc network app. How should I approach this?

Hack
Jun 1st, 2007, 10:52 AM
You are looking to establish a connection to a laptop without the laptop owner knowing a connection has been made? Is this what you are after?

mostafa3k
Jun 1st, 2007, 11:36 AM
No. The laptop owner will be running the same app and will know that there will be users connecting to his computer.

Imagine it this way. A group of people are playing a game on their laptops within proximity (this might work for a portable gaming platform), and a user can join in just by walking into wifi range with the same app running.

Al42
Jun 1st, 2007, 05:24 PM
Run one server on the segment. Then any user can connect by connecting to that server.

Or, if you want to expand the range ("I know that you can only change the last three digits of a machines ip address, this would also only allow me 255 users on a network"), you can use 192.168.x.x for a total of 64k users. (One WAP, handling even 254 users [0 and 255 are reserved] is going to get a bit laggy. With 64k users it's going to feel like a string and 2 tin cans.)

alkatran
Jun 11th, 2007, 03:01 PM
http://en.wikipedia.org/wiki/Mobile_ad-hoc_network